From: Joseph Sutton Date: Wed, 16 Mar 2022 22:20:45 +0000 (+1300) Subject: dsdb audit tests: Use assert_in_range() for comparing timestamps X-Git-Tag: tevent-0.12.0~421 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95abdbcbb8c96bb58aa1fe08ddc5c8280e9e6a30;p=thirdparty%2Fsamba.git dsdb audit tests: Use assert_in_range() for comparing timestamps This can make the code clearer. assert_in_range() takes only integer parameters, but POSIX allows us to assume that time_t is an integer. Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/samdb/ldb_modules/tests/test_audit_log.c b/source4/dsdb/samdb/ldb_modules/tests/test_audit_log.c index 2885b7fe744..885248e5fb9 100644 --- a/source4/dsdb/samdb/ldb_modules/tests/test_audit_log.c +++ b/source4/dsdb/samdb/ldb_modules/tests/test_audit_log.c @@ -74,8 +74,7 @@ static void check_timestamp(time_t before, const char* timestamp) /* * The timestamp should be before <= actual <= after */ - assert_true(difftime(actual, before) >= 0); - assert_true(difftime(after, actual) >= 0); + assert_in_range(actual, before, after); } static void test_has_password_changed(void **state)