diff options
Diffstat (limited to 'Build/source/libs/gd/libgd-src/tests/jpeg/bug00338.c')
-rw-r--r-- | Build/source/libs/gd/libgd-src/tests/jpeg/bug00338.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/Build/source/libs/gd/libgd-src/tests/jpeg/bug00338.c b/Build/source/libs/gd/libgd-src/tests/jpeg/bug00338.c index 15224d32b34..7874df28ed2 100644 --- a/Build/source/libs/gd/libgd-src/tests/jpeg/bug00338.c +++ b/Build/source/libs/gd/libgd-src/tests/jpeg/bug00338.c @@ -8,44 +8,39 @@ * See also ../png/bug00338.c */ - #include <string.h> #include "gd.h" #include "gd_errors.h" #include "gdtest.h" - #define MSG "gd-jpeg: JPEG library reports unrecoverable error: %s" - static int error_handler_called = 0; - static void error_handler(int priority, const char *format, va_list args) { - if (!strcmp(format, MSG)) { - gdTestAssertMsg(priority == GD_WARNING, "expected priority %d, but got %d", GD_WARNING, priority); - error_handler_called = 1; - } + if (!strcmp(format, MSG)) { + gdTestAssertMsg(priority == GD_WARNING, "expected priority %d, but got %d", GD_WARNING, priority); + error_handler_called = 1; + } } - int main() { - gdImagePtr im; - FILE *fp; + gdImagePtr im; + FILE *fp; - gdSetErrorMethod(error_handler); + gdSetErrorMethod(error_handler); - im = gdImageCreateTrueColor(10, 10); - fp = gdTestTempFp(); - gdImagePng(im, fp); - gdImageDestroy(im); + im = gdImageCreateTrueColor(10, 10); + fp = gdTestTempFp(); + gdImagePng(im, fp); + gdImageDestroy(im); - im = gdImageCreateFromJpeg(fp); - gdTestAssert(im == NULL); + im = gdImageCreateFromJpeg(fp); + gdTestAssert(im == NULL); - gdTestAssert(error_handler_called); + gdTestAssert(error_handler_called); - return gdNumFailures(); + return gdNumFailures(); } |