// // Tests for // template // bool operator==(intrusive_shared_ptr const& x, std::nullptr_t); // // template // bool operator!=(intrusive_shared_ptr const& x, std::nullptr_t); // // template // bool operator==(std::nullptr_t, intrusive_shared_ptr const& x); // // template // bool operator!=(std::nullptr_t, intrusive_shared_ptr const& x); // #include #include #include "test_policy.h" struct T { int i; }; template static void check_eq(T t, U u) { CHECK(t == u); CHECK(u == t); CHECK(!(t != u)); CHECK(!(u != t)); } template static void check_ne(T t, U u) { CHECK(!(t == u)); CHECK(!(u == t)); CHECK(t != u); CHECK(u != t); } template static void tests() { T obj{3}; { test_shared_ptr const a(&obj, libkern::no_retain); check_ne(a, nullptr); } { test_shared_ptr const a = nullptr; check_eq(a, nullptr); } } T_DECL(compare_equal_nullptr, "intrusive_shared_ptr.compare.equal.nullptr", T_META_TAG_VM_PREFERRED) { tests(); tests(); }