MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / main

Function main

tests/testnet.c:108–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108int
109main(int argc, const char *argv[])
110{
111 // IPV4
112 test_host("127.0.0.1", "127.0.0.1", "");
113 test_host("127.0.0.1:4532", "127.0.0.1", "4532");
114 test_host("192.168.1.1", "192.168.1.1", "");
115 test_host("192.168.1.1:4532", "192.168.1.1", "4532");
116 test_host("mdblack-VirtualBox", "mdblack-VirtualBox", "");
117 test_host("mdblack-VirtualBox:4532", "mdblack-VirtualBox", "4532");
118 test_host("localhost", "localhost", "");
119 test_host("localhost:4532", "localhost", "4532");
120 // IPV6 with brackets
121 test_host("[fe80::e034:55ef:ce2a:dc83]", "fe80::e034:55ef:ce2a:dc83", "");
122 test_host("[fe80::e034:55ef:ce2a:dc83]:4532", "fe80::e034:55ef:ce2a:dc83",
123 "4532");
124
125 test_host("fe80::e034:55ef:ce2a:dc83", "fe80::e034:55ef:ce2a:dc83", "");
126 test_host("fe80::e034:55ef:ce2a:dc83:4532", "fe80::e034:55ef:ce2a:dc83",
127 "4532");
128 test_host("fe80:e034:55ef:ce2a:dc83:1234:5678:9abc",
129 "fe80:e034:55ef:ce2a:dc83:1234:5678:9abc", "");
130 test_host("fe80:e034:55ef:ce2a:dc83:1234:5678:9abc:4532",
131 "fe80:e034:55ef:ce2a:dc83:1234:5678:9abc",
132 "4532");
133 test_host("::1", "::1", "");
134 test_host("::1:4532", "::1", "4532");
135
136#if 1 // server side addresses with IPV6
137 test_host("fe80::e034:55ef:ce2a:dc83%eth0", "fe80::e034:55ef:ce2a:dc83%eth0",
138 "");
139 test_host("[fe80::e034:55ef:ce2a:dc83%1]", "fe80::e034:55ef:ce2a:dc83%1", "");
140 test_host("[fe80::e034:55ef:ce2a:dc83%1]:4532", "fe80::e034:55ef:ce2a:dc83%1",
141 "4532");
142 test_host("fe80::e034:55ef:ce2a:dc83%eth0:4532",
143 "fe80::e034:55ef:ce2a:dc83%eth0", "4532");
144 test_host("fe80::e034:55ef:ce2a:dc83%1", "fe80::e034:55ef:ce2a:dc83%1", "");
145 test_host("fe80::e034:55ef:ce2a:dc83%1:4532", "fe80::e034:55ef:ce2a:dc83%1",
146 "4532");
147 test_host("[fe80::e034:55ef:ce2a:dc83%eth0]",
148 "fe80::e034:55ef:ce2a:dc83%eth0", "");
149 test_host("[fe80::e034:55ef:ce2a:dc83%eth0]:4532",
150 "fe80::e034:55ef:ce2a:dc83%eth0", "4532");
151#endif
152
153 return 0;
154}

Callers

nothing calls this directly

Calls 1

test_hostFunction · 0.85

Tested by

no test coverage detected