chore(test): allocate thread param on heap in SThread::Create test

This commit is contained in:
fallenoak 2022-12-28 22:52:14 -06:00
parent c4043d24ee
commit b5cef8cbee
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D

View file

@ -1,4 +1,5 @@
#include "storm/Thread.hpp"
#include "storm/Memory.hpp"
#include "test/Test.hpp"
uint32_t threadProc(void* param) {
@ -32,7 +33,8 @@ TEST_CASE("SCritSect::Leave", "[thread]") {
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);
auto threadName = const_cast<char*>("TestThread");
auto threadParam = SMemAlloc(16, nullptr, 0, 0x0);
REQUIRE(SThread::Create(threadProc, threadParam, thread, threadName, 0) != 0);
}
}