torture: add torture_assert_int_not_equal
authorMichael Adam <obnox@samba.org>
Thu, 2 Oct 2014 11:02:48 +0000 (13:02 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 3 Oct 2014 06:34:05 +0000 (08:34 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
lib/torture/torture.h

index 3a080429a8131b382e825651a1cc11808c718afa..e6f323abc5779be56572378838f72e07378225b2 100644 (file)
@@ -414,6 +414,16 @@ void torture_result(struct torture_context *test,
        } \
        } while(0)
 
+#define torture_assert_int_not_equal(torture_ctx,got,not_expected,cmt)\
+       do { int __got = (got), __not_expected = (not_expected); \
+       if (__got == __not_expected) { \
+               torture_result(torture_ctx, TORTURE_FAIL, \
+                       __location__": "#got" was %d (0x%X), expected a different number: %s", \
+                       __got, __got, cmt); \
+               return false; \
+       } \
+       } while(0)
+
 #define torture_assert_u64_equal(torture_ctx,got,expected,cmt)\
        do { uint64_t __got = (got), __expected = (expected); \
        if (__got != __expected) { \