summaryrefslogtreecommitdiff
path: root/Build/source/libs/gd/libgd-src/tests/gdimagerotate
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/gd/libgd-src/tests/gdimagerotate')
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/CMakeLists.txt6
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/Makemodule.am28
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067.c27
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_000_exp.pngbin30195 -> 49446 bytes
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_015_exp.pngbin34731 -> 100262 bytes
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_030_exp.pngbin36734 -> 124364 bytes
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_045_exp.pngbin36631 -> 134440 bytes
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_060_exp.pngbin36759 -> 124364 bytes
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_075_exp.pngbin34775 -> 100262 bytes
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_090_exp.pngbin30955 -> 49446 bytes
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_105_exp.pngbin35010 -> 100262 bytes
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_120_exp.pngbin36899 -> 124364 bytes
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_135_exp.pngbin37111 -> 134440 bytes
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_150_exp.pngbin36771 -> 124364 bytes
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_165_exp.pngbin34593 -> 100262 bytes
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_180_exp.pngbin30299 -> 49446 bytes
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/php_bug_64898.c30
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/php_bug_64898_exp.pngbin6363 -> 2371 bytes
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/remirh128.jpgbin10619 -> 0 bytes
-rw-r--r--Build/source/libs/gd/libgd-src/tests/gdimagerotate/remirh128.pngbin0 -> 49446 bytes
20 files changed, 51 insertions, 40 deletions
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/CMakeLists.txt b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/CMakeLists.txt
new file mode 100644
index 00000000000..fd8b4fa7b1b
--- /dev/null
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/CMakeLists.txt
@@ -0,0 +1,6 @@
+SET(TESTS_FILES
+ bug00067
+ php_bug_64898
+)
+
+ADD_GD_TESTS()
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/Makemodule.am b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/Makemodule.am
new file mode 100644
index 00000000000..696344bafb5
--- /dev/null
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/Makemodule.am
@@ -0,0 +1,28 @@
+if HAVE_LIBJPEG
+libgd_test_programs += \
+ gdimagerotate/bug00067
+endif
+
+if HAVE_LIBPNG
+libgd_test_programs += \
+ gdimagerotate/php_bug_64898
+endif
+
+EXTRA_DIST += \
+ gdimagerotate/CMakeLists.txt \
+ gdimagerotate/bug00067_000_exp.png \
+ gdimagerotate/bug00067_015_exp.png \
+ gdimagerotate/bug00067_030_exp.png \
+ gdimagerotate/bug00067_045_exp.png \
+ gdimagerotate/bug00067_060_exp.png \
+ gdimagerotate/bug00067_075_exp.png \
+ gdimagerotate/bug00067_090_exp.png \
+ gdimagerotate/bug00067_105_exp.png \
+ gdimagerotate/bug00067_120_exp.png \
+ gdimagerotate/bug00067_135_exp.png \
+ gdimagerotate/bug00067_150_exp.png \
+ gdimagerotate/bug00067_165_exp.png \
+ gdimagerotate/bug00067_180_exp.png \
+ gdimagerotate/php_bug_64898.png \
+ gdimagerotate/php_bug_64898_exp.png \
+ gdimagerotate/remirh128.png
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067.c b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067.c
index 4a6595988b9..add483d2d02 100644
--- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067.c
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067.c
@@ -7,33 +7,23 @@
int main()
{
gdImagePtr im, exp;
- char path[2048];
- const char *file_im = "gdimagerotate/remirh128.jpg";
- const char *file_exp = "gdimagerotate/bug00067";
+ char *path, filename[2048];
+ const char *file_im = "gdimagerotate/remirh128.png";
FILE *fp;
int color;
int error = 0;
int angle;
- sprintf(path, "%s/%s", GDTEST_TOP_DIR, file_im);
-
- fp = fopen(path, "rb");
-
- if (!fp) {
- gdTestErrorMsg("opening Jpeg %s for reading failed.\n", path);
- return 1;
- }
-
- im = gdImageCreateFromJpeg(fp);
-
+ fp = gdTestFileOpen(file_im);
+ im = gdImageCreateFromPng(fp);
fclose(fp);
if (!im) {
- gdTestErrorMsg("loading %s failed.\n", path);
+ gdTestErrorMsg("loading %s failed.\n", file_im);
return 1;
}
- color = gdImageColorAllocate(im, 0, 0, 0);
+ color = gdImageColorAllocateAlpha(im, 255, 255, 255, 127);
if (color < 0) {
gdTestErrorMsg("allocation color from image failed.\n");
@@ -51,12 +41,13 @@ int main()
return 1;
}
- sprintf(path, "%s/%s_%03d_exp.png", GDTEST_TOP_DIR, file_exp, angle);
-
+ sprintf(filename, "bug00067_%03d_exp.png", angle);
+ path = gdTestFilePath2("gdimagerotate", filename);
if (!gdAssertImageEqualsToFile(path, exp)) {
gdTestErrorMsg("comparing rotated image to %s failed.\n", path);
error += 1;
}
+ free(path);
gdImageDestroy(exp);
}
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_000_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_000_exp.png
index d06b5fe58fb..2db78821ab8 100644
--- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_000_exp.png
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_000_exp.png
Binary files differ
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_015_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_015_exp.png
index a0f8ce2efae..48bd53ab5d8 100644
--- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_015_exp.png
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_015_exp.png
Binary files differ
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_030_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_030_exp.png
index aad7f4ccb67..b56e1f1a159 100644
--- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_030_exp.png
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_030_exp.png
Binary files differ
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_045_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_045_exp.png
index 75916a51649..69385ed7114 100644
--- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_045_exp.png
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_045_exp.png
Binary files differ
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_060_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_060_exp.png
index f24364a062f..3dc07e54b6f 100644
--- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_060_exp.png
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_060_exp.png
Binary files differ
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_075_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_075_exp.png
index f8dcf449086..c38fdf478bf 100644
--- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_075_exp.png
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_075_exp.png
Binary files differ
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_090_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_090_exp.png
index a971447c7b2..3a85c2d4fe2 100644
--- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_090_exp.png
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_090_exp.png
Binary files differ
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_105_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_105_exp.png
index 2cf641d85a8..9a64cb71584 100644
--- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_105_exp.png
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_105_exp.png
Binary files differ
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_120_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_120_exp.png
index 1890f92545c..b8097ce8d32 100644
--- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_120_exp.png
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_120_exp.png
Binary files differ
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_135_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_135_exp.png
index 34ccb0aa054..e085e02bb8a 100644
--- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_135_exp.png
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_135_exp.png
Binary files differ
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_150_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_150_exp.png
index 330d030a7fa..b61bed7454b 100644
--- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_150_exp.png
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_150_exp.png
Binary files differ
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_165_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_165_exp.png
index df5b6400bc2..592bdea3b23 100644
--- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_165_exp.png
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_165_exp.png
Binary files differ
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_180_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_180_exp.png
index d4f65983615..65840b7b049 100644
--- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_180_exp.png
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/bug00067_180_exp.png
Binary files differ
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/php_bug_64898.c b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/php_bug_64898.c
index 9bbd98b5313..67f62a77cd7 100644
--- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/php_bug_64898.c
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/php_bug_64898.c
@@ -7,25 +7,15 @@
int main()
{
gdImagePtr im, exp;
- char path[2048];
- const char *file_im = "gdimagerotate/php_bug_64898.png";
- const char *file_exp = "gdimagerotate/php_bug_64898_exp.png";
FILE *fp;
- int color;
-
- sprintf(path, "%s/%s", GDTEST_TOP_DIR, file_im);
-
- fp = fopen(path, "rb");
-
- if (!fp) {
- gdTestErrorMsg("opening PNG %s for reading failed.\n", path);
- return 1;
- }
+ int error = 0;
+ fp = gdTestFileOpen("gdimagerotate/php_bug_64898.png");
+(void)fp;
im = gdImageCreateTrueColor(141, 200);
if (!im) {
- gdTestErrorMsg("loading %s failed.\n", path);
+ gdTestErrorMsg("loading failed.\n");
return 1;
}
@@ -42,17 +32,13 @@ int main()
return 1;
}
- sprintf(path, "%s/%s", GDTEST_TOP_DIR, file_exp);
-
- if (!gdAssertImageEqualsToFile(path, exp)) {
- printf("comparing rotated image to %s failed.\n", path);
- gdImageDestroy(im);
- gdImageDestroy(exp);
- return 1;
+ if (!gdAssertImageEqualsToFile("gdimagerotate/php_bug_64898_exp.png", exp)) {
+ gdTestErrorMsg("comparing rotated image failed.\n");
+ error = 1;
}
gdImageDestroy(exp);
gdImageDestroy(im);
- return 0;
+ return error;
}
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/php_bug_64898_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/php_bug_64898_exp.png
index a03bdb8e9d6..7ecaeb076b8 100644
--- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/php_bug_64898_exp.png
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/php_bug_64898_exp.png
Binary files differ
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/remirh128.jpg b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/remirh128.jpg
deleted file mode 100644
index bd5e3c77e3c..00000000000
--- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/remirh128.jpg
+++ /dev/null
Binary files differ
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/remirh128.png b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/remirh128.png
new file mode 100644
index 00000000000..2db78821ab8
--- /dev/null
+++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/remirh128.png
Binary files differ