Hello,I have the following scenario --I'm writing a death test to check for failures. I have to pass in a value to a variable in a mock object which i'm doing using EXPECT CALL.EXPECT_CALL ( *mock, foo ( arg1, _ ) )..WillOnce ( DoAll ( SetArgumentPointee<1> ( fake_var_value>), Return ( true ) );I'm then doing -EXPECT_DEATH ( bar ( ) )bar() in turn calls the foo().When I run this test it fails on the EXPECT_CALL saying that the function foo() was never called with message --Expected: to be called once Actual: never called - unsatisfied and activeBut when I do the exact same thing and use EXPECT_FALSE(..) instead of EXPECT_DEATH(..)EXPECT_FALSE ( bar ( ) )This code fatals correctly and I can see that foo() was in fact called correctly.I'm not able to understand why the test behaves as expected using EXPECT_FALSE but in case of EXPECT_DEATH it never calls foo().Can anyone please help out?Thanks,--Aditya
Hello,I have the following scenario --I'm writing a death test to check for failures. I have to pass in a value to a variable in a mock object which i'm doing using EXPECT CALL.EXPECT_CALL ( *mock, foo ( arg1, _ ) )..WillOnce ( DoAll ( SetArgumentPointee<1> ( fake_var_value>), Return ( true ) );I'm then doing -EXPECT_DEATH ( bar ( ) )bar() in turn calls the foo().When I run this test it fails on the EXPECT_CALL saying that the function foo() was never called with message --Expected: to be called once Actual: never called - unsatisfied and activeBut when I do the exact same thing and use EXPECT_FALSE(..) instead of EXPECT_DEATH(..)EXPECT_FALSE ( bar ( ) )This code fatals correctly and I can see that foo() was in fact called correctly.I'm not able to understand why the test behaves as expected using EXPECT_FALSE but in case of EXPECT_DEATH it never calls foo().Can anyone please help out?Thanks,--Aditya
--
---
You received this message because you are subscribed to the Google Groups "Google C++ Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframe...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframework+unsub...@googlegroups.com.
HiI am facing a similar problem,Please see after line 170I tried multiple combinations of WillRepeatedly and WillOnce with EXPECT_CALL.It seems that the statement in EXPECT_DEATH(statement) is effective. How to ensure that the statement's effect is visible? I could not quite understand the documentation.
I also tried ON_CALL - the logs seem to reveal that statement in EXPECT_DEATH(statement) was somewhat effective.I see warnings telling about return values for mock mehtods. however I do not see any logs from 'statement' itself.
Can someone point what I missed?Is it necessary to write death-tests in some particular style? The EXPECT_DEATH in other TEST_Fs in same file work as expected.
--