PPI: Fix senf::ppi::init() event hook scheduling
[senf.git] / Packets / 80221Bundle / MIHPacket.test.cc
index 675bc61..3b021ee 100644 (file)
 //#include "MIHPacket.test.hh"
 //#include "MIHPacket.test.ih"
 
-#include "../../Utils/auto_unit_test.hh"
-#include <boost/test/test_tools.hpp>
-
+// Custom includes
 #include "MIHPacket.hh"
 
-using namespace senf;
+#include "../../Utils/auto_unit_test.hh"
+#include <boost/test/test_tools.hpp>
 
 #define prefix_
 ///////////////////////////////cc.p////////////////////////////////////////
+using namespace senf;
 
 BOOST_AUTO_UNIT_TEST(MIHPacket_create_string)
 {
@@ -60,6 +60,9 @@ BOOST_AUTO_UNIT_TEST(MIHPacket_create_string)
     BOOST_CHECK_EQUAL( mihPacket->src_mihfId().asString(), "senf@berlios.de");
     BOOST_CHECK_EQUAL( mihPacket->dst_mihfId().asString(), "test");
 
+    // the maximum length of a MIHF_ID is 253 octets
+    BOOST_CHECK_THROW( mihPacket->dst_mihfId().setString( std::string(254, 'x')), std::length_error);
+
     // now expand a MIHF_ID
     mihPacket->dst_mihfId().maxLengthValue(253);
     mihPacket->dst_mihfId().setString( std::string(200, 'x'));