Commit graph

1024 commits

Author SHA1 Message Date
Chris Wilson
e3665bde5d [test/Makefile.am] Match *-out.{pdf,ps,svg}
When cleaning files, limit the glob to only match *-out.{pdf,ps,svg} in
order to distinguish the current practice of naming vector output files
from possible future vector target/reference files.
2008-08-13 22:02:12 +01:00
Chris Wilson
49ea4fbb25 [test/create-from-png-stream] Correct check for png loading error.
The test for failure to load the image surface from the png stream
incorrectly checked for a NULL surface, instead of the error surface.
2008-08-13 22:02:00 +01:00
Chris Wilson
93af67d7fd [test] Pass a 'complete' name to create_surface().
Construct the test name to pass to the boilerplate creation routines such
that it uniquely identifies the test in terms of test, target, content and
pass (similar, offset, thread). This allows the vector targets to create
output different output files for each test, whereas before, later tests
would overwrite existing files making debugging more difficult.
2008-08-13 22:01:51 +01:00
Chris Wilson
517e532fb7 [test] Run fallback-resolution if we have at least one vector surface.
Currently fallback-resolution is included in the test suite if we have all
of the vector surfaces available. This commit enables individual support
for the vector surfaces, so that the test can be run even if one or more
of the surfaces are not available.
2008-08-13 22:01:39 +01:00
Chris Wilson
d56ea9cc87 [test] Set CAIRO_TEST_UNTESTED to 77
77 is the magic exit code used by automake to indicate a skipped test, so
by using it we can get a slightly more informative test log.
2008-08-13 21:55:19 +01:00
Chris Wilson
f85a4aec1f [test] Export a function to check whether a target is enabled.
Allow individuals tests to check whether a test target is enabled -
useful for those tests that circumvent cairo_test() and perform
feature testing.
2008-08-13 21:55:09 +01:00
Chris Wilson
436c0c8be2 [test] Preparatory work for running under memfault.
In order to run under memfault, the framework is first extended to handle
running concurrent tests - i.e. multi-threading. (Not that this is a
requirement for memfault, instead it shares a common goal of storing
per-test data).  To that end all the global data is moved into a per-test
context and the targets are adjusted to avoid overlap on shared, global
resources (such as output files and frame buffers). In order to preserve
the simplicity of the standard draw routines, the context is not passed
explicitly as a parameter to the routines, but is instead attached to the
cairo_t via the user_data.

For the masochist, to enable the tests to be run across multiple threads
simply set the environment variable CAIRO_TEST_NUM_THREADS to the desired
number.

In the long run, we can hope the need for memfault (runtime testing of
error paths) will be mitigated by static analysis. A promising candidate
for this task would appear to be http://hal.cs.berkeley.edu/cil/.
2008-08-13 21:54:59 +01:00
Chris Wilson
5ace0cb17a [cairo-test] Exclude lcd-filter tests for vector targets.
Add text-lcd-filter-* to vector_ignored_tests.
2008-08-11 20:43:14 +01:00
Behdad Esfahbod
b176b5c29d [test/get-xrender-format.c] Don't fail if DISPLAY is not set 2008-08-11 15:06:31 -04:00
Behdad Esfahbod
bbd5f03fd8 [test/xlib-surface-source] Skip test if DISPLAY not set 2008-08-11 14:28:28 -04:00
Behdad Esfahbod
549dd9adb5 [test] Update ref image list 2008-08-11 01:40:27 -04:00
Behdad Esfahbod
e797f6791e [test/Makefil.am] Cosmetic 2008-08-10 23:39:28 -04:00
Chris Wilson
322c3ef7f9 [.gitignore] Update list of tests 2008-08-08 10:09:55 +01:00
Chris Wilson
893b50a980 [test] Update reference image for leaky-dashed-rectangle.
Bah, it seems someone fixed the code and the error lay in discrepancies
with the antialiasing in the reference image.
2008-08-08 10:09:37 +01:00
Behdad Esfahbod
08e8a42ea1 [test/user-font] Fix comments 2008-08-08 03:01:18 -04:00
Behdad Esfahbod
597bfa922a [test/user-font] Document glyph-not-found situation 2008-08-08 03:01:17 -04:00
Behdad Esfahbod
d9408041aa Add cairo_scaled_font_text_to_glyphs()
And update user-font text_to_glyphs() method to match.

Currently disable the win32-font text_to_glyphs(), until that one
is updated.  Or better yet, remove it and implement ucs4_to_index().
It's the toy font API afterall.
2008-08-08 03:01:16 -04:00
Behdad Esfahbod
b01ad0835d [user-font] Add a cairo_t argument to cairo_user_scaled_font_init_func_t
The init func does not actually need to draw anything, but having a cairo_t
similar to that passed to render_glyph is handy for computing font extents.
This is because cairo makes doing some things really hard (if not impossible)
without a cairo_t.

The user-font-proxy test case is a great example of how the added cairo_t
makes life much easier.
2008-08-08 03:01:15 -04:00
Behdad Esfahbod
7e57892983 Add toy font constructor and getters
New public API:

	cairo_toy_font_face_create()
	cairo_toy_font_face_get_family()
	cairo_toy_font_face_get_slant()
	cairo_toy_font_face_get_weight()
2008-08-08 03:01:14 -04:00
Jeff Muizelaar
e8ddbd1a14 Add a test case showing the invariance of push/pop_group
This shows the regressions caused by
1a9809baab
2008-08-07 19:25:40 -04:00
Chris Wilson
ae7bdd7ee0 [valgrind] More suppressions for XrmGetStringDatabase().
Another variation in the callstack needs suppressing.
2008-08-07 08:29:14 +01:00
Behdad Esfahbod
1dc0f3a1ad [test/user-font] Document that Poppler is buggy with glyph 0 2008-08-06 12:00:28 -04:00
Sylvain Pasche
65d017a406 Add tests for the new LCD filter API 2008-08-05 16:30:37 -04:00
Jeff Muizelaar
3074ba02a1 Add a test for scaling a surface with device offset. 2008-07-21 22:08:46 -04:00
Behdad Esfahbod
ba62d2d30a Update .gitignore files 2008-06-26 16:20:58 -04:00
Chris Wilson
47d8739ea1 [test/xlib-surface-source] Build under --disable-xlib-xrender.
Add an ifdef to support compiling without XRender.
2008-06-19 12:25:01 +01:00
Chris Wilson
38c4bcc2da [test/solid-pattern-cache-stress] Do what it says on the tin.
Actually draw to the surface after setting the source in order to
trigger use of the solid surface cache.
2008-06-19 12:24:30 +01:00
Søren Sandmann
cba1543c92 Remove large-clip from xfail list 2008-06-10 18:09:00 -04:00
Søren Sandmann
bd0cf05623 Add the correct reference image for the large-clip test 2008-06-10 18:09:00 -04:00
Søren Sandmann
60971fb514 New large-clip test
This tests clipping to a rectangle that doesn't fit in 16 bits.
2008-06-10 18:08:59 -04:00
Adrian Johnson
c8fc587ede Update user-font test PS/PDF ref images
The PDF output no longer requires a PDF specific reference image. The
lastest poppler from git is required to get the fix for a bug in Type
3 font rendering.
2008-06-09 23:14:47 +09:30
Adrian Johnson
4c5370dad8 Update PDF/PS ref images of text-rotate and ft-show-glyphs-positioning 2008-06-04 23:27:05 +09:30
Behdad Esfahbod
51885e9a1e [test/user-font.c] Fix compiler warnings 2008-05-28 16:52:19 -04:00
Behdad Esfahbod
0f07c45fa3 [test/user-font] Use user_data to access glyphs array
This way the same callback code can be used to render multiple different
glyph arrays.  Change done for education purposes, otherwise doesn't
make any difference in the test.
2008-05-27 17:53:35 -04:00
Behdad Esfahbod
a715671c6f [test/user-font-proxy] New test using fonts inside a user-font
PDF fails and needs some fixes in the PDF surface instead of a new
ref image IMO.
2008-05-24 20:34:41 -04:00
Behdad Esfahbod
4957a78947 [test/surface-finish-twice.c] Adapt to recent change that multiple finish is ok 2008-05-24 15:16:44 -04:00
Behdad Esfahbod
d947ee0ef6 [test/large-font] Make the font REALLY LARGE
10000 that is.  xlib fails now again.  Not because of glyph size issues.
Because we skip rendering any glyphs with positions not in range -1024..15359.
Working on a fix.
2008-05-23 20:41:26 -04:00
Carl Worth
b957beb0df Add large-font test to exercise a cairo-xlib bug.
The original bug report is here:

	corrupt glyph positions with large font
	https://bugzilla.redhat.com/show_bug.cgi?id=448104
2008-05-23 08:05:18 -07:00
Carl Worth
8efb103600 Extend fallback-resolution test to expose bug with groups
Groups appear to always be rendered with a fallback resolution of
72.0 ppi rather than the desired fallback resolution.
2008-05-21 10:23:37 -07:00
Behdad Esfahbod
168447cc2b [user-font] Use opaque colors such that PS backend gets tested
Also update ref images.  All backends pass now.
2008-05-15 20:09:17 -04:00
Behdad Esfahbod
142ba30604 [test/Makefile.am] Add 'make run' target
It runs tests under a tool specified tool.  For example:

	make run TOOL=gdb TESTS=user-font TARGETS=pdf
2008-05-15 19:27:17 -04:00
Behdad Esfahbod
62652ecab7 [test/user-font] Another minor tweak to the font 2008-05-15 13:28:03 -04:00
Behdad Esfahbod
f68fb2c747 [test/user-font] Add some more glyphs
The glyph for 'z' now reveals a bug in PDF type1 code.
2008-05-13 14:07:42 -04:00
Behdad Esfahbod
17f21ea307 [cairo-user-font] Implement user fonts 2008-05-10 01:21:45 +02:00
Behdad Esfahbod
1246ff8aec [cairo-test] Implement cairo_test_log_path() to dump a cairo_path_t to logs
Dumping paths is so hard in C.  Shouldn't be.  At least not when debugging...
2008-05-09 23:21:14 +02:00
Chris Wilson
ff596c64fb [test] Add degenerate-arc
This test case is to exercise the divide-by-zero error reported by
Luiz Americo Pereira Camara <luizmed@oi.com.br>,
http://lists.cairographics.org/archives/cairo/2008-May/014054.html.
2008-05-06 14:31:02 +01:00
Chris Wilson
fed9d9060e [test/invalid-matrix] Disable floating point exception.
test/invalid-matrix purposely feeds invalid numbers into cairo, in
order to check its detection of garbage values. In doing so, cairo
raises an Invalid exception, but as this is a direct result of an abuse
of the API we can treat it as expected behaviour and ignore the
exception.
2008-05-06 14:30:49 +01:00
Chris Wilson
1755a2d27d [test] Enable floating point exceptions.
Some platforms and applications enable floating point exceptions, so it
seems sensible to run the test-suite with the most serious exceptions
enabled - divide by zero, invalid result and overflow.
2008-05-06 14:30:35 +01:00
Chris Wilson
8742429c79 [test] Add test case for a leaky dashed rectangle.
Franz Schmid reported on the mailing list,
http://lists.cairographics.org/archives/cairo/2008-April/013912.html,
an issue with drawing a dashed rubber band in Scribus. The problem
appears when segments of the dashed rectangle are outside the image,
with the errant dash connecting the ends of the visible segments.
2008-04-29 15:19:40 +01:00
Chris Wilson
5d20479b99 [test/ft-font-create-for-ft-face] Fix the lifetime issues of FT_Face.
The font_face created from cairo_ft_font_face_create_for_ft_face()
was being kept alive by a reference from the context beyond the
lifetime of the parent cairo_scaled_font_t (which owned the FT_Face).
Correct the example in the test code to remove this errant reference
before cleaning up the fonts. (To be fair, to actually trigger a bug
one has to evict the FT_Face from the cache before using the font_face
- merely creating a cairo_scaled_font_t for every font on the system is
enough.)
2008-04-29 09:28:10 +01:00