mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-04-27 03:43:51 +00:00
feat(error): add SErrIsDisplayingError
This commit is contained in:
parent
b292aabac0
commit
5472065b8b
5 changed files with 25 additions and 1 deletions
|
|
@ -81,6 +81,10 @@ int32_t STORMCDECL SErrDisplayErrorFmt(uint32_t errorcode, const char* filename,
|
|||
return SErrDisplayError(errorcode, filename, linenumber, buffer, recoverable, exitcode);
|
||||
}
|
||||
|
||||
int32_t STORMAPI SErrIsDisplayingError() {
|
||||
return s_displaying;
|
||||
}
|
||||
|
||||
void STORMAPI SErrPrepareAppFatal(const char* filename, int32_t linenumber) {
|
||||
// TODO
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ int32_t STORMAPI SErrDisplayError(uint32_t errorcode, const char* filename, int3
|
|||
|
||||
int32_t STORMCDECL SErrDisplayErrorFmt(uint32_t errorcode, const char* filename, int32_t linenumber, int32_t recoverable, uint32_t exitcode, const char* format, ...);
|
||||
|
||||
int32_t STORMAPI SErrIsDisplayingError();
|
||||
|
||||
void STORMAPI SErrPrepareAppFatal(const char* filename, int32_t linenumber);
|
||||
|
||||
void STORMAPI SErrSetLastError(uint32_t errorcode);
|
||||
|
|
|
|||
|
|
@ -11,3 +11,20 @@ TEST_CASE("SErrDisplayError", "[error]") {
|
|||
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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ EXPORTS
|
|||
;SLogVWrite @553 NONAME
|
||||
SErrDisplayAppFatal @561 NONAME
|
||||
SErrDisplayErrorFmt @562 NONAME
|
||||
;SErrIsDisplayingError @563 NONAME
|
||||
SErrIsDisplayingError @563 NONAME
|
||||
SErrPrepareAppFatal @564 NONAME
|
||||
;SErrSetLogTitleString @565 NONAME
|
||||
;SErrCheckDebugSymbolLibrary @566 NONAME
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ void STORMAPI SBigToUnsigned(BigData*, uint32_t*) {}
|
|||
void STORMCDECL SErrDisplayAppFatal(const char* format, ...) {}
|
||||
int32_t STORMAPI SErrDisplayError(uint32_t, const char*, int32_t, const char*, int32_t, uint32_t) { return 0; }
|
||||
int32_t STORMCDECL SErrDisplayErrorFmt(uint32_t, const char*, int32_t, int32_t, uint32_t, const char*, ...) { return 0; }
|
||||
int32_t STORMAPI SErrIsDisplayingError() { return 0; }
|
||||
void STORMAPI SErrPrepareAppFatal(const char*, int32_t) {}
|
||||
void STORMAPI SErrSetLastError(uint32_t) {}
|
||||
uint32_t STORMAPI SErrGetLastError() { return 0; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue