diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2008-05-06 11:31:14 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2008-05-06 14:30:49 +0100 |
commit | fed9d9060eb950a6692334a7ba3879009b597532 (patch) | |
tree | 6d73f433a3ea3bc60f1348cf5fad2585bcd04025 /test/invalid-matrix.c | |
parent | 1755a2d27def853163f9c496c07ae79070c5002e (diff) | |
download | cairo-fed9d9060eb950a6692334a7ba3879009b597532.tar.gz |
[test/invalid-matrix] Disable floating point exception.
test/invalid-matrix purposely feeds invalid numbers into cairo, in
order to check its detection of garbage values. In doing so, cairo
raises an Invalid exception, but as this is a direct result of an abuse
of the API we can treat it as expected behaviour and ignore the
exception.
Diffstat (limited to 'test/invalid-matrix.c')
-rw-r--r-- | test/invalid-matrix.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/invalid-matrix.c b/test/invalid-matrix.c index 42240bc9d..c25197f1a 100644 --- a/test/invalid-matrix.c +++ b/test/invalid-matrix.c @@ -30,6 +30,10 @@ #define HAVE_INFINITY 1 #endif +#if HAVE_FEDISABLEEXCEPT +#include <fenv.h> +#endif + static cairo_test_draw_function_t draw; cairo_test_t test = { @@ -69,6 +73,11 @@ if ((status) == CAIRO_STATUS_SUCCESS) { \ return CAIRO_TEST_FAILURE; \ } + /* clear floating point exceptions (added by cairo_test_init()) */ +#if HAVE_FEDISABLEEXCEPT + fedisableexcept (FE_INVALID); +#endif + /* create a bogus matrix and check results of attempted inversion */ bogus.x0 = bogus.xy = bogus.xx = strtod ("NaN", NULL); bogus.y0 = bogus.yx = bogus.yy = bogus.xx; |