diff --git a/src/test/radix_tests.cpp b/src/test/radix_tests.cpp --- a/src/test/radix_tests.cpp +++ b/src/test/radix_tests.cpp @@ -134,21 +134,21 @@ auto keyThree = three->getId(); // There are no elements in the tree so far. - BOOST_CHECK_EQUAL(mytree.get(keyOne), NULLPTR(E)); + BOOST_CHECK_EQUAL(mytree.get(keyOne), nullptr); // Insert an element into the tree and check it is there. BOOST_CHECK(mytree.insert(one)); BOOST_CHECK_EQUAL(mytree.get(keyOne), one); // Let's insert more elements and check they are recovered properly. - BOOST_CHECK_EQUAL(mytree.get(keyZero), NULLPTR(E)); + BOOST_CHECK_EQUAL(mytree.get(keyZero), nullptr); BOOST_CHECK(mytree.insert(zero)); BOOST_CHECK_EQUAL(mytree.get(keyZero), zero); BOOST_CHECK_EQUAL(mytree.get(keyOne), one); // More elements. - BOOST_CHECK_EQUAL(mytree.get(keyTwo), NULLPTR(E)); - BOOST_CHECK_EQUAL(mytree.get(keyThree), NULLPTR(E)); + BOOST_CHECK_EQUAL(mytree.get(keyTwo), nullptr); + BOOST_CHECK_EQUAL(mytree.get(keyThree), nullptr); BOOST_CHECK(mytree.insert(two)); BOOST_CHECK(mytree.insert(three)); @@ -163,10 +163,10 @@ auto minustwo = RCUPtr::make(E::MinusTwo()); // Check that they are not in the tree. - BOOST_CHECK_EQUAL(mytree.get(E::SignedMax()), NULLPTR(E)); - BOOST_CHECK_EQUAL(mytree.get(E::SignedMin()), NULLPTR(E)); - BOOST_CHECK_EQUAL(mytree.get(E::MinusOne()), NULLPTR(E)); - BOOST_CHECK_EQUAL(mytree.get(E::MinusTwo()), NULLPTR(E)); + BOOST_CHECK_EQUAL(mytree.get(E::SignedMax()), nullptr); + BOOST_CHECK_EQUAL(mytree.get(E::SignedMin()), nullptr); + BOOST_CHECK_EQUAL(mytree.get(E::MinusOne()), nullptr); + BOOST_CHECK_EQUAL(mytree.get(E::MinusTwo()), nullptr); // Insert into the tree. BOOST_CHECK(mytree.insert(maxsigned)); @@ -213,7 +213,7 @@ // Insert an element into the tree and check you can remove it. BOOST_CHECK(mytree.insert(one)); BOOST_CHECK(mytree.remove(keyOne)); - BOOST_CHECK_EQUAL(mytree.get(keyOne), NULLPTR(E)); + BOOST_CHECK_EQUAL(mytree.get(keyOne), nullptr); // Insert several elements and remove them. BOOST_CHECK(mytree.insert(zero)); @@ -226,10 +226,10 @@ BOOST_CHECK(mytree.remove(keyTwo)); BOOST_CHECK(mytree.remove(keyThree)); - BOOST_CHECK_EQUAL(mytree.get(keyZero), NULLPTR(E)); - BOOST_CHECK_EQUAL(mytree.get(keyOne), NULLPTR(E)); - BOOST_CHECK_EQUAL(mytree.get(keyTwo), NULLPTR(E)); - BOOST_CHECK_EQUAL(mytree.get(keyThree), NULLPTR(E)); + BOOST_CHECK_EQUAL(mytree.get(keyZero), nullptr); + BOOST_CHECK_EQUAL(mytree.get(keyOne), nullptr); + BOOST_CHECK_EQUAL(mytree.get(keyTwo), nullptr); + BOOST_CHECK_EQUAL(mytree.get(keyThree), nullptr); // Once the elements are removed, removing them again returns false. BOOST_CHECK(!mytree.remove(keyZero)); @@ -263,14 +263,14 @@ BOOST_CHECK(mytree.remove(E::MinusOne())); BOOST_CHECK(mytree.remove(E::MinusTwo())); - BOOST_CHECK_EQUAL(mytree.get(keyZero), NULLPTR(E)); - BOOST_CHECK_EQUAL(mytree.get(keyOne), NULLPTR(E)); - BOOST_CHECK_EQUAL(mytree.get(keyTwo), NULLPTR(E)); - BOOST_CHECK_EQUAL(mytree.get(keyThree), NULLPTR(E)); - BOOST_CHECK_EQUAL(mytree.get(E::SignedMax()), NULLPTR(E)); - BOOST_CHECK_EQUAL(mytree.get(E::SignedMin()), NULLPTR(E)); - BOOST_CHECK_EQUAL(mytree.get(E::MinusOne()), NULLPTR(E)); - BOOST_CHECK_EQUAL(mytree.get(E::MinusTwo()), NULLPTR(E)); + BOOST_CHECK_EQUAL(mytree.get(keyZero), nullptr); + BOOST_CHECK_EQUAL(mytree.get(keyOne), nullptr); + BOOST_CHECK_EQUAL(mytree.get(keyTwo), nullptr); + BOOST_CHECK_EQUAL(mytree.get(keyThree), nullptr); + BOOST_CHECK_EQUAL(mytree.get(E::SignedMax()), nullptr); + BOOST_CHECK_EQUAL(mytree.get(E::SignedMin()), nullptr); + BOOST_CHECK_EQUAL(mytree.get(E::MinusOne()), nullptr); + BOOST_CHECK_EQUAL(mytree.get(E::MinusTwo()), nullptr); } BOOST_AUTO_TEST_CASE(remove_test) { diff --git a/src/test/rcu_tests.cpp b/src/test/rcu_tests.cpp --- a/src/test/rcu_tests.cpp +++ b/src/test/rcu_tests.cpp @@ -290,8 +290,8 @@ auto altptr = RCUPtr::make([] {}); // Check various operators. - BOOST_CHECK_EQUAL(gptr.get(), NULLPTR(RCURefTestItem)); - BOOST_CHECK_EQUAL(gptr, NULLPTR(RCURefTestItem)); + BOOST_CHECK_EQUAL(gptr.get(), nullptr); + BOOST_CHECK_EQUAL(gptr, nullptr); BOOST_CHECK(!gptr); auto copyptr = gptr; @@ -301,7 +301,7 @@ BOOST_CHECK(gptr != altptr); gptr = RCUPtr::acquire(ptr); - BOOST_CHECK_EQUAL(ptr, NULLPTR(RCURefTestItem)); + BOOST_CHECK_EQUAL(ptr, nullptr); BOOST_CHECK_EQUAL(gptr.get(), oldPtr); BOOST_CHECK_EQUAL(&*gptr, oldPtr); @@ -405,17 +405,17 @@ rcuptr1 = RCUPtr::acquire(ptr); BOOST_CHECK_EQUAL(rcuptr1, ptrCopy); - BOOST_CHECK_EQUAL(ptr, NULLPTR(RCURefMoveTestItem)); + BOOST_CHECK_EQUAL(ptr, nullptr); ptr = rcuptr1.release(); - BOOST_CHECK_EQUAL(rcuptr1, NULLPTR(RCURefMoveTestItem)); + BOOST_CHECK_EQUAL(rcuptr1, nullptr); BOOST_CHECK_EQUAL(ptr, ptrCopy); RCULock::synchronize(); BOOST_CHECK(!isDestroyed); RCUPtr::acquire(ptr); - BOOST_CHECK_EQUAL(ptr, NULLPTR(RCURefMoveTestItem)); + BOOST_CHECK_EQUAL(ptr, nullptr); BOOST_CHECK(!isDestroyed); RCULock::synchronize(); BOOST_CHECK(isDestroyed); diff --git a/src/test/util/setup_common.h b/src/test/util/setup_common.h --- a/src/test/util/setup_common.h +++ b/src/test/util/setup_common.h @@ -22,15 +22,6 @@ #include #include -/** - * Version of Boost::test prior to 1.64 have issues when dealing with nullptr_t. - * In order to work around this, we ensure that the null pointers are typed in a - * way that Boost will like better. - * - * TODO: Use nullptr directly once the minimum version of boost is 1.64 or more. - */ -#define NULLPTR(T) static_cast(nullptr) - // Enable BOOST_CHECK_EQUAL for enum class types template std::ostream &operator<<(