UnitTests: Add build script and move current tests to "tests/Engine" directory (from "tests/Nazara")

Former-commit-id: 5639305bbdbb69ad6f6f282df6c6de930220b57f
This commit is contained in:
Lynix
2015-09-19 01:14:19 +02:00
parent a09f859144
commit a61f968d05
24 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
#include <Nazara/Core/Error.hpp>
#include <Catch/catch.hpp>
SCENARIO("Error", "[CORE][ERROR]")
{
nzUInt32 oldFlags = NzError::GetFlags();
GIVEN("Multiple errors")
{
WHEN("Calling to error")
{
THEN("These errors should be written in the log file")
{
NzError::Error(nzErrorType_Internal, "nzErrorType_Internal");
NzError::Error(nzErrorType_Internal, "nzErrorType_Internal", 2, "Error.cpp", "2nd place Internal");
REQUIRE("nzErrorType_Internal" == NzError::GetLastError());
NzError::Error(nzErrorType_Normal, "nzErrorType_Normal");
NzError::Error(nzErrorType_Normal, "nzErrorType_Normal", 2, "Error.cpp", "2nd place Normal");
REQUIRE("nzErrorType_Normal" == NzError::GetLastError());
NzError::Error(nzErrorType_Warning, "nzErrorType_Warning");
NzError::Error(nzErrorType_Warning, "nzErrorType_Warning", 2, "Error.cpp", "2nd place Warning");
REQUIRE("nzErrorType_Warning" == NzError::GetLastError());
}
}
}
NzError::SetFlags(oldFlags);
}