請教一下
定義宣告如下
#define EXPECT_TRUE(condition) \
GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
GTEST_NONFATAL_FAILURE_)
#define GTEST_NONFATAL_FAILURE_(message) \
GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
if (const ::testing::AssertionResult gtest_ar_ = \
::testing::AssertionResult(expression)) \
; \
else \
fail(::testing::internal::GetBoolAssertionFailureMessage(\
gtest_ar_, text, #actual, #expected).c_str())
==============================================================
使用上的範例如下
EXPECT_TRUE(1) or EXPECT_TRUE(0) 判斷成功或是失敗
或
EXPECT_TRUE(system("echo 1 > /sys/class/gpio/gpio1021/value") == 0);
或
EXPECT_TRUE(!memcmp(buf, ref, sizeof(buf)));
我想問的是,上面的define的#,false,true,GTEST_NONFATAL_FAILURE_
這三個參數是要做什麼???
謝謝