Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mock.verify() should throw instead of returning a bool #4

Open
GoogleCodeExporter opened this issue Mar 19, 2015 · 1 comment
Open

Comments

@GoogleCodeExporter
Copy link

What is the expected output? What do you see instead?

mock.verify() should throw a std::exception-derived exception, with what() 
being populated with information about exactly what missing. that way, it is 
likely they can see the failure message output by the test framework's 
high-level exception handler and immediately know what's going on.


right now, mock.verify() returns a bool. what an assertion against that bool 
fails, most test frameworks output something like "expected true, but got 
false". This leads the developer to have to add printfs or fire up the 
debugger, which greatly reduced productivity/flow.





Original issue reported on code.google.com by [email protected] on 21 Sep 2011 at 9:55

@GoogleCodeExporter
Copy link
Author

I will model our verification exceptions types similar to those found in 
Mockito.
see: 
http://code.google.com/p/mockito/source/browse/#hg%2Fsrc%2Forg%2Fmockito%2Fexcep
tions%2Fverification%253Fstate%253Dclosed

Original comment by [email protected] on 15 Oct 2011 at 7:33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants