ASSERT_TRUE - macro. When expanded, it will contain a branch like:
if (fun1() == false) { return; }
This is how ASSERT_TRUE performs a hard stop on failure, but that also means that your bool abc::fun() method now has a void return return path that conflicts with its signature.
Possible fixes include not using hard stops:
bool abc::fun(){ bool result = fun1(); EXPECT_TRUE(result);
or change the type of returned methods, if not required:
void abc::fun(){ ASSERT_TRUE(fun1());
or return via the link:
void abc::fun(bool &outResult){ outResult = fun1();
Downward facing god
source share