diff mbox series

[kvm-unit-tests,23/39] nVMX: Add a non-reporting assertion macro

Message ID 20211125012857.508243-24-seanjc@google.com (mailing list archive)
State New, archived
Headers show
Series x86/access: nVMX: Big overhaul | expand

Commit Message

Sean Christopherson Nov. 25, 2021, 1:28 a.m. UTC
Add a version of VMX's TEST_ASSERT that doesn't report.  The output of
basic assertions is annoying, and other than inflating the number of
tests to make KUT look good, there's no value in reporting that KUT is
working as intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 x86/vmx.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/x86/vmx.h b/x86/vmx.h
index c1a8f6a..47b0461 100644
--- a/x86/vmx.h
+++ b/x86/vmx.h
@@ -9,7 +9,7 @@ 
 
 void __abort_test(void);
 
-#define TEST_ASSERT(cond)					\
+#define __TEST_ASSERT(cond)					\
 do {								\
 	if (!(cond)) {						\
 		report_fail("%s:%d: Assertion failed: %s",	\
@@ -17,6 +17,11 @@  do {								\
 		dump_stack();					\
 		__abort_test();					\
 	}							\
+} while (0)
+
+#define TEST_ASSERT(cond)					\
+do {								\
+	__TEST_ASSERT(cond);					\
 	report_passed();					\
 } while (0)