From 85d68d58a0dd06834d45049d8452aa56ccef3a8c Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Thu, 22 Jun 2017 20:56:36 +0200 Subject: [PATCH] tests: gpiomon: new test case Verify that we actually ignore events we're not watching. Signed-off-by: Bartosz Golaszewski --- tests/tests-gpiomon.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/tests-gpiomon.c b/tests/tests-gpiomon.c index 19b9a16..f734619 100644 --- a/tests/tests-gpiomon.c +++ b/tests/tests-gpiomon.c @@ -127,6 +127,24 @@ TEST_DEFINE(gpiomon_both_events_sigterm, "tools: gpiomon - receive both types of events and kill with SIGTERM", 0, { 8, 8 }); +static void gpiomon_ignore_falling_edge(void) +{ + test_tool_run("gpiomon", "--rising-edge", + test_chip_name(0), "4", (char *)NULL); + test_set_event(0, 4, TEST_EVENT_FALLING, 100); + usleep(300000); + test_tool_signal(SIGTERM); + test_tool_wait(); + + TEST_ASSERT(test_tool_exited()); + TEST_ASSERT_RET_OK(test_tool_exit_status()); + TEST_ASSERT_NULL(test_tool_stdout()); + TEST_ASSERT_NULL(test_tool_stderr()); +} +TEST_DEFINE(gpiomon_ignore_falling_edge, + "tools: gpiomon - wait for rising edge events, ignore falling edge", + 0, { 8, 8 }); + static void gpiomon_no_arguments(void) { test_tool_run("gpiomon", (char *)NULL); -- 2.30.2