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

Function test_create_invalid

dpdk/app/test/test_rib6.c:31–63  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

rte_rib6_createFunction · 0.85

Tested by

no test coverage detected