From 30f13c6c25be8d0fb5b0e6d819685b4e6f45829c Mon Sep 17 00:00:00 2001 From: Aaron Traas Date: Fri, 21 Jul 2017 17:22:03 -0400 Subject: [PATCH 1/1] Back up to 100% coverage. --- misc.c | 5 +++-- tests/illformed.chk | 25 +++++++++++++++++++------ tests/illformed.log | 2 ++ 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/misc.c b/misc.c index e64cad0..e6d31bf 100644 --- a/misc.c +++ b/misc.c @@ -394,9 +394,10 @@ static bool is_valid_int(const char *str) if (*str == '-') ++str; - // Handle empty string or just "-" + // Handle empty string or just "-". Should never reach this + // point, because this is only used with transitive verbs. if (!*str) - return false; + return false; // LCOV_EXCL_LINE // Check for non-digit chars in the rest of the stirng. while (*str) diff --git a/tests/illformed.chk b/tests/illformed.chk index 3546395..479da26 100644 --- a/tests/illformed.chk +++ b/tests/illformed.chk @@ -659,16 +659,29 @@ You're outside grate. The grate is locked. -> quit +> seed -123 -Do you really want to quit now? +Seed set to 4294967173 -> yes +You're outside grate. + +The grate is locked. + +> no OK -You scored 27 out of a possible 430, using 125 turns. +Are you trying to get into the cave? + +> quit + +Please answer the question. + +Are you trying to get into the cave? + +> yes + +I am prepared to give you a hint, but it will cost you 2 points. -You are obviously a rank amateur. Better luck next time. +Do you want the hint? -To achieve the next higher rating, you need 19 more points. diff --git a/tests/illformed.log b/tests/illformed.log index f3b781f..b29a08d 100644 --- a/tests/illformed.log +++ b/tests/illformed.log @@ -133,5 +133,7 @@ s down s in +seed -123 +no quit yes -- 2.31.1