X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPackets%2F80211Bundle%2FWLANPacket.test.cc;h=2300b3b33807e96c52cabec84a89c1ffa794171d;hb=8a6697d11e9a6557d9a5c42b4052666fce32bc10;hp=9a99389afb7a281d914dd70fe64ba4728696de04;hpb=767a76da8e5b96a69b620e44d32e0a1b04005679;p=senf.git diff --git a/senf/Packets/80211Bundle/WLANPacket.test.cc b/senf/Packets/80211Bundle/WLANPacket.test.cc index 9a99389..2300b3b 100644 --- a/senf/Packets/80211Bundle/WLANPacket.test.cc +++ b/senf/Packets/80211Bundle/WLANPacket.test.cc @@ -2,23 +2,28 @@ // // Copyright (C) 2008 // Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY -// Christian Niephaus // -// 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): +// Christian Niephaus /** \file \brief WLANPacket unit tests */ @@ -29,7 +34,7 @@ #include #include -///////////////////////////////cc.p//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// /* test parser with a data frame */ SENF_AUTO_UNIT_TEST(WLANPacket_dataFrame_packet) { @@ -86,7 +91,10 @@ SENF_AUTO_UNIT_TEST(WLANPacket_dataFrame_create) senf::WLANPacket_DataFrame p (senf::WLANPacket_DataFrame::create()); SENF_CHECK_NO_THROW( p->bssid() = senf::MACAddress::from_string("00:1a:4d:3e:c7:5c") ); + SENF_CHECK_NO_THROW(p->sequenceNumber(4095u)); + BOOST_CHECK_EQUAL( p->type(), 2u ); + BOOST_CHECK_EQUAL( p->sequenceNumber(), 4095u ); } @@ -112,7 +120,7 @@ SENF_AUTO_UNIT_TEST(WLANPacket_beaconFrame_packet) 0xa3, 0x40, 0x00, 0x27, 0xa4, 0x00, 0x00, 0x42, 0x43, 0x5e, 0x00, 0x62, 0x32, 0x2f, 0x00, 0xa0, 0x00, 0xdd, 0x09, 0x00, 0x03, 0x7f, 0x01, 0x01, - 0x00, 0x24, 0xff, 0x7f, + 0x00, 0x24, 0xff, 0x7f, }; senf::WLANPacket_MgtFrame p (senf::WLANPacket_MgtFrame::create(data)); @@ -156,8 +164,13 @@ SENF_AUTO_UNIT_TEST(WLANPacket_mgtFrame_create) SENF_CHECK_NO_THROW( p->bssid() = senf::MACAddress::from_string("00:1a:4d:3e:c7:5c") ); + SENF_CHECK_NO_THROW( + p->sequenceNumber(2); + p->sequenceNumber(p->sequenceNumber()+1); + ); BOOST_CHECK_EQUAL( p->type(), 0u ); + BOOST_CHECK_EQUAL( p->sequenceNumber(), 3u ); } @@ -165,8 +178,8 @@ SENF_AUTO_UNIT_TEST(WLANPacket_mgtFrame_create) SENF_AUTO_UNIT_TEST(WLANPacket_ctrlFrame_packet) { unsigned char data[] = { - 0xd4, 0x00, 0x00, 0x00, - 0x00, 0x0b, 0x6b, 0x57, 0x06, 0xb0, + 0xd4, 0x00, 0x00, 0x00, + 0x00, 0x0b, 0x6b, 0x57, 0x06, 0xb0, 0x4f, 0xda, // What is this ? }; @@ -196,11 +209,12 @@ SENF_AUTO_UNIT_TEST(WLANPacket_ctrlFrame_create) senf::WLANPacket_CtrlFrame p (senf::WLANPacket_CtrlFrame::create()) ; p->receiverAddress() = senf::MACAddress::from_string("00:1a:4d:3e:c7:5c"); p->set_ack(); + BOOST_CHECK_EQUAL( p->type(), 1u); BOOST_CHECK_EQUAL( p->subtype(), 13u); } -///////////////////////////////cc.e//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// // Local Variables: