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

Function test_free_null

dpdk/app/test/test_rib6.c:94–109  ·  view source on GitHub ↗

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

92 * not crash.
93 */
94int32_t
95test_free_null(void)
96{
97 struct rte_rib6 *rib = NULL;
98 struct rte_rib6_conf config;
99
100 config.max_nodes = MAX_RULES;
101 config.ext_sz = 0;
102
103 rib = rte_rib6_create(__func__, SOCKET_ID_ANY, &config);
104 RTE_TEST_ASSERT(rib != NULL, "Failed to create RIB\n");
105
106 rte_rib6_free(rib);
107 rte_rib6_free(NULL);
108 return TEST_SUCCESS;
109}
110
111/*
112 * Check that rte_rib6_insert fails gracefully

Callers

nothing calls this directly

Calls 2

rte_rib6_createFunction · 0.85
rte_rib6_freeFunction · 0.85

Tested by

no test coverage detected