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

Function test_create_graph

dpdk/app/test/test_graph.c:624–661  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

622}
623
624static int
625test_create_graph(void)
626{
627 static const char *node_patterns_dummy[] = {
628 "test_node_source1", "test_node00",
629 "test_node00-test_node11", "test_node00-test_node22",
630 "test_node00-test_node33", "test_node00-dummy_node",
631 };
632 struct rte_graph_param gconf = {
633 .socket_id = SOCKET_ID_ANY,
634 .nb_node_patterns = 6,
635 .node_patterns = node_patterns_dummy,
636 };
637 uint32_t dummy_node_id;
638 uint32_t node_id;
639
640 node_id = rte_node_from_name("test_node00");
641 dummy_node_id = rte_node_clone(node_id, "dummy_node");
642 if (rte_node_is_invalid(dummy_node_id)) {
643 printf("Got invalid node id\n");
644 return -1;
645 }
646
647 graph_id = rte_graph_create("worker0", &gconf);
648 if (graph_id != RTE_GRAPH_ID_INVALID) {
649 printf("Graph creation success with isolated node, expected graph creation fail\n");
650 return -1;
651 }
652
653 gconf.nb_node_patterns = 5;
654 gconf.node_patterns = node_patterns;
655 graph_id = rte_graph_create("worker0", &gconf);
656 if (graph_id == RTE_GRAPH_ID_INVALID) {
657 printf("Graph creation failed with error = %d\n", rte_errno);
658 return -1;
659 }
660 return 0;
661}
662
663static int
664test_graph_clone(void)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected