summaryrefslogtreecommitdiff
path: root/tests/gdimagecolor
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2016-09-25 17:37:45 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2016-09-27 13:34:18 +0200
commit3e8b5c5ee2b17629095e17773ff5c30422756c12 (patch)
tree27bf794a9d2eb44e82f3ae12c04b4feba8dc2a15 /tests/gdimagecolor
parent827bfd4cdddbd4c60d713c78e4407bf58a2e3fca (diff)
downloadlibgd-3e8b5c5ee2b17629095e17773ff5c30422756c12.tar.gz
Test and document some filter functions
Diffstat (limited to 'tests/gdimagecolor')
-rw-r--r--tests/gdimagecolor/.gitignore1
-rw-r--r--tests/gdimagecolor/CMakeLists.txt5
-rw-r--r--tests/gdimagecolor/Makemodule.am9
-rw-r--r--tests/gdimagecolor/basic.c29
-rw-r--r--tests/gdimagecolor/basic.pngbin0 -> 2092 bytes
-rw-r--r--tests/gdimagecolor/basic_exp.pngbin0 -> 2140 bytes
6 files changed, 44 insertions, 0 deletions
diff --git a/tests/gdimagecolor/.gitignore b/tests/gdimagecolor/.gitignore
new file mode 100644
index 0000000..1ffd796
--- /dev/null
+++ b/tests/gdimagecolor/.gitignore
@@ -0,0 +1 @@
+/basic
diff --git a/tests/gdimagecolor/CMakeLists.txt b/tests/gdimagecolor/CMakeLists.txt
new file mode 100644
index 0000000..381c74d
--- /dev/null
+++ b/tests/gdimagecolor/CMakeLists.txt
@@ -0,0 +1,5 @@
+LIST(APPEND TESTS_FILES
+ basic
+)
+
+ADD_GD_TESTS()
diff --git a/tests/gdimagecolor/Makemodule.am b/tests/gdimagecolor/Makemodule.am
new file mode 100644
index 0000000..caf26a4
--- /dev/null
+++ b/tests/gdimagecolor/Makemodule.am
@@ -0,0 +1,9 @@
+if HAVE_LIBPNG
+libgd_test_programs += \
+ gdimagecolor/basic
+endif
+
+EXTRA_DIST += \
+ gdimagecolor/CMakeLists.txt \
+ gdimagecolor/basic.png \
+ gdimagecolor/basic_exp.png
diff --git a/tests/gdimagecolor/basic.c b/tests/gdimagecolor/basic.c
new file mode 100644
index 0000000..2ad0f3c
--- /dev/null
+++ b/tests/gdimagecolor/basic.c
@@ -0,0 +1,29 @@
+/**
+ * Basic test for gdImageColor()
+ */
+
+
+#include "gd.h"
+#include "gdtest.h"
+
+
+int main()
+{
+ gdImagePtr im;
+ FILE *fp;
+ char *path;
+
+ fp = gdTestFileOpen2("gdimagecolor", "basic.png");
+ im = gdImageCreateFromPng(fp);
+ fclose(fp);
+
+ gdImageColor(im, 127, -127, -127, 0);
+
+ path = gdTestFilePath2("gdimagecolor", "basic_exp.png");
+ gdAssertImageEqualsToFile(path, im);
+ gdFree(path);
+
+ gdImageDestroy(im);
+
+ return gdNumFailures();
+}
diff --git a/tests/gdimagecolor/basic.png b/tests/gdimagecolor/basic.png
new file mode 100644
index 0000000..310f4ae
--- /dev/null
+++ b/tests/gdimagecolor/basic.png
Binary files differ
diff --git a/tests/gdimagecolor/basic_exp.png b/tests/gdimagecolor/basic_exp.png
new file mode 100644
index 0000000..0af3250
--- /dev/null
+++ b/tests/gdimagecolor/basic_exp.png
Binary files differ