summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-07-22 18:15:38 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-07-24 10:44:03 +0100
commit596dec95610ef02d86ede94eca5b83221b0b533a (patch)
treed0e5815022dd7890f4640dcdf82e2cab9b69c101 /test
parent0561539880b480273767a9559da89a25970802e2 (diff)
[test] Trap SIGFPE
Note the crash if we hit a floating-point exception.
Diffstat (limited to 'test')
-rw-r--r--test/cairo-test.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/cairo-test.c b/test/cairo-test.c
index 34dd60020..430acc17c 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -1509,6 +1509,7 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx,
#if defined(HAVE_SIGNAL_H) && defined(HAVE_SETJMP_H)
if (ctx->thread == 0 && ! RUNNING_ON_VALGRIND) {
void (* volatile old_segfault_handler)(int);
+ void (* volatile old_segfpe_handler)(int);
void (* volatile old_sigpipe_handler)(int);
void (* volatile old_sigabrt_handler)(int);
void (* volatile old_sigalrm_handler)(int);
@@ -1517,6 +1518,9 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx,
#ifdef SIGSEGV
old_segfault_handler = signal (SIGSEGV, segfault_handler);
#endif
+#ifdef SIGFPE
+ old_segfpe_handler = signal (SIGFPE, segfault_handler);
+#endif
#ifdef SIGPIPE
old_sigpipe_handler = signal (SIGPIPE, segfault_handler);
#endif
@@ -1533,6 +1537,9 @@ _cairo_test_context_run_for_target (cairo_test_context_t *ctx,
#ifdef SIGSEGV
signal (SIGSEGV, old_segfault_handler);
#endif
+#ifdef SIGFPE
+ signal (SIGFPE, old_segfpe_handler);
+#endif
#ifdef SIGPIPE
signal (SIGPIPE, old_sigpipe_handler);
#endif