X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FSocketPolicy.test.cc;h=84a830cbd856fcb4477865706dcc0f2c64519949;hb=81ffa1c459b96dd44472bcef37e1e373934ee138;hp=534f40d6e70ccd27bc3b46d572dc19a7a8a34323;hpb=85ab07d100a382467a42e19d741d403a7a96c951;p=senf.git diff --git a/Socket/SocketPolicy.test.cc b/Socket/SocketPolicy.test.cc index 534f40d..84a830c 100644 --- a/Socket/SocketPolicy.test.cc +++ b/Socket/SocketPolicy.test.cc @@ -83,7 +83,7 @@ namespace { BOOST_AUTO_UNIT_TEST(socketPolicy) { - // All these checks are really compile-time checks ... + // Most of these checks are really compile-time checks ... typedef MakeSocketPolicy< UnixAddressingPolicy, @@ -122,12 +122,22 @@ BOOST_AUTO_UNIT_TEST(socketPolicy) // The following should fail at compile time // BOOST_MPL_ASSERT(( SocketPolicyIsBaseOf )); - ConvertibleValue p1; - ConvertibleValue p3(p1); + { + ConvertibleValue p1; + ConvertibleValue p3(p1); + + p3 = p1; + // The following should fail at compile time + // p1 = p3; + } + + { + Policy1 p1; + Policy3 p3; - p3 = p1; - // The following should fail at compile time - // p1 = p3; + BOOST_CHECK_THROW( Policy1::checkBaseOf(p3), std::bad_cast ); + BOOST_CHECK_NO_THROW( Policy3::checkBaseOf(p1) ); + } } ///////////////////////////////cc.e//////////////////////////////////////// @@ -140,4 +150,6 @@ BOOST_AUTO_UNIT_TEST(socketPolicy) // c-file-style: "senf" // indent-tabs-mode: nil // ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 // End: