diff --git a/ReflexToQ3/test/case-parser-face-3indices.sh b/ReflexToQ3/test/case-parser-face-3indices.sh deleted file mode 100644 index f0c99bb..0000000 --- a/ReflexToQ3/test/case-parser-face-3indices.sh +++ /dev/null @@ -1,52 +0,0 @@ - -# 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 diff --git a/ReflexToQ3/test/cases-parser-faces.sh b/ReflexToQ3/test/cases-parser-faces.sh new file mode 100644 index 0000000..1fd0a77 --- /dev/null +++ b/ReflexToQ3/test/cases-parser-faces.sh @@ -0,0 +1,22 @@ + +# Test if the parser is correctly reading in faces with 3 indices. +# Map Versions as of : 4:26 PM 4/8/2017 + +function test () { + if [ "$1" == "$2" ]; then + echo "test passed" + else + echo "test failed" + echo $2 + fi +} + +# test parser will read in the data and output it in the same format. +dir="cases" +for each in "$dir"/* + do + echo "$each" + ansr=$(cat $each) + test=$(./test-parser --face $each 0) + test $ansr $test +done diff --git a/ReflexToQ3/test/cases/parser-face-3indices-0.txt b/ReflexToQ3/test/cases/parser-face-3indices-0.txt new file mode 100644 index 0000000..12dfa18 --- /dev/null +++ b/ReflexToQ3/test/cases/parser-face-3indices-0.txt @@ -0,0 +1,7 @@ + 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" \ No newline at end of file diff --git a/ReflexToQ3/test/cases/parser-face-3indices-1.txt b/ReflexToQ3/test/cases/parser-face-3indices-1.txt new file mode 100644 index 0000000..11fd47d --- /dev/null +++ b/ReflexToQ3/test/cases/parser-face-3indices-1.txt @@ -0,0 +1,5 @@ + 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 \ No newline at end of file diff --git a/ReflexToQ3/test/cases/parser-face-3indices-2.txt b/ReflexToQ3/test/cases/parser-face-3indices-2.txt new file mode 100644 index 0000000..b86a57c --- /dev/null +++ b/ReflexToQ3/test/cases/parser-face-3indices-2.txt @@ -0,0 +1,11 @@ + 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" \ No newline at end of file diff --git a/ReflexToQ3/test/cases/parser-face-5indices-0.txt b/ReflexToQ3/test/cases/parser-face-5indices-0.txt new file mode 100644 index 0000000..c507c0c --- /dev/null +++ b/ReflexToQ3/test/cases/parser-face-5indices-0.txt @@ -0,0 +1,8 @@ + 0.000000 0.000000 1.000000 1.000000 0.000000 1 2 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 0 3 4 0xff727278 common/materials/stone/stone + 0.000000 0.000000 1.000000 1.000000 0.000000 4 2 5 0xff727278 common/materials/stone/stone + 0.000000 0.000000 1.000000 1.000000 0.000000 0 4 6 0xff727278 common/materials/stone/stone + 0.000000 0.000000 1.000000 1.000000 0.000000 4 5 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 6 2 1 3 0xff727278 common/materials/stone/stone \ No newline at end of file diff --git a/ReflexToQ3/test/cases/parser-face-5indices-1.txt b/ReflexToQ3/test/cases/parser-face-5indices-1.txt new file mode 100644 index 0000000..df6b30a --- /dev/null +++ b/ReflexToQ3/test/cases/parser-face-5indices-1.txt @@ -0,0 +1,8 @@ + 0.000000 0.000000 1.000000 1.000000 0.000000 1 0 3 0xff727278 common/materials/stone/stone + 0.000000 0.000000 1.000000 1.000000 0.000000 3 0 6 0xff727278 common/materials/stone/stone + 0.000000 0.000000 1.000000 1.000000 0.000000 0 4 7 0xff727278 common/materials/stone/stone + 0.000000 0.000000 1.000000 1.000000 0.000000 3 6 7 0xff727278 common/materials/stone/stone + 0.000000 0.000000 1.000000 1.000000 0.000000 6 0 7 0xff727278 common/materials/stone/stone + 0.000000 0.000000 1.000000 1.000000 0.000000 0 1 2 4 0xff727278 common/materials/stone/stone + 0.000000 0.000000 1.000000 1.000000 0.000000 2 1 3 7 0xff727278 common/materials/stone/stone + 0.000000 0.000000 1.000000 1.000000 0.000000 2 7 5 7 4 0xff727278 common/materials/stone/stone \ No newline at end of file diff --git a/ReflexToQ3/test/cases/parser-face-nomaterial-0.txt b/ReflexToQ3/test/cases/parser-face-nomaterial-0.txt new file mode 100644 index 0000000..aba18b3 --- /dev/null +++ b/ReflexToQ3/test/cases/parser-face-nomaterial-0.txt @@ -0,0 +1,6 @@ + 0.000000 0.000000 1.000000 1.000000 0.000000 0 1 2 3 0x00000000 + 0.000000 0.000000 1.000000 1.000000 0.000000 6 5 4 7 0x00000000 + 0.000000 0.000000 1.000000 1.000000 0.000000 2 1 5 6 0x00000000 + 0.000000 0.000000 1.000000 1.000000 0.000000 0 3 7 4 0x00000000 + 0.000000 0.000000 1.000000 1.000000 0.000000 3 2 6 7 0x00000000 + 0.000000 0.000000 1.000000 1.000000 0.000000 1 0 4 5 0x00000000 \ No newline at end of file