Include Catch and tests for Core
Catch 1.2.1 Former-commit-id: 4149eaa61b21532d4d204db8a3771c6de8e4672c
This commit is contained in:
28
tests/Nazara/Core/Error.cpp
Normal file
28
tests/Nazara/Core/Error.cpp
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user