UnitTests: Add build script and move current tests to "tests/Engine" directory (from "tests/Nazara")
Former-commit-id: 5639305bbdbb69ad6f6f282df6c6de930220b57f
This commit is contained in:
28
tests/Engine/Core/Error.cpp
Normal file
28
tests/Engine/Core/Error.cpp
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user