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

Function test_reorder_init

dpdk/app/test/test_reorder.c:55–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55static int
56test_reorder_init(void)
57{
58 struct rte_reorder_buffer *b = NULL;
59 unsigned int size;
60 /*
61 * The minimum memory area size that should be passed to library determined
62 * by rte_reorder_memory_footprint_get().
63 * Otherwise error will be thrown
64 */
65
66 size = rte_reorder_memory_footprint_get(REORDER_BUFFER_SIZE) - 1;
67 b = rte_reorder_init(b, size, "PKT1", REORDER_BUFFER_SIZE);
68 TEST_ASSERT((b == NULL) && (rte_errno == EINVAL),
69 "No error on init with NULL buffer.");
70
71 b = rte_malloc(NULL, size, 0);
72 b = rte_reorder_init(b, size, "PKT1", REORDER_BUFFER_SIZE);
73 TEST_ASSERT((b == NULL) && (rte_errno == EINVAL),
74 "No error on init with invalid mem zone size.");
75 rte_free(b);
76
77 size = rte_reorder_memory_footprint_get(REORDER_BUFFER_SIZE);
78 b = rte_malloc(NULL, size, 0);
79 b = rte_reorder_init(b, size, "PKT1", REORDER_BUFFER_SIZE_INVALID);
80 TEST_ASSERT((b == NULL) && (rte_errno == EINVAL),
81 "No error on init with invalid buffer size param.");
82
83 b = rte_reorder_init(b, size, NULL, REORDER_BUFFER_SIZE);
84 TEST_ASSERT((b == NULL) && (rte_errno == EINVAL),
85 "No error on init with invalid name.");
86 rte_free(b);
87
88 return 0;
89}
90
91static int
92test_reorder_find_existing(void)

Callers

nothing calls this directly

Calls 4

rte_reorder_initFunction · 0.85
rte_mallocFunction · 0.85
rte_freeFunction · 0.85

Tested by

no test coverage detected