From 477df1f5504a507d0c5960aa7e21375284a6f99c Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 15 May 2009 10:48:56 +0100 Subject: [PATCH] [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. --- build/configure.ac.system | 2 +- test/invalid-matrix.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build/configure.ac.system b/build/configure.ac.system index d71d2d0ce..2ee0cc42c 100644 --- a/build/configure.ac.system +++ b/build/configure.ac.system @@ -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]) diff --git a/test/invalid-matrix.c b/test/invalid-matrix.c index 933e81c9a..4fbda614b 100644 --- a/test/invalid-matrix.c +++ b/test/invalid-matrix.c @@ -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; }