diff options
Diffstat (limited to 'test/core/common/PropertyTest.cpp')
-rw-r--r-- | test/core/common/PropertyTest.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/core/common/PropertyTest.cpp b/test/core/common/PropertyTest.cpp index c28feeb..0f3d74e 100644 --- a/test/core/common/PropertyTest.cpp +++ b/test/core/common/PropertyTest.cpp @@ -61,7 +61,8 @@ TEST(Getter, construction) TEST(Getter, validation) { - const PropertyType type{RttiTypes::Int}; + std::shared_ptr<PropertyType> type = + std::make_shared<PropertyType>(RttiTypes::Int); TestObject obj{123}; { @@ -73,7 +74,7 @@ TEST(Getter, validation) { // Int type set, returning strings is an exception Getter<TestObject> getter{getString}; - getter.propertyType = &type; + getter.propertyType = type; ASSERT_THROW(getter.get(&obj), LoggableException); } @@ -109,7 +110,8 @@ TEST(Setter, construction) TEST(Setter, validation) { - const PropertyType type{RttiTypes::Int}; + std::shared_ptr<PropertyType> type = + std::make_shared<PropertyType>(RttiTypes::Int); TestObject obj{123}; Setter<TestObject> setter{TestObject::setA}; @@ -128,7 +130,7 @@ TEST(Setter, validation) setter.set("foo", &obj); ASSERT_EQ(42, obj.a); - setter.propertyType = &type; + setter.propertyType = type; ASSERT_THROW(setter.set("foo", &obj), LoggableException); setter.set(123, &obj); |