i2c_bb/test/unit/i2c_open.c
2019-07-29 15:50:09 +02:00

26 lines
451 B
C

#include <stdlib.h>
#include <stdbool.h>
#include <time.h>
#include <sys/syscall.h>
#include <utest.h>
#include <mock_gpio.h>
#include <i2c.h>
UTEST(i2c_open, success)
{
struct i2c_bb i2x_obj;
gpio_open_fake.return_val = EXIT_SUCCESS;
ASSERT_EQ(i2c_open(&i2x_obj), EXIT_SUCCESS);
}
UTEST(i2c_open, failure)
{
struct i2c_bb i2x_obj;
gpio_open_fake.return_val = EXIT_FAILURE;
ASSERT_EQ(i2c_open(&i2x_obj), EXIT_FAILURE);
}