diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2016-09-25 17:37:45 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2016-09-27 13:34:18 +0200 |
commit | 3e8b5c5ee2b17629095e17773ff5c30422756c12 (patch) | |
tree | 27bf794a9d2eb44e82f3ae12c04b4feba8dc2a15 /tests/gdimagenegate | |
parent | 827bfd4cdddbd4c60d713c78e4407bf58a2e3fca (diff) | |
download | libgd-3e8b5c5ee2b17629095e17773ff5c30422756c12.tar.gz |
Test and document some filter functions
Diffstat (limited to 'tests/gdimagenegate')
-rw-r--r-- | tests/gdimagenegate/.gitignore | 1 | ||||
-rw-r--r-- | tests/gdimagenegate/CMakeLists.txt | 5 | ||||
-rw-r--r-- | tests/gdimagenegate/Makemodule.am | 9 | ||||
-rw-r--r-- | tests/gdimagenegate/basic.c | 29 | ||||
-rw-r--r-- | tests/gdimagenegate/basic.png | bin | 0 -> 2009 bytes | |||
-rw-r--r-- | tests/gdimagenegate/basic_exp.png | bin | 0 -> 2014 bytes |
6 files changed, 44 insertions, 0 deletions
diff --git a/tests/gdimagenegate/.gitignore b/tests/gdimagenegate/.gitignore new file mode 100644 index 0000000..1ffd796 --- /dev/null +++ b/tests/gdimagenegate/.gitignore @@ -0,0 +1 @@ +/basic diff --git a/tests/gdimagenegate/CMakeLists.txt b/tests/gdimagenegate/CMakeLists.txt new file mode 100644 index 0000000..381c74d --- /dev/null +++ b/tests/gdimagenegate/CMakeLists.txt @@ -0,0 +1,5 @@ +LIST(APPEND TESTS_FILES + basic +) + +ADD_GD_TESTS() diff --git a/tests/gdimagenegate/Makemodule.am b/tests/gdimagenegate/Makemodule.am new file mode 100644 index 0000000..03b4dce --- /dev/null +++ b/tests/gdimagenegate/Makemodule.am @@ -0,0 +1,9 @@ +if HAVE_LIBPNG +libgd_test_programs += \ + gdimagenegate/basic +endif + +EXTRA_DIST += \ + gdimagenegate/CMakeLists.txt \ + gdimagenegate/basic.png \ + gdimagenegate/basic_exp.png diff --git a/tests/gdimagenegate/basic.c b/tests/gdimagenegate/basic.c new file mode 100644 index 0000000..b904eb8 --- /dev/null +++ b/tests/gdimagenegate/basic.c @@ -0,0 +1,29 @@ +/**
+ * Basic test for gdImageNegate()
+ */
+
+
+#include "gd.h"
+#include "gdtest.h"
+
+
+int main()
+{
+ gdImagePtr im;
+ FILE *fp;
+ char *path;
+
+ fp = gdTestFileOpen2("gdimagenegate", "basic.png");
+ im = gdImageCreateFromPng(fp);
+ fclose(fp);
+
+ gdImageNegate(im);
+
+ path = gdTestFilePath2("gdimagenegate", "basic_exp.png");
+ gdAssertImageEqualsToFile(path, im);
+ gdFree(path);
+
+ gdImageDestroy(im);
+
+ return gdNumFailures();
+}
diff --git a/tests/gdimagenegate/basic.png b/tests/gdimagenegate/basic.png Binary files differnew file mode 100644 index 0000000..517010b --- /dev/null +++ b/tests/gdimagenegate/basic.png diff --git a/tests/gdimagenegate/basic_exp.png b/tests/gdimagenegate/basic_exp.png Binary files differnew file mode 100644 index 0000000..2dc0484 --- /dev/null +++ b/tests/gdimagenegate/basic_exp.png |