ztest API migration: bluetooth/adv

Migrate the tests at `bluetooth/adv` to the new ztest API.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2022-07-06 13:53:39 +02:00 committed by Carles Cufí
parent 55df2bf08f
commit 5a0b1f2b07
2 changed files with 4 additions and 8 deletions

View File

@ -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

View File

@ -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);
}