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

Function test_lookup_null

dpdk/app/test/test_stack.c:228–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228static int
229test_lookup_null(void)
230{
231 struct rte_stack *s = rte_stack_lookup("stack_not_found");
232
233 if (s != NULL) {
234 printf("[%s():%u] rte_stack found a non-existent stack\n",
235 __func__, __LINE__);
236 return -1;
237 }
238
239 if (rte_errno != ENOENT) {
240 printf("[%s():%u] rte_stack failed to set correct errno on failed lookup\n",
241 __func__, __LINE__);
242 return -1;
243 }
244
245 s = rte_stack_lookup(NULL);
246
247 if (s != NULL) {
248 printf("[%s():%u] rte_stack found a non-existent stack\n",
249 __func__, __LINE__);
250 return -1;
251 }
252
253 if (rte_errno != EINVAL) {
254 printf("[%s():%u] rte_stack failed to set correct errno on failed lookup\n",
255 __func__, __LINE__);
256 return -1;
257 }
258
259 return 0;
260}
261
262static int
263test_free_null(void)

Callers 1

__test_stackFunction · 0.70

Calls 2

rte_stack_lookupFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected