27 lines
515 B
C
27 lines
515 B
C
#include <stdlib.h>
|
|
#include <stdbool.h>
|
|
#include <time.h>
|
|
#include <sys/syscall.h>
|
|
|
|
#include <utest.h>
|
|
#include <mock_ftdi.h>
|
|
|
|
#include <ftdi_dev.h>
|
|
#include <gpio.h>
|
|
|
|
UTEST(gpio_close, invalid_gpio_obj) {
|
|
ASSERT_EQ(gpio_close(NULL), EXIT_FAILURE);
|
|
}
|
|
|
|
UTEST(gpio_close, empty_bitmask) {
|
|
struct gpio gpio_1;
|
|
struct ftdi_dev ftdi_obj;
|
|
|
|
ftdi_obj.is_open = true;
|
|
ftdi_obj.bit_mask = 0x08;
|
|
|
|
gpio_1.pin = 0x08;
|
|
gpio_1.ftdi_dev = &ftdi_obj;
|
|
ASSERT_EQ(gpio_close(&gpio_1), EXIT_SUCCESS);
|
|
|
|
} |