Add more tests

This commit is contained in:
Arne Keller 2020-02-17 09:46:00 +01:00
parent 2746b9e7cf
commit 4d23894509
5 changed files with 115 additions and 0 deletions

34
fuzz10_input.txt Normal file
View File

@ -0,0 +1,34 @@
add track (1,1) -> (5,1)
add switch (5,1) -> (8,1),(5,3)
add track (10,1) -> (8,1)
add switch (10,-3) -> (10,1),(12,-3)
add track (10,-3) -> (1,-3)
add track (5,3) -> (10,3)
add track (10,3) -> (12,3)
add switch (12,3) -> (12,-3),(14,3)
add track (14,-1) -> (14,3)
create engine steam T3 Emma 1 false true
create engine electrical 103 118 3 true true
delete rolling stock 3
delete rolling stock 103-118
create coach passenger 1 true true
add train 1 W1
delete train 1
add train 1 T3-Emma
add train 1 W2
create train-set 403 145 4 true true
add train 2 403-145
set switch 4 position (10,1)
set switch 2 position (8,1)
set switch 8 position (12,-3)
step 1
put train 1 at (1,1) in direction 1,0
put train 2 at (10,-2) in direction 0,1
step 2
step -2
step 2
step 4
step 1
# Beim Aufgleisen ist zu beachten, dass der Richtungsvektor der Richtung des Gleises beim Aufgleispunkt entspricht (oder dem entgegengesetzten).
put train 1 at (1,1) in direction 0,-1
exit

32
fuzz10_output.txt Normal file
View File

@ -0,0 +1,32 @@
1
2
3
4
5
6
7
8
9
T3-Emma
103-118
Error, could not delete rolling stock
OK
1
passenger coach W1 added to train 1
OK
steam engine T3-Emma added to train 1
Error, could not modify train
403-145
train-set 403-145 added to train 2
OK
OK
OK
OK
Error, could not place train
OK
Train 2 at (10,0)
Train 2 at (10,-2)
Train 2 at (10,0)
Train 2 at (7,1)
Train 2 at (6,1)
Error, could not place train

20
fuzz11_input.txt Normal file
View File

@ -0,0 +1,20 @@
add track (0,0) -> (0,14)
create engine diesel T3 Sabine 1 false true
add train 1 T3-Sabine
put train 1 at (0,0) in direction 0,-1
add track (0,0) -> (2,0)
add track (2,0) -> (2,2)
add track (2,2) -> (0,2)
create engine diesel T3 Emma 1 false true
create coach passenger 2 true true
create coach passenger 3 true true
create coach passenger 2 true false
add train 1 T3-Emma
add train 1 W2
put train 1 at (0,0) in direction 1,0
step 64
delete track 1
delete track 2
delete track 3
delete track 4
exit

19
fuzz11_output.txt Normal file
View File

@ -0,0 +1,19 @@
1
T3-Sabine
diesel engine T3-Sabine added to train 1
OK
2
3
4
T3-Emma
1
2
3
Error, could not modify train
Error, could not modify train
Error, could not place train
Crash of train 1
OK
OK
OK
OK

View File

@ -73,6 +73,16 @@ class MainTest {
cmpInOut("fuzz8_input.txt", "fuzz8_output.txt");
}
@Test
void fuzz10() throws IOException {
cmpInOut("fuzz10_input.txt", "fuzz10_output.txt");
}
@Test
void fuzz11() throws IOException {
cmpInOut("fuzz11_input.txt", "fuzz11_output.txt");
}
private void cmpInOut(String in, String out) throws IOException {
System.setIn(new ByteArrayInputStream(readFile(in)));
ByteArrayOutputStream output = new ByteArrayOutputStream();