lockfree: improve building of testsuite
[boost_lockfree.git] / libs / lockfree / test / tagged_ptr_test.cpp
blob524004779af8c7a5ba61e606e5cccebef50246ba
1 #include <boost/lockfree/detail/tagged_ptr.hpp>
3 #include <climits>
4 #define BOOST_TEST_DYN_LINK
5 #define BOOST_TEST_MAIN
6 #include <boost/test/unit_test.hpp>
8 BOOST_AUTO_TEST_CASE( tagged_ptr_test )
10 using namespace boost::lockfree::detail;
11 int a(1), b(2);
14 tagged_ptr<int> i (&a, 0);
15 tagged_ptr<int> j (&b, 1);
17 i = j;
19 BOOST_REQUIRE_EQUAL(i.get_ptr(), &b);
20 BOOST_REQUIRE_EQUAL(i.get_tag(), 1);
24 tagged_ptr<int> i (&a, 0);
25 tagged_ptr<int> j (i);
27 BOOST_REQUIRE_EQUAL(i.get_ptr(), j.get_ptr());
28 BOOST_REQUIRE_EQUAL(i.get_tag(), j.get_tag());