torture: add torture_assert_int_not_equal_goto
authorMichael Adam <obnox@samba.org>
Fri, 27 Mar 2015 09:02:28 +0000 (10:02 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 30 Mar 2015 11:41:25 +0000 (13:41 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
lib/torture/torture.h

index d6a92177767b4f11363f41d73eb05abd44aa9d45..efdba18245930eb530a7d4fbc6e973aca33828f1 100644 (file)
@@ -424,6 +424,17 @@ void torture_result(struct torture_context *test,
        } \
        } while(0)
 
+#define torture_assert_int_not_equal_goto(torture_ctx,got,not_expected,ret,label,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); \
+               ret = false; \
+               goto label; \
+       } \
+       } while(0)
+
 #define torture_assert_u64_equal(torture_ctx,got,expected,cmt)\
        do { uint64_t __got = (got), __expected = (expected); \
        if (__got != __expected) { \