test/reorder: fix memory leak
Add a teardown function that frees allocated resources. Fixes: d0c9b58d7156 ("app/test: new reorder unit test") Cc: stable@dpdk.org Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
This commit is contained in:
parent
24d376bfee
commit
8d0e39debc
@ -331,9 +331,20 @@ test_setup(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
test_teardown(void)
|
||||||
|
{
|
||||||
|
rte_reorder_free(test_params->b);
|
||||||
|
test_params->b = NULL;
|
||||||
|
rte_mempool_free(test_params->p);
|
||||||
|
test_params->p = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static struct unit_test_suite reorder_test_suite = {
|
static struct unit_test_suite reorder_test_suite = {
|
||||||
|
|
||||||
.setup = test_setup,
|
.setup = test_setup,
|
||||||
|
.teardown = test_teardown,
|
||||||
.suite_name = "Reorder Unit Test Suite",
|
.suite_name = "Reorder Unit Test Suite",
|
||||||
.unit_test_cases = {
|
.unit_test_cases = {
|
||||||
TEST_CASE(test_reorder_create),
|
TEST_CASE(test_reorder_create),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user