调用ASSERT_TRUE的函数,返回值类型定义必须是void,如果想返回别的类型,就用EXPECT_TRUE: void abc::fun(){ ASSERT_TRUE(fun1()); } bool abc::fun(){ bool result = fun1(); EXPECT_TRUE(result );returnresult ; } ASSERT_TRUE is amacro. When expanded it will contain a branch like:if(fun1(...
调用ASSERT_TRUE的函数,返回值类型定义必须是void,如果想返回别的类型,就用EXPECT_TRUE: void abc::fun(){ ASSERT_TRUE(fun1()); } bool abc::fun(){ bool result = fun1(); EXPECT_TRUE(result );returnresult ; } ASSERT_TRUE is amacro. When expanded it will contain a branch like:if(fun1(...