From: NHOrus Date: Sun, 2 Jul 2017 19:27:41 +0000 (+0300) Subject: Unfalsify coverage check X-Git-Tag: takebird~93 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=fbc80f0363936f740fdea00e7c143624bd0cb06d;p=open-adventure.git Unfalsify coverage check --- diff --git a/actions.c b/actions.c index 95a94b8..480b0f5 100644 --- a/actions.c +++ b/actions.c @@ -559,7 +559,7 @@ static int extinguish(token_t verb, int obj) if (game.prop[URN] != URN_EMPTY) { state_change(URN, URN_DARK); } else { - pspeak(URN, change, URN_DARK, true); + pspeak(URN, change, URN_DARK, true); } } else if (obj == LAMP) { @@ -941,7 +941,7 @@ static int read(struct command_t command) } else if (objects[command.obj].texts[0] == NULL || game.prop[command.obj] < 0) { rspeak(actions[command.verb].message); } else - pspeak(command.obj, study, game.prop[command.obj], true); + pspeak(command.obj, study, game.prop[command.obj], true); return GO_CLEAROBJ; } @@ -952,7 +952,7 @@ static int reservoir(void) rspeak(NOTHING_HAPPENS); return GO_CLEAROBJ; } else { - pspeak(RESER, look, game.prop[RESER] + 1, true); + pspeak(RESER, look, game.prop[RESER] + 1, true); game.prop[RESER] = 1 - game.prop[RESER]; if (AT(RESER)) return GO_CLEAROBJ; @@ -968,18 +968,18 @@ static int reservoir(void) static int rub(token_t verb, token_t obj) /* Rub. Yields various snide remarks except for lit urn. */ { - int spk = actions[verb].message; - if (obj != LAMP) - spk = PECULIAR_NOTHING; if (obj == URN && game.prop[URN] == URN_LIT) { DESTROY(URN); drop(AMBER, game.loc); game.prop[AMBER] = AMBER_IN_ROCK; --game.tally; drop(CAVITY, game.loc); - spk = URN_GENIES; + rspeak(URN_GENIES); + } else if (obj != LAMP) { + rspeak(PECULIAR_NOTHING); + } else { + rspeak(actions[verb].message); } - rspeak(spk); return GO_CLEAROBJ; } diff --git a/tests/weirdbird.chk b/tests/weirdbird.chk index f6d38b8..ce4c8b8 100644 --- a/tests/weirdbird.chk +++ b/tests/weirdbird.chk @@ -32,6 +32,10 @@ OK OK +> rub keys + +Peculiar. Nothing unexpected happens. + > out You're in front of building. @@ -180,7 +184,7 @@ OK The little bird is now dead. Its body disappears. -You scored 30 out of a possible 430, using 29 turns. +You scored 30 out of a possible 430, using 30 turns. You are obviously a rank amateur. Better luck next time. diff --git a/tests/weirdbird.log b/tests/weirdbird.log index 9df0710..8e03ef8 100644 --- a/tests/weirdbird.log +++ b/tests/weirdbird.log @@ -4,6 +4,7 @@ seed 694608006 in take lamp take keys +rub keys out go s walk s