From 5a0b1f2b07d5a23cd38fd47078d85442f6f9f877 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Wed, 6 Jul 2022 13:53:39 +0200 Subject: [PATCH] ztest API migration: bluetooth/adv Migrate the tests at `bluetooth/adv` to the new ztest API. Signed-off-by: Carles Cufi --- tests/bluetooth/adv/prj.conf | 1 + tests/bluetooth/adv/src/main.c | 11 +++-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/bluetooth/adv/prj.conf b/tests/bluetooth/adv/prj.conf index ef3f2fa1643..19e7c1b8f21 100644 --- a/tests/bluetooth/adv/prj.conf +++ b/tests/bluetooth/adv/prj.conf @@ -3,3 +3,4 @@ CONFIG_BT_DEBUG_LOG=y CONFIG_BT_DEVICE_NAME="Test Adv Data" CONFIG_ASSERT=y CONFIG_ZTEST=y +CONFIG_ZTEST_NEW_API=y diff --git a/tests/bluetooth/adv/src/main.c b/tests/bluetooth/adv/src/main.c index 40512566921..560217f901d 100644 --- a/tests/bluetooth/adv/src/main.c +++ b/tests/bluetooth/adv/src/main.c @@ -24,7 +24,9 @@ static const struct bt_data sd[] = { BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN), }; -void test_adv_fast_ad_data_update(void) +ZTEST_SUITE(adv_tests, NULL, NULL, NULL, NULL, NULL); + +ZTEST(adv_tests, test_adv_fast_ad_data_update) { int err; @@ -49,10 +51,3 @@ void test_adv_fast_ad_data_update(void) zassert_equal(err, 0, "Update adv data failed (err %d)\n", err); } } - -void test_main(void) -{ - ztest_test_suite(test_adv, - ztest_unit_test(test_adv_fast_ad_data_update)); - ztest_run_test_suite(test_adv); -}