mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng16] Moved bad pngs from tests to contrib/libtests/crashers
Moved testing of bad pngs into a separate tests/pngtest-badpngs script Added the --xfail (expected FAIL) option to pngtest.c. It writes XFAIL in the output but PASS for the libpng test.
This commit is contained in:
parent
2dca15686f
commit
207392821d
4
ANNOUNCE
4
ANNOUNCE
@ -72,6 +72,10 @@ Version 1.6.32beta09 [August 3, 2017]
|
|||||||
Version 1.6.32beta10 [August 4, 2017]
|
Version 1.6.32beta10 [August 4, 2017]
|
||||||
Moved chunk-length check into a png_check_chunk_length() private
|
Moved chunk-length check into a png_check_chunk_length() private
|
||||||
function (Suggested by Max Stepin).
|
function (Suggested by Max Stepin).
|
||||||
|
Moved bad pngs from tests to contrib/libtests/crashers
|
||||||
|
Moved testing of bad pngs into a separate tests/pngtest-badpngs script
|
||||||
|
Added the --xfail (expected FAIL) option to pngtest.c. It writes XFAIL
|
||||||
|
in the output but PASS for the libpng test.
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
4
CHANGES
4
CHANGES
@ -5955,6 +5955,10 @@ Version 1.6.32beta09 [August 3, 2017]
|
|||||||
Version 1.6.32beta10 [August 4, 2017]
|
Version 1.6.32beta10 [August 4, 2017]
|
||||||
Moved chunk-length check into a png_check_chunk_length() private
|
Moved chunk-length check into a png_check_chunk_length() private
|
||||||
function (Suggested by Max Stepin).
|
function (Suggested by Max Stepin).
|
||||||
|
Moved bad pngs from tests to contrib/libtests/crashers
|
||||||
|
Moved testing of bad pngs into a separate tests/pngtest-badpngs script
|
||||||
|
Added the --xfail (expected FAIL) option to pngtest.c. It writes XFAIL
|
||||||
|
in the output but PASS for the libpng test.
|
||||||
|
|
||||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||||
(subscription required; visit
|
(subscription required; visit
|
||||||
|
Before Width: | Height: | Size: 67 B After Width: | Height: | Size: 67 B |
Before Width: | Height: | Size: 67 B After Width: | Height: | Size: 67 B |
Before Width: | Height: | Size: 79 B After Width: | Height: | Size: 79 B |
20
pngtest.c
20
pngtest.c
@ -144,6 +144,7 @@ tIME_to_str(png_structp png_ptr, png_charp ts, png_const_timep t)
|
|||||||
static int verbose = 0;
|
static int verbose = 0;
|
||||||
static int strict = 0;
|
static int strict = 0;
|
||||||
static int relaxed = 0;
|
static int relaxed = 0;
|
||||||
|
static int xfail = 0;
|
||||||
static int unsupported_chunks = 0; /* chunk unsupported by libpng in input */
|
static int unsupported_chunks = 0; /* chunk unsupported by libpng in input */
|
||||||
static int error_count = 0; /* count calls to png_error */
|
static int error_count = 0; /* count calls to png_error */
|
||||||
static int warning_count = 0; /* count calls to png_warning */
|
static int warning_count = 0; /* count calls to png_warning */
|
||||||
@ -1897,6 +1898,15 @@ main(int argc, char *argv[])
|
|||||||
strict = 0;
|
strict = 0;
|
||||||
relaxed++;
|
relaxed++;
|
||||||
}
|
}
|
||||||
|
else if (strcmp(argv[1], "--xfail") == 0)
|
||||||
|
{
|
||||||
|
status_dots_requested = 0;
|
||||||
|
verbose = 1;
|
||||||
|
inname = argv[2];
|
||||||
|
strict = 0;
|
||||||
|
xfail++;
|
||||||
|
relaxed++;
|
||||||
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1951,11 +1961,16 @@ main(int argc, char *argv[])
|
|||||||
#endif /* TIME_RFC1123 */
|
#endif /* TIME_RFC1123 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (xfail)
|
||||||
|
fprintf(STDERR, " XFAIL\n");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fprintf(STDERR, " FAIL\n");
|
fprintf(STDERR, " FAIL\n");
|
||||||
ierror += kerror;
|
ierror += kerror;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
|
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
|
||||||
if (allocation_now != current_allocation)
|
if (allocation_now != current_allocation)
|
||||||
fprintf(STDERR, "MEMORY ERROR: %d bytes lost\n",
|
fprintf(STDERR, "MEMORY ERROR: %d bytes lost\n",
|
||||||
@ -2042,9 +2057,14 @@ main(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (xfail)
|
||||||
|
fprintf(STDERR, " XFAIL\n");
|
||||||
|
else
|
||||||
|
{
|
||||||
fprintf(STDERR, " FAIL\n");
|
fprintf(STDERR, " FAIL\n");
|
||||||
ierror += kerror;
|
ierror += kerror;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
|
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
|
||||||
if (allocation_now != current_allocation)
|
if (allocation_now != current_allocation)
|
||||||
fprintf(STDERR, "MEMORY ERROR: %d bytes lost\n",
|
fprintf(STDERR, "MEMORY ERROR: %d bytes lost\n",
|
||||||
|
9
tests/pngtest-badpngs
Executable file
9
tests/pngtest-badpngs
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# various crashers
|
||||||
|
# using --relaxed because some come from fuzzers that don't maintain CRC's
|
||||||
|
|
||||||
|
./pngtest --relaxed ${srcdir}/contrib/testpngs/crashers/badcrc.png
|
||||||
|
./pngtest --relaxed ${srcdir}/contrib/testpngs/crashers/badadler.png
|
||||||
|
|
||||||
|
exec ./pngtest --xfail ${srcdir}/contrib/testpngs/crashers/huge_idat.png
|
Loading…
x
Reference in New Issue
Block a user