mirror of
https://github.com/thunderbrewhq/squall.git
synced 2026-02-04 00:49:08 +00:00
chore(style): clean up line endings in core tests
This commit is contained in:
parent
8fe642e24c
commit
aae54bed6b
2 changed files with 41 additions and 42 deletions
|
|
@ -1,40 +1,39 @@
|
||||||
#include "test/Test.hpp"
|
#include "test/Test.hpp"
|
||||||
#include "EventTest.hpp"
|
#include "EventTest.hpp"
|
||||||
#include "storm/Core.hpp"
|
#include "storm/Core.hpp"
|
||||||
|
|
||||||
|
TEST_CASE("StormDestroy", "[core]") {
|
||||||
TEST_CASE("StormDestroy", "[core]") {
|
SECTION("always returns 1") {
|
||||||
SECTION("always returns 1") {
|
CHECK(StormDestroy() == 1);
|
||||||
CHECK(StormDestroy() == 1);
|
}
|
||||||
}
|
|
||||||
|
SECTION("SEvt") {
|
||||||
SECTION("SEvt") {
|
EventHandlerTest test;
|
||||||
EventHandlerTest test;
|
|
||||||
|
SECTION("destroys all event handlers") {
|
||||||
SECTION("destroys all event handlers") {
|
SEvtRegisterHandler(1, 1, 1, 0, &TestEventHandler1);
|
||||||
SEvtRegisterHandler(1, 1, 1, 0, &TestEventHandler1);
|
CHECK(SEvtDispatch(1, 1, 1, nullptr) == 1);
|
||||||
CHECK(SEvtDispatch(1, 1, 1, nullptr) == 1);
|
CHECK(test.NumCalls() == 1);
|
||||||
CHECK(test.NumCalls() == 1);
|
|
||||||
|
CHECK(SEvtDispatch(1, 1, 1, nullptr) == 1);
|
||||||
CHECK(SEvtDispatch(1, 1, 1, nullptr) == 1);
|
CHECK(test.NumCalls() == 2);
|
||||||
CHECK(test.NumCalls() == 2);
|
|
||||||
|
CHECK(StormDestroy() == 1);
|
||||||
CHECK(StormDestroy() == 1);
|
|
||||||
|
// Can't increment calls since the handler was destroyed
|
||||||
// Can't increment calls since the handler was destroyed
|
CHECK(SEvtDispatch(1, 1, 1, nullptr) == 0);
|
||||||
CHECK(SEvtDispatch(1, 1, 1, nullptr) == 0);
|
CHECK(test.NumCalls() == 2);
|
||||||
CHECK(test.NumCalls() == 2);
|
}
|
||||||
}
|
|
||||||
|
SECTION("doesn't destroy break data") {
|
||||||
SECTION("doesn't destroy break data") {
|
// not ideal but it's official behaviour
|
||||||
// not ideal but it's official behaviour
|
SEvtBreakHandlerChain(nullptr);
|
||||||
SEvtBreakHandlerChain(nullptr);
|
|
||||||
|
CHECK(StormDestroy() == 1);
|
||||||
CHECK(StormDestroy() == 1);
|
|
||||||
|
SEvtRegisterHandler(0, 0, 0, 0, &TestEventHandler1);
|
||||||
SEvtRegisterHandler(0, 0, 0, 0, &TestEventHandler1);
|
CHECK(SEvtDispatch(0, 0, 0, nullptr) == 0);
|
||||||
CHECK(SEvtDispatch(0, 0, 0, nullptr) == 0);
|
CHECK(SEvtDispatch(0, 0, 0, nullptr) == 1);
|
||||||
CHECK(SEvtDispatch(0, 0, 0, nullptr) == 1);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
#define CATCH_CONFIG_MAIN
|
#define CATCH_CONFIG_MAIN
|
||||||
#include "test/Test.hpp"
|
#include "test/Test.hpp"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue