* 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. */
| 116 | * not crash. |
| 117 | */ |
| 118 | int32_t |
| 119 | test_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 |
nothing calls this directly
no test coverage detected