File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -302,4 +302,22 @@ BOOST_AUTO_TEST_CASE(netbase_getgroup)
302
302
BOOST_CHECK (CreateInternal (" baz.net" ).GetGroup () == internal_group);
303
303
}
304
304
305
+ BOOST_AUTO_TEST_CASE (netbase_parsenetwork)
306
+ {
307
+ BOOST_CHECK_EQUAL (ParseNetwork (" ipv4" ), NET_IPV4);
308
+ BOOST_CHECK_EQUAL (ParseNetwork (" ipv6" ), NET_IPV6);
309
+ BOOST_CHECK_EQUAL (ParseNetwork (" onion" ), NET_ONION);
310
+ BOOST_CHECK_EQUAL (ParseNetwork (" tor" ), NET_ONION);
311
+
312
+ BOOST_CHECK_EQUAL (ParseNetwork (" IPv4" ), NET_IPV4);
313
+ BOOST_CHECK_EQUAL (ParseNetwork (" IPv6" ), NET_IPV6);
314
+ BOOST_CHECK_EQUAL (ParseNetwork (" ONION" ), NET_ONION);
315
+ BOOST_CHECK_EQUAL (ParseNetwork (" TOR" ), NET_ONION);
316
+
317
+ BOOST_CHECK_EQUAL (ParseNetwork (" :)" ), NET_UNROUTABLE);
318
+ BOOST_CHECK_EQUAL (ParseNetwork (" tÖr" ), NET_UNROUTABLE);
319
+ BOOST_CHECK_EQUAL (ParseNetwork (" \xfe\xff " ), NET_UNROUTABLE);
320
+ BOOST_CHECK_EQUAL (ParseNetwork (" " ), NET_UNROUTABLE);
321
+ }
322
+
305
323
BOOST_AUTO_TEST_SUITE_END ()
You can’t perform that action at this time.
0 commit comments