diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-18 18:22:14 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-18 18:22:14 +0100 |
commit | a30e627ffccf36384689295ce54af32e38ef5ef8 (patch) | |
tree | ffd03045f2f292da9d9f2d684d166093abaf7a21 /test/core | |
parent | 1ebaaf08c0bc7de704a3c2a423f572c54c4a069b (diff) |
Droped Rtti<T> class, using RttiType instead
Diffstat (limited to 'test/core')
-rw-r--r-- | test/core/common/ArgumentTest.cpp | 10 | ||||
-rw-r--r-- | test/core/common/RttiTest.cpp | 44 | ||||
-rw-r--r-- | test/core/managed/ManagedTest.cpp | 11 | ||||
-rw-r--r-- | test/core/model/NodeTest.cpp | 7 |
4 files changed, 36 insertions, 36 deletions
diff --git a/test/core/common/ArgumentTest.cpp b/test/core/common/ArgumentTest.cpp index e580986..d7d0d6a 100644 --- a/test/core/common/ArgumentTest.cpp +++ b/test/core/common/ArgumentTest.cpp @@ -23,7 +23,7 @@ #include <core/common/Argument.hpp> #include <core/common/Function.hpp> #include <core/common/Logger.hpp> -#include <core/common/Rtti.hpp> +#include <core/common/RttiBuilder.hpp> #include <core/managed/Managed.hpp> @@ -46,10 +46,10 @@ public: } namespace RttiTypes { -static const Rtti<ousia::TestManaged1> TestManaged1 = - RttiBuilder("TestManaged1"); -static const Rtti<ousia::TestManaged2> TestManaged2 = - RttiBuilder("TestManaged2").parent(&TestManaged1); +static const RttiType TestManaged1 = + RttiBuilder<ousia::TestManaged1>("TestManaged1"); +static const RttiType TestManaged2 = + RttiBuilder<ousia::TestManaged2>("TestManaged2").parent(&TestManaged1); } TEST(Argument, validateAny) diff --git a/test/core/common/RttiTest.cpp b/test/core/common/RttiTest.cpp index 5d02553..b8c1e7f 100644 --- a/test/core/common/RttiTest.cpp +++ b/test/core/common/RttiTest.cpp @@ -23,8 +23,7 @@ #include <gtest/gtest.h> #include <core/common/Function.hpp> -#include <core/common/Rtti.hpp> -#include <core/common/TypedRttiBuilder.hpp> +#include <core/common/RttiBuilder.hpp> #include <core/common/Variant.hpp> namespace ousia { @@ -45,18 +44,18 @@ class RttiTestClass6 { class RttiTestClass7 { }; -extern const Rtti<RttiTestClass6> Type6; -extern const Rtti<RttiTestClass7> Type7; +extern const RttiType Type6; +extern const RttiType Type7; -const Rtti<RttiTestClass1> Type1 = RttiBuilder{"Type1"}; -const Rtti<RttiTestClass2> Type2 = RttiBuilder{"Type2"}; -const Rtti<RttiTestClass3> Type3 = RttiBuilder{"Type3"}.parent(&Type1); -const Rtti<RttiTestClass4> Type4 = - RttiBuilder{"Type4"}.parent({&Type3, &Type2}); -const Rtti<RttiTestClass5> Type5 = - RttiBuilder{"Type5"}.composedOf({&Type6, &Type7}); -const Rtti<RttiTestClass6> Type6 = RttiBuilder{"Type6"}.composedOf(&Type1); -const Rtti<RttiTestClass7> Type7 = RttiBuilder{"Type7"}.parent(&Type6); +const RttiType Type1 = RttiBuilder<RttiTestClass1>{"Type1"}; +const RttiType Type2 = RttiBuilder<RttiTestClass2>{"Type2"}; +const RttiType Type3 = RttiBuilder<RttiTestClass3>{"Type3"}.parent(&Type1); +const RttiType Type4 = + RttiBuilder<RttiTestClass4>{"Type4"}.parent({&Type3, &Type2}); +const RttiType Type5 = + RttiBuilder<RttiTestClass5>{"Type5"}.composedOf({&Type6, &Type7}); +const RttiType Type6 = RttiBuilder<RttiTestClass6>{"Type6"}.composedOf(&Type1); +const RttiType Type7 = RttiBuilder<RttiTestClass7>{"Type7"}.parent(&Type6); TEST(Rtti, isa) { @@ -124,8 +123,8 @@ class RttiMethodTestClass1 { class RttiMethodTestClass2 { }; -static const Rtti<RttiMethodTestClass1> MType1 = - RttiBuilder{"MType1"} +static const RttiType MType1 = + RttiBuilder<RttiMethodTestClass1>{"MType1"} .genericMethod( "a", std::make_shared<Method<RttiMethodTestClass1>>([]( Variant::arrayType &args, @@ -139,8 +138,8 @@ static const Rtti<RttiMethodTestClass1> MType1 = Variant::arrayType &args, RttiMethodTestClass1 *thisPtr) { return Variant{"c"}; })); -static const Rtti<RttiMethodTestClass2> MType2 = - TypedRttiBuilder<RttiMethodTestClass2>{"MType2"} +static const RttiType MType2 = + RttiBuilder<RttiMethodTestClass2>{"MType2"} .parent(&MType1) .method("c", [](Variant::arrayType &args, @@ -218,13 +217,12 @@ public: } }; -static const Rtti<RttiPropertyTestClass1> PType1 = - TypedRttiBuilder<RttiPropertyTestClass1>{"PType1"}.property( - "a", {RttiTypes::Int, RttiPropertyTestClass1::getA, - RttiPropertyTestClass1::setA}); +static const RttiType PType1 = RttiBuilder<RttiPropertyTestClass1>{ + "PType1"}.property("a", {RttiTypes::Int, RttiPropertyTestClass1::getA, + RttiPropertyTestClass1::setA}); -static const Rtti<RttiMethodTestClass2> PType2 = - TypedRttiBuilder<RttiPropertyTestClass2>{"PType2"}.parent(&PType1).property( +static const RttiType PType2 = + RttiBuilder<RttiPropertyTestClass2>{"PType2"}.parent(&PType1).property( "b", {RttiTypes::Int, RttiPropertyTestClass2::getB, RttiPropertyTestClass2::setB}); diff --git a/test/core/managed/ManagedTest.cpp b/test/core/managed/ManagedTest.cpp index 0391738..b5a6e64 100644 --- a/test/core/managed/ManagedTest.cpp +++ b/test/core/managed/ManagedTest.cpp @@ -19,6 +19,7 @@ #include <gtest/gtest.h> #include <core/common/Rtti.hpp> +#include <core/common/RttiBuilder.hpp> #include <core/managed/Managed.hpp> #include "TestManaged.hpp" @@ -76,11 +77,11 @@ class TypeTestManaged5 : public Managed { using Managed::Managed; }; -static const Rtti<TypeTestManaged1> Type1 = RttiBuilder{"Type1"}; -static const Rtti<TypeTestManaged2> Type2 = RttiBuilder{"Type2"}; -static const Rtti<TypeTestManaged3> Type3 = RttiBuilder{"Type3"}.parent(&Type1); -static const Rtti<TypeTestManaged4> Type4 = - RttiBuilder{"Type4"}.parent({&Type3, &Type2}); +static const RttiType Type1 = RttiBuilder<TypeTestManaged1>("Type1"); +static const RttiType Type2 = RttiBuilder<TypeTestManaged2>("Type2"); +static const RttiType Type3 = RttiBuilder<TypeTestManaged3>("Type3").parent(&Type1); +static const RttiType Type4 = + RttiBuilder<TypeTestManaged4>("Type4").parent({&Type3, &Type2}); TEST(Managed, type) { diff --git a/test/core/model/NodeTest.cpp b/test/core/model/NodeTest.cpp index 8bbee05..aa6ef59 100644 --- a/test/core/model/NodeTest.cpp +++ b/test/core/model/NodeTest.cpp @@ -18,7 +18,7 @@ #include <gtest/gtest.h> -#include <core/common/Rtti.hpp> +#include <core/common/RttiBuilder.hpp> #include <core/managed/Managed.hpp> #include <core/model/Node.hpp> @@ -60,8 +60,9 @@ public: }; namespace RttiTypes { -const Rtti<ousia::TestNode> TestNode = - RttiBuilder("TestNode").parent(&RttiTypes::Node).composedOf(&TestNode); +const RttiType TestNode = RttiBuilder<ousia::TestNode>("TestNode") + .parent(&RttiTypes::Node) + .composedOf(&TestNode); } TEST(Node, isRoot) |