From 87f85350cc688352cdda7d74fdc3f0f674b41c6d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 30 Jul 2024 13:57:25 +0200 Subject: [PATCH] lib/torture: add torture_assert_nttime_equal_goto() BUG: https://bugzilla.samba.org/show_bug.cgi?id=15656 Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke --- lib/torture/torture.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/torture/torture.h b/lib/torture/torture.h index 2194703d5fc..4ef0d88735b 100644 --- a/lib/torture/torture.h +++ b/lib/torture/torture.h @@ -771,6 +771,15 @@ static inline void torture_dump_data_str_cb(const char *buf, void *private_data) }\ } while(0) +#define torture_assert_nttime_equal_goto(torture_ctx,got,expected,ret,label,cmt) \ + do { NTTIME __got = got, __expected = expected; \ + if (!nt_time_equal(&__got, &__expected)) { \ + torture_result(torture_ctx, TORTURE_FAIL, __location__": "#got" was %s, expected %s: %s", nt_time_string(torture_ctx, __got), nt_time_string(torture_ctx, __expected), cmt); \ + ret = false; \ + goto label; \ + }\ + } while(0) + #define torture_assert_sid_equal(torture_ctx,got,expected,cmt)\ do {const struct dom_sid *__got = (got), *__expected = (expected); \ if (!dom_sid_equal(__got, __expected)) { \