Disable RTTI everywhere and fix Linux compilation

Former-commit-id: c8c0f11725d2e5b6c6da6dc3ab11f0eda065094f [formerly c2977e388c70ba7ccdf52f9eb97d7fe71ed6f4cf] [formerly 73c0d0759a6c9cad05dff59bff486f99fde336b6 [formerly 96a6e52ba5c97fd3a107fed5d11738466bd53f7e]]
Former-commit-id: c6a193ee5ccb07a40a74719937dbf224ad22081e [formerly 5f275dc02a44bd2ee54f6d926338ddfe388f565b]
Former-commit-id: e35640a20ac2269f96b75998e56fcba2fdbf6f00
This commit is contained in:
Lynix 2016-09-30 14:15:19 +02:00
parent 2f527091d5
commit 3461eb49ca
4 changed files with 28 additions and 6 deletions

View File

@ -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)

View File

@ -2,7 +2,6 @@ TOOL.Name = "UnitTests"
TOOL.Directory = "../tests"
TOOL.EnableConsole = true
TOOL.EnableRTTI = true
TOOL.Kind = "Application"
TOOL.TargetDirectory = TOOL.Directory

View File

@ -6,6 +6,18 @@ namespace
class TestComponent : public Ndk::Component<TestComponent>
{
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<TestComponent*>(clone.get()) != nullptr);
REQUIRE(static_cast<TestComponent*>(clone.get())->GetValue() == 42);
}
}
}

View File

@ -6,15 +6,23 @@ namespace
class TestSystem : public Ndk::System<TestSystem>
{
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<TestSystem*>(clone.get()) != nullptr);
REQUIRE(static_cast<TestSystem*>(clone.get())->GetValue() == 42);
}
}
}