diff --git a/build/scripts/common.lua b/build/scripts/common.lua index b134bf4e3..30272acfd 100644 --- a/build/scripts/common.lua +++ b/build/scripts/common.lua @@ -439,6 +439,9 @@ function NazaraBuild:Execute() includedirs(exampleTable.Includes) links(exampleTable.Libraries) + configuration("Release*") + rtti(exampleTable.EnableRTTI and "On" or "Off") + configuration("x32") libdirs(exampleTable.LibraryPaths.x86) diff --git a/build/scripts/tools/unittests.lua b/build/scripts/tools/unittests.lua index f58b0eee0..5dcf6e215 100644 --- a/build/scripts/tools/unittests.lua +++ b/build/scripts/tools/unittests.lua @@ -2,7 +2,6 @@ TOOL.Name = "UnitTests" TOOL.Directory = "../tests" TOOL.EnableConsole = true -TOOL.EnableRTTI = true TOOL.Kind = "Application" TOOL.TargetDirectory = TOOL.Directory diff --git a/tests/SDK/NDK/Component.cpp b/tests/SDK/NDK/Component.cpp index f00bb9006..c41f541be 100644 --- a/tests/SDK/NDK/Component.cpp +++ b/tests/SDK/NDK/Component.cpp @@ -6,6 +6,18 @@ namespace class TestComponent : public Ndk::Component { public: + TestComponent(int value) : + m_value(value) + { + } + + int GetValue() const + { + return m_value; + } + + int m_value; + static Ndk::ComponentIndex componentIndex; }; @@ -16,7 +28,7 @@ SCENARIO("Component", "[NDK][COMPONENT]") { GIVEN("Our TestComponent") { - TestComponent testComponent; + TestComponent testComponent(42); WHEN("We clone it") { @@ -24,7 +36,7 @@ SCENARIO("Component", "[NDK][COMPONENT]") THEN("We should get a copy") { - REQUIRE(dynamic_cast(clone.get()) != nullptr); + REQUIRE(static_cast(clone.get())->GetValue() == 42); } } } diff --git a/tests/SDK/NDK/System.cpp b/tests/SDK/NDK/System.cpp index ca1917124..2948185ae 100644 --- a/tests/SDK/NDK/System.cpp +++ b/tests/SDK/NDK/System.cpp @@ -6,15 +6,23 @@ namespace class TestSystem : public Ndk::System { public: - TestSystem() + TestSystem(int value) : + m_value(value) { } + int GetValue() const + { + return m_value; + } + ~TestSystem() = default; static Ndk::SystemIndex systemIndex; private: + int m_value; + void OnUpdate(float elapsedTime) override { } @@ -27,7 +35,7 @@ SCENARIO("System", "[NDK][SYSTEM]") { GIVEN("Our TestSystem") { - TestSystem testSystem; + TestSystem testSystem(666); WHEN("We clone it") { @@ -35,7 +43,7 @@ SCENARIO("System", "[NDK][SYSTEM]") THEN("We should get a copy") { - REQUIRE(dynamic_cast(clone.get()) != nullptr); + REQUIRE(static_cast(clone.get())->GetValue() == 42); } } }