diff --git a/test/inc/mock_i2c.h b/test/inc/mock_i2c.h new file mode 100644 index 0000000..1c37d99 --- /dev/null +++ b/test/inc/mock_i2c.h @@ -0,0 +1,13 @@ +#ifndef __MOCK_I2C_H__ +#define __MOCK_I2C_H__ + +#include + +DEFINE_FFF_GLOBALS; + +DECLARE_FAKE_VALUE_FUNC(int, i2c_open, const struct i2c_bb *); +DECLARE_FAKE_VALUE_FUNC(int, i2c_close, const struct i2c_bb *); +DECLARE_FAKE_VALUE_FUNC(int, i2c_read, const struct i2c_bb *, uint8_t, char *, unsigned int); +DECLARE_FAKE_VALUE_FUNC(int, i2c_write, const struct i2c_bb *, uint8_t, const char *, unsigned int); + +#endif diff --git a/test/unit/mock_i2c.c b/test/unit/mock_i2c.c new file mode 100644 index 0000000..52c6879 --- /dev/null +++ b/test/unit/mock_i2c.c @@ -0,0 +1,9 @@ +#include +#include + +DEFINE_FFF_GLOBALS; + +DEFINE_FAKE_VALUE_FUNC(int, i2c_open, const struct i2c_bb *); +DEFINE_FAKE_VALUE_FUNC(int, i2c_close, const struct i2c_bb *); +DEFINE_FAKE_VALUE_FUNC(int, i2c_read, const struct i2c_bb *, uint8_t, char *, unsigned int); +DEFINE_FAKE_VALUE_FUNC(int, i2c_write, const struct i2c_bb *, uint8_t, const char *, unsigned int);