[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.
This commit is contained in:
Chris Wilson 2008-05-06 11:31:14 +01:00
parent 1755a2d27d
commit fed9d9060e
2 changed files with 10 additions and 1 deletions

View file

@ -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

View file

@ -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;