Skip to content

Commit 0c87784

Browse files
QiuPeiyangAnas Nashif
authored andcommitted
tests/gpio: fix test GPIO_INT_EDGE bug
When test GPIO_INT_EDGE, there is no code to skip GPIO_INT_LEVEL and jump to the end of the function. So GPIO_INT_LEVEL will always be checked (Besides, it't always true), even if it's testing GPIO_INT_EDGE, which will cause GPIO_INT_EDGE cases fail. Add a goto statement for GPIO_INT_EDGE to skip GPIO_INT_LEVEL. Jira: ZEP-1685 Change-Id: I10ce21c04c49f34aafdc2cd2f60f3e5377d6f1f5 Signed-off-by: Qiu Peiyang <[email protected]>
1 parent bc2faf3 commit 0c87784

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/drivers/gpio/gpio_basic_api/src/test_callback_trigger.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ static int test_callback(int mode)
9090
TC_ERROR("not trigger callback correctly\n");
9191
goto err_exit;
9292
}
93+
goto pass_exit;
9394
}
9495

9596
if ((mode & GPIO_INT_LEVEL) == GPIO_INT_LEVEL) {
@@ -98,6 +99,8 @@ static int test_callback(int mode)
9899
goto err_exit;
99100
}
100101
}
102+
103+
pass_exit:
101104
gpio_remove_callback(dev, &drv_data->gpio_cb);
102105
return TC_PASS;
103106

0 commit comments

Comments
 (0)