aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJack Mordaunt <jackmordaunt.dev@gmail.com>2025-06-12 16:13:22 -0300
committerJack Mordaunt <jackmordaunt.dev@gmail.com>2025-06-12 16:14:52 -0300
commit3c3fd6e580b017b2243303221709856b9c663a5c (patch)
treedd9d39ebf0c877efcd8be23a5f287793c0cec543 /tests
parentc1cd525d9df428897393c748acdafe077b7de19d (diff)
tests/core/sync/chan: move global state into test
While this state is not actually needed by more than one test, we can just make it a static variable.
Diffstat (limited to 'tests')
-rw-r--r--tests/core/sync/chan/test_core_sync_chan.odin5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/core/sync/chan/test_core_sync_chan.odin b/tests/core/sync/chan/test_core_sync_chan.odin
index 6bb918516..e8bb553b1 100644
--- a/tests/core/sync/chan/test_core_sync_chan.odin
+++ b/tests/core/sync/chan/test_core_sync_chan.odin
@@ -35,8 +35,6 @@ MAX_RAND :: 32
FAIL_TIME :: 1 * time.Second
SLEEP_TIME :: 1 * time.Millisecond
-__global_context_for_test: rawptr
-
comm_client :: proc(th: ^thread.Thread) {
data := cast(^Comm)th.data
manual_buffering := data.manual_buffering
@@ -384,6 +382,9 @@ test_try_select_raw_no_toctou :: proc(t: ^testing.T) {
assert(trigger_err == nil, "allocation failed")
defer chan.destroy(trigger)
+ @(static)
+ __global_context_for_test: rawptr
+
__global_context_for_test = &trigger
defer __global_context_for_test = nil