[libpng16] tests backported from libpng 1.7

This updates libpng16 with all the test changes from libpng17,
including changes to pngvalid.c to ensure that the original,
distributed, version of contrib/visupng/cexcept.h can be used.

pngvalid contains the correction to the use of SAVE/STORE_
UNKNOWN_CHUNKS; a bug revealed by changes in libpng 1.7.  More
tests contain the --strict option to detect warnings and the
pngvalid-standard test has been corrected so that it does not
turn on progresive-read (there is a separate test which does
that.)

Some signed/unsigned fixes have been made.

Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
John Bowler
2015-09-15 15:38:52 -07:00
parent 1e16e8829d
commit c3e7e7d715
19 changed files with 687 additions and 467 deletions

View File

@@ -107,7 +107,7 @@ typedef struct chunk_insert
png_charp parameters[1];
} chunk_insert;
static int
static unsigned int
channels_of_type(int color_type)
{
if (color_type & PNG_COLOR_MASK_PALETTE)
@@ -128,7 +128,7 @@ channels_of_type(int color_type)
}
}
static int
static unsigned int
pixel_depth_of_type(int color_type, int bit_depth)
{
return channels_of_type(color_type) * bit_depth;
@@ -682,7 +682,11 @@ write_png(const char **name, FILE *fp, int color_type, int bit_depth,
png_set_filter(png_ptr, PNG_FILTER_TYPE_BASE, filters);
{
int passes = png_set_interlace_handling(png_ptr);
# ifdef PNG_WRITE_INTERLACING_SUPPORTED
int passes = png_set_interlace_handling(png_ptr);
# else /* !WRITE_INTERLACING */
int passes = 1;
# endif /* !WRITE_INTERLACING */
int pass;
png_size_t rowbytes = png_get_rowbytes(png_ptr, info_ptr);