#include <stdlib.h>
#include <string.h>
+struct expectation {
+ const char *message;
+};
+
+const struct expectation END = {NULL};
+static struct expectation expectation(const char *message) {
+ struct expectation exp;
+ exp.message = message;
+ return exp;
+}
+
static void die(const char *message) {
fputs(message, stderr);
fputc('\n', stderr);
}
}
-static void write_to_tl_append(const char *content) {
+static struct expectation write_to_tl_append(const char *content) {
FILE *p = popen("./tl-append", "w");
if (p == NULL)
die_err("Couldn't run tl-append");
die_err("Error closing pipe");
if (status != 0)
die("tl-append exited abnormally");
+ return expectation(content);
}
static void verify_log_contents(const char *contents) {