Two coverage imprivenents, one by recognizing dead code.

This commit is contained in:
Eric S. Raymond 2017-07-16 05:33:43 -04:00
parent 9eda1f424d
commit 9b585f40d8
4 changed files with 125 additions and 15 deletions

View file

@ -101,7 +101,6 @@ enum phase_codes {
GO_TOP, GO_TOP,
GO_CLEAROBJ, GO_CLEAROBJ,
GO_CHECKHINT, GO_CHECKHINT,
GO_CHECKFOO,
GO_DIRECTION, GO_DIRECTION,
GO_LOOKUP, GO_LOOKUP,
GO_WORD2, GO_WORD2,

3
main.c
View file

@ -1103,7 +1103,6 @@ Lclearobj:
if (!get_command_input(&command)) if (!get_command_input(&command))
return false; return false;
Lclosecheck:
++game.turns; ++game.turns;
if (closecheck()) { if (closecheck()) {
@ -1194,8 +1193,6 @@ Lookup:
return true; return true;
case GO_TOP: case GO_TOP:
continue; /* back to top of main interpreter loop */ continue; /* back to top of main interpreter loop */
case GO_CHECKFOO:
goto Lclosecheck;
case GO_LOOKUP: case GO_LOOKUP:
goto Lookup; goto Lookup;
case GO_WORD2: case GO_WORD2:

View file

@ -1450,6 +1450,10 @@ OK
OK OK
> take coins
OK
> plugh > plugh
>>Foof!<< >>Foof!<<
@ -1728,7 +1732,7 @@ There are rare spices here!
> take spices > take spices
OK You can't carry anything more. You'll have to drop something first.
> drop keys > drop keys
@ -1826,8 +1830,6 @@ A precious jade necklace has been dropped here!
There is precious jewelry here! There is precious jewelry here!
There are many coins here!
> inven > inven
You're not carrying anything. You're not carrying anything.
@ -1876,8 +1878,6 @@ A precious jade necklace has been dropped here!
There is precious jewelry here! There is precious jewelry here!
There are many coins here!
> plugh > plugh
>>Foof!<< >>Foof!<<
@ -1910,9 +1910,9 @@ You're on sw side of chasm.
There is an empty bottle here. There is an empty bottle here.
Off to one side lies a glistening pearl! There are many coins here!
There are rare spices here! Off to one side lies a glistening pearl!
There is a golden chain lying in a heap on the floor! There is a golden chain lying in a heap on the floor!
@ -1929,9 +1929,9 @@ You're on sw side of chasm.
There is an empty bottle here. There is an empty bottle here.
Off to one side lies a glistening pearl! There are many coins here!
There are rare spices here! Off to one side lies a glistening pearl!
There is a golden chain lying in a heap on the floor! There is a golden chain lying in a heap on the floor!
@ -1948,6 +1948,10 @@ Don't be ridiculous!
For crying out loud, the poor thing is already dead! For crying out loud, the poor thing is already dead!
> take coins
OK
> sw > sw
You're in sloping corridor. You're in sloping corridor.
@ -2020,9 +2024,96 @@ There is no way across the fissure.
You're on east bank of fissure. You're on east bank of fissure.
> wave rod
You scored 243 out of a possible 430, using 330 turns. A crystal bridge now spans the fissure.
> across
You're on west bank of fissure.
A crystal bridge spans the fissure.
> w
You're at west end of Hall of Mists.
> w
You're at east end of long hall.
> w
You're at west end of long hall.
> s
You are in a maze of twisty little passages, all different.
> s
You are in a maze of twisting little passages, all different.
> sw
You are in a twisting little maze of passages, all different.
> se
You are in a twisting maze of little passages, all different.
> s
You are in a little maze of twisting passages, all different.
> s
Dead end
There is a massive vending machine here, swung back to reveal a
southward passage.
> drop coins
There are fresh batteries here.
> look
Sorry, but I am not allowed to give more detail. I will repeat the
long description of your location.
Dead end
There are fresh batteries here.
There is a massive vending machine here, swung back to reveal a
southward passage.
> n
You are in a little maze of twisting passages, all different.
> z
OK
> z
OK
> z
OK
> z
Your lamp is getting dim. You'd best go back for those batteries.
OK
You scored 233 out of a possible 430, using 350 turns.
You may now consider yourself a "Seasoned Adventurer". You may now consider yourself a "Seasoned Adventurer".
To achieve the next higher rating, you need 8 more points. To achieve the next higher rating, you need 18 more points.

View file

@ -246,6 +246,7 @@ drop emerald
drop ebony drop ebony
take keys take keys
take food take food
take coins
plugh plugh
on on
s s
@ -322,6 +323,8 @@ up
over over
feed bear feed bear
attack bear attack bear
# We'll need these when the game times out
take coins
# Back to fissure to test OVER # Back to fissure to test OVER
sw sw
d d
@ -338,3 +341,23 @@ w
take rod take rod
wave rod wave rod
across across
# Next, buy batteries but don't take them.
wave rod
across
w
w
w
s
s
sw
se
s
s
drop coins
look
n
z
z
z
z
# Battery warning happens here.