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

Function test_free_null

dpdk/app/test/test_rib.c:95–110  ·  view source on GitHub ↗

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

93 * not crash.
94 */
95int32_t
96test_free_null(void)
97{
98 struct rte_rib *rib = NULL;
99 struct rte_rib_conf config;
100
101 config.max_nodes = MAX_RULES;
102 config.ext_sz = 0;
103
104 rib = rte_rib_create(__func__, SOCKET_ID_ANY, &config);
105 RTE_TEST_ASSERT(rib != NULL, "Failed to create RIB\n");
106
107 rte_rib_free(rib);
108 rte_rib_free(NULL);
109 return TEST_SUCCESS;
110}
111
112/*
113 * Check that rte_rib_insert fails gracefully for incorrect user input arguments

Callers

nothing calls this directly

Calls 2

rte_rib_createFunction · 0.85
rte_rib_freeFunction · 0.85

Tested by

no test coverage detected