Automated merge with file:///Users/barnes26/Code/netsim/ns3/repos/ns-3-dev
This commit is contained in:
@@ -484,22 +484,30 @@ std::string
|
||||
TestRunnerImpl::ReplaceXmlSpecialCharacters (std::string xml) const
|
||||
{
|
||||
NS_LOG_FUNCTION (this << xml);
|
||||
std::string specials = "<>&\"'";
|
||||
std::string replacements[] = {"<", ">", "&", "'", """};
|
||||
typedef std::map <char, std::string> specials_map;
|
||||
specials_map specials;
|
||||
specials['<'] = "<";
|
||||
specials['>'] = ">";
|
||||
specials['&'] = "&";
|
||||
specials['"'] = "'";
|
||||
specials['\''] = """;
|
||||
|
||||
std::string result;
|
||||
std::size_t index, length = xml.length ();
|
||||
std::size_t length = xml.length ();
|
||||
|
||||
for (size_t i = 0; i < length; ++i)
|
||||
{
|
||||
char character = xml[i];
|
||||
|
||||
if ((index = specials.find (character)) == std::string::npos)
|
||||
specials_map::const_iterator it = specials.find (character);
|
||||
|
||||
if (it == specials.end ())
|
||||
{
|
||||
result.push_back (character);
|
||||
}
|
||||
else
|
||||
{
|
||||
result += replacements[index];
|
||||
result += it->second;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -539,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";
|
||||
@@ -596,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
|
||||
@@ -711,7 +720,7 @@ TestRunnerImpl::FilterTests (std::string testName,
|
||||
delete *j;
|
||||
|
||||
// Remove this test case from the test suite.
|
||||
test->m_children.erase (j);
|
||||
j = test->m_children.erase (j);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1141,14 +1141,18 @@ void
|
||||
RouteCache::AddNeighbor (std::vector<Ipv4Address> nodeList, Ipv4Address ownAddress, Time expire)
|
||||
{
|
||||
NS_LOG_LOGIC ("Add neighbor number " << nodeList.size ());
|
||||
for (std::vector<Ipv4Address>::iterator j = nodeList.begin (); j != nodeList.end (); ++j)
|
||||
for (std::vector<Ipv4Address>::iterator j = nodeList.begin (); j != nodeList.end ();)
|
||||
{
|
||||
Ipv4Address addr = *j;
|
||||
if (addr == ownAddress)
|
||||
{
|
||||
nodeList.erase (j);
|
||||
j = nodeList.erase (j);
|
||||
NS_LOG_DEBUG ("The node list size " << nodeList.size ());
|
||||
}
|
||||
else
|
||||
{
|
||||
++j;
|
||||
}
|
||||
Neighbor neighbor (addr, LookupMacAddress (addr), expire + Simulator::Now ());
|
||||
m_nb.push_back (neighbor);
|
||||
PurgeMac ();
|
||||
|
||||
@@ -1014,7 +1014,7 @@ void DsrRouting::CheckSendBuffer ()
|
||||
Ptr<Packet> cleanP = packet->Copy ();
|
||||
uint8_t protocol = i->GetProtocol ();
|
||||
|
||||
m_sendBuffer.GetBuffer ().erase (i);
|
||||
i = m_sendBuffer.GetBuffer ().erase (i);
|
||||
|
||||
DsrRoutingHeader dsrRoutingHeader;
|
||||
Ptr<Packet> copyP = packet->Copy ();
|
||||
|
||||
@@ -225,7 +225,7 @@ bool
|
||||
RreqTable::MarkLinkAsUnidirectional (Ipv4Address neighbor, Time blacklistTimeout)
|
||||
{
|
||||
NS_LOG_LOGIC ("Add neighbor address in blacklist " << m_blackList.size ());
|
||||
for (std::vector<BlackList>::iterator i = m_blackList.begin (); i != m_blackList.end (); ++i)
|
||||
for (std::vector<BlackList>::iterator i = m_blackList.begin (); i != m_blackList.end (); i++)
|
||||
{
|
||||
if (i->m_neighborAddress == neighbor)
|
||||
{
|
||||
|
||||
@@ -732,7 +732,7 @@ void Ipv6StaticRouting::NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv
|
||||
NS_LOG_FUNCTION (this << dst << mask << nextHop << interface);
|
||||
if (dst != Ipv6Address::GetZero ())
|
||||
{
|
||||
for (NetworkRoutesI j = m_networkRoutes.begin (); j != m_networkRoutes.end (); j++)
|
||||
for (NetworkRoutesI j = m_networkRoutes.begin (); j != m_networkRoutes.end ();)
|
||||
{
|
||||
Ipv6RoutingTableEntry* rtentry = j->first;
|
||||
Ipv6Prefix prefix = rtentry->GetDestNetworkPrefix ();
|
||||
@@ -741,7 +741,11 @@ void Ipv6StaticRouting::NotifyRemoveRoute (Ipv6Address dst, Ipv6Prefix mask, Ipv
|
||||
if (dst == entry && prefix == mask && rtentry->GetInterface () == interface)
|
||||
{
|
||||
delete j->first;
|
||||
m_networkRoutes.erase (j);
|
||||
j = m_networkRoutes.erase (j);
|
||||
}
|
||||
else
|
||||
{
|
||||
++j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +311,8 @@ NixVector::Deserialize (const uint32_t* buffer, uint32_t size)
|
||||
|
||||
// return zero if an entire nix-vector was
|
||||
// not deserialized
|
||||
return (sizeCheck != 0) ? 0 : 1;
|
||||
// This check is obviated by prior assert
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -1349,7 +1349,9 @@ PacketMetadata::Deserialize (const uint8_t* buffer, uint32_t size)
|
||||
UpdateTail (tmp);
|
||||
}
|
||||
NS_ASSERT (desSize == 0);
|
||||
return (desSize !=0) ? 0 : 1;
|
||||
// Return zero if entire meta data was not deserialized
|
||||
// This check is obviated by prior assert
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t*
|
||||
|
||||
@@ -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 ();
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user