Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[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.
  • Loading branch information...
commit 8e25a61277218608be08874f159cf0a327fd6c0b 1 parent f573ff7
Glenn Randers-Pehrson authored
Showing with 40 additions and 7 deletions.
  1. +5 −2 ANNOUNCE
  2. +4 −1 CHANGES
  3. +22 −3 pngtest.c
  4. +9 −1 test-pngtest.sh
View
7 ANNOUNCE
@@ -1,5 +1,5 @@
-Libpng 1.5.6beta03 - September 26, 2011
+Libpng 1.5.6beta03 - September 27, 2011
This is not intended to be a public release. It will be replaced
within a few weeks by a public version or by another test version.
@@ -45,7 +45,10 @@ Version 1.5.6beta02 [Septhember 26, 2011]
once with a particular info_ptr.
Fixed a typo in the definition of the new PNG_STRING_FROM_CHUNK(s,c) macro.
-Version 1.5.6beta03 [September 26, 2011]
+Version 1.5.6beta03 [September 27, 2011]
+ 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.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
(subscription required; visit
View
5 CHANGES
@@ -3606,7 +3606,10 @@ Version 1.5.6beta02 [Septhember 26, 2011]
once with a particular info_ptr.
Fixed a typo in the definition of the new PNG_STRING_FROM_CHUNK(s,c) macro.
-Version 1.5.6beta03 [September 26, 2011]
+Version 1.5.6beta03 [September 27, 2011]
+ 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.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
View
25 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];
View
10 test-pngtest.sh
@@ -5,4 +5,12 @@ echo "Running tests. For details see pngtest-log.txt"
echo "============ pngtest pngtest.png ==============" > pngtest-log.txt
echo "Running test-pngtest.sh"
-./pngtest ${srcdir}/pngtest.png >> pngtest-log.txt 2>&1
+if ./pngtest --strict ${srcdir}/pngtest.png >> pngtest-log.txt 2>&1
+then
+ echo " PASS: pngtest --strict pngtest.png"
+ err=0
+else
+ echo " FAIL: pngtest --strict pngtest.png"
+ err=1
+fi
+exit $err
Please sign in to comment.
Something went wrong with that request. Please try again.