Partially implement #220: replace all printf error messages with gdTestErrorMsg

master
Christoph M. Becker 2016-07-15 15:43:12 +02:00
parent e210ff1149
commit cea5c5aae0
3 changed files with 6 additions and 6 deletions

View File

@ -24,7 +24,7 @@ int main(int argc, char *argv[])
while (path[i] != NULL) {
fp = gdTestFileOpen2("gd2", path[i]);
if (!fp) {
printf("failed, cannot open file: %s\n", path[0]);
gdTestErrorMsg("failed, cannot open file: %s\n", path[0]);
return 1;
}
im = gdImageCreateFromGd2(fp);
@ -33,12 +33,12 @@ int main(int argc, char *argv[])
if (path_exp[i] != NULL) {
fp = gdTestFileOpen2("gd2", path_exp[i]);
if (!fp) {
printf("failed, cannot open file: %s\n", path_exp[i]);
gdTestErrorMsg("failed, cannot open file: %s\n", path_exp[i]);
return 1;
}
exp = gdImageCreateFromPng(fp);
if (!gdAssertImageEquals(exp, im)) {
printf("image %s differ from expected result\n", path[i]);
gdTestErrorMsg("image %s differs from expected result\n", path[i]);
gdImageDestroy(im);
error = 1;
} else {
@ -50,7 +50,7 @@ int main(int argc, char *argv[])
} else {
/* expected to fail */
if (im) {
printf("image %s should have failed to be loaded\n", path[i]);
gdTestErrorMsg("image %s should have failed to be loaded\n", path[i]);
gdImageDestroy(im);
error = 1;
} else {

View File

@ -12,7 +12,7 @@ int main(int argc, char *argv[])
fp = gdTestFileOpen2("gd2", "invalid_header.gd2");
if (!fp) {
printf("failed, cannot open file: %s\n", "invalid_header.gd2");
gdTestErrorMsg("failed, cannot open file: %s\n", "invalid_header.gd2");
return 1;
}
im = gdImageCreateFromGd2(fp);

View File

@ -53,7 +53,7 @@ int main()
}
for (j = 0; j < 8; j++) {
if (brect[j] != EXPECT[i][j]) {
printf("(%d, %d) (%d, %d) (%d, %d) (%d, %d) expected, but (%d, %d) (%d, %d) (%d, %d) (%d, %d)\n",
gdTestErrorMsg("(%d, %d) (%d, %d) (%d, %d) (%d, %d) expected, but (%d, %d) (%d, %d) (%d, %d) (%d, %d)\n",
EXPECT[i][0], EXPECT[i][1], EXPECT[i][2], EXPECT[i][3],
EXPECT[i][4], EXPECT[i][5], EXPECT[i][6], EXPECT[i][7],
brect[0], brect[1], brect[2], brect[3],