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

Function test_format_addr

dpdk/app/test/test_net_ether.c:39–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39static int
40test_format_addr(void)
41{
42 struct rte_ether_addr rand_ea = { };
43 char buf[RTE_ETHER_ADDR_FMT_SIZE];
44 unsigned int i;
45
46 for (i = 0; i < N; i++) {
47 struct rte_ether_addr result = { };
48 int ret;
49
50 rte_eth_random_addr(rand_ea.addr_bytes);
51
52 rte_ether_format_addr(buf, sizeof(buf), &rand_ea);
53
54 ret = rte_ether_unformat_addr(buf, &result);
55 if (ret != 0) {
56 fprintf(stderr, "rte_ether_unformat_addr(%s) failed\n", buf);
57 return -1;
58 }
59 RTE_TEST_ASSERT(rte_is_same_ether_addr(&rand_ea, &result),
60 "rte_ether_format/unformat mismatch");
61 }
62 return 0;
63
64}
65
66static int
67test_unformat_addr(void)

Callers 1

test_net_etherFunction · 0.85

Calls 4

rte_eth_random_addrFunction · 0.85
rte_ether_format_addrFunction · 0.85
rte_ether_unformat_addrFunction · 0.85
rte_is_same_ether_addrFunction · 0.85

Tested by

no test coverage detected