Commit graph

1900 commits

Author SHA1 Message Date
Chris Wilson
31b7652e1f [test] Never, ever, blame a crashing test on external factors. 2009-06-13 12:19:51 +01:00
Chris Wilson
3dde883b77 [test] Code review after sleep
Review cairo-test-trace.c and rewrite parts to ease understanding and fix
various bugs - such as failure to notice the slaves crashing and not
releasing our shared memory after an interrupt.
2009-06-13 10:38:52 +01:00
Chris Wilson
3b6e4018c6 [test] Add cairo-test-trace
The basic premise is that we feed the trace to multiple backends in
parallel and compare the output at the end of each context (based on
the premise that contexts demarcate expose events, or their logical
equivalents) with that of the image[1] backend. Each backend is
executed in a separate process, for robustness, with the image data
residing in shared memory and synchronising over a socket.

[1] Should be reference implementation, currently the image backend is
    considered to be the reference for all other backends.
2009-06-12 22:28:38 +01:00
Chris Wilson
a41e1275d2 [boilerplate] Make array of targets const.
Protect the boilerplate targets from unexpected modifications.
2009-06-12 22:28:38 +01:00
Chris Wilson
3f474555dd [test] Add jp2.jp2 to EXTRA_DIST
Required by test/mime-data and so triggering failures during distcheck as
it was not packaged.
2009-06-12 11:19:50 +01:00
Chris Wilson
80ba06803b [Makefile] Update list of reference images. 2009-06-12 08:33:24 +01:00
Carl Worth
fb21a0da87 Update CLEANFILES for 'make distcheck'
This is a standard part of the release ritual.
2009-06-11 15:28:02 -07:00
Chris Wilson
ac56371550 [test] Exercise overlapping glyphs
Quite an expensive test that converts an image into a distorted array of
glyphs, using a perspective transformation taking the intensity of the
pixel as depth. This generates a pretty picture and many overlapping
glyphs.
2009-06-09 00:06:08 +01:00
Chris Wilson
055e9b0eb6 [test] Cache resolved scaled-font
The intention is to stress test the solid pattern caches, so we can cheat
and avoid repeatedly resolving the toy font.
2009-06-07 23:35:57 +01:00
Chris Wilson
750c1b5b48 [configure] Check for FcInit() 2009-06-07 19:48:59 +01:00
Andrew Lavin
ab86662ab4 [test] Compile fix for invalid-matrix
Fixed test compile error on OS X that caused fenv.h not to be included.
2009-06-03 09:19:26 +01:00
Chris Wilson
cffb398f5a Add a generic cow-snapshotting framework
Provide a mechanism for backends to attach and remove snapshots. This can
be used by backends to provide a cache for _cairo_surface_clone_similar(),
or by the meta-surfaces to only emit a single pattern for each unique
snapshot.

In order to prevent stale data being returned upon a snapshot operation,
if the surface is modified (via the 5 high level operations, and on
notification of external modification) we break the association with any
current snapshot of the surface and thus preserve the current data for
their use.
2009-06-02 15:13:47 +01:00
Eric Anholt
f59f44c140 Merge commit 'origin/master' into gl
Felt like pulling the latest stuff, since I branched back in February.

Conflicts:
	build/configure.ac.features
	src/cairo.h
	util/cairo-script/csi-replay.c
2009-06-02 00:56:39 -07:00
Chris Wilson
cfd484cd01 [test] Change test semantics to match new in-fill definition
The in-fill definition has changed to include queries on the edges and
vertices, so update the test case to match.
2009-05-25 22:14:41 +01:00
Chris Wilson
87b764908a [gl] Add EGL target
Split the GLX context from the GL surface to enable use of an alternative
EGL interface.
2009-05-20 08:13:45 +01:00
Chris Wilson
791a6fa399 [memfault] Update macros to avoid namescape collision with memcheck
Basing the macro names of the memfault skin lead to a namespace
collision with memcheck. After updating the headers, update cairo's usage
to match.
2009-05-15 21:31:03 +01:00
Chris Wilson
c897f36a6b [test] Stress the ft from-face cache
Create a set of font faces using the same FT_Face to stress test the
handling of from-face fonts within the backend cache.
2009-05-15 21:31:03 +01:00
Chris Wilson
477df1f550 [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.
2009-05-15 21:31:03 +01:00
Chris Wilson
f47a93ef30 [test] Check text->path with user-fonts (twin)
Check behaviour of user-fonts, twin in particular, when using the text as
a path.
2009-05-15 21:31:02 +01:00
Chris Wilson
669e7ae5c9 [test] Relax APPROX_EQUALS condition
The bounding box of the text is rounded to the nearest pixel boundaries,
so therefore the test must accept a similar level of imprecision.
2009-05-15 21:31:02 +01:00
Chris Wilson
fe7410c6cd [test] Add a note to "Getting the elusive zero failures"
The test suite depends upon many external factors and in order to achieve
a pass, your system must match that upon which the reference images were
generated. Add a note to read test/README in case of failures so that the
casual user is not unduly alarmed by cairo reportedly failing.
2009-05-15 21:31:02 +01:00
Chris Wilson
2f962799a7 [test] Fix typos that excluded backend test sources 2009-05-15 21:31:02 +01:00
Chris Wilson
c25992479a [xlib] Use minimal depth for similar clones.
Damian Frank noted
[http://lists.cairographics.org/archives/cairo/2009-May/017095.html]
a performance problem with an older XServer with an
unaccelerated composite - similar problems will be seen with non-XRender
servers which will trigger extraneous fallbacks. The problem he found was
that painting an ARGB32 image onto an RGB24 destination window (using
SOURCE) was going via the RENDER protocol and not core. He was able to
demonstrate that this could be worked around by declaring the pixel data as
an RGB24 image. The issue is that the image is uploaded into a temporary
pixmap of matching depth (i.e. 32 bit for ARGB32 and 24 bit for RGB23
data), however the core protocol can only blit between Drawables of
matching depth - so without the work-around the Drawables are mismatched
and we either need to use RENDER or fallback.

This patch adds a content mask to _cairo_surface_clone_similar() to
provide the extra bit of information to the backends for when it is
possible for them to drop channels from the clone. This is used by the
xlib backend to only create a 24 bit source when blitting to a Window.
2009-05-15 21:31:02 +01:00
Chris Wilson
c488b33644 [test] Create a new fallback surface to exercise 16-bit paths.
Add a variation of test-fallback-surface that forces the use of a 16-bit
pixman format code instead of the standard 32-bit types. This creates an
image surface akin to the fallbacks used with low bit-depth xservers.
2009-05-05 21:17:11 +01:00
Chris Wilson
817589e196 [test] Call FcInit() manually.
Pre-initialise fontconfig whilst memfault is disabled to avoid a lot of
expensive, redundant testing of FcInit() throughout the test suite.
2009-04-20 10:21:24 +01:00
Chris Wilson
82cccb2672 [test] Handle memfaults during surface-finish-twice
Check and report memory allocation failures.
2009-04-16 09:34:02 +01:00
Chris Wilson
f12d52bfca [test] Use xmalloc() to evade memfault.
Do not use the simple malloc() as memfault will inject allocation failures
(unlike xmalloc() for which faults are excluded) - as this is unnecessary
inside the test harness and thus does not exercise any cairo code paths.
2009-04-16 09:34:02 +01:00
Chris Wilson
ca501d99bb [test] Disable signal handling under valgrind
Capturing and handling the signals prevents valgrind from providing
backtraces for fatal signals -- which is often more useful.
2009-04-16 09:34:01 +01:00
Jeff Muizelaar
2d6336624c [test-win32] Fix static linking of the test suite.
Previously, the test suite needed to be dynamically linked to work.
2009-04-01 11:32:58 -04:00
Chris Wilson
b580a4a8d6 [test] Improve fault injection coverage
In order to exercise the meta-surfaces, we need to inject faults into
cairo_surface_finish().
2009-03-31 12:16:01 +01:00
Chris Wilson
aee71e2063 [test] Memfault checks.
Don't assume an error means the test failed, check for injected allocation
errors.
2009-03-30 13:41:00 +01:00
Chris Wilson
ac30ced613 [test] Check for surface create failure.
If the image surface creation fails, the data pointer will be NULL leading
to a segfault -- so check!
2009-03-24 07:50:58 +00:00
Chris Wilson
b5a4a2c4b1 [test] Early test for memfault.
Check the error status within after each iteration in
solid-pattern-cache-stress.
2009-03-24 07:50:58 +00:00
Chris Wilson
1a7b94f934 [test] Check for errors during get-path-extents.
Need to check that an error was not raised on the context before checking
whether the extents match expectations.
2009-03-24 07:50:58 +00:00
Chris Wilson
c932a809d6 [test] Propagate allocation failure.
Check for memfaults during rel-path test.
2009-03-18 09:44:33 +00:00
Chris Wilson
7db55b37d4 [test] Destroy pattern on error paths.
Destroy the pattern after encountering an error in pattern-getters test.
2009-03-18 09:44:33 +00:00
Chris Wilson
dc176d88ac [test] Trivial leak on error in show-glyphs-many.
Free the allocated glyph array after failure.
2009-03-18 09:44:33 +00:00
Chris Wilson
a8158d443e [truetype] Move the sizeof asserts to compile time.
Eliminate the need for a runtime test on the sizeof the private structures
by performing the check at compile time. This was provoked by Ginn Chenn
noting that the test was including a private header.
2009-03-03 11:21:35 +00:00
Chris Wilson
f178f55e47 [test/any2ppm] Update the cairo-script-interpreter callback.
Reflect the current prototype which now specifies the content to use when
creating the surface.
2009-03-03 10:25:05 +00:00
Chris Wilson
694f2eea9f [test/any2ppm] Add feature checks for daemon()
Add the feature checks for the presence of the daemon() function call.
2009-03-03 10:24:25 +00:00
Chris Wilson
b30de64a8c [test] Add regression test for 005436
Jeff Muizelaar found a regression in commit 005436 and submitted this
little test to exercise it. The essence of the bug appears to be wrt to
the product of the CTM and device transform matrices.
2009-03-01 10:10:13 +00:00
Jeff Muizelaar
d4227fc912 [test] Fix assert on default font family in toy-font-face
toy-font-face was checking that cairo_toy_font_face_get_family returned ""
which is CAIRO_FONT_FAMILY_DEFAULT when the freetype font backend is the
default. However, when other font backends are the default the returned family
is different. Therefore, instead of checking for "", we check for the appropriate
string depending on the backend.
2009-02-19 11:45:33 -05:00
Jeff Muizelaar
f7b3c9df58 Add test/Makefile.sources
This lets test/Makefile.am and test/Makefile.win32 share a common list of sources.
It also makes test/Makefile.win32 useful again.
2009-02-16 22:28:32 -05:00
M Joonas Pihlaja
e380beae53 [sdl] Remove new backend.
The SDL backend makes invalid assumptions about SDL_Surface locking
semantics and doesn't deal correctly with the unpremultiplied pixel
format supported by SDL.  Removed as per discussion on the mailing list.

http://lists.cairographics.org/archives/cairo/2009-February/016595.html
2009-02-16 14:01:43 +02:00
Chris Wilson
187e347351 [test] Free ref_name in fallback-resolution.
Trivial leak of a few thousand bytes.
2009-02-13 13:26:52 +00:00
Søren Sandmann
b3e2433f1e Correct the reference image for the rotate-image-surface-paint test 2009-02-11 17:55:15 -05:00
Jeff Muizelaar
41cbd935f9 [test] Add cairo_test_NaN and use it in place of strtod
strtod("NaN") returns 0.0 with the MSVC runtime so we
need to generate NaN some other way.
2009-02-11 15:24:24 -05:00
Jeff Muizelaar
70297f257d [test] Add crtdbg.h include
crtdbg.h is required for _CrtSetReportMode() and _CrtSetReportFile().
2009-02-10 17:58:28 -05:00
Jeff Muizelaar
41e46c7754 [test] Don't embed preprocessor directives inside macros
MSVC can't handle this. GCC will warn with -pedantic, but I'm not
sure we want to enable that.
2009-02-10 11:44:20 -05:00
Jeff Muizelaar
fe40d3bdb0 [test] Allocate glyph array with malloc
Keeping it on the stack causes a stack overflow of Window's
default 1mb stack.
2009-02-09 23:43:04 -05:00