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

Function test_update_edges

dpdk/app/test/test_graph.c:585–622  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

583}
584
585static int
586test_update_edges(void)
587{
588 test_main_t *tm = &test_main;
589 uint32_t node_id;
590 uint16_t count;
591 int i;
592
593 node_id = rte_node_from_name("test_node00");
594 count = rte_node_edge_update(node_id, 0,
595 tm->test_node[0].node.next_nodes,
596 tm->test_node[0].node.nb_edges);
597 if (count != tm->test_node[0].node.nb_edges) {
598 printf("Update edges failed expected: %d got = %d\n",
599 tm->test_node[0].node.nb_edges, count);
600 return -1;
601 }
602
603 for (i = 1; i < MAX_NODES; i++) {
604 count = rte_node_edge_update(tm->test_node[i].idx, 0,
605 tm->test_node[i].node.next_nodes,
606 tm->test_node[i].node.nb_edges);
607 if (count != tm->test_node[i].node.nb_edges) {
608 printf("Update edges failed expected: %d got = %d\n",
609 tm->test_node[i].node.nb_edges, count);
610 return -1;
611 }
612
613 count = rte_node_edge_shrink(tm->test_node[i].idx,
614 tm->test_node[i].node.nb_edges);
615 if (count != tm->test_node[i].node.nb_edges) {
616 printf("Shrink edges failed\n");
617 return -1;
618 }
619 }
620
621 return 0;
622}
623
624static int
625test_create_graph(void)

Callers

nothing calls this directly

Calls 4

rte_node_from_nameFunction · 0.85
rte_node_edge_updateFunction · 0.85
rte_node_edge_shrinkFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected