tests/bridgefall: New; exercising splashing of bridges

Stuff sitting on bridges isn't covered, yet.  tests/fire has some.  To
be moved here eventually.

The test exposes bugs.  They're marked "BUG:" in the test input.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2014-01-16 21:59:41 +01:00
parent 964f55794c
commit 21b8add73e
10 changed files with 5621 additions and 0 deletions

View file

@ -0,0 +1,26 @@
|| loss of support, EASY_BRIDGES off
| regesignate head
| span 3,1 falls because its only support is gone
| the other spans still have support
desi 1,1 -
| trigger a bulletin as a separator
fire se 2,0 8,2
| now span 2,2 falls, because both its heads are gone
desi 3,3 -
desi 1,1 #
| head damaged below 20%
| span 1,3 falls, because its other head is redesignated
fire se 2,0 -1,3
| tower falls
| span -2,2 falls, because its other head is damaged
| BUG: doesn't fall now, falls on its next write
fire se 2,0 -3,1
| trigger a bulletin as a separator
fire se 2,0 8,2
| head damaged
| span -1,-1 falls, because its only support is gone
| span 0,2 falls, because its other head is damaged
| BUG: doesn't fall
fire se 2,0 1,1
| trigger a bulletin as a separator
fire se 2,0 8,2

View file

@ -0,0 +1,5 @@
map *
cens * ?terr=1
terr * 0
read 1
read 2

View file

@ -0,0 +1,13 @@
|| damage span
| span stands
fire se 2,0 3,-1
| span falls
fire se 2,0 -1,-1
| own span falls
fire se 2,0 0,-2
|| damage tower, loss of support, EASY_BRIDGES on
| tower stands, and supports span
fire se 2,0 6,0
| tower falls, span 3,-3 falls
| BUG: doesn't fall
fire se 2,0 1,-3

View file

@ -0,0 +1 @@
map *

5195
tests/bridgefall/final.xdump Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,269 @@
Main startup
Main prng MT19937 1
Conn0 output Conn0 2 Empire server ready
Conn0 input user tester
Conn0 output Conn0 0 hello tester
Conn0 input coun red
Conn0 output Conn0 10 country red does not exist
Conn0 output Conn0 3 so long...
Conn1 output Conn1 2 Empire server ready
Conn1 input user tester
Conn1 output Conn1 0 hello tester
Conn1 input coun 1
Conn1 output Conn1 0 country name 1
Conn1 input pass 1
Conn1 output Conn1 0 password ok
Conn1 input play
Conn1 login 1 127.0.0.1 tester
Play#1 output Play#1 2 2
Play#1 output Play#1 1
Play#1 output Play#1 1 *** Server configured for testing ***
Play#1 output Play#1 1 *** If you see this in a game, it is misconfigured! ***
Play#1 output Play#1 6 0 640
Play#1 input fire se 2,0 3,-1
Play#1 command fire
Play#1 output Play#1 1 Sector 2,0 ready to fire
Play#1 output Play#1 1 range is 4.00 (4.50)
Play#1 output Play#1 1 \007Kaboom!!!
Play#1 output Play#1 1 Shells hit sector 3,-1 for 25 damage.
Play#1 output Play#1 6 0 639
Play#1 input fire se 2,0 -1,-1
Play#1 command fire
Play#1 output Play#1 1 Sector 2,0 ready to fire
Play#1 output Play#1 1 range is 5.00 (4.50)
Play#1 output Play#1 1 \007Kaboom!!!
Play#1 output Play#1 1 Shells hit sector -1,-1 for 28 damage.
Play#1 output Play#1 6 0 638
Play#1 input fire se 2,0 0,-2
Play#1 command fire
Play#1 output Play#1 1 Sector 2,0 ready to fire
Play#1 output Play#1 1 range is 5.00 (4.50)
Play#1 output Play#1 1 \007Kaboom!!!
Play#1 output Play#1 1 Shells hit sector 0,-2 for 30 damage.
Play#1 output Play#1 1 Crumble... SCREEEECH! Splash! Bridge falls at 0,-2!
Play#1 output Play#1 6 0 637
Play#1 input fire se 2,0 6,0
Play#1 command fire
Play#1 output Play#1 1 Sector 2,0 ready to fire
Play#1 output Play#1 1 range is 4.00 (4.50)
Play#1 output Play#1 1 \007Kaboom!!!
Play#1 output Play#1 1 Shells hit sector 6,0 for 46 damage.
Play#1 output Play#1 6 0 636
Play#1 input fire se 2,0 1,-3
Play#1 command fire
Play#1 output Play#1 1 Sector 2,0 ready to fire
Play#1 output Play#1 1 range is 5.00 (4.50)
Play#1 output Play#1 1 \007Kaboom!!!
Play#1 output Play#1 1 Shells hit sector 1,-3 for 23 damage.
Play#1 output Play#1 6 0 635
Play#1 input ctld
Play#1 output Play#1 1 Bye-bye
Play#1 logout 1
Play#1 output Play#1 3 so long...
Conn2 output Conn2 2 Empire server ready
Conn2 input user tester
Conn2 output Conn2 0 hello tester
Conn2 input coun POGO
Conn2 output Conn2 0 country name POGO
Conn2 input pass peter
Conn2 output Conn2 0 password ok
Conn2 input play
Conn2 login 0 127.0.0.1 tester
Play#0 output Play#0 2 2
Play#0 output Play#0 1
Play#0 output Play#0 1 *** Server configured for testing ***
Play#0 output Play#0 1 *** If you see this in a game, it is misconfigured! ***
Play#0 output Play#0 6 0 640
Play#0 input map *
Play#0 command map
Play#0 output Play#0 1 1---------0000000000
Play#0 output Play#0 1 09876543210123456789
Play#0 output Play#0 1 -5 . . . . . . + . . . -5
Play#0 output Play#0 1 -4 . . . . . . = . . . -4
Play#0 output Play#0 1 -3 . . . . . . = . . . -3
Play#0 output Play#0 1 -2 . . . . . . = . . . -2
Play#0 output Play#0 1 -1 . . . . . # = . . . -1
Play#0 output Play#0 1 0 . . . . . c f . @ = 0
Play#0 output Play#0 1 1 . . . @ = # = . . . 1
Play#0 output Play#0 1 2 . . . . = = = . . - 2
Play#0 output Play#0 1 3 . . . . # = # . . . 3
Play#0 output Play#0 1 4 . . . . . . . . . . 4
Play#0 output Play#0 1 1---------0000000000
Play#0 output Play#0 1 09876543210123456789
Play#0 output Play#0 6 0 640
Play#0 input ctld
Play#0 output Play#0 1 Bye-bye
Play#0 logout 0
Play#0 output Play#0 3 so long...
Main shutdown
Main startup
Main prng MT19937 1
Conn0 output Conn0 2 Empire server ready
Conn0 input user tester
Conn0 output Conn0 0 hello tester
Conn0 input coun red
Conn0 output Conn0 10 country red does not exist
Conn0 output Conn0 3 so long...
Conn1 output Conn1 2 Empire server ready
Conn1 input user tester
Conn1 output Conn1 0 hello tester
Conn1 input coun 1
Conn1 output Conn1 0 country name 1
Conn1 input pass 1
Conn1 output Conn1 0 password ok
Conn1 input play
Conn1 login 1 127.0.0.1 tester
Play#1 output Play#1 2 2
Play#1 output Play#1 1
Play#1 output Play#1 1 *** Server configured for testing ***
Play#1 output Play#1 1 *** If you see this in a game, it is misconfigured! ***
Play#1 output Play#1 6 0 635
Play#1 input desi 1,1 -
Play#1 command designate
Play#1 output Play#1 1 Crumble... SCREEEECH! Splash! Bridge falls at 3,1!
Play#1 output Play#1 6 0 634
Play#1 input fire se 2,0 8,2
Play#1 command fire
Play#1 output Play#1 1 Sector 2,0 ready to fire
Play#1 output Play#1 1 range is 5.00 (4.50)
Play#1 output Play#1 1 \007Kaboom!!!
Play#1 output Play#1 1 Shells hit sector 8,2 for 28 damage.
Play#1 output Play#1 6 0 633
Play#1 input desi 3,3 -
Play#1 command designate
Play#1 output Play#1 6 0 632
Play#1 input desi 1,1 #
Play#1 command designate
Play#1 output Play#1 6 0 631
Play#1 input fire se 2,0 -1,3
Play#1 command fire
Play#1 output Play#1 1 Sector 2,0 ready to fire
Play#1 output Play#1 1 range is 5.00 (4.50)
Play#1 output Play#1 1 \007Kaboom!!!
Play#1 output Play#1 1 Shells hit sector -1,3 for 23 damage.
Play#1 output Play#1 6 0 630
Play#1 input fire se 2,0 -3,1
Play#1 command fire
Play#1 output Play#1 1 Sector 2,0 ready to fire
Play#1 output Play#1 1 range is 4.00 (4.50)
Play#1 output Play#1 1 \007Kaboom!!!
Play#1 output Play#1 1 Shells hit sector -3,1 for 30 damage.
Play#1 output Play#1 6 0 629
Play#1 input fire se 2,0 8,2
Play#1 command fire
Play#1 output Play#1 1 Sector 2,0 ready to fire
Play#1 output Play#1 1 range is 5.00 (4.50)
Play#1 output Play#1 1 \007Kaboom!!!
Play#1 output Play#1 1 Shells hit sector 8,2 for 35 damage.
Play#1 output Play#1 6 0 628
Play#1 input fire se 2,0 1,1
Play#1 command fire
Play#1 output Play#1 1 Sector 2,0 ready to fire
Play#1 output Play#1 1 range is 5.00 (4.50)
Play#1 output Play#1 1 \007Kaboom!!!
Play#1 output Play#1 1 Shells hit sector 1,1 for 23 damage.
Play#1 output Play#1 6 0 627
Play#1 input fire se 2,0 8,2
Play#1 command fire
Play#1 output Play#1 1 Sector 2,0 ready to fire
Play#1 output Play#1 1 range is 4.00 (4.50)
Play#1 output Play#1 1 \007Kaboom!!!
Play#1 output Play#1 1 Shells hit sector 8,2 for 48 damage.
Play#1 output Play#1 6 0 626
Play#1 input ctld
Play#1 output Play#1 1 Bye-bye
Play#1 logout 1
Play#1 output Play#1 3 so long...
Conn2 output Conn2 2 Empire server ready
Conn2 input user tester
Conn2 output Conn2 0 hello tester
Conn2 input coun POGO
Conn2 output Conn2 0 country name POGO
Conn2 input pass peter
Conn2 output Conn2 0 password ok
Conn2 input play
Conn2 login 0 127.0.0.1 tester
Play#0 output Play#0 2 2
Play#0 output Play#0 1
Play#0 output Play#0 1 *** Server configured for testing ***
Play#0 output Play#0 1 *** If you see this in a game, it is misconfigured! ***
Play#0 output Play#0 6 0 640
Play#0 input map *
Play#0 command map
Play#0 output Play#0 1 1---------0000000000
Play#0 output Play#0 1 09876543210123456789
Play#0 output Play#0 1 -5 . . . . . . + . . . -5
Play#0 output Play#0 1 -4 . . . . . . = . . . -4
Play#0 output Play#0 1 -3 . . . . . . = . . . -3
Play#0 output Play#0 1 -2 . . . . . . = . . . -2
Play#0 output Play#0 1 -1 . . . . . # = . . . -1
Play#0 output Play#0 1 0 . . . . . c f . @ = 0
Play#0 output Play#0 1 1 . . . . . # . . . . 1
Play#0 output Play#0 1 2 . . . . = = . . . - 2
Play#0 output Play#0 1 3 . . . . # . # . . . 3
Play#0 output Play#0 1 4 . . . . . . . . . . 4
Play#0 output Play#0 1 1---------0000000000
Play#0 output Play#0 1 09876543210123456789
Play#0 output Play#0 6 0 640
Play#0 input cens * ?terr=1
Play#0 command census
Play#0 output Play#0 1 Thu Jan 1 00:00:00 1970
Play#0 output Play#0 1 CENSUS del dst
Play#0 output Play#0 1 own sect eff prd mob uf uf old civ mil uw food work avail fall coa
Play#0 output Play#0 1 2 2,-4 = 100% 0 .. .. 100 0 0 0 0% 0 0 1
Play#0 output Play#0 1 0 1,-3 . 0% 0 .. .. 0 0 0 0 0% 0 0 1
Play#0 output Play#0 1 2 3,-3 = 100% 0 .. .. 100 0 0 0 0% 0 0 1
Play#0 output Play#0 1 0 0,-2 . 0% 0 .. .. 0 0 0 0 0% 0 0 1
Play#0 output Play#0 1 2 2,-2 = 100% 0 .. .. 100 0 0 0 0% 0 0 1
Play#0 output Play#0 1 0 -1,-1 . 0% 0 .. .. 0 0 0 0 0% 0 0 1
Play#0 output Play#0 1 1 1,-1 # 20% 0 .. .. 100 0 0 0 0% 0 0 1
Play#0 output Play#0 1 2 3,-1 = 80% 0 .. .. 80 0 0 0 0% 0 0 1
Play#0 output Play#0 1 2 6,0 @ 77% 0 .. .. 77 0 0 0 0% 0 0 1
Play#0 output Play#0 1 2 8,0 = 100% 0 .. .. 100 0 0 0 0% 0 0 1
Play#0 output Play#0 1 0 -3,1 . 0% 0 .. .. 0 0 0 0 0% 0 0 1
Play#0 output Play#0 1 0 -1,1 . 0% 0 .. .. 0 0 0 0 0% 0 0 1
Play#0 output Play#0 1 1 1,1 # 17% 0 .. .. 82 0 0 0 0% 0 0 1
Play#0 output Play#0 1 0 3,1 . 0% 0 .. .. 0 0 0 0 0% 0 0 1
Play#0 output Play#0 1 2 -2,2 = 100% 0 .. .. 100 0 0 0 0% 0 0 1
Play#0 output Play#0 1 2 0,2 = 100% 0 .. .. 100 0 0 0 0% 0 0 1
Play#0 output Play#0 1 0 2,2 . 0% 0 .. .. 0 0 0 0 0% 0 0 1
Play#0 output Play#0 1 2 -1,3 # 16% 0 .. .. 82 0 0 0 0% 0 0 1
Play#0 output Play#0 1 0 1,3 . 0% 0 .. .. 0 0 0 0 0% 0 0 1
Play#0 output Play#0 1 1 3,3 #- 20% 0 .. .. 100 0 0 0 0% 0 0 1
Play#0 output Play#0 1 20 sectors
Play#0 output Play#0 6 0 640
Play#0 input terr * 0
Play#0 command territory
Play#0 output Play#0 6 0 640
Play#0 input read 1
Play#0 command read
Play#0 output Play#0 1 No telegrams for 1 at the moment...
Play#0 output Play#0 6 0 640
Play#0 input read 2
Play#0 command read
Play#0 output Play#0 1
Play#0 output Play#0 1 > BULLETIN from POGO, (#0) dated Thu Jan 1 00:00:00 1970
Play#0 output Play#0 1 Country #1 shelled sector 3,-1 for 25 damage.
Play#0 output Play#0 1 Country #1 shelled sector -1,-1 for 28 damage.
Play#0 output Play#0 1 Crumble... SCREEEECH! Splash! Bridge falls at -1,-1!
Play#0 output Play#0 1 Country #1 shelled sector 6,0 for 46 damage.
Play#0 output Play#0 1 Country #1 shelled sector 1,-3 for 23 damage.
Play#0 output Play#0 1 Crumble... SCREEEECH! Splash! Bridge tower falls at 1,-3!
Play#0 output Play#0 1
Play#0 output Play#0 1 > BULLETIN from POGO, (#0) dated Thu Jan 1 00:00:00 1970
Play#0 output Play#0 1 Country #1 shelled sector 8,2 for 28 damage.
Play#0 output Play#0 1 Crumble... SCREEEECH! Splash! Bridge falls at 2,2!
Play#0 output Play#0 1 Country #1 shelled sector -1,3 for 23 damage.
Play#0 output Play#0 1 Crumble... SCREEEECH! Splash! Bridge falls at 1,3!
Play#0 output Play#0 1 Country #1 shelled sector -3,1 for 30 damage.
Play#0 output Play#0 1 Crumble... SCREEEECH! Splash! Bridge tower falls at -3,1!
Play#0 output Play#0 1 Country #1 shelled sector 8,2 for 35 damage.
Play#0 output Play#0 1 Crumble... SCREEEECH! Splash! Bridge falls at -1,1!
Play#0 output Play#0 1 Country #1 shelled sector 8,2 for 48 damage.
Play#0 output Play#0 1 Crumble... SCREEEECH! Splash! Bridge falls at -2,2!
Play#0 output Play#0 6 0 640
Play#0 input ctld
Play#0 output Play#0 1 Bye-bye
Play#0 logout 0
Play#0 output Play#0 3 so long...
Main shutdown

View file

@ -0,0 +1,34 @@
------------------------------------------------------
Empire server (pid 42) started
Configured for testing
Update schedule read
No update scheduled
Listening on 127.0.0.1
Connect from 127.0.0.1
Connect from 127.0.0.1
tester@127.0.0.1 using country #1
tester@127.0.0.1 logged in as country #1
tester@127.0.0.1 logged out, country #1
Connect from 127.0.0.1
tester@127.0.0.1 using country #0
tester@127.0.0.1 logged in as country #0
tester@127.0.0.1 logged out, country #0
Shutdown commencing (cleaning up threads.)
Server shutting down on signal 15
------------------------------------------------------
Empire server (pid 42) started
Configured for testing
Update schedule read
No update scheduled
Listening on 127.0.0.1
Connect from 127.0.0.1
Connect from 127.0.0.1
tester@127.0.0.1 using country #1
tester@127.0.0.1 logged in as country #1
tester@127.0.0.1 logged out, country #1
Connect from 127.0.0.1
tester@127.0.0.1 using country #0
tester@127.0.0.1 logged in as country #0
tester@127.0.0.1 logged out, country #0
Shutdown commencing (cleaning up threads.)
Server shutting down on signal 15

View file

@ -0,0 +1,47 @@
|| sectors
desi 0,0 c
desi 2,0 f
desi 1,-1:1 #
edit l 3,-1 e 100 s = S =
edit l -1:0,-2:-1 e 20 s = S =
edit l 1,-3 e 20 s @ S @
edit l 2:3,-4:-2 e 100 s = S =
des 3,-5 +
des 8,2 -
edit l -2:3,1:2 ?des=. e 100 s = S =
edit l 1,3 e 100 s = S =
desi 3,3 #
desi -1,3 #
edit l 6,0 e 100 s @ S @
edit l 8,0 e 100 s = S =
edit l -3,1 e 20 s @ S @
| mark sectors of interest
terr * ?des== 1
terr * ?des=# 1
terr * ?des=@ 1
| populate
give c * ?des#. 100
edit l 0:2,0 e 100
edit l * ?des=# e 20
|| country#1
add 1 1 1 p
edit c 1 s 4 b 640 M 25000 T 100
give m 2,0 5
give g 2,0 7
give s 2,0 100
edit l * ?des#.&des#=&des#@&des#- o 1 O 1
edit l 0,-2 o 1 O 1
edit l 3,1 o 1 O 1
|| country#2
add 2 2 2 p
| make country active, so it gets bulletins
edit c 2 s 4 b 640 M 25000 T 100
edit l * ?des#.&own=0 o 2 O 2
edit l -1,3 o 2 O 2
|| relations
decl h 1 2
decl h 2 1
|| show initial state here to help maintainers
cens * ?des#.
comm * ?des#.
map *