summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2019-04-26 14:17:49 +0200
committerQuentin Carbonneaux <quentin@c9x.me>2019-04-26 14:17:49 +0200
commitdda87279c17374baa2b7e1c7e60840c336e09d66 (patch)
treefe13078d63a5455be56e6b7143be5cbf6dfb9b37 /test
parent2a60575f53d831f36eb93658b40fcd2f5ab3c82f (diff)
downloadroux-dda87279c17374baa2b7e1c7e60840c336e09d66.tar.gz
update conaddr test to catch early segfaults
Diffstat (limited to 'test')
-rw-r--r--test/conaddr.ssa14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/conaddr.ssa b/test/conaddr.ssa
index 3f0aba7..43177ba 100644
--- a/test/conaddr.ssa
+++ b/test/conaddr.ssa
@@ -45,21 +45,21 @@ function $writeto0() {
# #include <stdlib.h>
# #include <signal.h>
# char a[] = "qbe rocks";
-# int ok = 1;
+# int ok;
# extern unsigned f0(long), f1(long), f2(long, long);
# extern char *f3(long);
# extern void writeto0();
# void h(int sig, siginfo_t *si, void *unused) {
-# ok &= si->si_addr == 0;
-# exit(!ok);
+# ok += si->si_addr == 0;
+# exit(!(ok == 5));
# }
# int main() {
# struct sigaction sa = {.sa_flags=SA_SIGINFO, .sa_sigaction=h};
# sigemptyset(&sa.sa_mask); sigaction(SIGSEGV, &sa, 0);
-# ok &= f0(2) == 'e';
-# ok &= f1((long)a-5) == 'o';
-# ok &= f2(4, 2) == 's';
-# ok &= *f3(0) == 'q';
+# ok += f0(2) == 'e';
+# ok += f1((long)a-5) == 'o';
+# ok += f2(4, 2) == 's';
+# ok += *f3(0) == 'q';
# writeto0(); /* will segfault */
# }
# <<<