Automated merge with file:///Users/barnes26/Code/netsim/ns3/repos/ns-3-dev

This commit is contained in:
Peter D. Barnes, Jr.
2013-06-26 17:32:03 -07:00
9 changed files with 39 additions and 18 deletions

View File

@@ -484,22 +484,30 @@ std::string
TestRunnerImpl::ReplaceXmlSpecialCharacters (std::string xml) const
{
NS_LOG_FUNCTION (this << xml);
std::string specials = "<>&\"'";
std::string replacements[] = {"&lt;", "&gt;", "&amp;", "&#39;", "&quot;"};
typedef std::map <char, std::string> specials_map;
specials_map specials;
specials['<'] = "&lt;";
specials['>'] = "&gt;";
specials['&'] = "&amp;";
specials['"'] = "&#39;";
specials['\''] = "&quot;";
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
{

View File

@@ -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 ();

View File

@@ -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 ();

View File

@@ -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)
{

View File

@@ -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;
}
}
}

View File

@@ -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

View File

@@ -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*

View File

@@ -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 ();
}

View File

@@ -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