diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2024-10-03 13:41:10 +0200 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-10-03 13:51:31 +0200 |
| commit | a78cd48aa3cb7ef29ee971b235859e1f5ee5481c (patch) | |
| tree | 7317a1feb38ee28cab0b71462cc692d2081979d5 /tests/core/sys | |
| parent | 76806080ef1de85537fec0adc33304c719cb4cc4 (diff) | |
remove posix signal test, it isn't thread safe
Diffstat (limited to 'tests/core/sys')
| -rw-r--r-- | tests/core/sys/posix/posix.odin | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/tests/core/sys/posix/posix.odin b/tests/core/sys/posix/posix.odin index 760ddc1fb..d73e49ffb 100644 --- a/tests/core/sys/posix/posix.odin +++ b/tests/core/sys/posix/posix.odin @@ -1,8 +1,6 @@ #+build darwin, freebsd, openbsd, netbsd package tests_core_posix -import "base:runtime" - import "core:log" import "core:path/filepath" import "core:strings" @@ -218,52 +216,6 @@ test_termios :: proc(t: ^testing.T) { } @(test) -test_signal :: proc(t: ^testing.T) { - @static tt: ^testing.T - tt = t - - @static ctx: runtime.Context - ctx = context - - act: posix.sigaction_t - act.sa_flags = {.SIGINFO, .RESETHAND} - act.sa_sigaction = handler - testing.expect_value(t, posix.sigaction(.SIGCHLD, &act, nil), posix.result.OK) - - handler :: proc "c" (sig: posix.Signal, info: ^posix.siginfo_t, address: rawptr) { - context = ctx - testing.expect_value(tt, sig, posix.Signal.SIGCHLD) - testing.expect_value(tt, info.si_signo, posix.Signal.SIGCHLD) - testing.expect_value(tt, info.si_status, 69) - testing.expect_value(tt, info.si_code.chld, posix.CLD_Code.EXITED) - } - - switch pid := posix.fork(); pid { - case -1: - log.errorf("fork() failure: %v", posix.strerror()) - case 0: - posix.exit(69) - case: - for { - status: i32 - res := posix.waitpid(pid, &status, {}) - if res == -1 { - if !testing.expect_value(t, posix.errno(), posix.Errno.EINTR) { - break - } - continue - } - - if posix.WIFEXITED(status) || posix.WIFSIGNALED(status) { - testing.expect(t, posix.WIFEXITED(status)) - testing.expect(t, posix.WEXITSTATUS(status) == 69) - break - } - } - } -} - -@(test) test_pthreads :: proc(t: ^testing.T) { testing.set_fail_timeout(t, time.Second) |