#include <string.h>
#include <time.h>
+#include "common.h"
+
typedef struct expectation {
time_t a, b;
const char *message;
return exp;
}
-static void die(const char *message) {
- fputs(message, stderr);
- fputc('\n', stderr);
- exit(1);
-}
-
-static void die_err(const char *message) {
- perror(message);
- exit(1);
-}
-
static void remove_logfile() {
- if (remove("tl.log") != 0) {
+ if (remove(FILENAME) != 0) {
if (errno != ENOENT) {
die_err("Error removing log file");
}
static void verify_log_contents(ex_t exps[]) {
- FILE *f = fopen("tl.log", "r");
+ FILE *f = fopen(FILENAME, "r");
if (f == NULL)
die_err("Error opening log file");
for (size_t i = 0; !is_end(exps[i]); i++) {