]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib/torture: add torture_assert_nttime_equal_goto()
authorStefan Metzmacher <metze@samba.org>
Tue, 30 Jul 2024 11:57:25 +0000 (13:57 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 29 Aug 2024 18:25:28 +0000 (18:25 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15656

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
lib/torture/torture.h

index 2194703d5fc8ccc9893e05593db21147c8dc312a..4ef0d88735b19b1fa5872073b1077df20d681f65 100644 (file)
@@ -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)) { \