From cfef7f1bd84aa560452121ae8675742be43397f4 Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 15 Feb 2011 05:17:20 +0000 Subject: [PATCH] Ensure that the exit status of the program indicates failure if one of the pixel value checks fails git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.1.x@362 632fc199-4ca6-4c93-a231-07263d6284db --- jpegut.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/jpegut.c b/jpegut.c index 49ea18d..ef66f27 100644 --- a/jpegut.c +++ b/jpegut.c @@ -1,6 +1,6 @@ /* Copyright (C)2004 Landmark Graphics Corporation * Copyright (C)2005 Sun Microsystems, Inc. - * Copyright (C)2009-2010 D. R. Commander + * Copyright (C)2009-2011 D. R. Commander * * This library is free software and may be redistributed and/or modified under * the terms of the wxWindows Library License, Version 3.1 or (at your option) @@ -390,7 +390,7 @@ void gentestjpeg(tjhandle hnd, unsigned char *jpegbuf, unsigned long *size, if(yuv==YUVENCODE) { if(checkbufyuv(jpegbuf, *size, w, h, subsamp)) printf("Passed."); - else printf("FAILED!"); + else {printf("FAILED!"); exitstatus=-1;} } else printf("Done."); printf(" %f ms\n Result in %s\n", t*1000., tempstr); @@ -454,12 +454,16 @@ void gentestbmp(tjhandle hnd, unsigned char *jpegbuf, unsigned long jpegsize, { if(checkbufyuv(bmpbuf, size, pw, ph, subsamp)) printf("Passed."); - else printf("FAILED!"); + else {printf("FAILED!"); exitstatus=-1;} } else { if(checkbuf(bmpbuf, w, h, ps, subsamp, flags)) printf("Passed."); - else {printf("FAILED!"); dumpbuf(bmpbuf, w, h, ps, flags);} + else + { + printf("FAILED!"); exitstatus=-1; + dumpbuf(bmpbuf, w, h, ps, flags); + } } printf(" %f ms\n\n", t*1000.); -- 2.40.0