From fed9d9060eb950a6692334a7ba3879009b597532 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 6 May 2008 11:31:14 +0100 Subject: [PATCH] [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. --- configure.in | 2 +- test/invalid-matrix.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 268a709cc..2ec8f5619 100644 --- a/configure.in +++ b/configure.in @@ -126,7 +126,7 @@ esac AC_MSG_RESULT([$solaris_posix_pthread]) # check for GNU-extensions to fenv -AC_CHECK_HEADER(fenv.h, [AC_CHECK_FUNCS(feenableexcept)]) +AC_CHECK_HEADER(fenv.h, [AC_CHECK_FUNCS(feenableexcept fedisableexcept)]) dnl =========================================================================== dnl 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 +#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;