X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FSocket%2FProtocols%2FINet%2FINet6Address.test.cc;h=e342b27a60748817c3163ce428dd09e48d7037ca;hb=afae50abf125df375ff1610b7a659f9b1da61bc0;hp=1283cbacf2f71b85377fc95e8231248bdf815b7b;hpb=1ec4c14339e1dbc9a56be7fb528d089e1f37600c;p=senf.git diff --git a/senf/Socket/Protocols/INet/INet6Address.test.cc b/senf/Socket/Protocols/INet/INet6Address.test.cc index 1283cba..e342b27 100644 --- a/senf/Socket/Protocols/INet/INet6Address.test.cc +++ b/senf/Socket/Protocols/INet/INet6Address.test.cc @@ -186,7 +186,7 @@ SENF_AUTO_UNIT_TEST(inet6Network) BOOST_CHECK( ! net.match(net2) ); BOOST_CHECK( net2.match(INet6Network("2001:db8:1234::/48")) ); BOOST_CHECK( ! net2.match(INet6Network("2001:db8:1234::/32")) ); - + BOOST_CHECK( ! INet6Network("ff14:1234::1/128").match(INet6Network("ff14:1234::2/128")) ); BOOST_CHECK_EQUAL( senf::str(net2), "2001:db8:1230::/44" ); @@ -196,12 +196,28 @@ SENF_AUTO_UNIT_TEST(inet6Network) BOOST_CHECK_THROW( INet6Network(""), AddressSyntaxException ); BOOST_CHECK_THROW( INet6Network("2001:db8:1234::/beef"), AddressSyntaxException ); + + { + std::stringstream str; + INet6Network net; + str >> net; + BOOST_CHECK( str.fail()); + } + { + std::stringstream str; + INet6Network net ("2001:db8:1230::/44"); + str << net; + BOOST_CHECK_EQUAL( str.str(), "2001:db8:1230::/44"); + str >> net; + BOOST_CHECK( ! str.fail()); + BOOST_CHECK_EQUAL(net, INet6Network("2001:db8:1230::/44")); + } } ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_ - + // Local Variables: // mode: c++ // fill-column: 100