#define CATCH_CONFIG_MAIN #include "catch.hpp" #include "data_structures/ptr_int.hpp" TEST_CASE("Size of pointer integer object") { REQUIRE(sizeof(PtrInt) == sizeof(uintptr_t)); } TEST_CASE("Construct and read pointer integer pair type") { auto ptr1 = std::make_unique(2); PtrInt pack1(ptr1.get(), 1); REQUIRE(pack1.get_int() == 1); REQUIRE(pack1.get_ptr() == ptr1.get()); auto ptr2 = std::make_unique(2); PtrInt pack2(ptr2.get(), 4); REQUIRE(pack2.get_int() == 4); REQUIRE(pack2.get_ptr() == ptr2.get()); }