Add unit tests for gpio ftdi driver.
This commit is contained in:
18
test/inc/mock_ftdi.h
Normal file
18
test/inc/mock_ftdi.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef __MOCK_FTDI_H__
|
||||
#define __MOCK_FTDI_H__
|
||||
|
||||
#include <fff.h>
|
||||
|
||||
DEFINE_FFF_GLOBALS;
|
||||
|
||||
DECLARE_FAKE_VOID_FUNC(ftdi_free, struct ftdi_context *);
|
||||
|
||||
DECLARE_FAKE_VALUE_FUNC(int, ftdi_usb_open, struct ftdi_context *, int, int);
|
||||
DECLARE_FAKE_VALUE_FUNC(int, ftdi_usb_close, struct ftdi_context *);
|
||||
DECLARE_FAKE_VALUE_FUNC(struct ftdi_context *, ftdi_new);
|
||||
DECLARE_FAKE_VALUE_FUNC(const char *, ftdi_get_error_string, struct ftdi_context *);
|
||||
DECLARE_FAKE_VALUE_FUNC(int, ftdi_set_bitmode, struct ftdi_context *, unsigned char, unsigned char);
|
||||
DECLARE_FAKE_VALUE_FUNC(int, ftdi_read_data, struct ftdi_context *, unsigned char *, int);
|
||||
DECLARE_FAKE_VALUE_FUNC(int, ftdi_write_data, struct ftdi_context *, const unsigned char *, int);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user