X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FPacket.test.cc;h=bb0c7b0e2ffbb2215f1704314b2d5dfd921bbdff;hb=f7dcc6267c7637efaba2ebe5a20df5f849a68d39;hp=8c28f73b58e1685f96c9a3de6737442194e28735;hpb=51b10105e78a9ffee631223f50e63aa28bb5d2b4;p=senf.git diff --git a/Packets/Packet.test.cc b/Packets/Packet.test.cc index 8c28f73..bb0c7b0 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,26 @@ BOOST_AUTO_UNIT_TEST(packetAnnotation) BOOST_CHECK( ! senf::detail::AnnotationIndexer::Small ); } +#ifdef COMPILE_CHECK + +COMPILE_FAIL(invalidAnnotation) +{ +#if 0 // The traits check fails for user defined but trivial constructors so ... +# ifdef BOOST_HAS_TYPE_TRAITS_INTRINSICS + + senf::Packet packet (FooPacket::create()); + (void) packet.annotation(); + +# else +# endif +#endif + + invalid_annotation_check_disabled(); + +} + +#endif + ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_