{
void* ptr = malloc(size);
if (ptr == NULL) {
+ // LCOV_EXCL_START
+ // exclude from coverage analysis because we can't simulate an out of memory error in testing
fprintf(stderr, "Out of memory!\n");
exit(EXIT_FAILURE);
+ // LCOV_EXCL_STOP
}
return (ptr);
}
}
}
-void token_to_packed(char token[6], long* packed)
-{
- *packed = 0;
- for (size_t i = 0; i < 5; ++i)
- {
- if (token[4 - i] == '\0')
- continue;
- char mapped = ascii_to_advent[(int) token[4 - i]];
- *packed |= (mapped << (6 * i));
- }
-}
-
/* Hide the fact that wods are corrently packed longs */
bool wordeq(token_t a, token_t b)
va_start(ap, skip);
switch (mode) {
case touch:
- vspeak(object_descriptions[msg].inventory, ap);
+ vspeak(objects[msg].inventory, ap);
break;
case look:
- vspeak(object_descriptions[msg].longs[skip], ap);
+ vspeak(objects[msg].longs[skip], ap);
break;
case hear:
- vspeak(object_descriptions[msg].sounds[skip], ap);
+ vspeak(objects[msg].sounds[skip], ap);
break;
case study:
- vspeak(object_descriptions[msg].texts[skip], ap);
+ vspeak(objects[msg].texts[skip], ap);
break;
}
va_end(ap);
lexeme = -1;
if (init < 0)
return (lexeme);
- BUG(REQUIRED_VOCABULARY_WORD_NOT_FOUND);
+ BUG(REQUIRED_VOCABULARY_WORD_NOT_FOUND); // LCOV_EXCL_LINE
}
if (init >= 0 && KTAB[i] / 1000 != init)
continue;
return (lexeme);
}
}
- BUG(RAN_OFF_END_OF_VOCABULARY_TABLE);
+ BUG(RAN_OFF_END_OF_VOCABULARY_TABLE); // LCOV_EXCL_LINE
}
void juggle(long object)
*t = (long) tv.tv_usec;
}
+// LCOV_EXCL_START
void bug(enum bugtype num, const char *error_string)
{
fprintf(stderr, "Fatal error %d, %s.\n", num, error_string);
exit(EXIT_FAILURE);
}
+// LCOV_EXCL_STOP
/* end */