googletest icon indicating copy to clipboard operation
googletest copied to clipboard

EXPECT_CALL failed, but Test::HasFailure()==false in testcase destructor

Open fchn289 opened this issue 3 years ago • 0 comments
trafficstars

description as title

expect Test::HasFailure()==true (actually ==false)

Steps to reproduce the bug struct MyTest : public Test {  ~MyTest()  {   if (Test::HasFailure()) "do sth"  } }; TEST_F(MyTest, test1) {  ...  EXPECT_CALL(...); //let it fail  ... }

Does the bug persist in the most recent commit? yes

What operating system and version are you using?

uname -a Linux ... 5.15.35-1.NSN.el7.x86_64 #1 SMP Tue May 24 15:26:52 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

What compiler and version are you using? gcc version 10.2.0 (GCC)

What build system are you using? cmake version 3.19.5

fchn289 avatar Nov 09 '22 02:11 fchn289