reflex2q3/ReflexToQ3/test/case-parser-face-3indices.sh

53 lines
2.9 KiB
Bash

# Test if the parser is correctly reading in faces with 3 indices.
# Map Versions as of : 4:26 PM 4/8/2017
# Answers are copied from the map file.
# The program is expected to output the same string as the answer.
# test-parser parameters
# 1. which parser to test
# 2. map file to use
# 3. line number to begin from
function test () {
if [ "$1" == "$2" ]; then
echo "test passed"
else
echo "test failed"
echo $2
fi
}
ansr1=" 0.000000 0.000000 1.000000 1.000000 0.000000 5 2 7 0xffffffff common/materials/metal/aluminum
0.000000 0.000000 1.000000 1.000000 0.000000 6 5 7 0xffffffff common/materials/metal/aluminum
0.000000 0.000000 1.000000 1.000000 0.000000 3 1 0 4 0xffffffff common/materials/metal/aluminum
0.000000 0.000000 1.000000 1.000000 0.000000 0 1 2 5 0xffffffff common/materials/metal/aluminum
0.000000 0.000000 1.000000 1.000000 0.000000 4 0 5 6 0xffffffff common/materials/metal/aluminum
0.000000 0.000000 1.000000 1.000000 0.000000 2 1 3 7 0xffffffff common/materials/metal/aluminum
0.000000 0.000000 1.000000 1.000000 0.000000 3 4 6 7 0xffffffff common/materials/metal/aluminum"
test1=$(./test-parser --face "maps/pocket-infinity.map" 142)
test $ansr1 $test1
ansr2=" 0.000000 0.000000 1.000000 1.000000 0.000000 2 0 4 0xffa5a5a5 common/materials/metal/p_metal3
0.000000 0.000000 1.000000 1.000000 0.000000 1 3 5 0xffa5a5a5 common/materials/metal/p_metal3
0.000000 0.000000 1.000000 1.000000 0.000000 0 3 1 4 0xffa5a5a5 common/materials/metal/p_metal3
0.000000 0.000000 1.000000 1.000000 0.000000 3 0 2 5 0xffa5a5a5 common/materials/metal/p_metal3
0.000000 0.000000 1.000000 1.000000 0.000000 2 4 1 5 0xffa5a5a5 common/materials/metal/p_metal3"
test2=$(./test-parser --face "maps/static-discharge.map" 1739)
test $ansr2 $test2
ansr3=" 0.000000 0.000000 1.000000 1.000000 0.000000 1 0 4 0xff727278 common/materials/stone/stone
0.000000 0.000000 1.000000 1.000000 0.000000 3 1 4 0xff727278 common/materials/stone/stone
0.000000 0.000000 1.000000 1.000000 0.000000 1 2 5 0xff727278 common/materials/stone/stone
0.000000 0.000000 1.000000 1.000000 0.000000 0 1 5 0xff727278 common/materials/stone/stone
0.000000 0.000000 1.000000 1.000000 0.000000 4 0 6 0xff727278 common/materials/stone/stone
0.000000 0.000000 1.000000 1.000000 0.000000 5 2 6 0xff727278 common/materials/stone/stone
0.000000 0.000000 1.000000 1.000000 0.000000 0 5 6 0xff727278 common/materials/stone/stone
0.000000 0.000000 1.000000 1.000000 0.000000 1 3 7 0xff727278 common/materials/stone/stone
0.000000 0.000000 1.000000 1.000000 0.000000 2 1 7 0xff727278 common/materials/stone/stone
0.000000 0.000000 1.000000 1.000000 0.000000 6 2 7 0xff727278 common/materials/stone/stone
0.000000 0.000000 1.000000 1.000000 0.000000 3 4 6 7 0xff727278 common/materials/stone/stone"
test3=$(./test-parser --face "maps/SkyTemples.map" 19354)
test $ansr3 $test3