summaryrefslogtreecommitdiff
path: root/pngtest.c
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2011-09-26 20:57:33 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2011-09-26 20:57:33 -0500
commit8e25a61277218608be08874f159cf0a327fd6c0b (patch)
treeb6ad7bfed6fb6001e6997cdc3f76532beb30508b /pngtest.c
parentf573ff7792f865574d9a656c0f3c054723ad6ab1 (diff)
downloadlibpng-8e25a61277218608be08874f159cf0a327fd6c0b.tar.gz
[libpng15]` Revised test-pngtest.sh to report FAIL when pngtest fails.
Added "--strict" option to pngtest, to report FAIL when the failure is only because the resulting valid files are different.
Diffstat (limited to 'pngtest.c')
-rw-r--r--pngtest.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/pngtest.c b/pngtest.c
index 56987771c..76fc9efa3 100644
--- a/pngtest.c
+++ b/pngtest.c
@@ -1,7 +1,7 @@
/* pngtest.c - a simple test program to test libpng
*
- * Last changed in libpng 1.5.4 [July 7, 2011]
+ * Last changed in libpng 1.5.6 [(PENDING RELEASE)]
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -98,6 +98,7 @@ static char tIME_string[PNG_tIME_STRING_LENGTH] = "tIME chunk is not present";
#endif
static int verbose = 0;
+static int strict = 0;
int test_one_file PNGARG((PNG_CONST char *inname, PNG_CONST char *outname));
@@ -1479,7 +1480,12 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
FCLOSE(fpin);
FCLOSE(fpout);
- return (0);
+
+ if (strict != 0)
+ return (1);
+
+ else
+ return (0);
}
if (!num_in)
@@ -1504,7 +1510,12 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
FCLOSE(fpin);
FCLOSE(fpout);
- return (0);
+
+ if (strict != 0)
+ return (1);
+
+ else
+ return (0);
}
}
@@ -1586,6 +1597,14 @@ main(int argc, char *argv[])
inname = argv[2];
}
+ else if (strcmp(argv[1], "--strict") == 0)
+ {
+ status_dots_requested = 0;
+ verbose = 1;
+ inname = argv[2];
+ strict++;
+ }
+
else
{
inname = argv[1];