summaryrefslogtreecommitdiff
path: root/tests/wbmp
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/wbmp
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/wbmp')
-rw-r--r--tests/wbmp/CMakeLists.txt11
-rw-r--r--tests/wbmp/Makefile.am3
-rw-r--r--tests/wbmp/wbmp_null.c14
3 files changed, 28 insertions, 0 deletions
diff --git a/tests/wbmp/CMakeLists.txt b/tests/wbmp/CMakeLists.txt
new file mode 100644
index 0000000..ea2e2f8
--- /dev/null
+++ b/tests/wbmp/CMakeLists.txt
@@ -0,0 +1,11 @@
+
+SET(TESTS_FILES
+ wbmp_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/wbmp/Makefile.am b/tests/wbmp/Makefile.am
new file mode 100644
index 0000000..9acb4cd
--- /dev/null
+++ b/tests/wbmp/Makefile.am
@@ -0,0 +1,3 @@
+## Process this file with automake to produce Makefile.in -*-Makefile-*-
+
+EXTRA_DIST = CMakeLists.txt wbmp_null.c
diff --git a/tests/wbmp/wbmp_null.c b/tests/wbmp/wbmp_null.c
new file mode 100644
index 0000000..43e9397
--- /dev/null
+++ b/tests/wbmp/wbmp_null.c
@@ -0,0 +1,14 @@
+#include <gd.h>
+
+int main()
+{
+ gdImagePtr im;
+
+ im = gdImageCreateFromWBMP(NULL);
+ if (im != NULL) {
+ gdImageDestroy(im);
+ return 1;
+ }
+ gdImageWBMP(im, 0, NULL); /* noop safely */
+ return 0;
+}