summaryrefslogtreecommitdiff
path: root/tests/gd2
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2016-07-21 20:03:33 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2016-07-21 21:00:17 +0200
commite86d8a66777b8c51de42de156b96a506835b2fcd (patch)
treefdc8a87e467aaf34dbe64c33e27935613ed6bc95 /tests/gd2
parent4cd4a9b4c457259596669e8a3a279e02799baff5 (diff)
downloadlibgd-e86d8a66777b8c51de42de156b96a506835b2fcd.tar.gz
Remove the huge test file, generate it on the fly instead
Diffstat (limited to 'tests/gd2')
-rw-r--r--tests/gd2/Makemodule.am3
-rw-r--r--tests/gd2/php_bug_72339.c31
-rw-r--r--tests/gd2/php_bug_72339_exp.gd2bin67108882 -> 0 bytes
3 files changed, 24 insertions, 10 deletions
diff --git a/tests/gd2/Makemodule.am b/tests/gd2/Makemodule.am
index 4c01990..754a284 100644
--- a/tests/gd2/Makemodule.am
+++ b/tests/gd2/Makemodule.am
@@ -21,5 +21,4 @@ EXTRA_DIST += \
gd2/conv_test_exp.png \
gd2/empty.gd2 \
gd2/invalid_header.gd2 \
- gd2/invalid_neg_size.gd2 \
- gd2/php_bug_72339_exp.gd2
+ gd2/invalid_neg_size.gd2
diff --git a/tests/gd2/php_bug_72339.c b/tests/gd2/php_bug_72339.c
index ef3ed62..7ce6028 100644
--- a/tests/gd2/php_bug_72339.c
+++ b/tests/gd2/php_bug_72339.c
@@ -8,14 +8,29 @@ int main()
{
gdImagePtr im;
FILE *fp;
-
- fp = gdTestFileOpen2("gd2", "php_bug_72339_exp.gd2");
- im = gdImageCreateFromGd2(fp);
- if (im == NULL) {
- return 0;
- } else {
- gdTestErrorMsg("Image should have failed to be loaded\n");
- return 1;
+ int i;
+ const char header[] = {
+ 0x00, 0x02,
+ 0x00, 0x01,
+ 0x00, 0x01,
+ 0x00, 0x40,
+ 0x00, 0x02,
+ 0x54, 0xA0,
+ 0x5B, 0x00
+ };
+
+ /* we're creating the test image dynamically, due to its size */
+ fp = gdTestTempFp();
+ fwrite(header, sizeof(header[0]), sizeof(header), fp);
+ for (i = 0; i < 0x4000000; i++) {
+ fputc(0x41, fp);
}
+ rewind(fp);
+
+ im = gdImageCreateFromGd2(fp);
+ fclose(fp);
+
+ gdTestAssertMsg(im == NULL, "Image should have failed to be loaded\n");
+ return gdNumFailures();
}
diff --git a/tests/gd2/php_bug_72339_exp.gd2 b/tests/gd2/php_bug_72339_exp.gd2
deleted file mode 100644
index 39ed227..0000000
--- a/tests/gd2/php_bug_72339_exp.gd2
+++ /dev/null
Binary files differ