"events - mixing events and gpiod_line_get_value()",
0, { 8 });
+static void event_get_value_active_low(void)
+{
+ TEST_CLEANUP(test_close_chip) struct gpiod_chip *chip = NULL;
+ struct timespec ts = { 1, 0 };
+ struct gpiod_line_event ev;
+ struct gpiod_line *line;
+ int rv;
+
+ chip = gpiod_chip_open(test_chip_path(0));
+ TEST_ASSERT_NOT_NULL(chip);
+
+ line = gpiod_chip_get_line(chip, 7);
+ TEST_ASSERT_NOT_NULL(line);
+
+ rv = gpiod_line_request_falling_edge_events_flags(line, TEST_CONSUMER,
+ GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW);
+ TEST_ASSERT_RET_OK(rv);
+
+ rv = gpiod_line_get_value(line);
+ TEST_ASSERT_EQ(rv, 1);
+
+ test_set_event(0, 7, TEST_EVENT_FALLING, 100);
+
+ rv = gpiod_line_event_wait(line, &ts);
+ TEST_ASSERT_EQ(rv, 1);
+
+ rv = gpiod_line_event_read(line, &ev);
+ TEST_ASSERT_RET_OK(rv);
+
+ TEST_ASSERT_EQ(ev.event_type, GPIOD_LINE_EVENT_FALLING_EDGE);
+
+ rv = gpiod_line_get_value(line);
+ TEST_ASSERT_EQ(rv, 0);
+}
+TEST_DEFINE(event_get_value_active_low,
+ "events - mixing events and gpiod_line_get_value() (active-low flag)",
+ 0, { 8 });
+
static void event_wait_multiple(void)
{
TEST_CLEANUP(test_close_chip) struct gpiod_chip *chip = NULL;