diff --git a/src/wifi/test/tx-duration-test.cc b/src/wifi/test/tx-duration-test.cc index 2546557d7..63ed492ca 100644 --- a/src/wifi/test/tx-duration-test.cc +++ b/src/wifi/test/tx-duration-test.cc @@ -1474,6 +1474,7 @@ class HeSigBDurationTest : public TestCase private: void DoRun() override; + void DoTeardown() override; /** * Build a TXVECTOR for HE MU. @@ -1482,6 +1483,8 @@ class HeSigBDurationTest : public TestCase */ WifiTxVector BuildTxVector() const; + Ptr m_phy; ///< the PHY under test + std::list m_userInfos; ///< HE MU specific per-user information WifiMode m_sigBMode; ///< Mode used to transmit HE-SIG-B MHz_u m_channelWidth; ///< Channel width @@ -1538,19 +1541,19 @@ HeSigBDurationTest::BuildTxVector() const void HeSigBDurationTest::DoRun() { - auto phy = CreateObject(); + m_phy = CreateObject(); auto channelNum = WifiPhyOperatingChannel::FindFirst(0, MHz_u{0}, MHz_u{160}, WIFI_STANDARD_80211ax, WIFI_PHY_BAND_6GHZ) ->number; - phy->SetOperatingChannel( + m_phy->SetOperatingChannel( WifiPhy::ChannelTuple{channelNum, 160, WIFI_PHY_BAND_6GHZ, m_p20Index}); - phy->ConfigureStandard(WIFI_STANDARD_80211ax); + m_phy->ConfigureStandard(WIFI_STANDARD_80211ax); const auto& txVector = BuildTxVector(); - const auto& hePhy = phy->GetPhyEntity(WIFI_MOD_CLASS_HE); + const auto& hePhy = m_phy->GetPhyEntity(WIFI_MOD_CLASS_HE); // Verify mode for HE-SIG-B field NS_TEST_EXPECT_MSG_EQ(hePhy->GetSigMode(WIFI_PPDU_FIELD_SIG_B, txVector), @@ -1597,7 +1600,7 @@ HeSigBDurationTest::DoRun() auto psdu = Create(Create(1000), hdr); ppduDuration = std::max( ppduDuration, - WifiPhy::CalculateTxDuration(psdu->GetSize(), txVector, phy->GetPhyBand(), i + 1)); + WifiPhy::CalculateTxDuration(psdu->GetSize(), txVector, m_phy->GetPhyBand(), i + 1)); psdus.insert(std::make_pair(i, psdu)); } auto ppdu = hePhy->BuildPpdu(psdus, txVector, ppduDuration); @@ -1606,6 +1609,15 @@ HeSigBDurationTest::DoRun() NS_TEST_EXPECT_MSG_EQ((txVector.GetHeMuUserInfoMap() == rxVector.GetHeMuUserInfoMap()), true, "Incorrect user infos in reconstructed TXVECTOR"); + + Simulator::Destroy(); +} + +void +HeSigBDurationTest::DoTeardown() +{ + m_phy->Dispose(); + m_phy = nullptr; } /**