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 <peiyangx.qiu@intel.com>
This commit is contained in:
Qiu Peiyang 2017-02-03 15:41:04 +08:00 committed by Anas Nashif
commit 0c87784c84

View file

@ -90,6 +90,7 @@ static int test_callback(int mode)
TC_ERROR("not trigger callback correctly\n");
goto err_exit;
}
goto pass_exit;
}
if ((mode & GPIO_INT_LEVEL) == GPIO_INT_LEVEL) {
@ -98,6 +99,8 @@ static int test_callback(int mode)
goto err_exit;
}
}
pass_exit:
gpio_remove_callback(dev, &drv_data->gpio_cb);
return TC_PASS;