Commit graph

1900 commits

Author SHA1 Message Date
Chris Wilson
968eaf3c44 [cairo-xlib] Fixup --disable-xlib-xrender
Fixup the headers and boilerplate to compile and run correctly when
configured with --disable-xlib-xrender.
2008-01-15 13:08:53 +00:00
Chris Wilson
a5e5c1b5b0 [test] Add a custom hook to summarise the failures.
Add a check-local hook that scans the log fails and displays a list
of failed tests (and the failing targets).
2008-01-13 15:00:58 +00:00
Chris Wilson
973d5fa8a5 [test] Sort TESTS
A couple of tests were out of order, causing a bit of confusion in the
user.
2008-01-12 11:04:03 +00:00
Chris Wilson
ac98c9e572 [test/rel-path] Check that invalid relative paths raise an error.
Check that NO_CURRENT_PATH is raised if a relative path op is used
on a new path.
2008-01-12 10:49:48 +00:00
Chris Wilson
864dab828b [test/text-zero-len] Test passing NULLs to the API.
Check that the public API handles NULL - at the moment the code
is a little inconsistent and crashes!
2008-01-12 10:28:16 +00:00
Chris Wilson
6418a8be87 [test/.valgrind-suppressions] Update for amd64/sid
Update the valgrind suppressions for the libz and Xrm spam.
2008-01-10 22:14:31 +00:00
Chris Wilson
cbe8d3855e [test] Fixup make check for mingw
Add EXEEXT to TESTS so that mingw builds the correct target.
2008-01-10 17:10:12 +00:00
Chris Wilson
9ae4b219e1 [test/solid-pattern-cache-stress] Check for drand48().
Apply an alternative rand() function if drand48() is not available for
the platform.
2008-01-10 14:47:16 +00:00
Keith Packard
81e029edda Add new miter-precision test. Checks miter joins at many scales.
This demonstrates an error in cairo where miter joins are replaced with
bevels at high scale factors due to a test added to eliminate wild miters
drawn when the line faces are nearly parallel.
2008-01-03 18:24:24 -08:00
Chris Wilson
c67d99787c [test/surface-pattern-big-scaled-down] Kill the surface leaks.
Destroy the surface and pattern after use.
2008-01-03 18:01:43 +00:00
Chris Wilson
6a7a07adf9 [test] Update distribution list of ref images.
Add missing *-ps-rgb24-ref.png images, and a couple of tests to .gitignore.
2008-01-03 17:35:06 +00:00
Chris Wilson
146484e312 [valgrind] Update zlib suppressions.
Match the zlib library as found on hardy+dbgsym.
2007-12-20 21:21:54 +00:00
Chris Wilson
3bf06c3366 [test/*] Create new surfaces using the group target.
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-12-20 21:21:32 +00:00
Chris Wilson
14454e12d8 [cairo-test] Wrap test function with cairo_save/restore().
Restore the context to the original state before blitting the
group surface in order to remove any residual state such as a clip path.
2007-12-20 17:51:56 +00:00
Chris Wilson
281b11aef1 [cairo-test] Use CAIRO_OPERATOR_SOURCE when painting the group surface.
To correctly copy a surface onto the destination irrespective of its
content requires the SOURCE operator. Forgetting to do so here causes
uninitialized pixels to be mixed into the result and the failure of
many tests for the similar surface. Oops...
2007-12-20 17:12:08 +00:00
Chris Wilson
ed3fccec01 [pdiff] Avoid the memleak for small surfaces.
Allocate the arrays after the guard against small surfaces to avoid
leaking them.
2007-12-20 14:13:12 +00:00
Brian Ewins
b81c8473bd [test] add test for gradient with no stops
Boris Zbarsky reported a bug where having zero stops in a
gradient pattern would crash in the quartz surface. This
test checks for that case. Mozilla bug#407104.

This also crashes testing pdf; and the ps, svg surfaces
look suspicious (they reference stops[0]) but I havent
been able to test them yet.
2007-12-06 21:31:10 +00:00
Vladimir Vukicevic
2c25033e14 [quartz] Handle creating 0x0 surfaces
Make all 0x0 surfaces be no-ops when used in a rendering operation.
2007-12-04 13:50:49 -08:00
Emmanuel Pacaud
3554c31e3d [SVG] Add missing image to REFERENCE_IMAGES list. 2007-11-10 10:43:43 +01:00
Emmanuel Pacaud
8edc3ed485 Merge branch 'master' of git+ssh://emmanuel@git.cairographics.org/git/cairo 2007-11-10 10:10:50 +01:00
Emmanuel Pacaud
b68968ffd1 [SVG] Fix opacity of combined stroke and fill.
When emitting combined stroke and fill, cairo SVG backend was using the opacity
two times, instead of using fill-opacity and stroke-opacity, leading to
incorrect output.

I've updated the mask test reference images for the SVG output, since it seems
there's a bug in librsvg when fill-opacity is used in the mask image.
I've checked the SVG output with batik, and it looks fine.
2007-11-10 10:07:12 +01:00
Brian Ewins
77e9b05b2b [test] support using a previous build as a reference
Allow using a previous test output directory as a source of
reference images. To make use of this, set the environment
variable 'CAIRO_REF_DIR' to point at an old test directory,
relative to the current test directory.

This is useful for testing backends when reference images haven't
been created yet, or which the current reference image structure
can't accomodate, like multiple font backends.
2007-11-10 01:34:03 +00:00
Brian Ewins
f8ee0cdf18 [test] Link to the correct reference image.
The generated test html guesses the names of the reference
images used in the tests. This is quite often wrong, and
makes it harder to change policy in cairo-test. Teach
make-html.pl to parse the log for the path to the reference image.
2007-11-10 01:34:01 +00:00
Brian Ewins
15fc1bbefb [test] log tested paths so that they can be parsed.
The test logs currently do not record the paths of
image output, the reference images tested against, and
the diffs created. This means that make-html.pl has to
duplicate the policy in cairo-test.c. Fix this by teaching
cairo-test.c to log the paths.
2007-11-10 01:33:47 +00:00
Chris Wilson
641215b2b0 [test/clip-all] Combine text and everything clipped out.
https://bugs.freedesktop.org/show_bug.cgi?id=13084 demonstrates a
regression where the clip is ignored by the xlib backend whilst
rendering text. Therefore we extend the current test cases to combine
a clip that represents everything clipped out with the rendering of
text. For completeness, we add a new test case that exactly mimics the
sequence of cairo operations that lead to the discovery of this bug -
namely the rendering of text with an empty clip path.
2007-11-06 13:28:10 +00:00
Behdad Esfahbod
570714b2b4 [test/fallback-resolution] set tolerance to a large value to see how it performs
in different fallback resolutions.
2007-11-05 13:23:40 -05:00
Behdad Esfahbod
5acbef2021 [test] fallback-resolution: center text 2007-11-05 13:23:35 -05:00
Chris Wilson
6d2615d449 [test/degenerate-pen] Add missing return value.
Carl - he likes to test us occasionally to make sure we're paying
attention. Well, that's the excuse I use...
2007-11-02 09:17:59 +00:00
Carl Worth
ee5dc04aaf Add missing images to REFERENCE_IMAGES list
Otherwise, these don't get included in the generated tar file
and the test suite doesn't pass when run from that tar file,
(like 'make distcheck' tests).
2007-10-30 22:33:24 -07:00
Carl Worth
5e76f65284 Add degenerate-pen test case.
This demonstrates the assertion failure pointed out by
Benjamin Otte here:

	[cairo] Assertion 'i < pen->num_vertices' failed in 1.4.10
	http://lists.cairographics.org/archives/cairo/2007-August/011282.html
2007-10-30 17:00:33 -07:00
Chris Wilson
bb6d36561c [test/get-path-extents] Add link to bug report.
Add a link to the original bug report for the broken extents with arcs.
[http://bugs.freedesktop.org/show_bug.cgi?id=7245]
2007-10-27 17:29:54 +01:00
Chris Wilson
483ebe866d [cairo-test] Remove executable flag from source files.
chmod a-x test/cairo-test.[ch]
2007-10-24 19:33:22 +01:00
Brian Ewins
7072959e3d Fix to support new similar tests.
The patch to repeat tests for similar surfaces changed the
format of the test log files, which were parsed to produce
index.html. This fixes the parser to understand those changes.
2007-10-20 13:52:08 +01:00
Chris Wilson
081507a09e [cairo-test] Repeat tests for similar surfaces.
Having noticed strange discrepancies creeping into similar surfaces
whilst working on the xlib backend, I thought it wise to also run
the test harness against similar targets. For consistency, only
targets whose similar surface use the same backend are included.

This can be disabled by exporting CAIRO_TEST_IGNORE_SIMILAR=1.
2007-10-20 00:15:34 +01:00
Chris Wilson
c70c2cf6d6 [Makefile.am] Fix ${top_srcdir}/libtool
libtool exists in the top level build directory, but in a couple of
places we refer to the top level source directory.
2007-10-19 23:31:36 +01:00
Chris Wilson
01eb169773 [test/.gitignore] Add *.exe.so
Ignore these winegcc output files.
2007-10-18 20:09:54 +01:00
Chris Wilson
5e09653e5d [test/rgb24-ignore-alpha] Destroy the surface after use.
Destroy the surface so that valgrind doesn't complain about the memory
leak.
2007-10-16 16:03:28 +01:00
Chris Wilson
bd3dd72262 [pdiff] Reorganise the inner loops of the convolution.
Reorder the indices and introduce a couple of temporary accumulators to
improve cache access.
2007-10-16 16:03:03 +01:00
Chris Wilson
fa9201b9c9 [pdiff] Check for too small images.
The Laplacian pyramid can only work on images larger than 3x3 due to the
size of its convolution kernel. So if the image is too small return an
error (-1) before attempting to construction the pyramid.
2007-10-16 15:57:44 +01:00
Adrian Johnson
ff35ffd2a7 Add meta-surface-pattern test 2007-10-13 22:09:04 +09:30
Adrian Johnson
0b3f530973 Add PS reference images for tests using gradients 2007-10-13 21:49:50 +09:30
Adrian Johnson
b5fa273c9a Add PS reference images for tests using create_similar
before the PS meta surface pattern patch these tests
had image fallacks in the PS output and did not require
a PS reference image.
2007-10-13 21:04:51 +09:30
Chris Wilson
e5b01e6797 [Makefile.am] Add missing headers and reference images.
Andrew Jorgensen spotted that make dist was missing a few headers needed
for compilation and running make distcheck had spurious failures. Add
the missing files to the distribution and a silly one-liner to check for
missing reference images.
2007-10-11 18:05:46 +01:00
Chris Wilson
ef5f460eb1 [cairo-path] Check for an empty path in cairo_append_path().
As we now generate empty paths, we must be able to handle empty paths
in the user facing API. cairo_append_path() has an explicit check, and
raises an error, for a NULL path->data, so we need to check the
path->num_data first for empty paths.
2007-10-04 09:18:36 +01:00
Chris Wilson
b4f86638cc [cairo-path] Don't raise an error when attempting to create an empty path.
Generate a real empty path structure instead of returning
_cairo_path_nil, if we have been asked to create an empty path.

(Also add a couple of missing _cairo_error()s and an appropriate test
case.)

Spotted by Fred Kiefer.
2007-10-01 17:59:57 +01:00
Chris Wilson
abe1b89da4 [test/get-path-extents] Test extents of cairo_text_path().
Check that the text path extents match the computed metrics.
2007-09-27 16:14:02 +01:00
Chris Wilson
0618818f7a [test/get-path-extents] Test extents of an arc.
Add the test case from bug 7245,
https://bugs.freedesktop.org/show_bug.cgi?id=7245.
2007-09-26 14:40:36 +01:00
Chris Wilson
76b9b18192 [test/create-for-stream] Add the missing cairo_surface_finish().
Moments after pushing the new test case did I realise the issue...
We do not attempt to write out the surface to the user stream until
we perform the cairo_surface_destroy() by which point we have lost
the ability to interrogate the error status. We can avoid this by
explicitly calling cairo_surface_finish() and then checking the
error status - and we see that the error is indeed reported
correctly.

No bug. Nothing to see here. Please move along. (Apart from the
request for the status to be return from cairo_surface_destroy!)
2007-09-26 00:41:31 +01:00
Chris Wilson
1e7f0bd4d5 [test/create-for-stream] Add test case for user error propagation.
From bug https://bugs.freedesktop.org/show_bug.cgi?id=7049, we find
that the error status from the user supplied write function to
cairo_*_surface_create_for_stream is ignored and not propagated back
to the surface/context - leading to silent data loss. Incorporate
the suggested test case, a write function that simply returns
CAIRO_STATUS_WRITE_ERROR, into create-for-stream.c.
2007-09-26 00:31:08 +01:00
Chris Wilson
1469de5211 [cairo-png] Propagate error from read and write funcs.
Use the png_struct->error_ptr to propagate the error status from the
user/stdio read and write functions through the png_error() to the
cairo_surface_write_to_png*() and cairo_surface_read_from_png*()
functions. From there the error is returned back to the user either
directly or as the most appropriate error surface.

(Fixes https://bugs.freedesktop.org/show_bug.cgi?id=6909)
2007-09-25 23:45:39 +01:00