From fae589be2af8efe36713536203ae715d29d78b5b Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 2 Oct 2014 13:02:48 +0200 Subject: [PATCH] torture: add torture_assert_int_not_equal Signed-off-by: Michael Adam --- lib/torture/torture.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/torture/torture.h b/lib/torture/torture.h index 3a080429a81..e6f323abc57 100644 --- a/lib/torture/torture.h +++ b/lib/torture/torture.h @@ -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) { \ -- 2.11.4.GIT