]> git.scottworley.com Git - tl-append/commitdiff
test: Populate expectation timestamp range
authorScott Worley <scottworley@scottworley.com>
Thu, 31 Aug 2023 18:53:27 +0000 (11:53 -0700)
committerScott Worley <scottworley@scottworley.com>
Fri, 1 Sep 2023 07:48:34 +0000 (00:48 -0700)
tl-append-test.c

index 3ac174cc82ff078a7b9ff742048d7a12cef9cea3..ea42dc947fcf7fb94619fdacb74e029ed2d54398 100644 (file)
@@ -45,14 +45,16 @@ static ex_t write_to_tl_append(const char *content) {
   FILE *p = popen("./tl-append", "w");
   if (p == NULL)
     die_err("Couldn't run tl-append");
+  time_t start = time(NULL);
   if (fputs(content, p) == EOF)
     die("Couldn't write to pipe");
   int status = pclose(p);
+  time_t end = time(NULL);
   if (status < 0)
     die_err("Error closing pipe");
   if (status != 0)
     die("tl-append exited abnormally");
-  return expectation((time_t)-1, ((time_t)-1), content);
+  return expectation(start, end, content);
 }
 
 static void verify_log_contents(ex_t exps[]) {