diff --git a/src/core/model/test.cc b/src/core/model/test.cc index 30fe7bade..24cbdab22 100644 --- a/src/core/model/test.cc +++ b/src/core/model/test.cc @@ -547,7 +547,7 @@ TestRunnerImpl::PrintReport (TestCase *test, std::ostream *os, bool xml, int lev double user = test->m_result->clock.GetElapsedUser () / MS_PER_SEC; double system = test->m_result->clock.GetElapsedSystem () / MS_PER_SEC; - (*os).precision (3); + std::streamsize oldPrecision = (*os).precision (3); *os << std::fixed; std::string statusString = test->IsFailed ()?"FAIL":"PASS"; @@ -604,7 +604,8 @@ TestRunnerImpl::PrintReport (TestCase *test, std::ostream *os, bool xml, int lev } } - os->unsetf(std::ios_base::floatfield); + (*os).unsetf(std::ios_base::floatfield); + (*os).precision (oldPrecision); } void diff --git a/src/spectrum/test/spectrum-ideal-phy-test.cc b/src/spectrum/test/spectrum-ideal-phy-test.cc index a3a30d4ce..0cb90c938 100644 --- a/src/spectrum/test/spectrum-ideal-phy-test.cc +++ b/src/spectrum/test/spectrum-ideal-phy-test.cc @@ -194,6 +194,8 @@ SpectrumIdealPhyTestCase::DoRun (void) Simulator::Run (); double throughputBps = (g_rxBytes * 8.0) / testDuration; + std::clog.unsetf(std::ios_base::floatfield); + if (m_rateIsAchievable) { NS_TEST_ASSERT_MSG_EQ_TOL (throughputBps, m_phyRate, m_phyRate*0.01, "throughput does not match PHY rate"); @@ -203,7 +205,6 @@ SpectrumIdealPhyTestCase::DoRun (void) NS_TEST_ASSERT_MSG_EQ (throughputBps, 0.0, "PHY rate is not achievable but throughput is non-zero"); } - std::clog.unsetf(std::ios_base::floatfield); Simulator::Destroy (); } diff --git a/src/wifi/model/ctrl-headers.cc b/src/wifi/model/ctrl-headers.cc index 9d9efe1d9..bd37fc699 100644 --- a/src/wifi/model/ctrl-headers.cc +++ b/src/wifi/model/ctrl-headers.cc @@ -314,7 +314,7 @@ void CtrlBAckResponseHeader::Print (std::ostream &os) const { NS_LOG_FUNCTION (this << &os); - os << "TID_INFO=" << m_tidInfo << ", StartingSeq=" << std::hex << m_startingSeq; + os << "TID_INFO=" << m_tidInfo << ", StartingSeq=" << std::hex << m_startingSeq << std::dec; } uint32_t