diff options
author | tabe <none@none> | 2009-06-18 13:35:26 +0000 |
---|---|---|
committer | tabe <none@none> | 2009-06-18 13:35:26 +0000 |
commit | e27c3c7f2c6f16c18031a00f940102c03bb64ae0 (patch) | |
tree | f87ef62609381074a06589db5cd4132cf795db79 /tests/tiff | |
parent | 1f025d2d729b6d821f219046899a9e1f35d3e04f (diff) | |
download | libgd-e27c3c7f2c6f16c18031a00f940102c03bb64ae0.tar.gz |
fix for FS#204
* gdImageCreateFrom*() returns null if null pointer given
* gdImage*() puts nothing if null pointer given
Diffstat (limited to 'tests/tiff')
-rw-r--r-- | tests/tiff/CMakeLists.txt | 11 | ||||
-rw-r--r-- | tests/tiff/Makefile.am | 3 | ||||
-rw-r--r-- | tests/tiff/tiff_null.c | 14 |
3 files changed, 28 insertions, 0 deletions
diff --git a/tests/tiff/CMakeLists.txt b/tests/tiff/CMakeLists.txt new file mode 100644 index 0000000..2b40a37 --- /dev/null +++ b/tests/tiff/CMakeLists.txt @@ -0,0 +1,11 @@ + +SET(TESTS_FILES + tiff_null +) + +FOREACH(test_name ${TESTS_FILES}) + add_executable(${test_name} "${test_name}.c") + target_link_libraries (${test_name} ${GDTESTS_TARGET_LINK}) + get_target_property(test_path ${test_name} LOCATION) + ADD_TEST(${test_name} ${test_path}) +ENDFOREACH(test_name) diff --git a/tests/tiff/Makefile.am b/tests/tiff/Makefile.am new file mode 100644 index 0000000..0b1a5b9 --- /dev/null +++ b/tests/tiff/Makefile.am @@ -0,0 +1,3 @@ +## Process this file with automake to produce Makefile.in -*-Makefile-*- + +EXTRA_DIST = CMakeLists.txt tiff_null.c diff --git a/tests/tiff/tiff_null.c b/tests/tiff/tiff_null.c new file mode 100644 index 0000000..064f63a --- /dev/null +++ b/tests/tiff/tiff_null.c @@ -0,0 +1,14 @@ +#include <gd.h> + +int main() +{ + gdImagePtr im; + + im = gdImageCreateFromTiff(NULL); + if (im != NULL) { + gdImageDestroy(im); + return 1; + } + gdImageTiff(im, NULL); /* noop safely */ + return 0; +} |