diff options
Diffstat (limited to 'Build/source/libs/gd/libgd-src/tests/gdimagerotate')
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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 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 Binary files differindex 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 diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/remirh128.jpg b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/remirh128.jpg Binary files differdeleted file mode 100644 index bd5e3c77e3c..00000000000 --- a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/remirh128.jpg +++ /dev/null diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagerotate/remirh128.png b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/remirh128.png Binary files differnew file mode 100644 index 00000000000..2db78821ab8 --- /dev/null +++ b/Build/source/libs/gd/libgd-src/tests/gdimagerotate/remirh128.png |