forked from 3rd-party/fff
Add custom fake tests
This commit is contained in:
@@ -242,3 +242,15 @@ TEST_F(FFFTestSuite, default_constants_can_be_overridden)
|
||||
ASSERT_EQ(OVERRIDE_ARG_HIST_LEN, voidfunc2_fake.arg_history_len);
|
||||
}
|
||||
|
||||
static int my_custom_fake_called = 0;
|
||||
void my_custom_fake(char a, char b)
|
||||
{
|
||||
my_custom_fake_called++;
|
||||
}
|
||||
|
||||
TEST_F(FFFTestSuite, can_register_custom_fake)
|
||||
{
|
||||
voidfunc2_fake.custom_fake = my_custom_fake;
|
||||
voidfunc2('a', 'b');
|
||||
ASSERT_EQ(1, my_custom_fake_called);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user