]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libtorture: add torture_assert_nttime_not_equal[_goto]()
authorRalph Boehme <slow@samba.org>
Thu, 6 Mar 2025 11:41:57 +0000 (12:41 +0100)
committerRalph Boehme <slow@samba.org>
Thu, 27 Mar 2025 05:37:43 +0000 (05:37 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/torture/torture.h

index 4ef0d88735b19b1fa5872073b1077df20d681f65..1bea7bd2c34b8e43303fd012393b5138dbb102ae 100644 (file)
@@ -780,6 +780,23 @@ static inline void torture_dump_data_str_cb(const char *buf, void *private_data)
        }\
        } while(0)
 
+#define torture_assert_nttime_not_equal(torture_ctx,got,expected,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); \
+               return false; \
+       }\
+       } while(0)
+
+#define torture_assert_nttime_not_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)) { \