COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
utest-uucount.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2013 von Karman Institute for Fluid Dynamics, Belgium
2 //
3 // This software is distributed under the terms of the
4 // GNU Lesser General Public License version 3 (LGPLv3).
5 // See doc/lgpl.txt and doc/gpl.txt for the license text.
6 
7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Test module for cf3::Component"
9 
10 #include <boost/test/unit_test.hpp>
11 
13 #include "common/UUCount.hpp"
14 
15 using namespace cf3;
16 using namespace cf3::common;
17 
18 
20 
21 BOOST_AUTO_TEST_SUITE( UUCountSuite )
22 
23 
25 BOOST_AUTO_TEST_CASE( UUCountCompare )
26 {
27  UUCount a, b;
28  UUCount c = a;
29 
30  BOOST_CHECK(a != b);
31  BOOST_CHECK(b > a);
32  BOOST_CHECK(a < b);
33 
34  BOOST_CHECK(a == c);
35  BOOST_CHECK(a >= c);
36  BOOST_CHECK(a <= c);
37 }
38 
39 BOOST_AUTO_TEST_CASE( UUSerialization )
40 {
41  UUCount a;
42  UUCount b(a.string());
43  BOOST_CHECK(a == b);
44 
45  BOOST_CHECK_THROW(UUCount("lala"), ParsingFailed);
46  BOOST_CHECK_THROW(UUCount("lala:lolo"), ParsingFailed);
47  BOOST_CHECK_THROW(UUCount("lala:1"), ParsingFailed);
48  BOOST_CHECK_THROW(UUCount("01234567-89ab-cdef-0123-456789abcdef:lala"), ParsingFailed);
49 
50  UUCount c("01234567-89ab-cdef-0123-456789abcdef:1");
51  BOOST_CHECK_EQUAL(c.string(), "01234567-89ab-cdef-0123-456789abcdef:1");
52 
53  UUCount d("");
54  BOOST_CHECK(d.is_nil());
55 }
56 
58 
59 BOOST_AUTO_TEST_SUITE_END()
60 
61 
BOOST_AUTO_TEST_CASE(UUCountCompare)
std::string string() const
Definition: UUCount.cpp:79
Top-level namespace for coolfluid.
Definition: Action.cpp:18
Combination of a UUID and a count, together forming the equivalent of a 192-bit identifier.
Definition: UUCount.hpp:21
Most basic kernel library.
Definition: Action.cpp:19
Send comments to:
COOLFluiD Web Admin