X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacket.test.cc;h=e61d67adf2818d03850cf552466f9defea254ea7;hb=fb2fe88ee9a9d2a777ecaf3327d04b60479fcc8d;hp=8c28f73b58e1685f96c9a3de6737442194e28735;hpb=51b10105e78a9ffee631223f50e63aa28bb5d2b4;p=senf.git diff --git a/Packets/Packet.test.cc b/Packets/Packet.test.cc index 8c28f73..e61d67a 100644 --- a/Packets/Packet.test.cc +++ b/Packets/Packet.test.cc @@ -28,6 +28,7 @@ // Custom includes #include +#include #include "Packets.hh" #include "../Utils/auto_unit_test.hh" @@ -126,6 +127,11 @@ namespace { struct ComplexEmptyAnnotation : senf::ComplexAnnotation {}; + struct InvalidAnnotation + { + std::string value; + }; + } BOOST_AUTO_UNIT_TEST(packet) @@ -273,6 +279,24 @@ BOOST_AUTO_UNIT_TEST(packetAnnotation) BOOST_CHECK( ! senf::detail::AnnotationIndexer::Small ); } +#ifdef COMPILE_CHECK + +COMPILE_FAIL(invalidAnnotation) +{ +# ifdef BOOST_HAS_TYPE_TRAITS_INTRINSICS + + senf::Packet packet (FooPacket::create()); + (void) packet.annotation(); + +# else + + invalid_annotation_check_disabled(); + +# endif +} + +#endif + ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_