MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_free_null

Function test_free_null

dpdk/app/test/test_fib6.c:120–138  ·  view source on GitHub ↗

* Call rte_fib6_free for NULL pointer user input. Note: free has no return and * therefore it is impossible to check for failure but this test is added to * increase function coverage metrics and to validate that freeing null does * not crash. */

Source from the content-addressed store, hash-verified

118 * not crash.
119 */
120int32_t
121test_free_null(void)
122{
123 struct rte_fib6 *fib = NULL;
124 struct rte_fib6_conf config;
125
126 config.max_routes = MAX_ROUTES;
127 config.rib_ext_sz = 0;
128 config.default_nh = 0;
129 config.type = RTE_FIB6_DUMMY;
130
131 fib = rte_fib6_create(__func__, SOCKET_ID_ANY, &config);
132 RTE_TEST_ASSERT(fib != NULL, "Failed to create FIB\n");
133
134 rte_fib6_free(fib);
135 rte_fib6_free(NULL);
136
137 return TEST_SUCCESS;
138}
139
140/*
141 * Check that rte_fib6_add and rte_fib6_delete fails gracefully

Callers

nothing calls this directly

Calls 2

rte_fib6_createFunction · 0.85
rte_fib6_freeFunction · 0.85

Tested by

no test coverage detected