Commit 3b951037 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Jim Harris
Browse files

spdk_cunit: only evaluate assert condition once



Change-Id: I2e8591df23fcb686c3189b0f6215759d749b84bd
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent c194ebd8
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -43,7 +43,14 @@
 * static analyzers figure out that it really doesn't return.
 * The abort() will never actually execute.
 */
#define SPDK_CU_ASSERT_FATAL(cond) do { CU_ASSERT_FATAL(cond); if (!(cond)) { abort(); } } while (0)
#define SPDK_CU_ASSERT_FATAL(cond)		\
	do {					\
		int result_ = !!(cond);		\
		CU_ASSERT_FATAL(result_); 	\
		if (!result_) {			\
			abort();		\
		}				\
	} while (0)

int spdk_cunit_print_results(const char *filename);