squall/test/Thread.cpp
2022-12-28 15:43:57 -06:00

26 lines
585 B
C++

#include "storm/Thread.hpp"
#include "test/Test.hpp"
TEST_CASE("SGetCurrentThreadId", "[thread]") {
SECTION("returns thread id") {
uintptr_t threadId = SGetCurrentThreadId();
CHECK(threadId > 0);
}
}
TEST_CASE("SCritSect::Enter", "[thread]") {
SECTION("locks critical section") {
SCritSect critSect;
critSect.Enter();
SUCCEED();
}
}
TEST_CASE("SCritSect::Leave", "[thread]") {
SECTION("unlocks critical section") {
SCritSect critSect;
critSect.Enter();
critSect.Leave();
SUCCEED();
}
}