tests: boards: intel_adsp: move the ssp test to new ztest API
Migrate the testsuite tests/boards/intel_adsp/ssp to the new ztest API. Signed-off-by: Enjia Mai <enjia.mai@intel.com>
This commit is contained in:
parent
c895d33ebf
commit
6db5e59af2
|
@ -1,4 +1,5 @@
|
|||
CONFIG_ZTEST=y
|
||||
CONFIG_ZTEST_NEW_API=y
|
||||
CONFIG_DAI=y
|
||||
CONFIG_INTEL_MN=y
|
||||
CONFIG_DMA_DW_HOST_MASK=1
|
||||
|
|
|
@ -255,7 +255,7 @@ static int check_transmission(void)
|
|||
return TC_PASS;
|
||||
}
|
||||
|
||||
void test_adsp_ssp_transfer(void)
|
||||
ZTEST(adsp_ssp, test_adsp_ssp_transfer)
|
||||
{
|
||||
const struct dai_properties *props;
|
||||
static int chan_id_rx;
|
||||
|
@ -344,7 +344,7 @@ void test_adsp_ssp_transfer(void)
|
|||
check_transmission();
|
||||
}
|
||||
|
||||
void test_adsp_ssp_config_set(void)
|
||||
ZTEST(adsp_ssp, test_adsp_ssp_config_set)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
@ -386,7 +386,7 @@ void test_adsp_ssp_config_set(void)
|
|||
zassert_equal(ret, TC_PASS, NULL);
|
||||
}
|
||||
|
||||
void test_adsp_ssp_probe(void)
|
||||
static void test_adsp_ssp_probe(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
@ -395,17 +395,16 @@ void test_adsp_ssp_probe(void)
|
|||
zassert_equal(ret, TC_PASS, NULL);
|
||||
}
|
||||
|
||||
void test_main(void)
|
||||
static void *adsp_ssp_setup(void)
|
||||
{
|
||||
k_object_access_grant(dev_dai_ssp, k_current_get());
|
||||
|
||||
zassert_true(device_is_ready(dev_dai_ssp), "device SSP_0 is not ready");
|
||||
zassert_true(device_is_ready(dev_dma_dw), "device DMA 0 is not ready");
|
||||
|
||||
ztest_test_suite(adsp_ssp,
|
||||
ztest_unit_test(test_adsp_ssp_probe),
|
||||
ztest_unit_test(test_adsp_ssp_config_set),
|
||||
ztest_unit_test(test_adsp_ssp_transfer));
|
||||
test_adsp_ssp_probe();
|
||||
|
||||
ztest_run_test_suite(adsp_ssp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ZTEST_SUITE(adsp_ssp, NULL, adsp_ssp_setup, NULL, NULL, NULL);
|
||||
|
|
Loading…
Reference in a new issue