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

Function test_create_invalid

dpdk/app/test/test_rib.c:32–64  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

30 * arguments
31 */
32int32_t
33test_create_invalid(void)
34{
35 struct rte_rib *rib = NULL;
36 struct rte_rib_conf config;
37
38 config.max_nodes = MAX_RULES;
39 config.ext_sz = 0;
40
41 /* rte_rib_create: rib name == NULL */
42 rib = rte_rib_create(NULL, SOCKET_ID_ANY, &config);
43 RTE_TEST_ASSERT(rib == NULL,
44 "Call succeeded with invalid parameters\n");
45
46 /* rte_rib_create: config == NULL */
47 rib = rte_rib_create(__func__, SOCKET_ID_ANY, NULL);
48 RTE_TEST_ASSERT(rib == NULL,
49 "Call succeeded with invalid parameters\n");
50
51 /* socket_id < -1 is invalid */
52 rib = rte_rib_create(__func__, -2, &config);
53 RTE_TEST_ASSERT(rib == NULL,
54 "Call succeeded with invalid parameters\n");
55
56 /* rte_rib_create: max_nodes = 0 */
57 config.max_nodes = 0;
58 rib = rte_rib_create(__func__, SOCKET_ID_ANY, &config);
59 RTE_TEST_ASSERT(rib == NULL,
60 "Call succeeded with invalid parameters\n");
61 config.max_nodes = MAX_RULES;
62
63 return TEST_SUCCESS;
64}
65
66/*
67 * Create rib table then delete rib table 10 times

Callers

nothing calls this directly

Calls 1

rte_rib_createFunction · 0.85

Tested by

no test coverage detected