Skip to content
Permalink
Browse files

tests: usb: Add write() and set_callback() tests

Add more tests for invalid EP testing.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
  • Loading branch information...
finikorg authored and nashif committed Mar 26, 2019
1 parent 8cf9bf0 commit f350c275e1bbdd034876d1fdfcd4741e8dd69dd6
Showing with 9 additions and 5 deletions.
  1. +9 −5 tests/subsys/usb/device/src/main.c
@@ -232,14 +232,18 @@ static void test_usb_dc_api_invalid(void)
"usb_dc_ep_mps(INVALID_EP)");
}

static void test_usb_dc_api_read(void)
static void test_usb_dc_api_read_write(void)
{
size_t read;
size_t size;
u8_t byte;

/* Read invalid EP */
zassert_not_equal(usb_read(0x20, &byte, sizeof(byte), &read),
TC_PASS, "usb_read(INVALID)");
zassert_not_equal(usb_read(INVALID_EP, &byte, sizeof(byte), &size),
TC_PASS, "usb_read(INVALID_EP)");

/* Write to invalid EP */
zassert_not_equal(usb_write(INVALID_EP, &byte, sizeof(byte), &size),
TC_PASS, "usb_write(INVALID_EP)");
}

/*test case main entry*/
@@ -251,7 +255,7 @@ void test_main(void)
ztest_unit_test(test_usb_disable),
ztest_unit_test(test_usb_setup),
ztest_unit_test(test_usb_dc_api),
ztest_unit_test(test_usb_dc_api_read),
ztest_unit_test(test_usb_dc_api_read_write),
ztest_unit_test(test_usb_dc_api_invalid),
ztest_unit_test(test_usb_deconfig),
ztest_unit_test(test_usb_disable));

0 comments on commit f350c27

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