Commit graph

2092 commits

Author SHA1 Message Date
Andrea Canciani
a3cc46d2cc quartz-font: Fix text-glyph-range
The index 0 is a legitimate index used for character codes that do not
correspond to any glyph in the font.  Instead, the API reserves 0xFFFF
(kCGFontIndexInvalid) as the invalid index and defines 0xFFFE
(kCGFontIndexMax = kCGGlyphMax) as the maximum legal index.

Fixes text-glyph-range.
2017-04-25 18:06:14 +02:00
Andrea Canciani
cb9f627378 test: Add a test for characters in the SMP
Unicode characters in the Supplementary Multilingual Plane are encoded
as surrogate pairs in UTF-16. This test tries to verify that backends
do not perform UCS4 to UTF-16 conversion by truncation.
2017-04-25 18:05:40 +02:00
Kouhei Sutou
dd4706d0a9 pdf: Fix wrong cairo_pdf_outline_flags_t item prefix 2017-01-05 08:33:07 +10:30
Adrian Johnson
4790a3663d strndup is not avuilable with MSVC 2016-10-07 07:38:37 +10:30
Adrian Johnson
55f8c6d9f4 fix compiler warnings 2016-10-04 12:00:30 +10:30
Adrian Johnson
23fd706bd1 add test for PDF document interchange features such as tagged text and links 2016-10-01 22:48:05 +09:30
darxus@chaosreigns.com
cbbd02f9c5 Add example to run specific tests by name to the test/README
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Uli Schlachter <psychon@znc.in>
2016-08-31 20:29:57 -07:00
darxus@chaosreigns.com
66205ad48e Remove closed poppler bugs from test/README
These bugs have all been closed resolved / fixed for years.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-08-31 18:22:10 -07:00
Adrian Johnson
deb994488f test: refresh text-rotate ref images 2016-07-05 20:26:47 +09:30
Adrian Johnson
d92015e4f9 add test text-unhinted-metrics
Based on bug report in https://lists.cairographics.org/archives/cairo/2016-April/027334.html
2016-07-05 20:26:47 +09:30
Adrian Johnson
113ba5f3fa Update ref images
ref images were creating using Debian Jessie 64-bit and latest poppler.
2016-06-05 20:43:36 +09:30
Adrian Johnson
14fa88fd02 pdf: fix record-replay-extend test failures 2016-06-05 20:43:36 +09:30
Adrian Johnson
e7b1cb0c53 image: fix record-replay-extend test failures 2016-06-05 20:43:36 +09:30
Adrian Johnson
8e4d4de2a3 test: replay record surface with negative extents for each extend mode
image fails for repeat, reflect, and pad.
2016-06-05 20:43:36 +09:30
Adrian Johnson
a736fd8699 Fix PDF record-neg-extents test failure
Modify PDF surface to allow surface extents to have negative x, y.
When emitting recording surfaces, set the surface extents to the
recording extents.
2016-06-05 20:43:36 +09:30
Adrian Johnson
d2dc2e90a7 Fix test failures when recording surface extents has negative x,y
Fixes record-neg-bounded-extents (image only) and
recording-ink-extents.
2016-06-05 20:43:36 +09:30
Adrian Johnson
58df191946 Add recording-ink-extents test
bounded_fill fails returning extents origin of (0, 0) instead of (-150, -100)
2016-06-05 20:43:36 +09:30
Adrian Johnson
9fff6f0be3 test: add record-neg-extents
Test case for bug 89232 - painting a recording surface to a
pdf/ps surface omits objects on the recording surface with negative
coordinates even though the pattern matrix has transformed the objects
to within the page extents.

The image surface also fails when the recording surface is bounded.
2016-06-05 20:43:36 +09:30
Adrian Johnson
00a36e4652 svg2png: fix deprecated warning
rsvg_pixbuf_from_file() is deprecated, replaced by
rsvg_handle_new_from_file() + rsvg_handle_render_cairo().
2016-04-16 18:05:41 +09:30
Adrian Johnson
11667ec47c pdf2png: fix deprecated warning 2016-04-16 17:42:56 +09:30
Bryce Harrington
0986ae4dee test: Fix use after frees
Fixes:  https://bugs.freedesktop.org/show_bug.cgi?id=93152
2015-12-09 11:30:34 -08:00
Adrian Johnson
30eb1b0e97 Add test case for thin lines
Bug 77298
2015-10-17 18:39:19 +10:30
Adrian Johnson
6952e03262 ps: fix raster source patterns 2015-10-17 18:16:22 +10:30
Bryce Harrington
e40806ecdf test: Add script to display the difference between two result sets 2015-07-31 19:00:48 -07:00
Bryce Harrington
60c2f69535 test: Add script to summarize the test results from a run 2015-07-31 18:59:34 -07:00
Bryce Harrington
e0963f6c8e gitignore: Ignore .trs (test results) 2015-07-31 17:56:54 -07:00
Bryce Harrington
c04bd43083 test: Free the memory, not the pointer to the memory
In read_file(), we see:

    *data = malloc (*len);
    ...
    if (fread(*data, *len, 1, fp) != 1) {
      free(data);
      ...

The free call needs to be free(*data), to match the malloc call.

Matthias Clasen found this via Coverity and proposed the fix.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=91381
2015-07-30 16:45:15 -07:00
Bryce Harrington
0dd5d84bae svg2png: Only call deprecated g_type_init() for old glib versions.
Quells the following warning:

pdf2png.c:52:5: warning: ‘g_type_init’ is deprecated (declared at
/usr/include/glib-2.0/gobject/gtype.h:667) [-Wdeprecated-declarations]
     g_type_init ();
     ^
svg2png.c:47:5: warning: ‘g_type_init’ is deprecated (declared at
/usr/include/glib-2.0/gobject/gtype.h:667) [-Wdeprecated-declarations]
     g_type_init ();
     ^

Patch authored by arpitj01@gmail.com

Fixes:  https://bugs.freedesktop.org/show_bug.cgi?id=81197
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2015-07-28 17:10:33 -07:00
Andrea Canciani
68e12cd37f test: Update quartz reference images 2015-07-27 12:45:59 +02:00
Andrea Canciani
e1353f3b85 test: Always use DejaVu Sans as default font
This makes the results of the test suite more stable across different
environments, because it does not rely anymore on
CAIRO_FONT_FAMILY_DEFAULT (which on Windows is "Arial", on Mac
"Helvetica").

This change should not affect Linux environments, assuming that the
default font is already set to "DejaVu Sans".
2015-07-27 12:45:59 +02:00
Arpit Jain
943ba26a20 test/bitmap-font: Fix use of pointer after freed pointer
The pointer 'filename' is already freed and still used as a function
argument.  This patch will free the pointer 'filename' only after it is
used.

Also, the patch ensures that it frees the pointer 'filename' before any
return of this function.

Fixes:  https://bugs.freedesktop.org/show_bug.cgi?id=91206
Signed-off-by: Arpit Jain <jain.arpit@samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-07-06 15:14:23 -07:00
Andrea Canciani
89942c6af0 test: Correct bug number in clip-complex-bug61592
The filename of the C source file is correct, but the test name (both
as function name and as reference image name) has a typo in it.

Related to https://bugs.freedesktop.org/show_bug.cgi?id=61592
2015-04-16 11:28:50 +02:00
Andrea Canciani
654b4a8efe test: Fix coverage-intersecting-triangles reference
Commit 4e3ef57bc8 added
coverage-intersecting-triangles with an incorrect reference and
generator. The test checks the rasterization of two overlapping
triangles in the following position:

   .   .
   |\ /|
   | X |
   |/ \|
   .---.

Since the triangles have both vertical and horizontal sides of size
x/WIDTH, the expected coverage is 3/4 (75%) of (x/WIDTH)^2. The
original code, instead, was checking for a coverage of 0.75*x/WIDTH,
as if one of the sides was always 1 unit long.

The image and xlib backends still suffer from some jitter, caused by
the approximation of the actual coverage by means of sampling. For
this reason their references are still considered XFAIL, even though
their result now looks mostly consistent with the expected reference.
2015-04-08 14:32:17 +02:00
Bryce Harrington
2cf2d8e340 Fix spellings descibed, indicies, stange 2015-04-04 15:49:18 -07:00
Andrea Canciani
b19b06c463 Harden make-cairo-test-constructors.sh
The make-cairo-test-constructors.sh script executes several commands
without checking their success. This can lead to undetected errors,
like those fixed in 86fad78fcd.

The script now exits with an error status if no file is
input. Moreover, it sets the '-e' flag, so that if a command fails,
the whole script is immediately terminated with an error.

In the Makefile.am, the script result is now checked and the target
file is removed upon error. This ensures that the
'cairo-test-constructors.c' target completes succesfully only if no
error occurred.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-03-13 13:18:32 -07:00
Bryce Harrington
86fad78fcd On MacOSX, the sed utility errors out when parsing non-UTF8
files. Because of this, the generated cairo-test-constructor only
contained a few tests and the test suite was thus incomplete.

Original patch by Andrea Canciani <ranma42@gmail.com>
2015-03-10 12:15:40 -07:00
Michael Haubenwallner
0916d580db test: fix include order for AIX, bug#89354 2015-03-05 17:02:14 -08:00
Michael Haubenwallner
f72bd7c757 skip MAP_NORESERVE when unsupported
Fixes a compilation on AIX ('MAP_NORESERVE' undeclared)

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=89340
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2015-03-05 14:48:28 -08:00
Andrea Canciani
4a225fca5f test: Free test list
When running the cairo-test-suite, valgrind reports each of the
registered test as a leak, because they are _list_prepend()'ed, but
the tests list is never _list_free()'d.

Fixes the following valgrind error:

malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
cairo_boilerplate_xmalloc (cairo-boilerplate-system.c:47)
cairo_test_register (cairo-test-runner.c:131)
_cairo_test_runner_register_tests (cairo-test-constructors.c:1112)
main (cairo-test-runner.c:714)

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2014-12-06 17:38:02 -08:00
Andrea Canciani
9806f437b4 test: Release owned pattern
The pattern created by cairo_pattern_create_rgb() is owned by the
caller, hence it needs to be released.

Fixes the following valgrind error:

malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
_cairo_pattern_create_solid (cairo-pattern.c:605)
_cairo_pattern_create_in_error (cairo-pattern.c:628)
cairo_pop_group (cairo.c:552)
test_cairo_push_group (api-special-cases.c:157)
preamble (api-special-cases.c:1766)
main (cairo-test-runner.c:228)

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2014-12-06 17:38:02 -08:00
Bryce Harrington
2c5af590dd Refactor ARRAY_LENGTH macro definitions in test code 2014-11-20 12:22:06 -08:00
Bryce Harrington
7edc5a8844 test: Use ARRAY_LENGTH macro 2014-11-20 12:22:06 -08:00
Bryce Harrington
b4e218c3e8 Drop the target-specific huge-radial.pdf.*.ref.png images
These two images are mis-rendered (clearly evident from visual
inspection).  By removing them, the test will fall back to the more
general format-specific images, huge-radial.argb32.ref.png and
huge-radial.rgb24.ref.png.

Note that the huge-radial.pdf tests still fail to pass, but the pdiff
looks more sensible.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66218

Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
2014-10-29 15:45:17 -07:00
Bryce Harrington
51892e91d4 Revert "Add execution bit for make-cairo-test-constructors.sh"
This reverts commit 5c17bf1a33.

Script is sourced in the makefile, no need for +x.
2014-10-18 19:10:32 -07:00
Bryce Harrington
5c17bf1a33 Add execution bit for make-cairo-test-constructors.sh
This is referenced in the Makefile but not set as executable
2014-10-17 15:50:31 -07:00
Bryce Harrington
82cd66f833 test: Update pixman downscaling 95 reference images
The pixman downscaling "95" tests attempt to rescale a 96x96 pixmap to
95x95.  Ideally the borders between color areas should be sharp, but for
this use case we allow for 1 pixel of blur between the areas as
acceptable.  The choice of what color to use for this blurred region is
not important, and in fact varies from backend to backend.

The old reference images were generated by Krzysztof Kosiński's
downscaling algorithm.  These new images are against the algorithms
written by Bill Spitzak.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2014-10-09 18:28:53 -07:00
Bryce Harrington
79b5a35f83 test: Add an update-refs.sh script to update reference images
There are cases where the rendered output of a test can vary from
backend to backend in ways which are visually acceptable.  This is why
we have reference images in the first place.  In these cases, changes to
the rendering logic can result in slight differences in the output that
is also within acceptable visual limits.

We see this in the pixman downscaling tests.  This script is introduced
as a way to more easily update the reference images after a renderer
change.

This script is intended to be expanded to handle updating of references
for other tests as we identify similar issues.  The intent is that this
script then serves as a way to document these exceptional cases.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2014-10-09 18:28:52 -07:00
Bryce Harrington
1570fa23e8 test: Fix error message to specify the executable that was missing
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2014-10-09 13:51:49 -07:00
Chris Wilson
a8abf3a48b test: Fix conflation of different device scales in index.html
Currently testtable.js does not recognise the difference between running
the same test with multiple scale factors and merges the results into
one.
2014-10-09 10:57:17 +01:00
Chris Wilson
14df211b9c test: Add whole flipped replays
When investing the symmetry of the raterisation, we want to have a
simple replay of all of the original geometry through a the flipped
recording surface. This reduces the worry about artifacts from the
clipped rendering.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-02 13:08:50 +01:00