Left: | ||
Right: |
OLD | NEW |
---|---|
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2005,2006 INRIA | 3 * Copyright (c) 2005,2006 INRIA |
4 * 2010 NICTA | 4 * 2010 NICTA |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
583 { | 583 { |
584 } | 584 } |
585 | 585 |
586 Bug730TestCase::~Bug730TestCase () | 586 Bug730TestCase::~Bug730TestCase () |
587 { | 587 { |
588 } | 588 } |
589 | 589 |
590 void | 590 void |
591 Bug730TestCase::Receive (std::string context, Ptr<const Packet> p, const Address &adr) | 591 Bug730TestCase::Receive (std::string context, Ptr<const Packet> p, const Address &adr) |
592 { | 592 { |
593 NS_UNUSED(adr); | |
593 if ((p->GetSize () == 1460) && (Simulator::Now () > Seconds (20))) | 594 if ((p->GetSize () == 1460) && (Simulator::Now () > Seconds (20))) |
594 { | 595 { |
595 m_received++; | 596 m_received++; |
596 } | 597 } |
597 } | 598 } |
598 | 599 |
599 | 600 |
600 void | 601 void |
601 Bug730TestCase::DoRun (void) | 602 Bug730TestCase::DoRun (void) |
602 { | 603 { |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1063 { | 1064 { |
1064 } | 1065 } |
1065 | 1066 |
1066 Bug2222TestCase::~Bug2222TestCase () | 1067 Bug2222TestCase::~Bug2222TestCase () |
1067 { | 1068 { |
1068 } | 1069 } |
1069 | 1070 |
1070 void | 1071 void |
1071 Bug2222TestCase::TxDataFailedTrace (std::string context, Mac48Address adr) | 1072 Bug2222TestCase::TxDataFailedTrace (std::string context, Mac48Address adr) |
1072 { | 1073 { |
1074 NS_UNUSED(adr); | |
1073 //Indicate the long retry counter has been increased in the wifi remote statio n manager | 1075 //Indicate the long retry counter has been increased in the wifi remote statio n manager |
1074 m_countInternalCollisions++; | 1076 m_countInternalCollisions++; |
1075 } | 1077 } |
1076 | 1078 |
1077 void | 1079 void |
1078 Bug2222TestCase::DoRun (void) | 1080 Bug2222TestCase::DoRun (void) |
1079 { | 1081 { |
1080 m_countInternalCollisions = 0; | 1082 m_countInternalCollisions = 0; |
1081 | 1083 |
1082 //Generate same backoff for AC_VI and AC_VO | 1084 //Generate same backoff for AC_VI and AC_VO |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1211 | 1213 |
1212 Bug2483TestCase::~Bug2483TestCase () | 1214 Bug2483TestCase::~Bug2483TestCase () |
1213 { | 1215 { |
1214 } | 1216 } |
1215 | 1217 |
1216 void | 1218 void |
1217 Bug2483TestCase::StoreDistinctTuple (std::string context, Ptr<SpectrumSignalPar ameters> txParams) | 1219 Bug2483TestCase::StoreDistinctTuple (std::string context, Ptr<SpectrumSignalPar ameters> txParams) |
1218 { | 1220 { |
1219 // Extract starting frequency and number of subbands | 1221 // Extract starting frequency and number of subbands |
1220 Ptr<const SpectrumModel> c = txParams->psd->GetSpectrumModel (); | 1222 Ptr<const SpectrumModel> c = txParams->psd->GetSpectrumModel (); |
1221 uint32_t numBands = c->GetNumBands (); | 1223 uint32_t numBands = static_cast<uint32_t>(c->GetNumBands ()); |
S. Deronne
2018/02/16 21:24:32
Or change GetNumBands to return uint32_t???
ammo6818-vandals.uidaho.edu
2018/02/18 05:13:10
changed variable declaration to size_t
| |
1222 double startingFreq = c->Begin ()->fl; | 1224 double startingFreq = c->Begin ()->fl; |
1223 | 1225 |
1224 // Get channel bandwidth and modulation class | 1226 // Get channel bandwidth and modulation class |
1225 Ptr<const WifiSpectrumSignalParameters> wifiTxParams = DynamicCast<WifiSpectru mSignalParameters> (txParams); | 1227 Ptr<const WifiSpectrumSignalParameters> wifiTxParams = DynamicCast<WifiSpectru mSignalParameters> (txParams); |
1226 Ptr<Packet> packet = wifiTxParams->packet->Copy (); | 1228 Ptr<Packet> packet = wifiTxParams->packet->Copy (); |
1227 WifiPhyTag tag; | 1229 WifiPhyTag tag; |
1228 if (!packet->RemovePacketTag (tag)) | 1230 if (!packet->RemovePacketTag (tag)) |
1229 { | 1231 { |
1230 NS_FATAL_ERROR ("Received Wi-Fi Signal with no WifiPhyTag"); | 1232 NS_FATAL_ERROR ("Received Wi-Fi Signal with no WifiPhyTag"); |
1231 return; | 1233 return; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1312 Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> (); | 1314 Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> (); |
1313 positionAlloc->Add (Vector (0.0, 0.0, 0.0)); | 1315 positionAlloc->Add (Vector (0.0, 0.0, 0.0)); |
1314 positionAlloc->Add (Vector (1.0, 0.0, 0.0)); // put close enough in order to u se MCS | 1316 positionAlloc->Add (Vector (1.0, 0.0, 0.0)); // put close enough in order to u se MCS |
1315 mobility.SetPositionAllocator (positionAlloc); | 1317 mobility.SetPositionAllocator (positionAlloc); |
1316 | 1318 |
1317 mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); | 1319 mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); |
1318 mobility.Install (wifiApNode); | 1320 mobility.Install (wifiApNode); |
1319 mobility.Install (wifiStaNode); | 1321 mobility.Install (wifiStaNode); |
1320 | 1322 |
1321 // Send two 5 packet-bursts | 1323 // Send two 5 packet-bursts |
1322 Simulator::Schedule (Seconds (0.5), &Bug2483TestCase::SendPacketBurst, this, 5 , apDevice.Get (0), staDevice.Get (0)->GetAddress ()); | 1324 Simulator::Schedule (Seconds (0.5), &Bug2483TestCase::SendPacketBurst, this, s tatic_cast<uint8_t>(5), apDevice.Get (0), staDevice.Get (0)->GetAddress ()); |
S. Deronne
2018/02/16 21:24:32
why? Or change SendPacketBurst signature.
ammo6818-vandals.uidaho.edu
2018/02/18 05:13:10
changed signature
| |
1323 Simulator::Schedule (Seconds (0.6), &Bug2483TestCase::SendPacketBurst, this, 5 , apDevice.Get (0), staDevice.Get (0)->GetAddress ()); | 1325 Simulator::Schedule (Seconds (0.6), &Bug2483TestCase::SendPacketBurst, this, s tatic_cast<uint8_t>(5), apDevice.Get (0), staDevice.Get (0)->GetAddress ()); |
1324 | 1326 |
1325 Config::Connect ("/ChannelList/*/$ns3::MultiModelSpectrumChannel/TxSigParams", MakeCallback (&Bug2483TestCase::StoreDistinctTuple, this)); | 1327 Config::Connect ("/ChannelList/*/$ns3::MultiModelSpectrumChannel/TxSigParams", MakeCallback (&Bug2483TestCase::StoreDistinctTuple, this)); |
1326 | 1328 |
1327 Simulator::Stop (Seconds (0.8)); | 1329 Simulator::Stop (Seconds (0.8)); |
1328 Simulator::Run (); | 1330 Simulator::Run (); |
1329 | 1331 |
1330 Simulator::Destroy (); | 1332 Simulator::Destroy (); |
1331 | 1333 |
1332 // {starting frequency, channelWidth, Number of subbands in SpectrumModel, mod ulation type} tuples | 1334 // {starting frequency, channelWidth, Number of subbands in SpectrumModel, mod ulation type} tuples |
1333 uint8_t numberTuples = m_distinctTuples.size (); | 1335 uint8_t numberTuples = static_cast<uint8_t>(m_distinctTuples.size ()); |
S. Deronne
2018/02/16 21:24:33
can you avoid this cast in any way?
ammo6818-vandals.uidaho.edu
2018/02/18 05:13:10
changed declaration
| |
1334 NS_TEST_ASSERT_MSG_EQ (numberTuples, 2, "Only two distinct tuples expected"); | 1336 NS_TEST_ASSERT_MSG_EQ (numberTuples, 2, "Only two distinct tuples expected"); |
1335 NS_TEST_ASSERT_MSG_EQ (std::get<0> (m_distinctTuples[0]), std::get<0> (m_disti nctTuples[1]), "Both tuples should have same starting frequency"); | 1337 NS_TEST_ASSERT_MSG_EQ (std::get<0> (m_distinctTuples[0]), std::get<0> (m_disti nctTuples[1]), "Both tuples should have same starting frequency"); |
1336 // Note that the first tuple should the one initiated by the beacon, i.e. lega cy OFDM (20 MHz) | 1338 // Note that the first tuple should the one initiated by the beacon, i.e. lega cy OFDM (20 MHz) |
1337 NS_TEST_ASSERT_MSG_EQ (std::get<1> (m_distinctTuples[0]), 20, "First tuple's c hannel width should be 20 MHz"); | 1339 NS_TEST_ASSERT_MSG_EQ (std::get<1> (m_distinctTuples[0]), 20, "First tuple's c hannel width should be 20 MHz"); |
1338 NS_TEST_ASSERT_MSG_EQ (std::get<2> (m_distinctTuples[0]), 129, "First tuple sh ould have 129 subbands (64+DC, 20MHz+DC, inband and 32*2 out-of-band, 10MHz on e ach side)"); | 1340 NS_TEST_ASSERT_MSG_EQ (std::get<2> (m_distinctTuples[0]), 129, "First tuple sh ould have 129 subbands (64+DC, 20MHz+DC, inband and 32*2 out-of-band, 10MHz on e ach side)"); |
1339 NS_TEST_ASSERT_MSG_EQ (std::get<3> (m_distinctTuples[0]), WifiModulationClass: :WIFI_MOD_CLASS_OFDM, "First tuple should be OFDM"); | 1341 NS_TEST_ASSERT_MSG_EQ (std::get<3> (m_distinctTuples[0]), WifiModulationClass: :WIFI_MOD_CLASS_OFDM, "First tuple should be OFDM"); |
1340 // Second tuple | 1342 // Second tuple |
1341 NS_TEST_ASSERT_MSG_EQ (std::get<1> (m_distinctTuples[1]), channelWidth, "Secon d tuple's channel width should be 40 MHz"); | 1343 NS_TEST_ASSERT_MSG_EQ (std::get<1> (m_distinctTuples[1]), channelWidth, "Secon d tuple's channel width should be 40 MHz"); |
1342 NS_TEST_ASSERT_MSG_EQ (std::get<2> (m_distinctTuples[1]), 193, "Second tuple s hould have 193 subbands (128+DC, 40MHz+DC, inband and 32*2 out-of-band, 10MHz on each side)"); | 1344 NS_TEST_ASSERT_MSG_EQ (std::get<2> (m_distinctTuples[1]), 193, "Second tuple s hould have 193 subbands (128+DC, 40MHz+DC, inband and 32*2 out-of-band, 10MHz on each side)"); |
1343 NS_TEST_ASSERT_MSG_EQ (std::get<3> (m_distinctTuples[1]), WifiModulationClass: :WIFI_MOD_CLASS_VHT, "Second tuple should be VHT_OFDM"); | 1345 NS_TEST_ASSERT_MSG_EQ (std::get<3> (m_distinctTuples[1]), WifiModulationClass: :WIFI_MOD_CLASS_VHT, "Second tuple should be VHT_OFDM"); |
(...skipping 18 matching lines...) Expand all Loading... | |
1362 AddTestCase (new QosUtilsIsOldPacketTest, TestCase::QUICK); | 1364 AddTestCase (new QosUtilsIsOldPacketTest, TestCase::QUICK); |
1363 AddTestCase (new InterferenceHelperSequenceTest, TestCase::QUICK); //Bug 991 | 1365 AddTestCase (new InterferenceHelperSequenceTest, TestCase::QUICK); //Bug 991 |
1364 AddTestCase (new DcfImmediateAccessBroadcastTestCase, TestCase::QUICK); | 1366 AddTestCase (new DcfImmediateAccessBroadcastTestCase, TestCase::QUICK); |
1365 AddTestCase (new Bug730TestCase, TestCase::QUICK); //Bug 730 | 1367 AddTestCase (new Bug730TestCase, TestCase::QUICK); //Bug 730 |
1366 AddTestCase (new SetChannelFrequencyTest, TestCase::QUICK); | 1368 AddTestCase (new SetChannelFrequencyTest, TestCase::QUICK); |
1367 AddTestCase (new Bug2222TestCase, TestCase::QUICK); //Bug 2222 | 1369 AddTestCase (new Bug2222TestCase, TestCase::QUICK); //Bug 2222 |
1368 AddTestCase (new Bug2483TestCase, TestCase::QUICK); //Bug 2483 | 1370 AddTestCase (new Bug2483TestCase, TestCase::QUICK); //Bug 2483 |
1369 } | 1371 } |
1370 | 1372 |
1371 static WifiTestSuite g_wifiTestSuite; ///< the test suite | 1373 static WifiTestSuite g_wifiTestSuite; ///< the test suite |
OLD | NEW |