gdnametest.c (libgd-2.2.4) | : | gdnametest.c (libgd-2.2.5) | ||
---|---|---|---|---|
skipping to change at line 67 | skipping to change at line 67 | |||
{"img.png", 0, 0, 0}, | {"img.png", 0, 0, 0}, | |||
{"img.gif", 5, 1, 0}, // This seems to come from tc<->palette | {"img.gif", 5, 1, 0}, // This seems to come from tc<->palette | |||
{"img.GIF", 5, 1, 0}, // Test for case insensitivity | {"img.GIF", 5, 1, 0}, // Test for case insensitivity | |||
{"img.gd", 0, 1, 0}, | {"img.gd", 0, 1, 0}, | |||
{"img.gd2", 0, 0, 0}, | {"img.gd2", 0, 0, 0}, | |||
{"img.jpg", 25, 0, 0}, | {"img.jpg", 25, 0, 0}, | |||
{"img.jpeg", 25, 0, 0}, | {"img.jpeg", 25, 0, 0}, | |||
{"img.wbmp", 0, 1, 0}, | {"img.wbmp", 0, 1, 0}, | |||
{"img.bmp", 0, 1, 0}, | {"img.bmp", 0, 1, 0}, | |||
{"img-ref.xpm", 0, 0, 1}, | {"img-ref.xpm", 0, 0, 1}, | |||
{"img-ref.xbm", 0, 1, 1}, | ||||
// These break the test so I'm skipping them since the point | {"img-ref.tga", 0, 1, 1}, | |||
// of this test is not those loaders. | {"img.webp", 10, 1, 0}, | |||
{"img-ref.xbm", 0, -1, 1}, | {"img.tiff", 0, 1, 0}, | |||
{"img-ref.tga", 0, -1, 1}, | ||||
{"img.webp", 0, -1, 0}, | ||||
{"img.tiff", 0, -1, 0}, | ||||
{NULL, 0} | {NULL, 0} | |||
}; | }; | |||
for (n = 0; names[n].nm; n++) { | for (n = 0; names[n].nm; n++) { | |||
gdImagePtr orig, copy; | gdImagePtr orig, copy; | |||
int status; | int status; | |||
char *full_filename = NULL; | char *full_filename = NULL; | |||
unsigned int pixels; | ||||
/* Some image readers are buggy and crash the program so we | /* Some image readers are buggy and crash the program so we | |||
* skip them. Bug fixers should remove these from the list of | * skip them. Bug fixers should remove these from the list of | |||
* skipped items as bugs are fixed. */ | * skipped items as bugs are fixed. */ | |||
if (names[n].required < 0) { | if (names[n].required < 0) { | |||
printf("Skipping test for '%s'. FIX THIS!\n", names[n].nm); | printf("Skipping test for '%s'. FIX THIS!\n", names[n].nm); | |||
continue; | continue; | |||
}/* if */ | }/* if */ | |||
/* Skip this file if the current library build doesn't support | /* Skip this file if the current library build doesn't support | |||
* it. (If it's one of the built-in types, *that* a different | * it. (If it's one of the built-in types, *that* a different | |||
* problem; we assert that here.) */ | * problem; we assert that here.) */ | |||
if (!gdSupportsFileType(names[n].nm, 0)) { | if (!gdSupportsFileType(names[n].nm, 0)) { | |||
gdTestAssertMsg(!names[n].required, "GD doesn't support required fil e type: %s\n", full_filename); | gdTestAssertMsg(!names[n].required, "GD doesn't support required fil e type: %s\n", names[n].nm); | |||
continue; | continue; | |||
}/* if */ | }/* if */ | |||
orig = mkcross(); | orig = mkcross(); | |||
/* Write the image unless writing is not supported. */ | /* Write the image unless writing is not supported. */ | |||
if (!names[n].readonly) { | if (!names[n].readonly) { | |||
/* Prepend the test directory; this is expected to be run in | /* Prepend the test directory; this is expected to be run in | |||
* the parent dir. */ | * the parent dir. */ | |||
full_filename = gdTestTempFile(names[n].nm); | full_filename = gdTestTempFile(names[n].nm); | |||
skipping to change at line 118 | skipping to change at line 116 | |||
} else { | } else { | |||
/* Prepend the test directory; this is expected to be run in | /* Prepend the test directory; this is expected to be run in | |||
* the parent dir. */ | * the parent dir. */ | |||
full_filename = gdTestFilePath2("gdimagefile", names[n].nm); | full_filename = gdTestFilePath2("gdimagefile", names[n].nm); | |||
}/* if */ | }/* if */ | |||
copy = gdImageCreateFromFile(full_filename); | copy = gdImageCreateFromFile(full_filename); | |||
gdTestAssertMsg(!!copy, "Failed to load %s\n", full_filename); | gdTestAssertMsg(!!copy, "Failed to load %s\n", full_filename); | |||
if (!copy) continue; | if (!copy) continue; | |||
gdTestAssertMsg(gdMaxPixelDiff(orig, copy) <= names[n].maxdiff,"Pixels d | pixels = gdMaxPixelDiff(orig, copy); | |||
ifferent on %s\n", full_filename, full_filename); | gdTestAssertMsg(pixels <= names[n].maxdiff, "%u pixels different on %s\n | |||
", pixels, full_filename); | ||||
if (!names[n].readonly) { | if (!names[n].readonly) { | |||
status = remove(full_filename); | status = remove(full_filename); | |||
gdTestAssertMsg(status == 0, "Failed to delete %s\n", full_filename) ; | gdTestAssertMsg(status == 0, "Failed to delete %s\n", full_filename) ; | |||
}/* if */ | }/* if */ | |||
free(full_filename); | free(full_filename); | |||
gdImageDestroy(orig); | gdImageDestroy(orig); | |||
gdImageDestroy(copy); | gdImageDestroy(copy); | |||
}/* for */ | }/* for */ | |||
End of changes. 4 change blocks. | ||||
10 lines changed or deleted | 9 lines changed or added |