added test for size of PtrInt object
Summary: added test for size of PtrInt object Test Plan: ctest -V ptr_int -R Reviewers: sale Subscribers: buda, sale Differential Revision: https://memgraph.phacility.com/D12
This commit is contained in:
parent
0c65a9e97e
commit
7362cab9f2
@ -3,6 +3,11 @@
|
|||||||
|
|
||||||
#include "data_structures/ptr_int.hpp"
|
#include "data_structures/ptr_int.hpp"
|
||||||
|
|
||||||
|
TEST_CASE("Size of pointer integer object")
|
||||||
|
{
|
||||||
|
REQUIRE(sizeof(PtrInt<int *, 1, int>) == sizeof(uintptr_t));
|
||||||
|
}
|
||||||
|
|
||||||
TEST_CASE("Construct and read pointer integer pair type")
|
TEST_CASE("Construct and read pointer integer pair type")
|
||||||
{
|
{
|
||||||
auto ptr1 = std::make_unique<int>(2);
|
auto ptr1 = std::make_unique<int>(2);
|
||||||
@ -13,8 +18,8 @@ TEST_CASE("Construct and read pointer integer pair type")
|
|||||||
|
|
||||||
|
|
||||||
auto ptr2 = std::make_unique<int>(2);
|
auto ptr2 = std::make_unique<int>(2);
|
||||||
PtrInt<int *, 3, int> pack2(ptr2.get(), 2);
|
PtrInt<int *, 3, int> pack2(ptr2.get(), 4);
|
||||||
|
|
||||||
REQUIRE(pack2.get_int() == 2);
|
REQUIRE(pack2.get_int() == 4);
|
||||||
REQUIRE(pack2.get_ptr() == ptr2.get());
|
REQUIRE(pack2.get_ptr() == ptr2.get());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user