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

Function test_free_null

dpdk/app/test/test_fib.c:118–135  ·  view source on GitHub ↗

* Call rte_fib_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

116 * not crash.
117 */
118int32_t
119test_free_null(void)
120{
121 struct rte_fib *fib = NULL;
122 struct rte_fib_conf config;
123
124 config.max_routes = MAX_ROUTES;
125 config.rib_ext_sz = 0;
126 config.default_nh = 0;
127 config.type = RTE_FIB_DUMMY;
128
129 fib = rte_fib_create(__func__, SOCKET_ID_ANY, &config);
130 RTE_TEST_ASSERT(fib != NULL, "Failed to create FIB\n");
131
132 rte_fib_free(fib);
133 rte_fib_free(NULL);
134 return TEST_SUCCESS;
135}
136
137/*
138 * Check that rte_fib_add and rte_fib_delete fails gracefully

Callers

nothing calls this directly

Calls 2

rte_fib_createFunction · 0.85
rte_fib_freeFunction · 0.85

Tested by

no test coverage detected