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

Windows 上mock global function, 报异常 #44

Open
lxr5109 opened this issue Oct 11, 2024 · 0 comments
Open

Windows 上mock global function, 报异常 #44

lxr5109 opened this issue Oct 11, 2024 · 0 comments

Comments

@lxr5109
Copy link

lxr5109 commented Oct 11, 2024

直接用的README里的示例:
`
// 待测函数
int foobar(int x) {
return x;
}

TEST_F(FooTest, foobar_test)
{

// 测试时,像下面这样就可以mock
EMOCK(foobar)
	.stubs()
	.with(any()) // 约束匹配任意输入
	.will(returnValue(1)); // 调用时返回1

// 调用会返回1
EXPECT_EQ(foobar(0), 1);

}
`
然后报了异常:
image

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

No branches or pull requests

1 participant