svunit / svmock

A mock framework for use with SVUnit
Apache License 2.0
15 stars 4 forks source link

Example for `FAIL_UNLESS(mock_*.verify()); is wrongly placed #20

Open akika777 opened 3 years ago

akika777 commented 3 years ago

Small issue here as it may confuse users.

In all of the examples FAILUNLESS(mock*.verify()); is wrongly placed.

For the check to actually contribute to test status this line of code needs to be placed inside some SVTEST ... SVTEST_END and not in the teardown task.

Currently it only displays if the EXPACT_CALL had some mismatches, but doesn't make the test fail if there are mismatches.

I guess, it should be obvious that it is wrong, but made me confused for a minute.

Regards, Aleksandar Kalajdzic

muneebullashariff commented 1 year ago

Hi Aleksandar, I hope the issue you have mentioned is no longer there - it has been resolved!

If you run the example under bedrock then you can see one test is failing because the test is as below:

 75   `SVTEST(dino_called_once)                                                                         
 76     `EXPECT_CALL(mock_f, dino).exactly(2);                                                          
 77                                                                                                     
 78     uut.yabba_dabba_do(betty);                                                                      
 79   `SVTEST_END
image