Include Catch and tests for Core

Catch 1.2.1


Former-commit-id: 4149eaa61b21532d4d204db8a3771c6de8e4672c
This commit is contained in:
Gawaboumga
2015-08-21 11:46:46 +02:00
parent 2d07922478
commit f61aa8f36e
8 changed files with 566 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
#include <Nazara/Core/Error.hpp>
#include <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);
}