ztest API Migration: bluetooth/l2cap
Migrate the unit tests at `bluetooth/l2cap` to use the new ztest API. Signed-off-by: Tristan Honscheid <honscheid@google.com>
This commit is contained in:
parent
7e7855d669
commit
aa8f740abf
2 changed files with 4 additions and 9 deletions
|
@ -1,5 +1,6 @@
|
||||||
CONFIG_TEST=y
|
CONFIG_TEST=y
|
||||||
CONFIG_ZTEST=y
|
CONFIG_ZTEST=y
|
||||||
|
CONFIG_ZTEST_NEW_API=y
|
||||||
|
|
||||||
CONFIG_BT=y
|
CONFIG_BT=y
|
||||||
CONFIG_BT_CTLR=n
|
CONFIG_BT_CTLR=n
|
||||||
|
|
|
@ -38,7 +38,9 @@ static struct bt_l2cap_server test_inv_server = {
|
||||||
.psm = 0xffff,
|
.psm = 0xffff,
|
||||||
};
|
};
|
||||||
|
|
||||||
void test_l2cap_register(void)
|
ZTEST_SUITE(test_l2cap, NULL, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
ZTEST(test_l2cap, test_l2cap_register)
|
||||||
{
|
{
|
||||||
/* Attempt to register server with PSM auto allocation */
|
/* Attempt to register server with PSM auto allocation */
|
||||||
zassert_false(bt_l2cap_server_register(&test_server),
|
zassert_false(bt_l2cap_server_register(&test_server),
|
||||||
|
@ -68,11 +70,3 @@ void test_l2cap_register(void)
|
||||||
zassert_true(bt_l2cap_server_register(&test_dyn_server),
|
zassert_true(bt_l2cap_server_register(&test_dyn_server),
|
||||||
"Test dynamic PSM server duplicate succeeded");
|
"Test dynamic PSM server duplicate succeeded");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*test case main entry*/
|
|
||||||
void test_main(void)
|
|
||||||
{
|
|
||||||
ztest_test_suite(test_l2cap,
|
|
||||||
ztest_unit_test(test_l2cap_register));
|
|
||||||
ztest_run_test_suite(test_l2cap);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue