From 7ffb504643d5bdc6b4aa893cb7044596e1f32317 Mon Sep 17 00:00:00 2001 From: roby2014 Date: Mon, 13 Nov 2023 13:35:58 +0000 Subject: [PATCH] test(memory): AnyValue move assignment --- core/tests/memory/any_value.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/tests/memory/any_value.cpp b/core/tests/memory/any_value.cpp index e307b5ea4..75b03ab16 100644 --- a/core/tests/memory/any_value.cpp +++ b/core/tests/memory/any_value.cpp @@ -35,6 +35,17 @@ TEST_CASE("memory::AnyValue") CHECK(any.type().is()); CHECK(*static_cast(any.get()) == value); } + + SUBCASE("move assignment") + { + int value = 1337; + AnyValue any{}; + REQUIRE_FALSE(any.valid()); + any = AnyValue::moveConstruct(reflect(), &value); + REQUIRE(any.valid()); + CHECK(any.type().is()); + CHECK(*static_cast(any.get()) == value); + } } SUBCASE("detect destructor")