mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00

png_handle_unknown() when SAVE support is absent. Moved the shell test scripts for contrib/libtests from the libpng top directory to contrib/libtests. png_handle_unknown() must always read or skip the chunk, if SAVE_UNKNOWN_CHUNKS is turned off *and* the application does not set a user callback an unknown chunk will not be read, leading to a read error, which was revealed by the "tunknown" test.
39 lines
774 B
Bash
Executable File
39 lines
774 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Run the unknown API tests
|
|
err=0
|
|
image="${srcdir}/pngtest.png"
|
|
#
|
|
# stream 4 is used for the output of the shell, pngtest-log.txt gets all the
|
|
# normal program output.
|
|
exec 4>&1 1>>pngtest-log.txt 2>&1
|
|
|
|
echo
|
|
echo "============ test-unknown.sh =============="
|
|
|
|
echo "Running test-unknown.sh" >&4
|
|
|
|
for tests in \
|
|
"discard default=discard"\
|
|
"save default=save"\
|
|
"if-safe default=if-safe"\
|
|
"vpAg vpAg=if-safe"\
|
|
"sTER sTER=if-safe"\
|
|
"IDAT default=discard IDAT=save"\
|
|
"sAPI bKGD=save cHRM=save gAMA=save all=discard iCCP=save sBIT=save sRGB=save"
|
|
do
|
|
set $tests
|
|
test="$1"
|
|
shift
|
|
|
|
if ./tunknown "$@" "$image" 4>&-
|
|
then
|
|
echo " PASS: test-unknown $test" >&4
|
|
else
|
|
echo " FAIL: test-unknown $test" >&4
|
|
err=1
|
|
fi
|
|
done
|
|
|
|
exit $err
|