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

Function test_ether_addr

dpdk/app/test/test_net_ether.c:17–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15};
16
17static int
18test_ether_addr(void)
19{
20 struct rte_ether_addr rand_ea = { };
21 unsigned int i;
22
23 RTE_TEST_ASSERT(rte_is_zero_ether_addr(&zero_ea), "Zero address is not zero");
24 RTE_TEST_ASSERT(!rte_is_zero_ether_addr(&bcast_ea), "Broadcast is zero");
25
26 for (i = 0; i < N; i++) {
27 rte_eth_random_addr(rand_ea.addr_bytes);
28 RTE_TEST_ASSERT(!rte_is_zero_ether_addr(&rand_ea),
29 "Random address is zero");
30 RTE_TEST_ASSERT(rte_is_unicast_ether_addr(&rand_ea),
31 "Random address is not unicast");
32 RTE_TEST_ASSERT(rte_is_local_admin_ether_addr(&rand_ea),
33 "Random address is not local admin");
34 }
35
36 return 0;
37}
38
39static int
40test_format_addr(void)

Callers 1

test_net_etherFunction · 0.85

Calls 4

rte_is_zero_ether_addrFunction · 0.85
rte_eth_random_addrFunction · 0.85

Tested by

no test coverage detected