summaryrefslogtreecommitdiff
path: root/test/create-from-png.c
Commit message (Collapse)AuthorAgeFilesLines
* test: Add special cases for create-from-png and fallback-resolutionBryce W. Harrington2013-07-041-0/+5
| | | | | | | | | | | These tests use reference images somewhat differently from other tests, so treat them as special cases and avoid recommending deleting any of their files. Add TODO's to each test to rework them to be more consistent with other tests. Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
* create-from-png*: Test mark_dirty with mime dataUli Schlachter2011-10-091-0/+4
| | | | | | | | | | | This currently hits the following assertion: lt-cairo-test-suite: cairo-surface.c:1381: cairo_surface_mark_dirty_rectangle: Assertion `! _cairo_surface_has_mime_data (surface)' failed. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41409 Signed-off-by: Uli Schlachter <psychon@znc.in>
* test/create-from-png: Update to point to new reference/ imagesChris Wilson2011-09-231-16/+13
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* [test] Memfault checks.Chris Wilson2009-03-301-51/+113
| | | | | Don't assume an error means the test failed, check for injected allocation errors.
* [test] Use '.' as the field separator in the namesChris Wilson2008-10-311-8/+8
| | | | | | | | | We frequently use '-' within the test name or format name and so we encounter confusion as '-' is also used as the field separator. At times this has caused a new test to break an old test because the new test would match one of the old test's target specific reference images. So switch everything over to use '.' between fields (test name, target, format, subtest, etc.).
* [test] Build test suite into single binary.Chris Wilson2008-10-311-46/+36
| | | | | | | | | Avoid calling libtool to link every single test case, by building just one binary from all the sources. This binary is then given the task of choosing tests to run (based on user selection and individual test requirement), forking each test into its own process and accumulating the results.
* PS/PDF: Set image Interpolation flagAdrian Johnson2008-10-301-0/+1
| | | | | | | | | | | | | | | | If the filter mode is anything other than DEFAILT, FAST or NEAREST set the Interpolate flag in the image dictionary so that a smoothing filter is applied when rasterising the vector file. As we have no control over the implementation of the Interpolate filter (the PS/PDF specifications leave it undefined) we need to capture the output of poppler/GS and update our reference images. (For a couple of tests, the filtering is irrelevant so for those we set the filter to NEAREST.) Note that GhostScript's Interpolate filter does not work on rotated images (and a variety of other transformations) so several of the PS reference images have use nearest-neighbour sampling instead of a bilinear filter.
* [test/create-from-png] Return the failure.Chris Wilson2008-08-171-0/+3
| | | | Having checked all the possible PNG formats, report any failures.
* [test] Preparatory work for running under memfault.Chris Wilson2008-08-131-101/+89
| | | | | | | | | | | | | | | | | | | | 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/.
* [test/create-from-png] Check loading of various colour types.Chris Wilson2008-04-211-0/+121
| | | | | | | Check that when loading from index/gray/rgb PNGs, with and without alpha/transparency, that the correct surface is generated by read_png(), i.e. if the PNG contains an alpha channel then the image must be an ARGB32 surface.
* [cairo-png] Propagate error from read and write funcs.Chris Wilson2007-09-251-9/+75
| | | | | | | | | | Use the png_struct->error_ptr to propagate the error status from the user/stdio read and write functions through the png_error() to the cairo_surface_write_to_png*() and cairo_surface_read_from_png*() functions. From there the error is returned back to the user either directly or as the most appropriate error surface. (Fixes https://bugs.freedesktop.org/show_bug.cgi?id=6909)
* Add prototype for draw in each test file and remove it from the header.Behdad Esfahbod2006-07-131-0/+2
|
* More test suite infrastructure improvements:Behdad Esfahbod2006-07-111-2/+3
| | | | | | | | | | | | | | | | | - 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.
* Fix so that one of three different error status values will be returned:Carl Worth2005-07-281-2/+11
| | | | | | | CAIRO_STATUS_NO_MEMORY CAIRO_STATUS_FILE_NOT_FOUND CAIRO_STATUS_READ_ERROR Add new CAIRO_STATUS_FILE_NOT_FOUND. Add new _cairo_surface_nil_read_error and _cairo_surface_nil_file_not_found. Test the new FILE_NOT_FOUND error.
* Fix typo that caused cairo_image_surface_create_from_png_stream to segfault. ↵Carl Worth2005-07-271-1/+3
| | | | | | Closes bug #3863 (thanks to Steve Chaplin). Add a test to actually call cairo_image_surface_create_from_png_stream.
* Rename create-for-png test to create-from-png to match the naming of the ↵Carl Worth2005-07-141-2/+2
| | | | cairo_image_surface_create_from_png function.
* Removing mucking around with stderr and add a cairo_test_log function instead.Carl Worth2005-05-101-1/+1
| | | | Switch all error messages from fprintf(stderr,...) to cairo_test_log(...).
* Originally 2005-04-20 Carl Worth <cworth@cworth.org>Carl Worth2005-05-031-4/+2
| | | | | | | | | Remove cairo_show_surface. Add new cairo_set_source_surface. Remove _cairo_gstate_show_surface. Replace calls to cairo_show_surface with cairo_set_source_surface; cairo_paint. Fix messages to prefer - over _. Fix documentation. Three new tests to exercise set_source_surface more completely, (two of these are expected failures dues to outstanding bugs).
* Add very simple test to generate PDF output, (no automated verification yet).Carl Worth2005-04-261-2/+0
| | | | Track PNG interface changes, (no more include of cairo-png.h, cairo_surface_write_png renamed to cairo_surface_write_to_png).
* Factor out bulk of the code into a new callback based function, write_png(). ↵Kristian Høgsberg2005-04-251-10/+9
| | | | | | | | Call it with a stdio write callback. (cairo_surface_write_png_to_stream): New function to write a surface to a PNG stream. (cairo_image_surface_create_from_png): Likewise, move most of the code to read_png(), clean up error handling and reduce this function to calling read_png() with a stdio based read function. (cairo_image_surface_create_from_png_stream): New function to create an image surface from a PNG stream. New functions to get widht and height of an image surface. Add new prototype and error codes. Adjust to new PNG API.
* Change type of data parameter from char* to unsigned char*.Carl Worth2005-04-041-0/+74
Propagate the unsigned char* change down the stack. Add cast since XImage uses char* rather than unsigned char*. Fix memory leak of image data. Switch to use cairo_surface_write_png rather than a custom write_png_argb32. Add test to exercise the cairo_image_surface_create_for_png function.