[PATCH v16 2/6] test/memarea: support memarea test

Burakov, Anatoly anatoly.burakov at intel.com
Mon Jul 17 15:22:26 CEST 2023


On 7/10/2023 7:49 AM, Chengwen Feng wrote:
> This patch supports memarea test of rte_memarea_create() and
> rte_memarea_destroy() API.
> 
> Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
> Reviewed-by: Dongdong Liu <liudongdong3 at huawei.com>
> Acked-by: Morten Brørup <mb at smartsharesystems.com>
> ---

Hi,

> +	/* test for create with LIBC */
> +	test_memarea_init_param(&init);
> +	init.source = RTE_MEMAREA_SOURCE_LIBC;
> +	ma = rte_memarea_create(&init);
> +	TEST_ASSERT(ma != NULL, "Expected Non-NULL");
> +	rte_memarea_destroy(ma);
> +
> +	return 0;

Here and in other test functions: I think TEST_SUCCESS would be the 
semantically correct value to return.

> +}
> +
> +static struct unit_test_suite memarea_test_suite  = {
> +	.suite_name = "Memarea Unit Test Suite",
> +	.setup = NULL,
> +	.teardown = NULL,
> +	.unit_test_cases = {
> +		TEST_CASE(test_memarea_create_bad_param),
> +		TEST_CASE(test_memarea_create_destroy),
> +
> +		TEST_CASES_END() /**< NULL terminate unit test array */
> +	}
> +};
> +
> +static int
> +test_memarea(void)
> +{
> +	return unit_test_suite_runner(&memarea_test_suite);
> +}
> +
> +REGISTER_TEST_COMMAND(memarea_autotest, test_memarea);

Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>

-- 
Thanks,
Anatoly



More information about the dev mailing list