From: Ralph Boehme Date: Thu, 6 Mar 2025 11:41:57 +0000 (+0100) Subject: libtorture: add torture_assert_nttime_not_equal[_goto]() X-Git-Tag: tevent-0.17.0~502 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e2ed11e0f7aa9ca73e40483a24c1556df78ce32e;p=thirdparty%2Fsamba.git libtorture: add torture_assert_nttime_not_equal[_goto]() BUG: https://bugzilla.samba.org/show_bug.cgi?id=13594 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/lib/torture/torture.h b/lib/torture/torture.h index 4ef0d88735b..1bea7bd2c34 100644 --- a/lib/torture/torture.h +++ b/lib/torture/torture.h @@ -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)) { \