From e210ff1149e97b990900fd8165db15c3ab022d51 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 13 Jul 2016 04:44:04 +0200 Subject: [PATCH] Partially implement #220: tests: replace all printf error messages with gdTestErrorMsg --- tests/bmp/bmp_im2im.c | 10 ++--- tests/freetype/bug00132.c | 6 +-- tests/gd/gd_im2im.c | 10 ++--- tests/gd2/gd2_im2im.c | 10 ++--- .../gdimagecolorreplace/gdimagecolorreplace.c | 26 +++++------ tests/gdimagecopy/bug00081.c | 6 +-- tests/gdimagefilltoborder/bug00037.c | 2 +- tests/gdimageline/bug00111.c | 4 +- tests/gdimagepixelate/gdimagepixelate.c | 44 +++++++++---------- tests/gdimagerotate/php_bug_64898.c | 2 +- tests/gdimagescale/github_bug_00218.c | 2 +- tests/gdimagescatterex/bug00208_1.c | 8 ++-- tests/gdimagescatterex/bug00208_2.c | 8 ++-- tests/gif/gif_im2im.c | 10 ++--- tests/jpeg/jpeg_im2im.c | 8 ++-- tests/png/bug00086.c | 2 +- tests/png/png_im2im.c | 10 ++--- tests/tiff/tiff_dpi.c | 12 ++--- tests/tiff/tiff_im2im.c | 8 ++-- tests/wbmp/wbmp_im2im.c | 10 ++--- 20 files changed, 99 insertions(+), 99 deletions(-) diff --git a/tests/bmp/bmp_im2im.c b/tests/bmp/bmp_im2im.c index 00e2123..692588c 100644 --- a/tests/bmp/bmp_im2im.c +++ b/tests/bmp/bmp_im2im.c @@ -12,7 +12,7 @@ int main() src = gdImageCreate(100, 100); if (src == NULL) { - printf("could not create src\n"); + gdTestErrorMsg("could not create src\n"); return 1; } r = gdImageColorAllocate(src, 0xFF, 0, 0); @@ -32,26 +32,26 @@ int main() p = gdImageBmpPtr(src, &size, 1); if (p == NULL) { status = 1; - printf("p is null\n"); + gdTestErrorMsg("p is null\n"); goto door0; } if (size <= 0) { status = 1; - printf("size is non-positive\n"); + gdTestErrorMsg("size is non-positive\n"); goto door1; } dst = gdImageCreateFromBmpPtr(size, p); if (dst == NULL) { status = 1; - printf("could not create dst\n"); + gdTestErrorMsg("could not create dst\n"); goto door1; } OUTPUT_BMP(dst); gdTestImageDiff(src, dst, NULL, &result); if (result.pixels_changed > 0) { status = 1; - printf("pixels changed: %d\n", result.pixels_changed); + gdTestErrorMsg("pixels changed: %d\n", result.pixels_changed); } gdImageDestroy(dst); door1: diff --git a/tests/freetype/bug00132.c b/tests/freetype/bug00132.c index da0585e..ab1c394 100644 --- a/tests/freetype/bug00132.c +++ b/tests/freetype/bug00132.c @@ -16,7 +16,7 @@ int main() im = gdImageCreateTrueColor(50, 30); if (!im) { - printf("can't get truecolor image\n"); + gdTestErrorMsg("can't get truecolor image\n"); return 1; } @@ -28,11 +28,11 @@ int main() free(path); if (ret) { error = 1; - printf("%s\n", ret); + gdTestErrorMsg("%s\n", ret); } else { if (!gdAssertImageEqualsToFile("freetype/bug00132_exp.png", im)) { error = 1; - printf("Reference image and destination differ\n"); + gdTestErrorMsg("Reference image and destination differ\n"); } } gdImageDestroy(im); diff --git a/tests/gd/gd_im2im.c b/tests/gd/gd_im2im.c index 990605d..385e503 100644 --- a/tests/gd/gd_im2im.c +++ b/tests/gd/gd_im2im.c @@ -12,7 +12,7 @@ int main() src = gdImageCreate(100, 100); if (src == NULL) { - printf("could not create src\n"); + gdTestErrorMsg("could not create src\n"); return 1; } r = gdImageColorAllocate(src, 0xFF, 0, 0); @@ -32,26 +32,26 @@ int main() p = gdImageGdPtr(src, &size); if (p == NULL) { status = 1; - printf("p is null\n"); + gdTestErrorMsg("p is null\n"); goto door0; } if (size <= 0) { status = 1; - printf("size is non-positive\n"); + gdTestErrorMsg("size is non-positive\n"); goto door1; } dst = gdImageCreateFromGdPtr(size, p); if (dst == NULL) { status = 1; - printf("could not create dst\n"); + gdTestErrorMsg("could not create dst\n"); goto door1; } OUTPUT_GD(dst); gdTestImageDiff(src, dst, NULL, &result); if (result.pixels_changed > 0) { status = 1; - printf("pixels changed: %d\n", result.pixels_changed); + gdTestErrorMsg("pixels changed: %d\n", result.pixels_changed); } gdImageDestroy(dst); door1: diff --git a/tests/gd2/gd2_im2im.c b/tests/gd2/gd2_im2im.c index 72e99da..02a4420 100644 --- a/tests/gd2/gd2_im2im.c +++ b/tests/gd2/gd2_im2im.c @@ -12,7 +12,7 @@ int main() src = gdImageCreate(100, 100); if (src == NULL) { - printf("could not create src\n"); + gdTestErrorMsg("could not create src\n"); return 1; } r = gdImageColorAllocate(src, 0xFF, 0, 0); @@ -32,26 +32,26 @@ int main() p = gdImageGd2Ptr(src, (GD2_CHUNKSIZE_MIN+GD2_CHUNKSIZE_MAX)/2, GD2_FMT_COMPRESSED, &size); if (p == NULL) { status = 1; - printf("p is null\n"); + gdTestErrorMsg("p is null\n"); goto door0; } if (size <= 0) { status = 1; - printf("size is non-positive\n"); + gdTestErrorMsg("size is non-positive\n"); goto door1; } dst = gdImageCreateFromGd2Ptr(size, p); if (dst == NULL) { status = 1; - printf("could not create dst\n"); + gdTestErrorMsg("could not create dst\n"); goto door1; } OUTPUT_GD2(dst); gdTestImageDiff(src, dst, NULL, &result); if (result.pixels_changed > 0) { status = 1; - printf("pixels changed: %d\n", result.pixels_changed); + gdTestErrorMsg("pixels changed: %d\n", result.pixels_changed); } gdImageDestroy(dst); door1: diff --git a/tests/gdimagecolorreplace/gdimagecolorreplace.c b/tests/gdimagecolorreplace/gdimagecolorreplace.c index d4fe923..102a674 100644 --- a/tests/gdimagecolorreplace/gdimagecolorreplace.c +++ b/tests/gdimagecolorreplace/gdimagecolorreplace.c @@ -44,22 +44,22 @@ static void run_tests(gdImagePtr im, int *error) COLOR(yellow, 0xFF, 0xFF, 0); #undef COLOR -#define CHECK_VALUE(n, expected) do { \ - if (gdTestAssert((n) == (expected)) != 1) { \ - printf("%d is expected, but %d\n", expected, n); \ - *error = -1; \ - } \ +#define CHECK_VALUE(n, expected) do { \ + if (gdTestAssert((n) == (expected)) != 1) { \ + gdTestErrorMsg("%d is expected, but %d\n", expected, n);\ + *error = -1; \ + } \ } while (0) #define CHECK_PIXEL(x, y, expected) \ - do { \ - int pix; \ - gdImageSetClip(im, 0, 0, 4, 4); \ - pix = gdImageGetPixel(im, (x), (y)); \ - if (gdTestAssert(pix == (expected)) != 1) { \ - printf("%d is expected, but %d\n", expected, pix); \ - *error = -1; \ - } \ + do { \ + int pix; \ + gdImageSetClip(im, 0, 0, 4, 4); \ + pix = gdImageGetPixel(im, (x), (y)); \ + if (gdTestAssert(pix == (expected)) != 1) { \ + gdTestErrorMsg("%d is expected, but %d\n", expected, pix); \ + *error = -1; \ + } \ } while (0) c = gdImageColorAllocate(im, 0xFF, 0, 0xFF); diff --git a/tests/gdimagecopy/bug00081.c b/tests/gdimagecopy/bug00081.c index fb1740c..3fc4e6e 100644 --- a/tests/gdimagecopy/bug00081.c +++ b/tests/gdimagecopy/bug00081.c @@ -12,7 +12,7 @@ int main() im = gdImageCreateTrueColor(5, 5); if (!im) { - printf("can't create the src truecolor image\n"); + gdTestErrorMsg("can't create the src truecolor image\n"); return 1; } @@ -22,7 +22,7 @@ int main() im2 = gdImageCreateTrueColor(20, 20); if (!im2) { - printf("can't create the dst truecolor image\n"); + gdTestErrorMsg("can't create the dst truecolor image\n"); gdImageDestroy(im); return 1; } @@ -31,7 +31,7 @@ int main() if (!gdAssertImageEqualsToFile("gdimagecopy/bug00081_exp.png", im2)) { error = 1; - printf("Reference image and destination differ\n"); + gdTestErrorMsg("Reference image and destination differ\n"); } gdImageDestroy(im); diff --git a/tests/gdimagefilltoborder/bug00037.c b/tests/gdimagefilltoborder/bug00037.c index 646adbd..ab7e1b8 100644 --- a/tests/gdimagefilltoborder/bug00037.c +++ b/tests/gdimagefilltoborder/bug00037.c @@ -22,7 +22,7 @@ int main() if (gdTestAssert(color==0x1000000)) { return 0; } else { - printf("c: %X, expected %X\n", color, 0x1000000); + gdTestErrorMsg("c: %X, expected %X\n", color, 0x1000000); return -1; } diff --git a/tests/gdimageline/bug00111.c b/tests/gdimageline/bug00111.c index 0cf2d34..2a787f1 100644 --- a/tests/gdimageline/bug00111.c +++ b/tests/gdimageline/bug00111.c @@ -12,7 +12,7 @@ int main() im = gdImageCreateTrueColor(10, 10); if (!im) { - printf("can't get truecolor image\n"); + gdTestErrorMsg("can't get truecolor image\n"); return 1; } @@ -23,7 +23,7 @@ int main() if (!gdAssertImageEqualsToFile("gdimageline/bug00111_exp.png", im)) { error = 1; - printf("Reference image and destination differ\n"); + gdTestErrorMsg("Reference image and destination differ\n"); } gdImageDestroy(im); diff --git a/tests/gdimagepixelate/gdimagepixelate.c b/tests/gdimagepixelate/gdimagepixelate.c index 2a0a469..f8e6646 100644 --- a/tests/gdimagepixelate/gdimagepixelate.c +++ b/tests/gdimagepixelate/gdimagepixelate.c @@ -27,28 +27,28 @@ static const int expected_average[][3] = { } \ } while (0) -#define CHECK_PIXELS(im, expected) do { \ - int x, y; \ - for (y = 0; y < (im)->sy; y++) { \ - for (x = 0; x < (im)->sx; x++) { \ - int p = gdImageGetPixel(im, x, y); \ - int r = ((expected)[y/BLOCK_SIZE][x/BLOCK_SIZE]>>16)&0xFF; \ - int g = ((expected)[y/BLOCK_SIZE][x/BLOCK_SIZE]>> 8)&0xFF; \ - int b = ((expected)[y/BLOCK_SIZE][x/BLOCK_SIZE] )&0xFF; \ - if (r != gdImageRed(im, p)) { \ - printf("Red %x is expected, but %x\n", r, gdImageRed(im, p)); \ - return 0; \ - } \ - if (g != gdImageGreen(im, p)) { \ - printf("Green %x is expected, but %x\n", g, gdImageGreen(im, p)); \ - return 0; \ - } \ - if (b != gdImageBlue(im, p)) { \ - printf("Blue %x is expected, but %x\n", b, gdImageBlue(im, p)); \ - return 0; \ - } \ - } \ - } \ +#define CHECK_PIXELS(im, expected) do { \ + int x, y; \ + for (y = 0; y < (im)->sy; y++) { \ + for (x = 0; x < (im)->sx; x++) { \ + int p = gdImageGetPixel(im, x, y); \ + int r = ((expected)[y/BLOCK_SIZE][x/BLOCK_SIZE]>>16)&0xFF; \ + int g = ((expected)[y/BLOCK_SIZE][x/BLOCK_SIZE]>> 8)&0xFF; \ + int b = ((expected)[y/BLOCK_SIZE][x/BLOCK_SIZE] )&0xFF; \ + if (r != gdImageRed(im, p)) { \ + gdTestErrorMsg("Red %x is expected, but %x\n", r, gdImageRed(im, p)); \ + return 0; \ + } \ + if (g != gdImageGreen(im, p)) { \ + gdTestErrorMsg("Green %x is expected, but %x\n", g, gdImageGreen(im, p)); \ + return 0; \ + } \ + if (b != gdImageBlue(im, p)) { \ + gdTestErrorMsg("Blue %x is expected, but %x\n", b, gdImageBlue(im, p)); \ + return 0; \ + } \ + } \ + } \ } while (0) static int testPixelate(gdImagePtr im) diff --git a/tests/gdimagerotate/php_bug_64898.c b/tests/gdimagerotate/php_bug_64898.c index 6b723df..67f62a7 100644 --- a/tests/gdimagerotate/php_bug_64898.c +++ b/tests/gdimagerotate/php_bug_64898.c @@ -33,7 +33,7 @@ int main() } if (!gdAssertImageEqualsToFile("gdimagerotate/php_bug_64898_exp.png", exp)) { - printf("comparing rotated image failed.\n"); + gdTestErrorMsg("comparing rotated image failed.\n"); error = 1; } diff --git a/tests/gdimagescale/github_bug_00218.c b/tests/gdimagescale/github_bug_00218.c index dbbc860..a25793c 100644 --- a/tests/gdimagescale/github_bug_00218.c +++ b/tests/gdimagescale/github_bug_00218.c @@ -9,7 +9,7 @@ int main() im = gdImageCreate(5,5); dest = gdImageScale(im, 0, 1); if (dest != NULL) { - printf("expecting NULL result\n"); + gdTestErrorMsg("expecting NULL result\n"); status = 1; } else { status = 0; diff --git a/tests/gdimagescatterex/bug00208_1.c b/tests/gdimagescatterex/bug00208_1.c index 56fd2e2..3d02b2c 100644 --- a/tests/gdimagescatterex/bug00208_1.c +++ b/tests/gdimagescatterex/bug00208_1.c @@ -12,7 +12,7 @@ int main() im = gdImageCreateFromPng(fp); fclose(fp); if (!im) { - fprintf(stderr, "could not create image\n"); + gdTestErrorMsg("could not create image\n"); return 1; } @@ -22,7 +22,7 @@ int main() s.num_colors = 0; if (!gdImageScatterEx(im, &s)) { gdImageDestroy(im); - fprintf(stderr, "could not scatter\n"); + gdTestErrorMsg("could not scatter\n"); return 1; } @@ -30,7 +30,7 @@ int main() ex = gdImageCreateFromPng(fp); fclose(fp); if (!ex) { - fprintf(stderr, "could not create image\n"); + gdTestErrorMsg("could not create image\n"); gdImageDestroy(im); return 1; } @@ -39,7 +39,7 @@ int main() gdImageDestroy(ex); gdImageDestroy(im); if (r.pixels_changed > 10000) { - fprintf(stderr, "too much diff: %d\n", r.pixels_changed); + gdTestErrorMsg("too much diff: %d\n", r.pixels_changed); return 1; } return 0; diff --git a/tests/gdimagescatterex/bug00208_2.c b/tests/gdimagescatterex/bug00208_2.c index b376b10..58c1382 100644 --- a/tests/gdimagescatterex/bug00208_2.c +++ b/tests/gdimagescatterex/bug00208_2.c @@ -13,7 +13,7 @@ int main() im = gdImageCreateFromPng(fp); fclose(fp); if (!im) { - fprintf(stderr, "could not create image\n"); + gdTestErrorMsg("could not create image\n"); return 1; } @@ -24,7 +24,7 @@ int main() s.colors = colors; if (!gdImageScatterEx(im, &s)) { gdImageDestroy(im); - fprintf(stderr, "could not scatter\n"); + gdTestErrorMsg("could not scatter\n"); return 1; } @@ -32,7 +32,7 @@ int main() ex = gdImageCreateFromPng(fp); fclose(fp); if (!ex) { - fprintf(stderr, "could not create image\n"); + gdTestErrorMsg("could not create image\n"); gdImageDestroy(im); return 1; } @@ -41,7 +41,7 @@ int main() gdImageDestroy(ex); gdImageDestroy(im); if (r.pixels_changed > 10000) { - fprintf(stderr, "too much diff: %d\n", r.pixels_changed); + gdTestErrorMsg("too much diff: %d\n", r.pixels_changed); return 1; } return 0; diff --git a/tests/gif/gif_im2im.c b/tests/gif/gif_im2im.c index b66dddf..00bd137 100644 --- a/tests/gif/gif_im2im.c +++ b/tests/gif/gif_im2im.c @@ -12,7 +12,7 @@ int main() src = gdImageCreate(100, 100); if (src == NULL) { - printf("could not create src\n"); + gdTestErrorMsg("could not create src\n"); return 1; } r = gdImageColorAllocate(src, 0xFF, 0, 0); @@ -32,26 +32,26 @@ int main() p = gdImageGifPtr(src, &size); if (p == NULL) { status = 1; - printf("p is null\n"); + gdTestErrorMsg("p is null\n"); goto door0; } if (size <= 0) { status = 1; - printf("size is non-positive\n"); + gdTestErrorMsg("size is non-positive\n"); goto door1; } dst = gdImageCreateFromGifPtr(size, p); if (dst == NULL) { status = 1; - printf("could not create dst\n"); + gdTestErrorMsg("could not create dst\n"); goto door1; } OUTPUT_GIF(dst); gdTestImageDiff(src, dst, NULL, &result); if (result.pixels_changed > 0) { status = 1; - printf("pixels changed: %d\n", result.pixels_changed); + gdTestErrorMsg("pixels changed: %d\n", result.pixels_changed); } gdImageDestroy(dst); door1: diff --git a/tests/jpeg/jpeg_im2im.c b/tests/jpeg/jpeg_im2im.c index b361f4d..d66727f 100644 --- a/tests/jpeg/jpeg_im2im.c +++ b/tests/jpeg/jpeg_im2im.c @@ -14,7 +14,7 @@ int main() src = gdImageCreateTrueColor(100, 100); if (src == NULL) { - printf("could not create src\n"); + gdTestErrorMsg("could not create src\n"); return 1; } r = gdImageColorAllocate(src, 0xFF, 0, 0); @@ -34,19 +34,19 @@ int main() p = gdImageJpegPtr(src, &size, 100); if (p == NULL) { status = 1; - printf("p is null\n"); + gdTestErrorMsg("p is null\n"); goto door0; } if (size <= 0) { status = 1; - printf("size is non-positive\n"); + gdTestErrorMsg("size is non-positive\n"); goto door1; } dst = gdImageCreateFromJpegPtr(size, p); if (dst == NULL) { status = 1; - printf("could not create dst\n"); + gdTestErrorMsg("could not create dst\n"); goto door1; } OUTPUT_JPEG(dst); diff --git a/tests/png/bug00086.c b/tests/png/bug00086.c index ef9d43b..e01e799 100644 --- a/tests/png/bug00086.c +++ b/tests/png/bug00086.c @@ -17,7 +17,7 @@ int main(void) if ( ( im = gdImageCreateFromPngPtr(93, (char*) &pngdata[0]) ) == NULL) { return 0; } else { - fprintf(stderr, "failed!\n"); + gdTestErrorMsg("failed!\n"); gdImageDestroy(im); return 1; } diff --git a/tests/png/png_im2im.c b/tests/png/png_im2im.c index df6037d..e02d057 100644 --- a/tests/png/png_im2im.c +++ b/tests/png/png_im2im.c @@ -12,7 +12,7 @@ int main() src = gdImageCreate(100, 100); if (src == NULL) { - printf("could not create src\n"); + gdTestErrorMsg("could not create src\n"); return 1; } r = gdImageColorAllocate(src, 0xFF, 0, 0); @@ -32,26 +32,26 @@ int main() p = gdImagePngPtr(src, &size); if (p == NULL) { status = 1; - printf("p is null\n"); + gdTestErrorMsg("p is null\n"); goto door0; } if (size <= 0) { status = 1; - printf("size is non-positive\n"); + gdTestErrorMsg("size is non-positive\n"); goto door1; } dst = gdImageCreateFromPngPtr(size, p); if (dst == NULL) { status = 1; - printf("could not create dst\n"); + gdTestErrorMsg("could not create dst\n"); goto door1; } OUTPUT_PNG(dst); gdTestImageDiff(src, dst, NULL, &result); if (result.pixels_changed > 0) { status = 1; - printf("pixels changed: %d\n", result.pixels_changed); + gdTestErrorMsg("pixels changed: %d\n", result.pixels_changed); } gdImageDestroy(dst); door1: diff --git a/tests/tiff/tiff_dpi.c b/tests/tiff/tiff_dpi.c index cdffe6d..584ae68 100644 --- a/tests/tiff/tiff_dpi.c +++ b/tests/tiff/tiff_dpi.c @@ -16,7 +16,7 @@ int main() src = gdImageCreate(100, 100); if (src == NULL) { - printf("could not create src\n"); + gdTestErrorMsg("could not create src\n"); return 1; } r = gdImageColorAllocate(src, 0xFF, 0, 0); @@ -40,30 +40,30 @@ int main() p = gdImageTiffPtr(src, &size); if (p == NULL) { status = 1; - printf("p is null\n"); + gdTestErrorMsg("p is null\n"); goto door0; } if (size <= 0) { status = 1; - printf("size is non-positive\n"); + gdTestErrorMsg("size is non-positive\n"); goto door1; } dst = gdImageCreateFromTiffPtr(size, p); if (dst == NULL) { status = 1; - printf("could not create dst\n"); + gdTestErrorMsg("could not create dst\n"); goto door1; } if (dst->res_x != res_x) { status = 1; - printf("mismatch in res_x (got %d, expected %d)", dst->res_x, res_x); + gdTestErrorMsg("mismatch in res_x (got %d, expected %d)", dst->res_x, res_x); } if (dst->res_y != res_y) { status = 1; - printf("mismatch in res_y (got %d, expected %d)", dst->res_y, res_y); + gdTestErrorMsg("mismatch in res_y (got %d, expected %d)", dst->res_y, res_y); } gdImageDestroy(dst); diff --git a/tests/tiff/tiff_im2im.c b/tests/tiff/tiff_im2im.c index 2fc113d..31deafa 100644 --- a/tests/tiff/tiff_im2im.c +++ b/tests/tiff/tiff_im2im.c @@ -14,7 +14,7 @@ int main() src = gdImageCreate(100, 100); if (src == NULL) { - printf("could not create src\n"); + gdTestErrorMsg("could not create src\n"); return 1; } r = gdImageColorAllocate(src, 0xFF, 0, 0); @@ -34,19 +34,19 @@ int main() p = gdImageTiffPtr(src, &size); if (p == NULL) { status = 1; - printf("p is null\n"); + gdTestErrorMsg("p is null\n"); goto door0; } if (size <= 0) { status = 1; - printf("size is non-positive\n"); + gdTestErrorMsg("size is non-positive\n"); goto door1; } dst = gdImageCreateFromTiffPtr(size, p); if (dst == NULL) { status = 1; - printf("could not create dst\n"); + gdTestErrorMsg("could not create dst\n"); goto door1; } OUTPUT_TIFF(dst); diff --git a/tests/wbmp/wbmp_im2im.c b/tests/wbmp/wbmp_im2im.c index 597f602..1b1ebb2 100644 --- a/tests/wbmp/wbmp_im2im.c +++ b/tests/wbmp/wbmp_im2im.c @@ -12,7 +12,7 @@ int main() src = gdImageCreate(100, 100); if (src == NULL) { - printf("could not create src\n"); + gdTestErrorMsg("could not create src\n"); return 1; } gdImageColorAllocate(src, 0xFF, 0xFF, 0xFF); /* allocate white for background color */ @@ -30,26 +30,26 @@ int main() p = gdImageWBMPPtr(src, &size, 1); if (p == NULL) { status = 1; - printf("p is null\n"); + gdTestErrorMsg("p is null\n"); goto door0; } if (size <= 0) { status = 1; - printf("size is non-positive\n"); + gdTestErrorMsg("size is non-positive\n"); goto door1; } dst = gdImageCreateFromWBMPPtr(size, p); if (dst == NULL) { status = 1; - printf("could not create dst\n"); + gdTestErrorMsg("could not create dst\n"); goto door1; } OUTPUT_WBMP(dst); gdTestImageDiff(src, dst, NULL, &result); if (result.pixels_changed > 0) { status = 1; - printf("pixels changed: %d\n", result.pixels_changed); + gdTestErrorMsg("pixels changed: %d\n", result.pixels_changed); } gdImageDestroy(dst); door1: