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

Function test8

dpdk/app/test/test_lpm6.c:400–432  ·  view source on GitHub ↗

* Checks that rte_lpm6_delete_bulk_func fails gracefully for incorrect user * input arguments */

Source from the content-addressed store, hash-verified

398 * input arguments
399 */
400int32_t
401test8(void)
402{
403 struct rte_lpm6 *lpm = NULL;
404 struct rte_lpm6_config config;
405 uint8_t ip[10][16];
406 uint8_t depth[10];
407 int32_t status = 0;
408
409 config.max_rules = MAX_RULES;
410 config.number_tbl8s = NUMBER_TBL8S;
411 config.flags = 0;
412
413 /* rte_lpm6_delete: lpm == NULL */
414 status = rte_lpm6_delete_bulk_func(NULL, ip, depth, 10);
415 TEST_LPM_ASSERT(status < 0);
416
417 /*Create valid lpm to use in rest of test. */
418 lpm = rte_lpm6_create(__func__, SOCKET_ID_ANY, &config);
419 TEST_LPM_ASSERT(lpm != NULL);
420
421 /* rte_lpm6_delete: ip = NULL */
422 status = rte_lpm6_delete_bulk_func(lpm, NULL, depth, 10);
423 TEST_LPM_ASSERT(status < 0);
424
425 /* rte_lpm6_delete: next_hop = NULL */
426 status = rte_lpm6_delete_bulk_func(lpm, ip, NULL, 10);
427 TEST_LPM_ASSERT(status < 0);
428
429 rte_lpm6_free(lpm);
430
431 return PASS;
432}
433
434/*
435 * Call add, lookup and delete for a single rule with depth < 24.

Callers

nothing calls this directly

Calls 3

rte_lpm6_createFunction · 0.50
rte_lpm6_freeFunction · 0.50

Tested by

no test coverage detected