Commit graph

1900 commits

Author SHA1 Message Date
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
Andrea Canciani
2b84d82bcf test: Silence gcc
api-special-cases.c:94:1: warning: "Cursor" redefined
api-special-cases.c:81:1: warning: this is the location of the previous definition
2011-03-17 16:47:44 +01:00
Andrea Canciani
e45077612d test: Fix missing REFERENCE_IMAGES 2011-03-17 16:47:33 +01:00
Benjamin Otte
48774c09d0 test: Fix gcc signedness warning 2011-02-19 12:08:17 +01:00
Benjamin Otte
9fc5ff797a test: Fix copy/paste error 2011-02-19 10:32:19 +01:00
Benjamin Otte
f847b3c216 test: Fix gcc complaints about old style definitions 2011-02-19 10:25:22 +01:00
Benjamin Otte
7386960d06 test: Add a test for 0-radius negative arcs
This test checks the behavior of
e46dc9e17a
2011-02-19 10:23:46 +01:00
Benjamin Otte
0fc65a1008 Revert accidental checkin in last commit
Today is not my day...
2011-02-18 19:57:22 +01:00
Benjamin Otte
e46dc9e17a arc: Handle radius == 0 the same no matter the arc direction
Commit a0ea0b63fd fixed cairo_arc() but
did not apply the same patch to cairo_arc_negative(). This patch fixes
that oversight.
2011-02-18 19:51:44 +01:00
Benjamin Otte
9dcd29bef4 test: Add missing format to any2ppm to silence gcc 2011-02-18 18:53:45 +01:00
Benjamin Otte
303f56a2d3 test: Add line-width-overlap
Test case taken from the WebKit test suite, failure originally reported
by Zan Dobersek <zandobersek@gmail.com>. WebKit test is
LayoutTests/canvas/philip/tests/2d.path.rect.selfintersect.html
2011-02-17 18:17:08 +01:00
Benjamin Otte
937465b15e tests: Fix gcc complaint
warning: ‘static’ is not at beginning of declaration
2011-02-17 18:09:22 +01:00
Benjamin Otte
4d4056872d tests: Add line-width-tolerance
Test case taken from the WebKit test suite, failure originally reported
by Zan Dobersek <zandobersek@gmail.com> at
https://bugs.webkit.org/show_bug.cgi?id=54471
2011-02-15 20:41:04 +01:00
Andrea Canciani
219f0d49a3 test: Fix REFERENCE_IMAGES
Makefile.am not updated along with changing the reference images in
6825007ac6 and
070bc5dd89.
2011-02-14 10:00:25 +01:00
Andrea Canciani
5fa49462be test: Fix surface-pattern-scale-down-extend
This test creates a similar surface using cairo_push_group () and
assumes its size will be w x h. This is not true when testing similar
surfaces with "cairo-test-suite -a", because they are bigger than the
actual ROI, which corresponds to the rectangle (0,0) - (w,h).

Clipping to the ROI guarantees that the surface created by
cairo_push_group () always has the same size.

Fixes surface-pattern-scale-down-extend.
2011-02-13 20:49:47 +01:00
Andrea Canciani
34612c400d test: Fix clip-device-offset
The test was incorrectly translating the "target" of the context
instead of the "group target" (i.e. the current destination).

"cairo-test-suite -a" runs the tests on similar surfaces created using
cairo_push_group (), thus without this change the device-offset did
not affect the real destination surface.

Fixes clip-device-offset.
2011-02-13 17:34:04 +01:00
Uli Schlachter
7ad3aebbe6 arc-looping-dash: Add a missing cairo_restore ()
This test called cairo_save () without restoring again. Normally, this doesn't
cause a problem. However, when cairo-test-suite is called with "-a", it also
executes the tests on a similar surface. This then caused
cairo_pop_group_to_source to be called on a cairo_save state which causes a
CAIRO_STATUS_INVALID_RESTORE since commit 5d95ae924e.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-12 21:12:46 +01:00
Uli Schlachter
070bc5dd89 xcb-surface-source: Add image16 and ps ref images
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-10 17:10:06 +01:00
Uli Schlachter
6825007ac6 ps: Update xlib-surface-source ref images
Since 9948b5180a, the *-surface-source tests draw a different image (a
translucent region was added). However, the ref images for xlib-surface-source
with cairo-ps weren't updated and thus the test failed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-10 17:10:06 +01:00
Andrea Canciani
5f039f0f89 mesh: Rename cairo_pattern_mesh_* functions to cairo_mesh_pattern_*
This is consistent with the naming of most cairo types/functions
(example: cairo_foo_surface_*).

The substitution in the code has been performed using:

  sed -i 's/cairo_pattern_mesh_/cairo_mesh_pattern_/' <files>
2011-02-07 20:28:09 +01:00
Chris Wilson
fda784793e test: Attempt to capture out-of-bounds spans compositing bug
Attempt to provoke out-of-bounds accesses as demonstrated by
https://bugs.launchpad.net/ubuntu/+source/cairo/+bug/710072

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-06 18:12:08 +00:00
Andrea Canciani
062e78b620 Fix regressions from 1.10 merge
d6dc6e8e39 introduced two regressions:

 - the compiler warns about _gradient_stops_are_opaque being unused in
   cairo-pdf-surface.c

 - get-path-extents now checks for the wrong extents, thus it fails
2011-01-24 10:35:23 +01:00
Chris Wilson
d6dc6e8e39 Merge branch '1.10' into tmp
Synchronize stable bug-fixes with development snapshot

Conflicts:
	cairo-version.h
	src/cairo-path-bounds.c
	src/cairo-pdf-surface.c
	test/get-path-extents.c
2011-01-23 16:05:01 +00:00
Andrea Canciani
e0b741de90 test: Add group-state
The interaction between the group and the state API is currently
untested and buggy. This test tries to use them incorrectly and check
that cairo notices the problem and marks the cr object with an error
status.
2011-01-22 11:59:38 +01:00
Andrea Canciani
67cfb20bd0 test: Workaround pixman limits in large-source-roi
Since 1cc750ed92a936d84b47cac696aaffd226e1c02e pixman won't perform
the compositing if it can't prove that this the computations it has to
perform will fit within the size of the variables it uses.

It looks like in this case it cannot prove that no overflow will
happen unless surface_width <= 30582. Instead of this size (discovered
by bisection), a safer looking 30000 was chosen. It should still
trigger the problems the original test was looking for, because
backends which support 30000xheight surfaces will likely support
32767xheight as well.
2011-01-19 14:41:52 +01:00
Andrea Canciani
5a1e590b12 test: Update quartz ref images
The following commits fix and/or improve the output of some tests.
Updating the ref images before fixing the code allows to check that
the fix is correct and makes it easy to find out which tests are fixed
by each commit.
2011-01-19 11:52:41 +01:00
Andrea Canciani
2e75bf5a25 test: Fix operator-alpha-alpha
The test is checking the compositing of color-alpha sources although
it was meant to check the compositing of alpha-only sources on
alpha-only destinations.

This commit fixes the code to respect the test description.
2011-01-19 11:52:40 +01:00
Andrea Canciani
45505fc5fb Add a results.tar.gz target to the test Makefile
Sometimes it is useful to be able to package the result of a run of
the testsuite. This new target creates an archive containing the html
page and at least all the files it links to.

The archive might contain some unneeded images.
2011-01-18 16:00:08 +01:00
Uli Schlachter
44095f3dde Add a test case for a bug in the xcb backend
This was found via cairo-perf-micro which sometimes triggered this bug in its
mask-similar_image-* test.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-17 22:21:20 +01:00
Andrea Canciani
9e6d8ff86c test: Add missing ref image to REFERENCE_IMAGES 2011-01-17 12:17:30 +01:00
Andrea Canciani
2af0b0f5da test: Add white-in-noop
Exercise an incorrect optimization in cairo-surface.c. It replaces
with a noop any region-based fill with solid white source and an IN
operator.
2011-01-17 10:59:33 +01:00
Andrea Canciani
6472864b2c test: Huge means more than MAX_INT
Cairo makes it possible to create gradients whose extreme objects are
defined with double precision coordinates, but it internally
represents them with 24.8 fixed point precision.

This shows that coordinates that don't fit the valid range are
mishandled and don't even trigger an error status.
2011-01-02 18:32:46 +01:00
Andrea Canciani
7b188f852e test: Make huge-* test gradients not within pixed_fixed_t range
Cairo represents gradients coordinate with 24.8 fixed point precision,
but pixman uses 16.16 fixed point coordinates.

This shows that cairo is currently unable to handle gradients with
coordinates which are valid for cairo but not for pixman.
2011-01-02 18:31:50 +01:00
Andrea Canciani
ada6057b8c test: New radial-gradient tests
The old radial gradient tests were actually drawing the same gradients
with different operators (OVER/SOURCE) and operations (paint/mask).

It is possible to refactor them to share the gradient construction
code. This makes it easy to change the gradient shape in all of them
to test more interesting combinations.

Instead of testing 16 generic positions we are now testing just 7
cases, which correspond to every possible combination of the relative
size and position of the two circles defining the gradient. In
particular we are now testing a constant radius gradient and gradients
with tangent circles.
2011-01-02 18:31:35 +01:00
Adrian Johnson
a8344f98e7 test: Add tests for mesh patterns
mesh-pattern tests a mesh pattern with non-opaque two overlapping
patches.

mesh-pattern-accuracy tests the accuracy of the color computed in each
point of a patch. It can point out defects in rasterizers which rely
on mesh subdivision only use the mesh shape instead of both shape and
color to decide when the tensor-product patches can be approximated
with Gouraud-shaded triangles.

mesh-pattern-conical is an example of how a conical gradient can be
approximated with a mesh pattern.

mesh-pattern-control-points tests a mesh pattern with control points
in non-default position to verify that their position affects the
color as expected.

mesh-pattern-fold tests a mesh pattern with a patch which folds along
both sides.

mesh-pattern-overlap tests a mesh pattern with a patch which folds
along just one side.

mesh-pattern-transformed tests a mesh pattern with non-identity
transform matrix.
2011-01-01 13:05:14 +01:00