summaryrefslogtreecommitdiff
path: root/Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle')
-rw-r--r--Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle/CMakeLists.txt11
-rw-r--r--Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle/bug00004.c27
-rw-r--r--Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle/bug00078.c39
-rw-r--r--Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle/bug00106_gdimagefilledrectangle.c27
4 files changed, 104 insertions, 0 deletions
diff --git a/Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle/CMakeLists.txt b/Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle/CMakeLists.txt
new file mode 100644
index 00000000000..73920709bb5
--- /dev/null
+++ b/Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle/CMakeLists.txt
@@ -0,0 +1,11 @@
+SET(TESTS_FILES
+ bug00004
+ bug00078
+ bug00106_gdimagefilledrectangle
+)
+
+FOREACH(test_name ${TESTS_FILES})
+ add_executable(${test_name} "${test_name}.c")
+ target_link_libraries (${test_name} gdTest)
+ add_test(NAME ${test_name} COMMAND ${test_name})
+ENDFOREACH(test_name)
diff --git a/Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle/bug00004.c b/Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle/bug00004.c
new file mode 100644
index 00000000000..594e29637d7
--- /dev/null
+++ b/Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle/bug00004.c
@@ -0,0 +1,27 @@
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+ gdImagePtr im;
+ int c1,c2,c3,c4,c5;
+
+ im = gdImageCreateTrueColor(100,100);
+ gdImageFilledRectangle(im, 2,2, 80,95, 0x50FFFFFF);
+
+ c1 = gdImageGetTrueColorPixel(im, 2, 2);
+ c2 = gdImageGetTrueColorPixel(im, 80, 95);
+ c3 = gdImageGetTrueColorPixel(im, 80, 2);
+ c4 = gdImageGetTrueColorPixel(im, 2, 95);
+ c5 = gdImageGetTrueColorPixel(im, 49, 49);
+
+ gdImageDestroy(im);
+ if (0x005e5e5e == c1 && 0x005e5e5e == c2 &&
+ 0x005e5e5e == c3 && 0x005e5e5e == c4 &&
+ 0x005e5e5e == c5) {
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
diff --git a/Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle/bug00078.c b/Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle/bug00078.c
new file mode 100644
index 00000000000..adf244ebca2
--- /dev/null
+++ b/Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle/bug00078.c
@@ -0,0 +1,39 @@
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+ gdImagePtr im;
+ int c1,c2,c3,c4,c5;
+
+ im = gdImageCreateTrueColor(100,100);
+ gdImageFilledRectangle(im, 2,2, 80,95, 0x50FFFFFF);
+ c1 = gdImageGetTrueColorPixel(im, 2, 2);
+ c2 = gdImageGetTrueColorPixel(im, 80, 95);
+ c3 = gdImageGetTrueColorPixel(im, 80, 2);
+ c4 = gdImageGetTrueColorPixel(im, 2, 95);
+ c5 = gdImageGetTrueColorPixel(im, 49, 49);
+
+ if (!(0x005e5e5e == c1 && 0x005e5e5e == c2 &&
+ 0x005e5e5e == c3 && 0x005e5e5e == c4)) {
+ return 1;
+ }
+ gdImageFilledRectangle(im, 0, 0, 99, 99, 0x0);
+
+ gdImageFilledRectangle(im, 80,95, 2,2, 0x50FFFFFF);
+ c1 = gdImageGetTrueColorPixel(im, 2, 2);
+ c2 = gdImageGetTrueColorPixel(im, 80, 95);
+ c3 = gdImageGetTrueColorPixel(im, 80, 2);
+ c4 = gdImageGetTrueColorPixel(im, 2, 95);
+ c5 = gdImageGetTrueColorPixel(im, 49, 49);
+
+ if (!(0x005e5e5e == c1 && 0x005e5e5e == c2 &&
+ 0x005e5e5e == c3 && 0x005e5e5e == c4 &&
+ 0x005e5e5e == c5)) {
+ return 1;
+ }
+
+ gdImageDestroy(im);
+ return 0;
+}
+
diff --git a/Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle/bug00106_gdimagefilledrectangle.c b/Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle/bug00106_gdimagefilledrectangle.c
new file mode 100644
index 00000000000..24f5ceb9327
--- /dev/null
+++ b/Build/source/libs/gd/libgd-2.1.1/tests/gdimagefilledrectangle/bug00106_gdimagefilledrectangle.c
@@ -0,0 +1,27 @@
+#include "gd.h"
+#include "gdtest.h"
+
+int main()
+{
+ gdImagePtr im;
+ int c1,c2,c3,c4;
+
+ im = gdImageCreateTrueColor(10,10);
+ if (!im) {
+ return 1;
+ }
+
+ gdImageFilledRectangle(im, 1,1, 1,1, 0x50FFFFFF);
+ c1 = gdImageGetTrueColorPixel(im, 1, 1);
+ c2 = gdImageGetTrueColorPixel(im, 2, 1);
+ c3 = gdImageGetTrueColorPixel(im, 1, 2);
+ c4 = gdImageGetTrueColorPixel(im, 2, 2);
+ gdImageDestroy(im);
+ if (0x005e5e5e == c1 && 0x0 == c2 &&
+ 0x0 == c3 && 0x0 == c4) {
+ return 0;
+ } else {
+ return 1;
+ }
+}
+