diff --git a/src/olsr/test/bug780-0-0.pcap b/src/olsr/test/bug780-0-0.pcap index 32b471a3f..65bac6018 100644 Binary files a/src/olsr/test/bug780-0-0.pcap and b/src/olsr/test/bug780-0-0.pcap differ diff --git a/src/olsr/test/bug780-1-0.pcap b/src/olsr/test/bug780-1-0.pcap index 2f1409d97..bc318b90a 100644 Binary files a/src/olsr/test/bug780-1-0.pcap and b/src/olsr/test/bug780-1-0.pcap differ diff --git a/src/olsr/test/bug780-2-0.pcap b/src/olsr/test/bug780-2-0.pcap index 8778f1e13..2d56a22fb 100644 Binary files a/src/olsr/test/bug780-2-0.pcap and b/src/olsr/test/bug780-2-0.pcap differ diff --git a/src/olsr/test/bug780-test.cc b/src/olsr/test/bug780-test.cc index 6c59853e1..66acfbbb6 100644 --- a/src/olsr/test/bug780-test.cc +++ b/src/olsr/test/bug780-test.cc @@ -89,6 +89,7 @@ Bug780Test::CreateNodes (void) int nWifis = 3; double SimTime = 200.0; std::string phyMode ("DsssRate1Mbps"); + int64_t streamsUsed = 0; //sending one packets per sec // Fix non-unicast data rate to be the same as that of unicast @@ -103,7 +104,8 @@ Bug780Test::CreateNodes (void) YansWifiChannelHelper wifiChannel; wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel"); wifiChannel.AddPropagationLoss ("ns3::FriisPropagationLossModel"); - wifiPhy.SetChannel (wifiChannel.Create ()); + Ptr chan = wifiChannel.Create (); + wifiPhy.SetChannel (chan); // Add a non-QoS upper mac, and disable rate control NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); @@ -120,13 +122,21 @@ Bug780Test::CreateNodes (void) wifiMac.SetType ("ns3::AdhocWifiMac"); NetDeviceContainer adhocDevices = wifi.Install (wifiPhy, wifiMac, adhocNodes); + // Assign fixed stream numbers to wifi and channel random variables + streamsUsed += wifi.AssignStreams (adhocDevices, streamsUsed); + // Assign 6 streams per Wifi device + NS_TEST_ASSERT_MSG_EQ (streamsUsed, (adhocDevices.GetN () * 6), "Stream assignment mismatch"); + streamsUsed += wifiChannel.AssignStreams (chan, streamsUsed); + // Assign 0 streams per channel for this configuration + NS_TEST_ASSERT_MSG_EQ (streamsUsed, (adhocDevices.GetN () * 6), "Stream assignment mismatch"); + OlsrHelper olsr; InternetStackHelper internet; internet.SetRoutingHelper (olsr); internet.Install (adhocNodes); - int64_t streamsUsed = olsr.AssignStreams (adhocNodes, 0); - NS_TEST_EXPECT_MSG_EQ (streamsUsed, nWifis, "Should have assigned 3 streams"); + streamsUsed += olsr.AssignStreams (adhocNodes, 0); + NS_TEST_ASSERT_MSG_EQ (streamsUsed, ((adhocDevices.GetN () * 6) + nWifis), "Should have assigned 3 streams"); Ipv4AddressHelper addressAdhoc; addressAdhoc.SetBase ("10.1.1.0", "255.255.255.0"); diff --git a/src/olsr/test/hello-regression-test.cc b/src/olsr/test/hello-regression-test.cc index 155055efb..461b6510c 100644 --- a/src/olsr/test/hello-regression-test.cc +++ b/src/olsr/test/hello-regression-test.cc @@ -75,8 +75,9 @@ HelloRegressionTest::CreateNodes () InternetStackHelper internet; internet.SetRoutingHelper (olsr); internet.Install (c); + // Assign OLSR RVs to specific streams int64_t streamsUsed = olsr.AssignStreams (c, 0); - NS_TEST_EXPECT_MSG_EQ (streamsUsed, 2, "Should have assigned 2 streams"); + NS_TEST_ASSERT_MSG_EQ (streamsUsed, 2, "Should have assigned 2 streams"); // create p2p channel & devices PointToPointHelper p2p; p2p.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));