Test coverage: make LCOV ignore sig_handler and OOM check
[open-adventure.git] / main.c
diff --git a/main.c b/main.c
index 2eb427b59a66b67ce6cd0b5c0f2925b0f28dcd0e..8acae39e43bc2b94aea85d3147643a2f995dcf04 100644 (file)
--- a/main.c
+++ b/main.c
@@ -37,6 +37,8 @@ bool oldstyle = false;
 bool editline = true;
 bool prompt = true;
 
+// LCOV_EXCL_START
+// exclude from coverage analysis because it requires interactivity to test
 static void sig_handler(int signo)
 {
     if (signo == SIGINT) {
@@ -45,6 +47,7 @@ static void sig_handler(int signo)
     }
     exit(0);
 }
+// LCOV_EXCL_STOP
 
 /*
  * MAIN PROGRAM
@@ -584,8 +587,8 @@ static bool playermove(token_t verb, int motion)
         game.oldloc = game.loc;
     }
 
-    /* Look for a way to fulfil the motion - kk indexes the beginning
-     * of the motion entries for here (game.loc). */
+    /* Look for a way to fulfil the motion verb passed in - kk indexes
+     * the beginning of the motion entries for here (game.loc). */
     for (;;) {
         if (T_TERMINATE(travel[kk]) || travel[kk].motion == motion)
             break;
@@ -598,7 +601,7 @@ static bool playermove(token_t verb, int motion)
             if (motion == 29 || motion == 30)spk = BAD_DIRECTION;
             if (motion == 7 || motion == 36 || motion == 37)spk = UNSURE_FACING;
             if (motion == 11 || motion == 19)spk = NO_INOUT_HERE;
-            if (verb == FIND || verb == INVENT)spk = NEARBY;
+            if (verb == FIND || verb == INVENTORY)spk = NEARBY;
             if (motion == 62 || motion == 65)spk = NOTHING_HAPPENS;
             if (motion == 17)spk = WHICH_WAY;
             rspeak(spk);
@@ -606,14 +609,18 @@ static bool playermove(token_t verb, int motion)
         }
         ++kk;
     }
+
+    /* (ESR) We've found a destination that goes with the motion verb.
+     * Next we need to check any conditional(s) on this destination, and
+     * possibly on following entries. */
     scratchloc = T_HIGH(travel[kk]);
 
     do {
         /*
-         * (ESR) This special-travel loop may have to be repeated if it includes
-         * the plover passage.  Same deal for any future cases where we need to
-         * block travel and then redo it once the blocking condition has been
-         * removed.
+         * (ESR) This conditional-skip loop may have to be repeated if
+         * it includes the plover passage.  Same deal for any future
+         * cases where we need to block travel and then redo it once
+         * the blocking condition has been removed.
          */
         for (;;) { /* L12 loop */
             for (;;) {