From b5cef8cbee6de587f1cb786341231a0cf4e5a9ce Mon Sep 17 00:00:00 2001 From: fallenoak Date: Wed, 28 Dec 2022 22:52:14 -0600 Subject: [PATCH] chore(test): allocate thread param on heap in SThread::Create test --- test/Thread.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/Thread.cpp b/test/Thread.cpp index 5ec0a05..3055aed 100644 --- a/test/Thread.cpp +++ b/test/Thread.cpp @@ -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("TestThread"); - REQUIRE(SThread::Create(threadProc, nullptr, thread, threadName, 0) != 0); + auto threadName = const_cast("TestThread"); + auto threadParam = SMemAlloc(16, nullptr, 0, 0x0); + REQUIRE(SThread::Create(threadProc, threadParam, thread, threadName, 0) != 0); } }