mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 10:32:29 +00:00
26 lines
585 B
C++
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();
|
|
}
|
|
}
|