Commit graph

1784 commits

Author SHA1 Message Date
Chris Wilson
d356deb182 test: Add a second ring to overlapping-dash-caps
Demonstrate a second artefact when using SQUARE.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-02 15:38:49 +01:00
Chris Wilson
953a4a2e55 test: Add an test case to exercise overlapping caps between dash segments
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-02 14:36:45 +01:00
Chris Wilson
c0407e84e9 test: Extend PDF blend tests to include an opacity mask
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-08-01 12:08:55 +01:00
Andrea Canciani
e04e368748 Remove useless checks for NULL before freeing
This patch has been generated by the following Coccinelle semantic patch:
// Remove useless checks for NULL before freeing
//
// free (NULL) is a no-op, so there is no need to avoid it

@@
expression E;
@@
+ free (E);
+ E = NULL;
- if (unlikely (E != NULL)) {
-   free(E);
(
-   E = NULL;
|
-   E = 0;
)
   ...
- }

@@
expression E;
@@
+ free (E);
- if (unlikely (E != NULL)) {
-   free (E);
- }
2011-07-31 16:46:36 +02:00
Chris Wilson
b231bb0a0b test: Exercise extend modes with recording patterns
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-31 08:12:54 +01:00
Andrea Canciani
de25fec06b test: Improve horizontal-clip
The bug pointed out by this test now causes failures in xcb and xlib.
2011-07-28 18:11:27 +02:00
Andrea Canciani
80b7a1aa9b test: Update image references
Makefile.refs was missing some images.
2011-07-28 18:11:27 +02:00
Chris Wilson
1b888c4c3a test: Add horizontal clip test
Doesn't actually hit the code path but it should...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-27 19:49:47 +01:00
Chris Wilson
a69335a84e API: map-to-image and create-similar-image
A common requirement is the fast upload of pixel data. In order to
allocate the most appropriate image buffer, we need knowledge of the
destination. The most obvious example is that we could use a
shared-memory region for the image to avoid the transfer cost of
uploading the pixels to the X server. Similarly, gl, win32, quartz...

The other side of the equation is that for manual modification of a
remote surface, it would be more efficient if we can create a similar
image to reduce the transfer costs. This strategy is already followed
for the destination fallbacks and this merely exposes the same
capability for the application fallbacks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-26 14:55:58 +01:00
Chris Wilson
e4b3f84d4c test: Add clip-intersect
Exercises a bug in the unbounded drawing of an empty polygon...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-24 13:05:24 +01:00
Chris Wilson
4d5c95f629 test: Exercise replaying basic painting paths
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-24 11:50:48 +01:00
Chris Wilson
69e52c6707 tests: Another missing ref, this time clip-disjoint-hatching
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-23 15:51:49 +01:00
Chris Wilson
9b039a65a6 tests: Missing ref images for new recording-surface test
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-23 15:48:10 +01:00
Chris Wilson
c2dada9722 test: Add a paint-with-alpha variant to test clip-boxes fast path
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-23 15:33:14 +01:00
Chris Wilson
5de0232937 test: Extend recording-surface-pattern to include a SOURCE operator test
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-23 14:42:17 +01:00
Chris Wilson
abd8fcc833 test: Expand partial-clip-text
Test partial clipping along each edge.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-23 14:42:17 +01:00
Chris Wilson
b132fae5e8 clip: Rudimentary support for clip-polygon extraction
Step 1, fix the failings sighted recently by tracking clip-boxes as an
explicit property of the clipping and of composition.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-19 21:14:34 +01:00
Andrea Canciani
e5dfac245f build: Fix automake error
b8f43617a9 regressed the generation of
Makefiles. automake 1.10 fails when executed during ./autogen.sh:

automake: cairo_test_suite_OBJECTS should not be defined
test/Makefile.am:76:   while processing program `cairo-test-suite'
2011-07-19 07:26:59 +02:00
Chris Wilson
9ab9ecfdbd test,perf: Another hatching!
This one illustrates the quadratic explosion lurking in the clipping
code.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-19 00:32:45 +01:00
Chris Wilson
3a29365713 tests,perf: Add a hatchings clip-test
A benchmark to test how close we get to reducing paint+clip to an ordinary
fill, and to check correctness.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-18 10:31:25 +01:00
Chris Wilson
27692ca759 test: Add random-clips to stress test clipping
Not sure what the right results are, so refs will come later. The output
looks superficially right, but the *code* is known to be buggy...

(And hopefully this has captured a few of those bugs.)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-16 20:45:43 +01:00
Chris Wilson
b8f43617a9 test: Always compile cairo-test-suite
I'm tired of having to explicitly type make cairo-test-suite.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-16 20:45:03 +01:00
Chris Wilson
2055732ffc tests: Add paint-clip-fill
A false reduction bug found by Taekyun Kim.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-15 11:05:19 +01:00
Chris Wilson
524809759b tests: Add clip-complex-shape
Contributed by Taekyun Kim to exercise a major bug he found in the
treatment of complex clips.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-15 11:05:19 +01:00
Chris Wilson
727a0092d1 test: Test a1 clipping semantics
If I've written the tests correctly, these should produce identical
images as the a1 rasterisation tests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-13 12:35:51 +01:00
Uli Schlachter
5b8c01ec77 Add a test case that asserts on xcb
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-09 09:42:22 +02:00
Andrea Canciani
a6d4d840d3 test: Fix check-ref-missing
ce3806510f changed the format of
Makefile.refs, breaking the check-ref-missing target.

Ignoring any line not containing a .png file fixes check-ref-missing
and makes it more robust.
2011-06-25 14:35:38 +02:00
Chris Wilson
ce3806510f test: Add a Makefile.refs generator
Generates the lexicographical Makefile.refs based on the *.ref.png and
*.xfail.png checked into git.

This might be nice to automate as a Makefile target. But for now play
safe and do the updates manually.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-25 13:08:17 +01:00
Andrea Canciani
ffdfdf2fa9 test: Merge text-antialias-*
The test-antialias-* tests perform the same operation with just a
different antialias flag. Sharing the code ensures that they are kept
in sync and permits adding new flags combinations easily.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=14268
2011-06-25 10:32:45 +02:00
Andrea Canciani
acfc001685 test: Add extended-blend-solid tests
Unify extended-blend* tests and add a solid pattern version, which
crashes on the win32 backend.

Bug pointed out by Peter Frentrup <peter_frentrup@gmx.de> in
http://lists.cairographics.org/archives/cairo/2011-April/021908.html
2011-06-25 10:19:36 +02:00
Andrea Canciani
5fffa3fae1 test: Ignore \r when parsing test log files
This fixes the log parsing on win32.
2011-06-25 10:19:36 +02:00
Andrea Canciani
0baf009b39 test: Make parsing of log files more solid
The old code considered every even "word" as a key and every odd
"word" as a value when parsing a test log file.
All of the keys end with ':', so restrict with this requirement.
2011-06-25 10:19:36 +02:00
Andrea Canciani
6835421003 test: Fix typo
scrdir -> srcdir
2011-06-25 09:46:46 +02:00
Andrea Canciani
5c798bcf86 test: Improve check-ref-missing
On linux it is impossible to check the missing references because of
argument length constraints:
make: execvp: /bin/bash: Argument list too long

Using a temporary file instead of variable expansion makes it possible
to work around this.

Makefile.refs is now required to be in lexicographical order, which
avoids ordering problems and the risk of duplicated entries (like
clipped-surface.ref.png).
2011-06-25 09:39:52 +02:00
Andrea Canciani
3a5c8b2c74 test: Cleanup build on Win32
Put cairo-test-suite.exe in a $(CFG)-dependent folder and link to
libraries from $(top_builddir).
2011-06-24 11:57:28 +02:00
Andrea Canciani
b6d593dc71 build: Clean up environment variables and flags for the win32 build
Avoid ovverriding LINK, as it has a special meaning for the MSVC build
tools.
2011-06-20 10:24:21 +02:00
Andrea Canciani
5534c30524 build: Use common rules for making pdiff
Instead of providing special rules for compiling C files in pdiff, use
the common ones and build a different pdiff for debug and release.
2011-06-20 10:24:21 +02:00
Andrea Canciani
f9b50cec2b build: Improve dependencies in win32 Makefiles
Test targets now explicitly depend on the cairo library and build it
appropriately.

Phony targets depend on inform, so that they print a warning if the
environment is not set up appropriately.
2011-06-20 10:24:21 +02:00
Andrea Canciani
b9d9ca281c Avoid deprecated functions on win32
Some POSIX functions are deprecated in MSVC and should instead be used
with an alternative name beginning with '_'.
2011-06-20 10:24:20 +02:00
Andrea Canciani
3b9c874489 test: Use POSIX-compatible unlink
On Win32, the POSIX-compatible unlink function is named "_unlink".

A function named "unlink" exists, but does not have the same behavior
as the POSIX-specified one. This function makes the cairo test suite
behave incorrectly and immediately terminate with the message:

Error: Cannot remove cairo-test-suite.log: No error
2011-06-14 16:47:32 +02:00
Andrea Canciani
0cbe3d1020 test: Update generation of constructors on win32
51bd27afa1 removed
make-cairo-test-constructors.c but did not update the win32 Makefiles
accordingly.

cairo-test-constructors.c is now generated by a make target which runs
make-cairo-test-constructors.sh.
2011-06-14 16:46:32 +02:00
Chris Wilson
1b33552a6d test: Add unaligned-box
Test the handling of the various pixel-alignment boundary points of
rectangles.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-06-01 18:09:48 +01:00
Uli Schlachter
b377380b7a test/Makefile.am: Don't reference non-existant files
In commit 532cbcfbc7 'Add unaligned boxes to "operator-source" test', I
removed some reference images from the test suite, but I forgot to also remove
these files from test/Makefile.am. This caused "make dist" to fail.

Thanks to Alexandros Frantzis for noticing this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-04-05 19:08:31 +02:00
Uli Schlachter
532cbcfbc7 Add unaligned boxes to "operator-source" test
These ref images might be wrong. Since the test failed here already before this
change, I took the old ref images and copied the new part from the test output
underneath it. For the backends that I don't have, I deleted the images (sorry).

After this, the "operator-source" test still fails for me on all backends, but
much more prominently so for the image backend. xcb-render-0.0/argb32 gets
compared against a rgb24 ref image, but apparently this was already the case
before(?). The rest are minor differences.

This reveals a bug in the image backend. This was originally reported here:
http://lists.cairographics.org/archives/cairo/2011-March/021827.html

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-24 18:09:34 +01:00
Andrea Canciani
4369255961 test: Add stroke-open-box
Add a new test to check that the stroking of a 3-sided box is not
"optimized" to a 4-sided box.

Test case based on the code by Simon Kellner in
https://bugs.freedesktop.org/show_bug.cgi?id=34560
2011-03-18 10:30:25 +01:00
Andrea Canciani
db04ab8f63 test: Add show-glyphs-advance
This new test (based on show-glyphs-many) checks that the glyphs
advances are respected along both axes.

9c0d761bfc introduced a bug which
regresses this test in quartz.

Thanks to Jeff Muizelaar for the report!
2011-03-18 09:41:55 +01:00
Andrea Canciani
0ce4face45 test: Use ARRAY_LENGTH() macro
Some tests hand-code ARRAY_LENGTH(). It is now provided by
cairo-test.h, so it can be reused.
2011-03-17 17:45:57 +01:00
Andrea Canciani
75fea162d9 test: Cleanup macros
The ARRAY_LENGTH macro is used by many tests, although sometimes it is
named ARRAY_SIZE. Define it just once in cairo-test.h and reuse it.

In a similar way, MAX() and MIN() are currently defined in some
specific tests, while they could be reused.
2011-03-17 17:45:57 +01:00
Andrea Canciani
4ef32a36ba test: Silence gcc warnings
warning: cannot optimize possibly infinite loops

gcc does not detect that the "infinite" loops are actually just one or
two iterations, depending on the has_similar value being FALSE or
TRUE. It realizes it if the iteration variable and the iteration stop
value are both enum values.
2011-03-17 17:35:28 +01:00
Andrea Canciani
d6efb2a0b7 test: Silence gcc warning
cairo-test-runner.c:180: warning: unused variable ‘buf’
2011-03-17 17:04:42 +01:00