diff --git a/src/devices/wimax/bandwidth-manager.cc b/src/devices/wimax/bandwidth-manager.cc index bc0113358..65ec495e8 100644 --- a/src/devices/wimax/bandwidth-manager.cc +++ b/src/devices/wimax/bandwidth-manager.cc @@ -182,7 +182,7 @@ BandwidthManager::ProcessBandwidthRequest (const BandwidthRequestHeader &bwReque else { serviceFlow->GetRecord ()->SetRequestedBandwidth (bwRequestHdr.GetBr ()); - bs->GetUplinkScheduler()->OnSetRequestedBandwidth(serviceFlow->GetRecord()); + bs->GetUplinkScheduler ()->OnSetRequestedBandwidth (serviceFlow->GetRecord ()); } bs->GetUplinkScheduler ()->ProcessBandwidthRequest (bwRequestHdr); // update backlogged diff --git a/src/devices/wimax/service-flow.cc b/src/devices/wimax/service-flow.cc index f8cfea789..7d3bf673d 100644 --- a/src/devices/wimax/service-flow.cc +++ b/src/devices/wimax/service-flow.cc @@ -251,7 +251,10 @@ ServiceFlow::GetRecord (void) const Ptr ServiceFlow::GetQueue (void) const { - if (!m_connection) return 0; + if (!m_connection) + { + return 0; + } return m_connection->GetQueue (); } @@ -264,14 +267,20 @@ ServiceFlow::GetSchedulingType (void) const bool ServiceFlow::HasPackets (void) const { - if (!m_connection) return false; + if (!m_connection) + { + return false; + } return m_connection->HasPackets (); } bool ServiceFlow::HasPackets (MacHeaderType::HeaderType packetType) const { - if (!m_connection) return false; + if (!m_connection) + { + return false; + } return m_connection->HasPackets (packetType); } @@ -282,20 +291,21 @@ ServiceFlow::CleanUpQueue (void) Time timeStamp; Ptr packet; Time currentTime = Simulator::Now (); - if (m_connection){ - while (m_connection->HasPackets ()) - { - packet = m_connection->GetQueue ()->Peek (hdr, timeStamp); + if (m_connection) + { + while (m_connection->HasPackets ()) + { + packet = m_connection->GetQueue ()->Peek (hdr, timeStamp); - if (currentTime - timeStamp > MilliSeconds (GetMaximumLatency ())) - { - m_connection->Dequeue (); - } - else - { - break; - } - } + if (currentTime - timeStamp > MilliSeconds (GetMaximumLatency ())) + { + m_connection->Dequeue (); + } + else + { + break; + } + } } } diff --git a/src/devices/wimax/simple-ofdm-wimax-phy.cc b/src/devices/wimax/simple-ofdm-wimax-phy.cc index 716357c9d..04d7e55dd 100644 --- a/src/devices/wimax/simple-ofdm-wimax-phy.cc +++ b/src/devices/wimax/simple-ofdm-wimax-phy.cc @@ -815,7 +815,7 @@ uint8_t SimpleOfdmWimaxPhy::DoGetFrameDurationCode (void) const { uint16_t duration = 0; - duration = (uint16_t) (GetFrameDuration ().GetSeconds () * 10000); + duration = (uint16_t)(GetFrameDuration ().GetSeconds () * 10000); switch (duration) { case 25: diff --git a/src/devices/wimax/ss-mac-test.cc b/src/devices/wimax/ss-mac-test.cc index b3ec06ae2..0631bc99f 100644 --- a/src/devices/wimax/ss-mac-test.cc +++ b/src/devices/wimax/ss-mac-test.cc @@ -88,14 +88,12 @@ Ns3WimaxNetworkEntryTestCase::DoRun (void) WimaxHelper::DEVICE_TYPE_BASE_STATION, WimaxHelper::SIMPLE_PHY_TYPE_OFDM, scheduler); - Simulator::Stop (Seconds (0.5)); + Simulator::Stop (Seconds (1)); Simulator::Run (); for (int i = 0; i < 10; i++) { - if (ssDevs.Get (i)->GetObject ()->IsRegistered () == false) - { - return true; // Test fail because SS[i] is not registered - } + NS_TEST_EXPECT_MSG_EQ (ssDevs.Get (i)->GetObject ()->IsRegistered (),true, + "SS[" << i << "] IsNotRegistered"); } Simulator::Destroy (); return (false); // Test was ok, all the SS are registered @@ -151,14 +149,12 @@ Ns3WimaxManagementConnectionsTestCase::DoRun (void) WimaxHelper::DEVICE_TYPE_BASE_STATION, WimaxHelper::SIMPLE_PHY_TYPE_OFDM, scheduler); - Simulator::Stop (Seconds (0.5)); + Simulator::Stop (Seconds (1)); Simulator::Run (); for (int i = 0; i < 10; i++) { - if (ssDevs.Get (i)->GetObject ()->GetAreManagementConnectionsAllocated () == false) - { - return true; // Test fail because management connections of SS[i] are not allocated - } + NS_TEST_EXPECT_MSG_EQ (ssDevs.Get (i)->GetObject ()->GetAreManagementConnectionsAllocated (), + true, "Management connections for SS[" << i << "] are not allocated"); } Simulator::Destroy (); return (false); diff --git a/src/devices/wimax/wimax-fragmentation-test.cc b/src/devices/wimax/wimax-fragmentation-test.cc index 6954e55d6..7b5b3779b 100644 --- a/src/devices/wimax/wimax-fragmentation-test.cc +++ b/src/devices/wimax/wimax-fragmentation-test.cc @@ -76,7 +76,7 @@ Ns3WimaxFragmentationTestCase::DoRun (void) Cid cid; WimaxConnection *connectionTx = new WimaxConnection (cid, Cid::TRANSPORT); WimaxConnection *connectionRx = new WimaxConnection (cid, Cid::TRANSPORT); - bool testResult=false; + bool testResult = false; // A Packet of 1000 bytes has been created. // It will be fragmentated into 4 fragments and then defragmentated into fullPacket. @@ -115,8 +115,8 @@ Ns3WimaxFragmentationTestCase::DoRun (void) if (((tmpType >> 2) & 1) != 1) { // The packet is not a fragment - testResult=true; - break; + testResult = true; + break; } } @@ -128,19 +128,19 @@ Ns3WimaxFragmentationTestCase::DoRun (void) if (fc == 1 && i != 0) { // the fragment in not the first one - testResult=true; - break; + testResult = true; + break; } if (fc == 2 && i != 3) { // the fragment in not the latest one - testResult=true; - break; + testResult = true; + break; } if ((fc == 3 && i != 1) && (fc == 3 && i != 2)) { // the fragment in not the middle one - testResult= true; + testResult = true; break; } @@ -170,7 +170,7 @@ Ns3WimaxFragmentationTestCase::DoRun (void) if (fullPacket->GetSize () != 1000) { // The defragmentation is correct. - testResult= true; // Test is passed + testResult = true; // Test is passed break; } }