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

Function test5

dpdk/app/test/test_lpm.c:241–269  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

239 * arguments
240 */
241int32_t
242test5(void)
243{
244#if defined(RTE_LIBRTE_LPM_DEBUG)
245 struct rte_lpm *lpm = NULL;
246 struct rte_lpm_config config;
247
248 config.max_rules = MAX_RULES;
249 config.number_tbl8s = NUMBER_TBL8S;
250 config.flags = 0;
251 uint32_t ip = RTE_IPV4(0, 0, 0, 0), next_hop_return = 0;
252 int32_t status = 0;
253
254 /* rte_lpm_lookup: lpm == NULL */
255 status = rte_lpm_lookup(NULL, ip, &next_hop_return);
256 TEST_LPM_ASSERT(status < 0);
257
258 /*Create valid lpm to use in rest of test. */
259 lpm = rte_lpm_create(__func__, SOCKET_ID_ANY, &config);
260 TEST_LPM_ASSERT(lpm != NULL);
261
262 /* rte_lpm_lookup: depth < 1 */
263 status = rte_lpm_lookup(lpm, ip, NULL);
264 TEST_LPM_ASSERT(status < 0);
265
266 rte_lpm_free(lpm);
267#endif
268 return PASS;
269}
270
271
272

Callers

nothing calls this directly

Calls 3

rte_lpm_lookupFunction · 0.50
rte_lpm_createFunction · 0.50
rte_lpm_freeFunction · 0.50

Tested by

no test coverage detected