squall/test/Error.cpp
2026-01-05 21:50:37 -06:00

30 lines
1 KiB
C++

#include "test/Test.hpp"
#include "storm/Error.hpp"
TEST_CASE("SErrDisplayError", "[error]") {
SECTION("does nothing if errors are suppressed") {
uint32_t errorcode = GENERATE(0, STORM_ERROR_ASSERTION, ERROR_INVALID_PARAMETER);
int32_t recoverable = GENERATE(0, 1);
uint32_t exitcode = GENERATE(0, 1);
SErrSuppressErrors(1);
CHECK_FALSE(SErrDisplayError(errorcode, nullptr, 0, nullptr, recoverable, exitcode));
}
}
TEST_CASE("SErrDisplayErrorFmt", "[error]") {
SECTION("does nothing if errors are suppressed") {
uint32_t errorcode = GENERATE(0, STORM_ERROR_ASSERTION, ERROR_INVALID_PARAMETER);
int32_t recoverable = GENERATE(0, 1);
uint32_t exitcode = GENERATE(0, 1);
SErrSuppressErrors(1);
CHECK_FALSE(SErrDisplayErrorFmt(errorcode, nullptr, 0, recoverable, exitcode, ""));
}
}
TEST_CASE("SErrIsDisplayingError", "[error]") {
SECTION("returns false by default") {
CHECK_FALSE(SErrIsDisplayingError());
}
}