MrazqRuby / googlemock

Automatically exported from code.google.com/p/googlemock
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

need to print return value last when the default value needs to be returned but isn't set #36

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When GoogleMock sees an unexpected call, it prints out
information in the following order:

1. Which function is being called and with what arguments,
2. What value it returns, and
3. What expectations gMock has tried to match the call with.

The reason for picking this order is that #1 and #2 are usually short
while #3 can be very lengthy.  If we print #3 before #2, it can be
very hard to tell where #3 ends and spot the function's return value,
which in my opinion is bad user experience.

This usually works fine.  However, if the function returns a class type, no
default action is set for it, and no default value is set for the return
type, the program will crash in
step #2, and #3 never gets a chance to be printed.

It should be possible for GoogleMock to do #3 before #2 when no default
return value is set.

Original issue reported on code.google.com by zhanyong...@gmail.com on 4 Mar 2009 at 7:09

GoogleCodeExporter commented 9 years ago

Original comment by w...@google.com on 27 Sep 2010 at 9:20