From a46f8a63cde8d4fee05693bc5c566c1374d0baaa Mon Sep 17 00:00:00 2001 From: Wainer dos Santos Moschetta Date: Mon, 9 Mar 2020 23:50:58 -0300 Subject: [PATCH] selftests: kvm: Introduce the TEST_FAIL macro Some tests/utilities use the TEST_ASSERT(false, ...) pattern to indicate a failure and stop execution. This change introduces the TEST_FAIL macro which is a wrap around TEST_ASSERT(false, ...) and so provides a direct alternative for failing a test. Signed-off-by: Wainer dos Santos Moschetta Signed-off-by: Paolo Bonzini --- tools/testing/selftests/kvm/include/test_util.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/kvm/include/test_util.h b/tools/testing/selftests/kvm/include/test_util.h index f556ec5..f588ad14 100644 --- a/tools/testing/selftests/kvm/include/test_util.h +++ b/tools/testing/selftests/kvm/include/test_util.h @@ -55,6 +55,9 @@ void test_assert(bool exp, const char *exp_str, #a, #b, #a, (unsigned long) __a, #b, (unsigned long) __b); \ } while (0) +#define TEST_FAIL(fmt, ...) \ + TEST_ASSERT(false, fmt, ##__VA_ARGS__) + size_t parse_size(const char *size); int64_t timespec_to_ns(struct timespec ts); -- 2.7.4