X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FDefaultBundle%2FICMPv6Packet.test.cc;h=a116e2b8e32e595dd5fcc50c7c625f856a162e90;hb=9428e2877c15dac640efdb075d40cafea554cc88;hp=3b1bd0234f326e78e377f24540937ec32162cac6;hpb=ccc827edda90ace7d2f8564660ee26b09a5a23b5;p=senf.git diff --git a/Packets/DefaultBundle/ICMPv6Packet.test.cc b/Packets/DefaultBundle/ICMPv6Packet.test.cc index 3b1bd02..a116e2b 100644 --- a/Packets/DefaultBundle/ICMPv6Packet.test.cc +++ b/Packets/DefaultBundle/ICMPv6Packet.test.cc @@ -1,9 +1,9 @@ -// $Id: main.test.cc 206 2007-02-20 14:20:52Z g0dil $ +// $Id$ // -// Copyright (C) 2006 +// Copyright (C) 2008 // Fraunhofer Institute for Open Communication Systems (FOKUS) // Competence Center NETwork research (NET), St. Augustin, GERMANY -// Philipp Batroff +// Philipp Batroff // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -24,23 +24,29 @@ // Custom includes -#include "ICMPv6Packet.hh" -#include "../../Packets/Packets.hh" #include "../../Utils/auto_unit_test.hh" #include +#include "ICMPv6Packet.hh" #include "ICMPv6TypePacket.hh" BOOST_AUTO_UNIT_TEST(ICMPv6Packet_packet) { - unsigned char data[] = { 0x8f, 0x00 ,0x8d ,0x54 ,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[] = { + 0x8f, 0x00, 0x8d, 0x54, 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::ICMPv6Packet p ( senf::ICMPv6Packet::create(data) ); - - BOOST_CHECK_EQUAL( p->type(), 0x8f); - BOOST_CHECK_EQUAL( p->code(), 0x00); - BOOST_CHECK_EQUAL( p->checksumOutput(), 0x8d54); + + BOOST_CHECK_EQUAL( p->type(), 0x8f ); + BOOST_CHECK_EQUAL( p->code(), 0x00 ); + BOOST_CHECK_EQUAL( p->checksum(), 0x8d54 ); BOOST_CHECK( p.next() ); BOOST_CHECK( p.next().is() ); BOOST_CHECK_EQUAL( p.next().size(), 24u ); + std::ostringstream oss (std::ostringstream::out); + SENF_CHECK_NO_THROW( p.dump( oss)); }