Skip to content
Permalink
Browse files

tests: usb: Fix checking error code

Instead of checking for -EINVAL check that return is not successful
since USB device may return other error code.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
  • Loading branch information...
finikorg authored and nashif committed Mar 25, 2019
1 parent 4f2674f commit 9fa5d9a5bf7ef5cb95edea7bbf5f93a23a978f60
Showing with 3 additions and 5 deletions.
  1. +0 −2 tests/subsys/usb/device/prj.conf
  2. +3 −3 tests/subsys/usb/device/src/main.c
@@ -6,5 +6,3 @@ CONFIG_USB_DRIVER_LOG_LEVEL_DBG=y

CONFIG_USB=y
CONFIG_USB_DEVICE_STACK=y

CONFIG_USB_NATIVE_POSIX=y
@@ -157,8 +157,8 @@ static void test_device_deconfig(void)

static void test_device_dc_api(void)
{
zassert_equal(usb_dc_ep_mps(0x20), -EINVAL,
"Invalid test usb_dc_ep_mps(INVALID) failed");
zassert_not_equal(usb_dc_ep_mps(0x20), TC_PASS,
"Invalid test usb_dc_ep_mps(INVALID) failed");

zassert_equal(usb_dc_ep_mps(0x0), 64,
"usb_dc_ep_mps(0x00) failed");
@@ -170,7 +170,7 @@ static void test_device_dc_api(void)
"usb_dc_ep_mps(ENDP_BULK_IN) failed");

zassert_equal(usb_dc_set_address(0x01), TC_PASS,
"usb_dc_set_address(0x01) failed");
"usb_dc_set_address(0x01) (not attached) failed");
}

/*test case main entry*/

0 comments on commit 9fa5d9a

Please sign in to comment.
You can’t perform that action at this time.