[test] Clear expected floating point exceptions

test/invalid-matrix deliberately feeds garbage into the API to test our
error detection. This causes FPE to be raised during the course of the
test - so they are deliberately disable for the duration. However, the
exceptions were not being cleared and so the FPE could be triggered on
the next floating point operation. This was being masked during make check,
by the fact that each test is run in its own forked process and was only
observed when multiple tests were run in foreground mode.
This commit is contained in:
Chris Wilson 2009-05-15 10:48:56 +01:00
parent f47a93ef30
commit 477df1f550
2 changed files with 5 additions and 1 deletions

View file

@ -65,7 +65,7 @@ AC_CHECK_HEADERS([sched.h],
dnl check for GNU-extensions to fenv
AC_CHECK_HEADER(fenv.h,
[AC_CHECK_FUNCS(feenableexcept fedisableexcept)])
[AC_CHECK_FUNCS(feenableexcept fedisableexcept feclearexcept)])
dnl check for misc headers and functions
AC_CHECK_HEADERS([libgen.h byteswap.h signal.h setjmp.h])

View file

@ -363,6 +363,10 @@ if ((status) == CAIRO_STATUS_SUCCESS) { \
CHECK_STATUS (status, "cairo_rotate(∞)");
cairo_destroy (cr2);
#if HAVE_FECLEAREXCEPT
feclearexcept (FE_INVALID);
#endif
return CAIRO_TEST_SUCCESS;
}