feat(thread): implement SThread::Create for windows

This commit is contained in:
fallenoak 2022-12-28 20:03:31 -06:00 committed by GitHub
parent 4dbfb0b3be
commit db87a5d782
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 41 additions and 6 deletions

View file

@ -1,6 +1,10 @@
#include "storm/Thread.hpp"
#include "test/Test.hpp"
uint32_t threadProc(void* param) {
return 0;
};
TEST_CASE("SGetCurrentThreadId", "[thread]") {
SECTION("returns thread id") {
uintptr_t threadId = SGetCurrentThreadId();
@ -24,3 +28,11 @@ TEST_CASE("SCritSect::Leave", "[thread]") {
SUCCEED();
}
}
TEST_CASE("SThread::Create", "[thread]") {
SECTION("creates new thread") {
SThread thread;
char* threadName = const_cast<char*>("TestThread");
REQUIRE(SThread::Create(threadProc, nullptr, thread, threadName, 0) != 0);
}
}