return expectation(start, end, content);
}
+static void verify_line(const ex_t *ex, const char *line) {
+ if (strncmp(ex->message, line, strlen(ex->message) + 1) != 0)
+ die("Wrong contents in log file");
+}
+
static void verify_log_contents(ex_t exps[]) {
FILE *f = fopen(FILENAME, "r");
die("Error reading log file");
if (ferror(f))
die("Error reading log file");
- if (strncmp(exps[i].message, buf, len + 1) != 0)
- die("Wrong contents in log file");
+ verify_line(&exps[i], buf);
free(buf);
}
if (fclose(f) != 0)