From f5f26c6b438181af2a6ae16baccd497e39f85178 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Fri, 20 Jul 2018 18:06:34 +0300 Subject: [PATCH] wifi: Get rid of "NS_ASSERT_MSG (false, ..." Replaced with NS_FATAL_ERROR or proper NS_ASSERT_MSG --- src/wifi/model/ap-wifi-mac.cc | 2 +- src/wifi/model/minstrel-ht-wifi-manager.cc | 8 ++++---- src/wifi/model/supported-rates.cc | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/wifi/model/ap-wifi-mac.cc b/src/wifi/model/ap-wifi-mac.cc index c893a4ce2..292aa5819 100644 --- a/src/wifi/model/ap-wifi-mac.cc +++ b/src/wifi/model/ap-wifi-mac.cc @@ -1592,7 +1592,7 @@ ApWifiMac::GetNextAssociationId (void) return nextAid; } } - NS_ASSERT_MSG (false, "No free association ID available!"); + NS_FATAL_ERROR ("No free association ID available!"); return 0; } diff --git a/src/wifi/model/minstrel-ht-wifi-manager.cc b/src/wifi/model/minstrel-ht-wifi-manager.cc index 89b9f5e8a..c1eeb9dba 100644 --- a/src/wifi/model/minstrel-ht-wifi-manager.cc +++ b/src/wifi/model/minstrel-ht-wifi-manager.cc @@ -655,7 +655,7 @@ MinstrelHtWifiManager::DoReportAmpduTxStatus (WifiRemoteStation *st, uint8_t nSu if (!station->m_isHt) { - NS_ASSERT_MSG (false,"A-MPDU Tx Status called but no HT or VHT supported."); + NS_FATAL_ERROR ("A-MPDU Tx Status called but no HT or VHT supported."); } NS_LOG_DEBUG ("DoReportAmpduTxStatus. TxRate=" << station->m_txrate << " SuccMpdus= " << @@ -766,7 +766,7 @@ MinstrelHtWifiManager::UpdateRate (MinstrelHtWifiRemoteStation *station) } else { - NS_ASSERT_MSG (false,"Max retries reached and m_longRetry not cleared properly. longRetry= " << station->m_longRetry); + NS_FATAL_ERROR ("Max retries reached and m_longRetry not cleared properly. longRetry= " << station->m_longRetry); } } @@ -790,7 +790,7 @@ MinstrelHtWifiManager::UpdateRate (MinstrelHtWifiRemoteStation *station) } else { - NS_ASSERT_MSG (false,"Max retries reached and m_longRetry not cleared properly. longRetry= " << station->m_longRetry); + NS_FATAL_ERROR ("Max retries reached and m_longRetry not cleared properly. longRetry= " << station->m_longRetry); } } NS_LOG_DEBUG ("Next rate to use TxRate = " << station->m_txrate); @@ -865,7 +865,7 @@ MinstrelHtWifiManager::DoGetDataTxVector (WifiRemoteStation *st) // Check consistency of rate selected. if ((group.sgi && !GetShortGuardInterval (station)) || group.chWidth > GetChannelWidth (station) || group.streams > GetNumberOfSupportedStreams (station)) { - NS_ASSERT_MSG (false, "Inconsistent group selected. Group: (" << +group.streams << + NS_FATAL_ERROR ("Inconsistent group selected. Group: (" << +group.streams << "," << +group.sgi << "," << group.chWidth << ")" << " Station capabilities: (" << GetNumberOfSupportedStreams (station) << "," << GetShortGuardInterval (station) << "," << GetChannelWidth (station) << ")"); diff --git a/src/wifi/model/supported-rates.cc b/src/wifi/model/supported-rates.cc index 8f6d251fb..25615fb38 100644 --- a/src/wifi/model/supported-rates.cc +++ b/src/wifi/model/supported-rates.cc @@ -97,10 +97,10 @@ void SupportedRates::AddBssMembershipSelectorRate (uint64_t bs) { NS_LOG_FUNCTION (this << bs); - if ((bs != BSS_MEMBERSHIP_SELECTOR_HT_PHY) && (bs != BSS_MEMBERSHIP_SELECTOR_VHT_PHY) && (bs != BSS_MEMBERSHIP_SELECTOR_HE_PHY)) - { - NS_ASSERT_MSG (false, "Value " << bs << " not a BSS Membership Selector"); - } + NS_ASSERT_MSG (bs == BSS_MEMBERSHIP_SELECTOR_HT_PHY || + bs == BSS_MEMBERSHIP_SELECTOR_VHT_PHY || + bs == BSS_MEMBERSHIP_SELECTOR_HE_PHY, + "Value " << bs << " not a BSS Membership Selector"); uint8_t rate = static_cast (bs / 500000); for (uint8_t i = 0; i < m_nRates; i++) {