What steps will reproduce the problem?
A simple one file teset:
#include <gtest/gtest.h>
#include <mockcpp/mockcpp.hpp>
void func()
{
std::cout<<"In real func\n";
}
TEST(Test, should_call_func_once)
{
MOCKER(func)
.expects(once());
func();
GlobalMockObject::verify();
}
int main(int argc, char **argv) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
What is the expected output? What do you see instead?
I expect TEST pass, but I got:
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from Test
[ RUN ] Test.should_call_func_once
In real func
/cygdrive/d/mockcpp/mockcpp/src/ChainableMockObjectBase.cpp:85: Failure
Invocation is expected only once(), but it's been invoked 0 times
method(func)
.expects(once())
.invoked(0);
unknown file: Failure
C++ exception with description "failed due to mockcpp exception" thrown in the
test body.
[ FAILED ] Test.should_call_func_once (0 ms)
[----------] 1 test from Test (0 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (0 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] Test.should_call_func_once
1 FAILED TEST
What version of the product are you using? On what operating system?
Windows XP, cygwin(gcc/g++ 4.5.3), gtest 1.6.0, mockcpp 2.6
Please provide any additional information below.
Original issue reported on code.google.com by wu.hait...@zte.com.cn on 27 Jul 2012 at 2:23
Original issue reported on code.google.com by
wu.hait...@zte.com.cn
on 27 Jul 2012 at 2:23