19 #include <boost/test/unit_test.hpp>
20 #include <boost/cstdint.hpp>
21 #include <boost/integer_traits.hpp>
27 BOOST_AUTO_TEST_SUITE(common)
34 BOOST_REQUIRE_EQUAL((
size_t) 1,
sizeof(boost::int8_t));
35 BOOST_REQUIRE_EQUAL((
size_t) 1,
sizeof(boost::uint8_t));
36 BOOST_REQUIRE_EQUAL((
size_t) 2,
sizeof(boost::int16_t));
37 BOOST_REQUIRE_EQUAL((
size_t) 2,
sizeof(boost::uint16_t));
38 BOOST_REQUIRE_EQUAL((
size_t) 4,
sizeof(boost::int32_t));
39 BOOST_REQUIRE_EQUAL((
size_t) 4,
sizeof(boost::uint32_t));
40 BOOST_REQUIRE_EQUAL((
size_t) 8,
sizeof(boost::int64_t));
41 BOOST_REQUIRE_EQUAL((
size_t) 8,
sizeof(boost::uint64_t));
46 BOOST_WARN_EQUAL((
size_t) 1,
sizeof(
char));
47 BOOST_WARN_EQUAL((
size_t) 2,
sizeof(
short));
48 BOOST_WARN_EQUAL((
size_t) 4,
sizeof(
int));
49 BOOST_WARN_EQUAL((
size_t) 8,
sizeof(
long));
50 BOOST_WARN_EQUAL((
size_t) 8,
sizeof(
long long));
54 #define STANDARD_ENCAPSULATED_INTEGER_BLOCK(TYPE) \
57 typedef EncapsulatedInteger<type> EInt; \
63 EInt eint1 = boost::integer_traits<TYPE>::const_min; \
65 EInt eint3, eint4, eint5; \
72 eint4 = boost::integer_traits<TYPE>::const_max; \
83 BOOST_CHECK_EQUAL(boost::integer_traits<TYPE>::const_min, int1); \
84 BOOST_CHECK_EQUAL(boost::integer_traits<TYPE>::const_max, int2); \
85 BOOST_CHECK_EQUAL(boost::integer_traits<TYPE>::const_min, eint3); \
86 BOOST_CHECK_EQUAL(boost::integer_traits<TYPE>::const_max, eint4); \
109 BOOST_AUTO_TEST_SUITE_END()
#define STANDARD_ENCAPSULATED_INTEGER_BLOCK(TYPE)
Standard macro to be used for each of the encapsulated integer types.
BOOST_AUTO_TEST_CASE(AnnotatedUnitTest)
Unit test for the Annotated class.
Header for the EncapsulatedInteger template.