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

Function test_latencystats_get

dpdk/app/test/test_latencystats.c:107–135  ·  view source on GitHub ↗

Test case to get latency stats values */

Source from the content-addressed store, hash-verified

105
106/* Test case to get latency stats values */
107static int test_latencystats_get(void)
108{
109 int ret = 0, i = 0;
110 int size = 0;
111 struct rte_metric_value values[NUM_STATS];
112
113 size_t v_size = sizeof(struct rte_metric_value);
114 for (i = 0; i < NUM_STATS; i++)
115 memset(&values[i], 0, v_size);
116
117 /* Success Test: Valid values and valid size */
118 size = NUM_STATS;
119 ret = rte_latencystats_get(values, size);
120 TEST_ASSERT((ret == NUM_STATS), "Test Failed to get latency metrics"
121 " values");
122
123 /* Failure Test: Invalid values and valid size */
124 ret = rte_latencystats_get(NULL, size);
125 TEST_ASSERT((ret == NUM_STATS), "Test Failed to get the stats count,"
126 "Actual: %d Expected: %d", ret, NUM_STATS);
127
128 /* Failure Test: Valid values and invalid size */
129 size = 0;
130 ret = rte_latencystats_get(values, size);
131 TEST_ASSERT((ret == NUM_STATS), "Test Failed to get the stats count,"
132 "Actual: %d Expected: %d", ret, NUM_STATS);
133
134 return TEST_SUCCESS;
135}
136
137static int test_latency_ring_setup(void)
138{

Callers

nothing calls this directly

Calls 2

memsetFunction · 0.85
rte_latencystats_getFunction · 0.85

Tested by

no test coverage detected