Age | Commit message (Collapse) | Author | Files | Lines |
|
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.
|
|
GCC 3.4.3 on OpenSolaris does not recognise INFINITY. Use HUGE_VAL
instead for every compiler instead of just MSVC.
|
|
Fixed test compile error on OS X that caused fenv.h not to be included.
|
|
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.
|
|
strtod("NaN") returns 0.0 with the MSVC runtime so we
need to generate NaN some other way.
|
|
1./0. produces a compiler error on MSVC so we'll use HUGEVAL instead.
|
|
In my defence, even with INFINITY as 0, I was seeing new asserts on win32.
Caught by Jeremy Lea.
|
|
This lets us use more of invalid-matrix on win32
|
|
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.
|
|
Such that we don't rely on more GNU extensions accidentally.
|
|
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/.
|
|
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.
|
|
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.)
|
|
Feed infinities into the API and check that we correctly return
INVALID_MATRIX.
|
|
Test that INVALID_MATRIX is returned if the user calls cairo_scale(0,0)
or a variant thereof.
|
|
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.
|
|
Pass NaNs to cairo_translate() and friends and check that they raise
an INVALID_MATRIX error.
|
|
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).
|
|
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.
|
|
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.
|