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

Function test_invalid_addr

dpdk/app/test/test_net_ether.c:117–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117static int
118test_invalid_addr(void)
119{
120 static const char * const invalid[] = {
121 "123",
122 "123:456",
123 "12:34:56:78:9a:gh",
124 "12:34:56:78:9a",
125 "100:34:56:78:9a:bc",
126 "34-56-78-9a-bc",
127 "12:34:56-78:9a:bc",
128 "12:34:56.78:9a:bc",
129 "123:456:789:abc",
130 "NOT.AN.ADDRESS",
131 "102.304.506",
132 "",
133 };
134 struct rte_ether_addr result;
135 unsigned int i;
136
137 for (i = 0; i < RTE_DIM(invalid); ++i) {
138 if (!rte_ether_unformat_addr(invalid[i], &result)) {
139 fprintf(stderr, "rte_ether_unformat_addr(%s) succeeded!\n",
140 invalid[i]);
141 return -1;
142 }
143 }
144 return 0;
145}
146
147static int
148test_net_ether(void)

Callers 1

test_net_etherFunction · 0.85

Calls 1

rte_ether_unformat_addrFunction · 0.85

Tested by

no test coverage detected