X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPackets%2FVariantParser.test.cc;h=d5f588277664d3ff34ebe8326e520548c84b3f88;hb=ab7ff164ab5ae711ec09ce2b24228510f1ffdcff;hp=02ac3fed5b5c2c1aed7cf761dd1fee473c352a92;hpb=26610f603ebdd465307b9621f532c1fe19fd5571;p=senf.git diff --git a/senf/Packets/VariantParser.test.cc b/senf/Packets/VariantParser.test.cc index 02ac3fe..d5f5882 100644 --- a/senf/Packets/VariantParser.test.cc +++ b/senf/Packets/VariantParser.test.cc @@ -2,23 +2,28 @@ // // Copyright (C) 2007 // Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY -// Stefan Bund // -// 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 -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. +// The contents of this file are subject to the Fraunhofer FOKUS Public License +// Version 1.0 (the "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// http://senf.berlios.de/license.html // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// The Fraunhofer FOKUS Public License Version 1.0 is based on, +// but modifies the Mozilla Public License Version 1.1. +// See the full license text for the amendments. // -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the -// Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// Software distributed under the License is distributed on an "AS IS" basis, +// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +// for the specific language governing rights and limitations under the License. +// +// The Original Code is Fraunhofer FOKUS code. +// +// The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V. +// (registered association), Hansastraße 27 c, 80686 Munich, Germany. +// All Rights Reserved. +// +// Contributor(s): +// Stefan Bund /** \file \brief VariantParser unit tests */ @@ -33,14 +38,14 @@ #include #define prefix_ -///////////////////////////////cc.p//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// -BOOST_AUTO_UNIT_TEST(VariantParser) +SENF_AUTO_UNIT_TEST(VariantParser) { typedef senf::ArrayParser<10, senf::UInt8Parser> Array10; typedef senf::VariantParser< senf::detail::FixedAuxParserPolicy, boost::mpl::vector > Variant; - + unsigned char data[] = { 0x01, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B }; senf::DataPacket p (senf::DataPacket::create(data)); @@ -55,7 +60,7 @@ BOOST_AUTO_UNIT_TEST(VariantParser) BOOST_REQUIRE_EQUAL( p.data().size(), 11u ); BOOST_REQUIRE_EQUAL( v.variant(), 0u ); BOOST_CHECK_EQUAL( senf::bytes(v), 0u ); - + v.init<2>(); // v invalidated } @@ -78,13 +83,13 @@ BOOST_AUTO_UNIT_TEST(VariantParser) }; } -// We can't use the unnamed namespace here since there's a bug in gcc-4.2.3 which is +// We can't use the unnamed namespace here since there's a bug in gcc-4.2.3 which is // the default version of gcc on ubuntu hardy :-( // See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34213 namespace VariantParser_test_cc_anon_namespace { - + struct SubParser : public senf::PacketParserBase - { + { # include SENF_FIXED_PARSER() SENF_PARSER_FIELD( foo, senf::UInt32Parser ); @@ -100,7 +105,7 @@ namespace VariantParser_test_cc_anon_namespace { SENF_PARSER_BITFIELD_RO( len, 4, unsigned ); SENF_PARSER_BITFIELD_RO( type, 4, unsigned ); // just here so the second variant is 'var' - SENF_PARSER_VARIANT( value, len, + SENF_PARSER_VARIANT( value, len, (senf::VoidPacketParser) (senf::UInt8Parser) (senf::UInt16Parser) @@ -113,14 +118,14 @@ namespace VariantParser_test_cc_anon_namespace { SENF_PARSER_FINALIZE(TestParser); }; - + } using namespace VariantParser_test_cc_anon_namespace; -BOOST_AUTO_UNIT_TEST(VariantParserMacro) +SENF_AUTO_UNIT_TEST(VariantParserMacro) { senf::DataPacket p (senf::DataPacket::create(senf::init_bytes::value)); - + { TestParser v (p.data().begin(), & p.data()); v.init(); @@ -141,7 +146,7 @@ BOOST_AUTO_UNIT_TEST(VariantParserMacro) } } -///////////////////////////////cc.e//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// #undef prefix_