summaryrefslogtreecommitdiff
path: root/test/create-for-stream.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2006-07-11 22:19:39 -0400
committerBehdad Esfahbod <behdad@behdad.org>2006-07-11 22:19:39 -0400
commit973d3a3d1466830dcaa94e9fe39fa6fdf510fbbc (patch)
tree80eb49f8c4f0bf09eb83517e42533cca45dae5d6 /test/create-for-stream.c
parent94bdbc15f79308269f1bcd74b3d8899f8458babc (diff)
More test suite infrastructure improvements:
- Remove cairo_test_expect_failure. cairo-test.c now checks env var CAIRO_XFAIL_TESTS to see if the running test is expected to fail. The reason for expected failure is appended to the test description. - Test description is written out. - Failed/crashed tests also write a line out to stderr (in red), so one can now redirect stdout to /dev/null to only see failures. - cairo_test() has been changed to not take the draw function anymore, instead, draw function is now part of the test struct. - "make check" doesn't allow limiting backends to test using env var anymore. To limit backends to test, one should use the TARGETS variable on the make command line. - "make check-valgrind" now writes its log to valgrind-log instead of valgrind.log, to not interfere with test log file processing.
Diffstat (limited to 'test/create-for-stream.c')
-rw-r--r--test/create-for-stream.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/test/create-for-stream.c b/test/create-for-stream.c
index 7995e105..b2137cec 100644
--- a/test/create-for-stream.c
+++ b/test/create-for-stream.c
@@ -57,20 +57,27 @@
#define WIDTH_IN_POINTS (WIDTH_IN_INCHES * 72.0)
#define HEIGHT_IN_POINTS (HEIGHT_IN_INCHES * 72.0)
-static void
-draw (cairo_surface_t *surface)
+static cairo_test_status_t
+draw (cairo_t *cr, int width, int height)
{
- cairo_t *cr;
-
/* Just draw a rectangle. */
- cr = cairo_create (surface);
- cairo_rectangle (cr, WIDTH_IN_POINTS / 10, HEIGHT_IN_POINTS /10,
- WIDTH_IN_POINTS - 2 * WIDTH_IN_POINTS / 10,
- HEIGHT_IN_POINTS - 2 * HEIGHT_IN_POINTS /10);
+ cairo_rectangle (cr, width / 10., height /10.,
+ width - 2 * width / 10.,
+ height - 2 * height /10.);
cairo_fill (cr);
cairo_show_page (cr);
+}
+
+static void
+draw_to (cairo_surface_t *surface)
+{
+ cairo_t *cr;
+
+ cr = cairo_create (surface);
+
+ draw (cr, WIDTH_IN_POINTS, HEIGHT_IN_POINTS);
cairo_destroy (cr);
}
@@ -135,7 +142,7 @@ test_surface (const char *filename,
return CAIRO_TEST_FAILURE;
}
- draw (surface);
+ draw_to (surface);
cairo_surface_destroy (surface);
@@ -154,7 +161,7 @@ test_surface (const char *filename,
return CAIRO_TEST_FAILURE;
}
- draw (surface);
+ draw_to (surface);
cairo_surface_destroy (surface);
@@ -188,7 +195,7 @@ main (void)
{
cairo_test_status_t status;
- printf("\n");
+ cairo_test_init ("create-for-stream");
#if CAIRO_HAS_PS_SURFACE
status = test_surface ("create-for-stream.ps",