Commit graph

8 commits

Author SHA1 Message Date
Carl Worth
e49db8ed3e Fix create-for-stream test to log its failure properly
Without this, a failure of this test won't be nicely reported
in the post-make-check summary. (Also fix a silly little typo
in the svg-clip test.)
2008-01-16 08:16:06 -08:00
Chris Wilson
76b9b18192 [test/create-for-stream] Add the missing cairo_surface_finish().
Moments after pushing the new test case did I realise the issue...
We do not attempt to write out the surface to the user stream until
we perform the cairo_surface_destroy() by which point we have lost
the ability to interrogate the error status. We can avoid this by
explicitly calling cairo_surface_finish() and then checking the
error status - and we see that the error is indeed reported
correctly.

No bug. Nothing to see here. Please move along. (Apart from the
request for the status to be return from cairo_surface_destroy!)
2007-09-26 00:41:31 +01:00
Chris Wilson
1e7f0bd4d5 [test/create-for-stream] Add test case for user error propagation.
From bug https://bugs.freedesktop.org/show_bug.cgi?id=7049, we find
that the error status from the user supplied write function to
cairo_*_surface_create_for_stream is ignored and not propagated back
to the surface/context - leading to silent data loss. Incorporate
the suggested test case, a write function that simply returns
CAIRO_STATUS_WRITE_ERROR, into create-for-stream.c.
2007-09-26 00:31:08 +01:00
Chris Wilson
cab4d41cae create-for-stream - free resources after test failure.
create-for-stream often fails whilst running under valgrind due to the
postscript output containing a CreationDate with seconds resolution,
hence the visibility of the resource leaks during failure.
2007-04-16 16:57:24 +01:00
Carl Worth
b52dda62fe Augment cairo_test_init with cairo_test_fini to avoid leak
Without this, any tests that were using cairo_test_init rather than
cairo_test would end up leaking a FILE* for the log file. So this
keeps valgrind much more happy with the test suite.
2007-03-02 11:31:13 -08:00
Carl Worth
c3b912d7db Eliminate most compiler warnings from the test suite 2006-08-08 01:16:49 -07:00
Behdad Esfahbod
973d3a3d14 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.
2006-07-11 22:19:39 -04:00
Kristian Høgsberg
9ef99d10bb Add test case for the PDF, PS and SVG stream constructors. 2006-06-14 19:21:46 -04:00