summaryrefslogtreecommitdiff
path: root/test/invalid-matrix.c
AgeCommit message (Collapse)AuthorFilesLines
2009-06-18[test] Fix checking of the fenv.h include.M Joonas Pihlaja1-2/+2
This adds a configure check for fenv.h and makes invalid-matrix.c check for it with HAVE_FENV_H instead of HAVE_FEDISABLEEXCEPT -- turns out Solaris doesn't have fedisableexcept(), but it does have feclearexcept(). The same issue appears on OSX and was fixed in ab86662ab499e1f29c0f8c4248771e730c281e3f. This patch adds some configure magic.
2009-06-18[test] Fallback to HUGE_VAL in place of INFINITY in invalid-matrix.c.M Joonas Pihlaja1-1/+1
GCC 3.4.3 on OpenSolaris does not recognise INFINITY. Use HUGE_VAL instead for every compiler instead of just MSVC.
2009-06-03[test] Compile fix for invalid-matrixAndrew Lavin1-1/+1
Fixed test compile error on OS X that caused fenv.h not to be included.
2009-05-15[test] Clear expected floating point exceptionsChris Wilson1-0/+4
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.
2009-02-11[test] Add cairo_test_NaN and use it in place of strtodJeff Muizelaar1-1/+1
strtod("NaN") returns 0.0 with the MSVC runtime so we need to generate NaN some other way.
2009-02-09[test] Define INFINITY on MSVCJeff Muizelaar1-2/+2
1./0. produces a compiler error on MSVC so we'll use HUGEVAL instead.
2009-02-05[test] Fix the definition of INFINITYJeff Muizelaar1-1/+1
In my defence, even with INFINITY as 0, I was seeing new asserts on win32. Caught by Jeremy Lea.
2009-02-03[test] Define INFINITY if it hasn't been defined.Jeff Muizelaar1-20/+2
This lets us use more of invalid-matrix on win32
2008-10-31[test] Build test suite into single binary.Chris Wilson1-14/+6
Avoid calling libtool to link every single test case, by building just one binary from all the sources. This binary is then given the task of choosing tests to run (based on user selection and individual test requirement), forking each test into its own process and accumulating the results.
2008-09-02Move _GNU_SOURCE declarations to where it's usedBehdad Esfahbod1-1/+4
Such that we don't rely on more GNU extensions accidentally.
2008-08-13[test] Preparatory work for running under memfault.Chris Wilson1-3/+4
In order to run under memfault, the framework is first extended to handle running concurrent tests - i.e. multi-threading. (Not that this is a requirement for memfault, instead it shares a common goal of storing per-test data). To that end all the global data is moved into a per-test context and the targets are adjusted to avoid overlap on shared, global resources (such as output files and frame buffers). In order to preserve the simplicity of the standard draw routines, the context is not passed explicitly as a parameter to the routines, but is instead attached to the cairo_t via the user_data. For the masochist, to enable the tests to be run across multiple threads simply set the environment variable CAIRO_TEST_NUM_THREADS to the desired number. In the long run, we can hope the need for memfault (runtime testing of error paths) will be mitigated by static analysis. A promising candidate for this task would appear to be http://hal.cs.berkeley.edu/cil/.
2008-05-06[test/invalid-matrix] Disable floating point exception.Chris Wilson1-0/+9
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.
2008-02-15Compile fix for AIX.Shailendra Jain1-1/+1
Minor correction for a build failure on AIX: "mozilla/gfx/cairo/cairo/src/cairo-gstate.c", line 45.43: 1506-294 (S) Syntax error in expression on #if directive. (Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=415867.)
2008-02-15[test/invalid-matrix] Test detection of infinities.Chris Wilson1-1/+122
Feed infinities into the API and check that we correctly return INVALID_MATRIX.
2008-02-15[test/invalid-matrix] Check scale(0,0)Chris Wilson1-0/+16
Test that INVALID_MATRIX is returned if the user calls cairo_scale(0,0) or a variant thereof.
2008-02-15[test/invalid-matrix] Promote incorrect status warning to an error.Chris Wilson1-1/+2
As the last warning for an incorrect status has been resolved, throw an error if we regress and no longer report an INVALID_MATRIX under testing.
2008-02-15[test/invalid] Test cairo_translate() and friends for NaN safety.Chris Wilson1-0/+37
Pass NaNs to cairo_translate() and friends and check that they raise an INVALID_MATRIX error.
2007-12-20[test/*] Create new surfaces using the group target.Chris Wilson1-1/+1
cairo_get_target() returns the original surface passed to cairo_create(), and not the current destination as required when testing drawing to the same surface using multiple contexts. For completeness we also use the group target when creating similar surfaces within the tests (to check that similar surfaces of similar surfaces also work).
2007-07-05[cairo-matrix] Check determinant for invalid numbers.Chris Wilson1-12/+82
By checking matrices for invalid determinants, we can prevent the setting and application of invalid matrices. The trick used here is that NaNs, as specified by IEE754, always return FALSE in comparisons. Since we know that the square of the determinant must be positive definite, then if the comparison is FALSE the computation must have resulted in a NaN.
2007-04-11test/invalid-matrix: Add new test to exercise CAIRO_STATUS_INVALID_MATRIX pathsCarl Worth1-0/+142
This new test exercises every path where the user might possibly pass in an invalid matrix. Currently the test fails if no error is reported. Also, if an incorrect error is reported, (such as CAIRO_STATUS_NO_MEMORY instead of CAIRO_STATUS_INVALID_MATRIX), this is logged as a warning in invalid-matrix.log, but the test still passes. It would still be worthwhile to follow up quickly and fix those cases to propagate the correct error value.