summaryrefslogtreecommitdiff
path: root/test/cairo-test.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-05-06 10:29:20 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-05-06 14:30:35 +0100
commit1755a2d27def853163f9c496c07ae79070c5002e (patch)
tree4e0a93013de9883a6e711fc2bcabc6bfad9f9a00 /test/cairo-test.c
parentbf49015202523c6e9f4130c3160e8b5c50f16db8 (diff)
[test] Enable floating point exceptions.
Some platforms and applications enable floating point exceptions, so it seems sensible to run the test-suite with the most serious exceptions enabled - divide by zero, invalid result and overflow.
Diffstat (limited to 'test/cairo-test.c')
-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 8ed588959..b1f019167 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -35,6 +35,9 @@
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
+#if HAVE_FEENABLEEXCEPT
+#include <fenv.h>
+#endif
#include <assert.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -110,6 +113,10 @@ cairo_test_init (const char *test_name)
{
char *log_name;
+#if HAVE_FEENABLEEXCEPT
+ feenableexcept (FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
+#endif
+
xasprintf (&log_name, "%s%s", test_name, CAIRO_TEST_LOG_SUFFIX);
xunlink (log_name);