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