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

Function test5

dpdk/app/test/test_lpm6.c:286–318  ·  view source on GitHub ↗

* Check that rte_lpm6_delete fails gracefully for incorrect user input * arguments */

Source from the content-addressed store, hash-verified

284 * arguments
285 */
286int32_t
287test5(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

Callers

nothing calls this directly

Calls 3

rte_lpm6_deleteFunction · 0.50
rte_lpm6_createFunction · 0.50
rte_lpm6_freeFunction · 0.50

Tested by

no test coverage detected