Closed GoogleCodeExporter closed 9 years ago
Your iface class needs to have a virtual destructor, as mentioned in the
googlemock wiki.
Please provide the error messages you see in step 4.
Original comment by w...@google.com
on 21 Dec 2009 at 7:11
The virtuality of the destructor is irrelevant to this case, and adding it
changes
nothing.
Attached are the outputs from running (changed to include the virtual
destructor,)
compiled both with and without -D_GLIBCXX_DEBUG, and also the result from a
valgrind
run with -D_GLIBCXX_DEUBUG (it's not pretty!)
Original comment by bjor...@fahller.se
on 22 Dec 2009 at 8:43
Attachments:
Original comment by w...@google.com
on 22 Dec 2009 at 5:45
You need to call InitGoogleMock instead of InitGoogleTest. See
http://code.google.com/p/googlemock/wiki/ForDummies . Otherwise gtest is
initialized
but gmock is not.
gmock should fail with an explicit message though. I'll create an issue to
track it.
Original comment by w...@google.com
on 22 Dec 2009 at 8:47
Please see issue 93.
Original comment by w...@google.com
on 22 Dec 2009 at 8:49
I'm closing this issue now. Please reopen it if InitGoogleMock doesn't fix the
problem.
Original comment by w...@google.com
on 23 Dec 2009 at 2:50
You had my hopes up, but alas, it fails the same way.
Original comment by bjor...@fahller.se
on 23 Dec 2009 at 4:17
Attachments:
Original comment by w...@google.com
on 23 Dec 2009 at 6:36
Did you compile gmock itself with -D_GLIBCXX_DEBUG=1 too? You need to define
this
macro when compiling both gmock and t.cpp, otherwise you get undefined behavior
for
violating the one-definition rule of C++.
On my Ubunto machine, I got:
- compiling both gmock and t.cpp without -D_GLIBCXX_DEBUG=1 => works fine.
- compiling both gmock and t.cpp with -D_GLIBCXX_DEBUG=1 => works fine.
- compiling gmock without -D_GLIBCXX_DEBUG=1 but compiling t.cpp with it =>
segfault.
Closing the issue now. Please reopen if this doesn't fix your problem.
Original comment by w...@google.com
on 23 Dec 2009 at 5:43
Original issue reported on code.google.com by
bjor...@fahller.se
on 20 Dec 2009 at 2:39Attachments: