-// $Id: main.test.cc 206 2008-06-08 14:20:52Z pug $
+// $Id$
//
// Copyright (C) 2006
// Fraunhofer Institute for Open Communication Systems (FOKUS)
// Custom includes
#include "ICMPv6Packet.hh"
+#include "ICMPv6TypePacket.hh"
#include "../../Packets/DataPacket.hh"
+#include "../../Utils/String.hh"
+
#include "../../Utils/auto_unit_test.hh"
#include <boost/test/test_tools.hpp>
-#include "ICMPv6TypePacket.hh"
+
BOOST_AUTO_UNIT_TEST(ICMPv6_MLDv2_Packet_packet)
{
- unsigned char data[] = {0x00 ,0x00 ,0x00 ,0x01 ,0x04 ,0x00 ,0x00 ,0x00 ,0xff ,0x15 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x16};
+ unsigned char data[] = {
+ 0x00 ,0x00 ,0x00 ,0x01 ,0x04 ,0x00 ,0x00 ,0x00 ,
+ 0xff ,0x15 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,
+ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x16
+ };
senf::MLDv2ListenerReport p ( senf::MLDv2ListenerReport::create(data) );
senf::MLDv2ListenerReport::Parser::mcastAddrRecords_t::container mcastAddrRecords (p->mcastAddrRecords());
senf::MLDv2ListenerReport::Parser::mcastAddrRecords_t::container::iterator mcAddrIt (mcastAddrRecords.begin() );
BOOST_CHECK_EQUAL(mcAddrIt->recordType(), 0x04);
- BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(mcAddrIt->mcAddress() ), "ff15::16");
+ BOOST_CHECK_EQUAL(senf::str(mcAddrIt->mcAddress() ), "ff15::16");
}