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

Function test_graph_lookup_functions

dpdk/app/test/test_graph.c:888–938  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

886}
887
888static int
889test_graph_lookup_functions(void)
890{
891 test_main_t *tm = &test_main;
892 struct rte_node *node;
893 int i;
894
895 for (i = 0; i < MAX_NODES; i++) {
896 node = rte_graph_node_get(graph_id, tm->test_node[i].idx);
897 if (!node) {
898 printf("rte_graph_node_get, failed for node = %d\n",
899 tm->test_node[i].idx);
900 return -1;
901 }
902
903 if (tm->test_node[i].idx != node->id) {
904 printf("Node id didn't match, expected = %d got = %d\n",
905 tm->test_node[i].idx, node->id);
906 return 0;
907 }
908
909 if (strncmp(node->name, node_names[i], RTE_NODE_NAMESIZE)) {
910 printf("Node name didn't match, expected = %s got %s\n",
911 node_names[i], node->name);
912 return -1;
913 }
914 }
915
916 for (i = 0; i < MAX_NODES; i++) {
917 node = rte_graph_node_get_by_name("worker0", node_names[i]);
918 if (!node) {
919 printf("rte_graph_node_get, failed for node = %d\n",
920 tm->test_node[i].idx);
921 return -1;
922 }
923
924 if (tm->test_node[i].idx != node->id) {
925 printf("Node id didn't match, expected = %d got = %d\n",
926 tm->test_node[i].idx, node->id);
927 return 0;
928 }
929
930 if (strncmp(node->name, node_names[i], RTE_NODE_NAMESIZE)) {
931 printf("Node name didn't match, expected = %s got %s\n",
932 node_names[i], node->name);
933 return -1;
934 }
935 }
936
937 return 0;
938}
939
940static int
941graph_cluster_stats_cb_t(bool is_first, bool is_last, void *cookie,

Callers

nothing calls this directly

Calls 4

rte_graph_node_getFunction · 0.85
strncmpFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected