26 lines
460 B
C
26 lines
460 B
C
|
#include <stdlib.h>
|
||
|
#include <stdbool.h>
|
||
|
#include <time.h>
|
||
|
#include <sys/syscall.h>
|
||
|
|
||
|
#include <utest.h>
|
||
|
#include <mock_ftdi.h>
|
||
|
|
||
|
#include <i2c_bb.h>
|
||
|
|
||
|
UTEST(i2c_close, success)
|
||
|
{
|
||
|
struct i2c_bb i2x_obj;
|
||
|
|
||
|
gpio_close_fake.return_val = EXIT_SUCCESS;
|
||
|
ASSERT_EQ(i2c_close(&i2x_obj), EXIT_SUCCESS);
|
||
|
}
|
||
|
|
||
|
UTEST(i2c_close, failure)
|
||
|
{
|
||
|
struct i2c_bb i2x_obj;
|
||
|
|
||
|
gpio_close_fake.return_val = EXIT_FAILURE;
|
||
|
ASSERT_EQ(i2c_close(&i2x_obj), EXIT_FAILURE);
|
||
|
}
|