19 lines
505 B
C++
19 lines
505 B
C++
#include <doctest/doctest.h>
|
|
|
|
#include <hdk/grid/PrimitiveWrapper.hpp>
|
|
|
|
TEST_CASE("PrimitiveWrapper stores and exposes primitive values") {
|
|
hdk::grid::PrimitiveWrapper<int> wrapped(7);
|
|
CHECK(static_cast<int>(wrapped) == 7);
|
|
|
|
wrapped = 42;
|
|
CHECK(static_cast<int>(wrapped) == 42);
|
|
}
|
|
|
|
TEST_CASE("PrimitiveWrapper assignment returns self for chaining") {
|
|
hdk::grid::PrimitiveWrapper<int> wrapped(1);
|
|
auto& ref = (wrapped = 9);
|
|
CHECK(&ref == &wrapped);
|
|
CHECK(static_cast<int>(wrapped) == 9);
|
|
}
|