// // Tests for // template // bool operator==(std::nullptr_t, safe_allocation const& x); // // template // bool operator!=(std::nullptr_t, safe_allocation const& x); // // template // bool operator==(safe_allocation const& x, std::nullptr_t); // // template // bool operator!=(safe_allocation const& x, std::nullptr_t); // #include #include #include "test_utils.h" struct T { }; template static void tests() { { test_safe_allocation const array(10, libkern::allocate_memory); CHECK(!(array == nullptr)); CHECK(!(nullptr == array)); CHECK(array != nullptr); CHECK(nullptr != array); } { test_safe_allocation const array = nullptr; CHECK(array == nullptr); CHECK(nullptr == array); CHECK(!(array != nullptr)); CHECK(!(nullptr != array)); } } T_DECL(compare_equal_nullptr, "safe_allocation.compare.equal.nullptr", T_META_TAG_VM_PREFERRED) { tests(); tests(); }