summaryrefslogtreecommitdiff
path: root/tests/tiff
diff options
context:
space:
mode:
authortabe <none@none>2009-06-18 13:35:26 +0000
committertabe <none@none>2009-06-18 13:35:26 +0000
commite27c3c7f2c6f16c18031a00f940102c03bb64ae0 (patch)
treef87ef62609381074a06589db5cd4132cf795db79 /tests/tiff
parent1f025d2d729b6d821f219046899a9e1f35d3e04f (diff)
downloadlibgd-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.txt11
-rw-r--r--tests/tiff/Makefile.am3
-rw-r--r--tests/tiff/tiff_null.c14
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;
+}