summaryrefslogtreecommitdiff
path: root/test/create-from-png.c
AgeCommit message (Collapse)AuthorFilesLines
2009-03-30[test] Memfault checks.Chris Wilson1-51/+113
Don't assume an error means the test failed, check for injected allocation errors.
2008-10-31[test] Use '.' as the field separator in the namesChris Wilson1-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.).
2008-10-31[test] Build test suite into single binary.Chris Wilson1-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.
2008-10-30PS/PDF: Set image Interpolation flagAdrian Johnson1-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.
2008-08-17[test/create-from-png] Return the failure.Chris Wilson1-0/+3
Having checked all the possible PNG formats, report any failures.
2008-08-13[test] Preparatory work for running under memfault.Chris Wilson1-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/.
2008-04-21[test/create-from-png] Check loading of various colour types.Chris Wilson1-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.
2007-09-25[cairo-png] Propagate error from read and write funcs.Chris Wilson1-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)
2006-07-13Add prototype for draw in each test file and remove it from the header.Behdad Esfahbod1-0/+2
2006-07-11More test suite infrastructure improvements:Behdad Esfahbod1-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.
2005-07-28Fix so that one of three different error status values will be returned:Carl Worth1-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.
2005-07-27Fix typo that caused cairo_image_surface_create_from_png_stream to segfault. ↵Carl Worth1-1/+3
Closes bug #3863 (thanks to Steve Chaplin). Add a test to actually call cairo_image_surface_create_from_png_stream.
2005-07-14Rename create-for-png test to create-from-png to match the naming of the ↵Carl Worth1-2/+2
cairo_image_surface_create_from_png function.
2005-05-10Removing mucking around with stderr and add a cairo_test_log function instead.Carl Worth1-1/+1
Switch all error messages from fprintf(stderr,...) to cairo_test_log(...).
2005-05-03Originally 2005-04-20 Carl Worth <cworth@cworth.org>Carl Worth1-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).
2005-04-26Add very simple test to generate PDF output, (no automated verification yet).Carl Worth1-2/+0
Track PNG interface changes, (no more include of cairo-png.h, cairo_surface_write_png renamed to cairo_surface_write_to_png).
2005-04-25Factor out bulk of the code into a new callback based function, write_png(). ↵Kristian Høgsberg1-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.
2005-04-04Change type of data parameter from char* to unsigned char*.Carl Worth1-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.