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

Function test_graph_id_collisions

dpdk/app/test/test_graph.c:698–767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

696}
697
698static int
699test_graph_id_collisions(void)
700{
701 static const char *node_patterns[] = {"test_node_source1", "test_node00"};
702 struct rte_graph_param gconf = {
703 .socket_id = SOCKET_ID_ANY,
704 .nb_node_patterns = 2,
705 .node_patterns = node_patterns,
706 };
707 rte_graph_t g1, g2, g3, g4;
708
709 g1 = rte_graph_create("worker1", &gconf);
710 if (g1 == RTE_GRAPH_ID_INVALID) {
711 printf("Graph 1 creation failed with error = %d\n", rte_errno);
712 return -1;
713 }
714 g2 = rte_graph_create("worker2", &gconf);
715 if (g2 == RTE_GRAPH_ID_INVALID) {
716 printf("Graph 2 creation failed with error = %d\n", rte_errno);
717 return -1;
718 }
719 g3 = rte_graph_create("worker3", &gconf);
720 if (g3 == RTE_GRAPH_ID_INVALID) {
721 printf("Graph 3 creation failed with error = %d\n", rte_errno);
722 return -1;
723 }
724 if (g1 == g2 || g2 == g3 || g1 == g3) {
725 printf("Graph ids should be different\n");
726 return -1;
727 }
728 if (rte_graph_destroy(g2) < 0) {
729 printf("Graph 2 suppression failed\n");
730 return -1;
731 }
732 g4 = rte_graph_create("worker4", &gconf);
733 if (g4 == RTE_GRAPH_ID_INVALID) {
734 printf("Graph 4 creation failed with error = %d\n", rte_errno);
735 return -1;
736 }
737 if (g1 == g3 || g1 == g4 || g3 == g4) {
738 printf("Graph ids should be different\n");
739 return -1;
740 }
741 g2 = rte_graph_clone(g1, "worker2", &gconf);
742 if (g2 == RTE_GRAPH_ID_INVALID) {
743 printf("Graph 4 creation failed with error = %d\n", rte_errno);
744 return -1;
745 }
746 if (g1 == g2 || g1 == g3 || g1 == g4 || g2 == g3 || g2 == g4 || g3 == g4) {
747 printf("Graph ids should be different\n");
748 return -1;
749 }
750 if (rte_graph_destroy(g1) < 0) {
751 printf("Graph 1 suppression failed\n");
752 return -1;
753 }
754 if (rte_graph_destroy(g2) < 0) {
755 printf("Graph 2 suppression failed\n");

Callers

nothing calls this directly

Calls 4

rte_graph_createFunction · 0.85
rte_graph_destroyFunction · 0.85
rte_graph_cloneFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected