tests: arm64_gicv3_its: Move to new ztest API

Migrate the test to the new ztest API.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This commit is contained in:
Carlo Caione 2022-07-06 10:36:38 +02:00 committed by Fabio Baltieri
parent 3a303498b4
commit 8ada5b38c4
2 changed files with 7 additions and 15 deletions

View file

@ -1,3 +1,4 @@
CONFIG_LOG=y
CONFIG_ZTEST=y
CONFIG_GIC_V3_ITS=y
CONFIG_ZTEST_NEW_API=y

View file

@ -34,7 +34,7 @@ static void lpi_irq_handle(const void *parameter)
unsigned int vectors[ITS_TEST_NUM_DEVS][ITS_TEST_NUM_ITES];
static void test_gicv3_its_alloc(void)
ZTEST(arm64_gicv3_its, test_gicv3_its_alloc)
{
int devn, event_id;
const struct device *dev = DEVICE_DT_INST_GET(0);
@ -57,7 +57,7 @@ static void test_gicv3_its_alloc(void)
}
}
static void test_gicv3_its_connect(void)
ZTEST(arm64_gicv3_its, test_gicv3_its_connect)
{
int devn, event_id;
const struct device *dev = DEVICE_DT_INST_GET(0);
@ -78,7 +78,7 @@ static void test_gicv3_its_connect(void)
}
}
static void test_gicv3_its_irq_simple(void)
ZTEST(arm64_gicv3_its, test_gicv3_its_irq_simple)
{
const struct device *dev = DEVICE_DT_INST_GET(0);
unsigned int irqn = vectors[0][0];
@ -101,7 +101,7 @@ static void test_gicv3_its_irq_simple(void)
irqn, device_id, event_id);
}
static void test_gicv3_its_irq_disable(void)
ZTEST(arm64_gicv3_its, test_gicv3_its_irq_disable)
{
const struct device *dev = DEVICE_DT_INST_GET(0);
unsigned int irqn = vectors[0][0];
@ -140,7 +140,7 @@ static void test_gicv3_its_irq_disable(void)
irqn, device_id, event_id);
}
static void test_gicv3_its_irq(void)
ZTEST(arm64_gicv3_its, test_gicv3_its_irq)
{
int devn, event_id;
const struct device *dev = DEVICE_DT_INST_GET(0);
@ -172,13 +172,4 @@ static void test_gicv3_its_irq(void)
}
}
void test_main(void)
{
ztest_test_suite(its_func,
ztest_unit_test(test_gicv3_its_alloc),
ztest_unit_test(test_gicv3_its_connect),
ztest_unit_test(test_gicv3_its_irq_simple),
ztest_unit_test(test_gicv3_its_irq_disable),
ztest_unit_test(test_gicv3_its_irq));
ztest_run_test_suite(its_func);
}
ZTEST_SUITE(arm64_gicv3_its, NULL, NULL, NULL, NULL, NULL);