From 1bb2bb3a211bef2bec575862f74ca9e9e865edc8 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 13 Jun 2024 11:22:55 +0100 Subject: [PATCH] Extend polyline tests --- test/data/polypoints.mvg | 12 ++++++++++++ test/data/polypoints.svg | 34 ++++++++++++++++++++++++++++++++++ test/runtest.sh | 14 ++++++++------ 3 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 test/data/polypoints.mvg create mode 100644 test/data/polypoints.svg diff --git a/test/data/polypoints.mvg b/test/data/polypoints.mvg new file mode 100644 index 0000000..6a80245 --- /dev/null +++ b/test/data/polypoints.mvg @@ -0,0 +1,12 @@ +viewbox 0 0 200 200 +fill none stroke #ff0000 stroke-width 1 path 'M 100 100 L 109 109 ' +fill none stroke #ff0000 stroke-width 1 path 'M 100 100 L 100 300 ' +fill none stroke #ff0000 stroke-width 1 path 'M -3.40282e+38 -3.40282e+38 L 3.40282e+38 3.40282e+38 ' +fill none stroke #008000 stroke-width 1 path 'M 100 109 L 109 100 ' +fill none stroke #008000 stroke-width 1 path 'M 100 100 L 112.346 112.346 ' +fill none stroke #0000ff stroke-width 1 path 'M 100 104.5 L 109 104.5 ' +fill none stroke #0000ff stroke-width 1 path 'M 0 0 L 0 200 ' +fill #000000 stroke #112233 stroke-width 1 path 'M 100 100 ' +fill #000000 stroke #090909 stroke-width 1 path 'M 100 100 ' +fill #000000 stroke #112233 stroke-width 1 path 'M 100 100 ' +fill #000000 stroke #112233 stroke-width 1 path 'M 100 100 ' diff --git a/test/data/polypoints.svg b/test/data/polypoints.svg new file mode 100644 index 0000000..9c83781 --- /dev/null +++ b/test/data/polypoints.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/runtest.sh b/test/runtest.sh index 708f84a..35dc17f 100755 --- a/test/runtest.sh +++ b/test/runtest.sh @@ -25,19 +25,21 @@ SVGTESTS="${SVGTESTS} test/ns-afl-svg/*.svg" svgdecode() { - OUTF=$(basename ${1} .svg) - CMPF=$(dirname ${1})/${OUTF}.mvg + LEAFNAME=$(basename ${1} .svg) # leaf name of the test file + CHECKNAME=$(dirname ${1})/${LEAFNAME}.mvg # name of comparison file + OUTNAME=${TEST_OUT}/${LEAFNAME}.mvg # name of the generated output file + echo "SVG:${1}" >> ${TEST_LOG} - ${TEST_PATH}/test_decode_svg ${1} 1.0 ${TEST_OUT}/${OUTF}.mvg 2>> ${TEST_LOG} + ${TEST_PATH}/test_decode_svg ${1} 1.0 ${OUTNAME} 2>> ${TEST_LOG} ECODE=$? - echo "Exit code:${ECODE}" >> ${TEST_LOG} if [ "${ECODE}" -gt 0 ];then + echo "Exit code:${ECODE}" >> ${TEST_LOG} return ${ECODE} fi - if [ -f "${CMPF}" ]; then - cmp ${CMPF} ${TEST_OUT}/${OUTF}.ppm >> ${TEST_LOG} 2>> ${TEST_LOG} + if [ -f "${CHECKNAME}" ]; then + cmp ${CHECKNAME} ${OUTNAME} >> ${TEST_LOG} 2>> ${TEST_LOG} if [ "$?" -ne 0 ]; then return 128 fi -- 2.49.0