Commit a46f8a63 authored by Wainer dos Santos Moschetta's avatar Wainer dos Santos Moschetta Committed by Paolo Bonzini

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: default avatarWainer dos Santos Moschetta <wainersm@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 3203a017
...@@ -55,6 +55,9 @@ void test_assert(bool exp, const char *exp_str, ...@@ -55,6 +55,9 @@ void test_assert(bool exp, const char *exp_str,
#a, #b, #a, (unsigned long) __a, #b, (unsigned long) __b); \ #a, #b, #a, (unsigned long) __a, #b, (unsigned long) __b); \
} while (0) } while (0)
#define TEST_FAIL(fmt, ...) \
TEST_ASSERT(false, fmt, ##__VA_ARGS__)
size_t parse_size(const char *size); size_t parse_size(const char *size);
int64_t timespec_to_ns(struct timespec ts); int64_t timespec_to_ns(struct timespec ts);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment