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

Function test_node_clone

dpdk/app/test/test_graph.c:543–583  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

541}
542
543static int
544test_node_clone(void)
545{
546 test_main_t *tm = &test_main;
547 uint32_t node_id, dummy_id;
548 int i;
549
550 node_id = rte_node_from_name("test_node00");
551 tm->test_node[0].idx = node_id;
552
553 dummy_id = rte_node_clone(node_id, "test_node00");
554 if (rte_node_is_invalid(dummy_id)) {
555 printf("Got invalid id when clone, Expecting fail\n");
556 return -1;
557 }
558
559 /* Clone with same name, should fail */
560 dummy_id = rte_node_clone(node_id, "test_node00");
561 if (!rte_node_is_invalid(dummy_id)) {
562 printf("Got valid id when clone with same name, Expecting fail\n");
563 return -1;
564 }
565
566 for (i = 1; i < MAX_NODES; i++) {
567 tm->test_node[i].idx =
568 rte_node_clone(node_id, tm->test_node[i].node.name);
569 if (rte_node_is_invalid(tm->test_node[i].idx)) {
570 printf("Got invalid node id\n");
571 return -1;
572 }
573 }
574
575 /* Clone from cloned node should fail */
576 dummy_id = rte_node_clone(tm->test_node[1].idx, "dummy_node");
577 if (!rte_node_is_invalid(dummy_id)) {
578 printf("Got valid node id when cloning from cloned node, expected fail\n");
579 return -1;
580 }
581
582 return 0;
583}
584
585static int
586test_update_edges(void)

Callers 1

graph_setupFunction · 0.85

Calls 4

rte_node_from_nameFunction · 0.85
rte_node_cloneFunction · 0.85
rte_node_is_invalidFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected