diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-14 02:44:09 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-14 02:44:09 +0100 |
commit | 7d1b3c5df2eab1d42179332d467d5756aefed587 (patch) | |
tree | 6a44220ea0781a686d6c7b513ca914ba1ce6e919 /test/core/common/PropertyTest.cpp | |
parent | 92c1f8d9c933d13a8f038565587c83abae28711e (diff) |
Implemented attaching Methods and Property information to Types (this will later allow script engines to access these methods).
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); |