You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TEST(mockcpp, test_basic_add){ //This is a simple case to get mockcpp exception
MOCKER(add).expects(once()).with(eq(2),eq(2)).will(returnValue(4));
int ret;
ret = add(1,2);
EXPECT_EQ(ret, 3);
GlobalMockObject::verify();
}
TEST(mockcpp, test_basic_add_timeout){
int ret; //time out when call mock object
ret = add(2,3);
EXPECT_EQ(ret, 5);
}
As the title says, mockcpp will throw an exception at the end of the test_basic_add case.
in this case, because there is no execution that matched argument function.
But in the next testcase, it will timeout when calling add, although we have called the verify() function
Observed from the debugger tool, it is stuck on mockcpp::ApiHookFunctor() ApiHookFunctor.h:168:1
-> std::mutex::lock
So I would like to ask if it is possible to provide a more comprehensive function than verify to clear all settings (including unlock mutex) We can put it in the SetUp, so that each testcase has a clean environment Or, is there any suitable solution to avoid this problem?
thanks
-Sam
The text was updated successfully, but these errors were encountered:
OS: Ubuntu 18.04
Compiler: Clang15.0.6
Googletest: Googletest 1.13.0
mockcpp: 2.7
As the title says, mockcpp will throw an exception at the end of the test_basic_add case.
in this case, because there is no execution that matched argument function.
But in the next testcase, it will timeout when calling add, although we have called the verify() function
Observed from the debugger tool, it is stuck on mockcpp::ApiHookFunctor() ApiHookFunctor.h:168:1
-> std::mutex::lock
So I would like to ask if it is possible to provide a more comprehensive function than verify to clear all settings (including unlock mutex)
We can put it in the SetUp, so that each testcase has a clean environment
Or, is there any suitable solution to avoid this problem?
thanks
-Sam
The text was updated successfully, but these errors were encountered: