summaryrefslogtreecommitdiff
path: root/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon')
-rw-r--r--Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/CMakeLists.txt13
-rw-r--r--Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon0.c22
-rw-r--r--Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon0.pngbin0 -> 95 bytes
-rw-r--r--Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon1.c31
-rw-r--r--Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon1.pngbin0 -> 95 bytes
-rw-r--r--Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon2.c33
-rw-r--r--Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon2.pngbin0 -> 140 bytes
-rw-r--r--Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon3.c35
-rw-r--r--Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon3.pngbin0 -> 237 bytes
9 files changed, 134 insertions, 0 deletions
diff --git a/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/CMakeLists.txt b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/CMakeLists.txt
new file mode 100644
index 00000000000..09a22678077
--- /dev/null
+++ b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/CMakeLists.txt
@@ -0,0 +1,13 @@
+SET(TESTS_FILES
+ gdimageopenpolygon0
+ gdimageopenpolygon1
+ gdimageopenpolygon2
+ gdimageopenpolygon3
+)
+
+FOREACH(test_name ${TESTS_FILES})
+ add_executable(${test_name} "${test_name}.c")
+ target_link_libraries (${test_name} gdTest)
+ get_target_property(test_path ${test_name} LOCATION)
+ ADD_TEST(${test_name} ${test_path})
+ENDFOREACH(test_name)
diff --git a/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon0.c b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon0.c
new file mode 100644
index 00000000000..d9bf1bd962a
--- /dev/null
+++ b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon0.c
@@ -0,0 +1,22 @@
+#include <stdlib.h>
+#include "gd.h"
+#include "gdtest.h"
+
+int
+main(void)
+{
+ gdImagePtr im;
+ int white, black, r;
+
+ im = gdImageCreate(100, 100);
+ if (!im) exit(EXIT_FAILURE);
+ white = gdImageColorAllocate(im, 0xff, 0xff, 0xff);
+ black = gdImageColorAllocate(im, 0, 0, 0);
+ gdImageFilledRectangle(im, 0, 0, 99, 99, white);
+ gdImageOpenPolygon(im, NULL, 0, black); /* no effect */
+ gdImageOpenPolygon(im, NULL, -1, black); /* no effect */
+ r = gdAssertImageEqualsToFile(GDTEST_TOP_DIR "/gdimageopenpolygon/gdimageopenpolygon0.png", im);
+ gdImageDestroy(im);
+ if (!r) exit(EXIT_FAILURE);
+ return EXIT_SUCCESS;
+}
diff --git a/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon0.png b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon0.png
new file mode 100644
index 00000000000..14c7090a415
--- /dev/null
+++ b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon0.png
Binary files differ
diff --git a/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon1.c b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon1.c
new file mode 100644
index 00000000000..07ee29dff49
--- /dev/null
+++ b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon1.c
@@ -0,0 +1,31 @@
+#include <stdlib.h>
+#include "gd.h"
+#include "gdhelpers.h"
+#include "gdtest.h"
+
+int
+main(void)
+{
+ gdImagePtr im;
+ int white, black, r;
+ gdPointPtr points;
+
+ im = gdImageCreate(100, 100);
+ if (!im) exit(EXIT_FAILURE);
+ white = gdImageColorAllocate(im, 0xff, 0xff, 0xff);
+ black = gdImageColorAllocate(im, 0, 0, 0);
+ gdImageFilledRectangle(im, 0, 0, 99, 99, white);
+ points = (gdPointPtr)calloc(3, sizeof(gdPoint));
+ if (!points) {
+ gdImageDestroy(im);
+ exit(EXIT_FAILURE);
+ }
+ points[0].x = 10;
+ points[0].y = 10;
+ gdImageOpenPolygon(im, points, 1, black);
+ r = gdAssertImageEqualsToFile(GDTEST_TOP_DIR "/gdimageopenpolygon/gdimageopenpolygon1.png", im);
+ free(points);
+ gdImageDestroy(im);
+ if (!r) exit(EXIT_FAILURE);
+ return EXIT_SUCCESS;
+}
diff --git a/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon1.png b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon1.png
new file mode 100644
index 00000000000..14c7090a415
--- /dev/null
+++ b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon1.png
Binary files differ
diff --git a/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon2.c b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon2.c
new file mode 100644
index 00000000000..ab097d83cad
--- /dev/null
+++ b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon2.c
@@ -0,0 +1,33 @@
+#include <stdlib.h>
+#include "gd.h"
+#include "gdhelpers.h"
+#include "gdtest.h"
+
+int
+main(void)
+{
+ gdImagePtr im;
+ int white, black, r;
+ gdPointPtr points;
+
+ im = gdImageCreate(100, 100);
+ if (!im) exit(EXIT_FAILURE);
+ white = gdImageColorAllocate(im, 0xff, 0xff, 0xff);
+ black = gdImageColorAllocate(im, 0, 0, 0);
+ gdImageFilledRectangle(im, 0, 0, 99, 99, white);
+ points = (gdPointPtr)calloc(3, sizeof(gdPoint));
+ if (!points) {
+ gdImageDestroy(im);
+ exit(EXIT_FAILURE);
+ }
+ points[0].x = 10;
+ points[0].y = 10;
+ points[1].x = 50;
+ points[1].y = 70;
+ gdImageOpenPolygon(im, points, 2, black);
+ r = gdAssertImageEqualsToFile(GDTEST_TOP_DIR "/gdimageopenpolygon/gdimageopenpolygon2.png", im);
+ free(points);
+ gdImageDestroy(im);
+ if (!r) exit(EXIT_FAILURE);
+ return EXIT_SUCCESS;
+}
diff --git a/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon2.png b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon2.png
new file mode 100644
index 00000000000..80f91a2814b
--- /dev/null
+++ b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon2.png
Binary files differ
diff --git a/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon3.c b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon3.c
new file mode 100644
index 00000000000..027bfacd20b
--- /dev/null
+++ b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon3.c
@@ -0,0 +1,35 @@
+#include <stdlib.h>
+#include "gd.h"
+#include "gdhelpers.h"
+#include "gdtest.h"
+
+int
+main(void)
+{
+ gdImagePtr im;
+ int white, black, r;
+ gdPointPtr points;
+
+ im = gdImageCreate(100, 100);
+ if (!im) exit(EXIT_FAILURE);
+ white = gdImageColorAllocate(im, 0xff, 0xff, 0xff);
+ black = gdImageColorAllocate(im, 0, 0, 0);
+ gdImageFilledRectangle(im, 0, 0, 99, 99, white);
+ points = (gdPointPtr)calloc(3, sizeof(gdPoint));
+ if (!points) {
+ gdImageDestroy(im);
+ exit(EXIT_FAILURE);
+ }
+ points[0].x = 10;
+ points[0].y = 10;
+ points[1].x = 50;
+ points[1].y = 70;
+ points[2].x = 90;
+ points[2].y = 30;
+ gdImageOpenPolygon(im, points, 3, black);
+ r = gdAssertImageEqualsToFile(GDTEST_TOP_DIR "/gdimageopenpolygon/gdimageopenpolygon3.png", im);
+ free(points);
+ gdImageDestroy(im);
+ if (!r) exit(EXIT_FAILURE);
+ return EXIT_SUCCESS;
+}
diff --git a/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon3.png b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon3.png
new file mode 100644
index 00000000000..9d63d6ac9ba
--- /dev/null
+++ b/Build/source/libs/gd/libgd-2.1.0/tests/gdimageopenpolygon/gdimageopenpolygon3.png
Binary files differ