From 853b83c48d322e84bc1fffa80255180223cf8aad Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Thu, 31 Aug 2023 11:51:08 -0700 Subject: [PATCH] test: Expectations have timestamp range --- tl-append-test.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tl-append-test.c b/tl-append-test.c index 2a5d233..3ac174c 100644 --- a/tl-append-test.c +++ b/tl-append-test.c @@ -3,15 +3,21 @@ #include #include #include +#include typedef struct expectation { + time_t a, b; const char *message; } ex_t; -const ex_t END = {NULL}; -static int is_end(ex_t exp) { return exp.message == END.message; } -static ex_t expectation(const char *message) { +const ex_t END = {((time_t)-1), ((time_t)-1), NULL}; +static int is_end(ex_t exp) { + return exp.a == END.a && exp.b == END.b && exp.message == END.message; +} +static ex_t expectation(time_t a, time_t b, const char *message) { ex_t exp; + exp.a = a; + exp.b = b; exp.message = message; return exp; } @@ -46,7 +52,7 @@ static ex_t write_to_tl_append(const char *content) { die_err("Error closing pipe"); if (status != 0) die("tl-append exited abnormally"); - return expectation(content); + return expectation((time_t)-1, ((time_t)-1), content); } static void verify_log_contents(ex_t exps[]) { -- 2.44.1