Open lxr5109 opened 2 days ago
直接用的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);
} ` 然后报了异常:
直接用的README里的示例: ` // 待测函数 int foobar(int x) { return x; }
TEST_F(FooTest, foobar_test) {
} ` 然后报了异常: