* Check that rte_lpm6_delete fails gracefully for incorrect user input * arguments */
| 284 | * arguments |
| 285 | */ |
| 286 | int32_t |
| 287 | test5(void) |
| 288 | { |
| 289 | struct rte_lpm6 *lpm = NULL; |
| 290 | struct rte_lpm6_config config; |
| 291 | uint8_t ip[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; |
| 292 | uint8_t depth = 24; |
| 293 | int32_t status = 0; |
| 294 | |
| 295 | config.max_rules = MAX_RULES; |
| 296 | config.number_tbl8s = NUMBER_TBL8S; |
| 297 | config.flags = 0; |
| 298 | |
| 299 | /* rte_lpm_delete: lpm == NULL */ |
| 300 | status = rte_lpm6_delete(NULL, ip, depth); |
| 301 | TEST_LPM_ASSERT(status < 0); |
| 302 | |
| 303 | /*Create valid lpm to use in rest of test. */ |
| 304 | lpm = rte_lpm6_create(__func__, SOCKET_ID_ANY, &config); |
| 305 | TEST_LPM_ASSERT(lpm != NULL); |
| 306 | |
| 307 | /* rte_lpm_delete: depth < 1 */ |
| 308 | status = rte_lpm6_delete(lpm, ip, 0); |
| 309 | TEST_LPM_ASSERT(status < 0); |
| 310 | |
| 311 | /* rte_lpm_delete: depth > MAX_DEPTH */ |
| 312 | status = rte_lpm6_delete(lpm, ip, (MAX_DEPTH + 1)); |
| 313 | TEST_LPM_ASSERT(status < 0); |
| 314 | |
| 315 | rte_lpm6_free(lpm); |
| 316 | |
| 317 | return PASS; |
| 318 | } |
| 319 | |
| 320 | /* |
| 321 | * Check that rte_lpm6_lookup fails gracefully for incorrect user input |
nothing calls this directly
no test coverage detected