Skip to content

Commit

Permalink
test(memory): AnyValue move assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
roby2014 committed Nov 13, 2023
1 parent d4134e7 commit 7ffb504
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions core/tests/memory/any_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ TEST_CASE("memory::AnyValue")
CHECK(any.type().is<int>());
CHECK(*static_cast<int*>(any.get()) == value);
}

SUBCASE("move assignment")
{
int value = 1337;
AnyValue any{};
REQUIRE_FALSE(any.valid());
any = AnyValue::moveConstruct(reflect<int>(), &value);
REQUIRE(any.valid());
CHECK(any.type().is<int>());
CHECK(*static_cast<int*>(any.get()) == value);
}
}

SUBCASE("detect destructor")
Expand Down

0 comments on commit 7ffb504

Please sign in to comment.