Clean up core, network, internet, point-to-point tests that don't access private class attributes and methods in accordance to sample-test-suite.cc.
--- a/src/core/test/attribute-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/core/test/attribute-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -34,7 +34,7 @@
#include "ns3/pointer.h"
#include "ns3/object-factory.h"
-namespace ns3 {
+using namespace ns3;
class ValueClassTest
{
@@ -1290,5 +1290,3 @@
}
static AttributesTestSuite attributesTestSuite;
-
-} // namespace ns3
--- a/src/core/test/callback-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/core/test/callback-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -20,7 +20,7 @@
#include "ns3/callback.h"
#include <stdint.h>
-namespace ns3 {
+using namespace ns3;
// ===========================================================================
// Test the basic Callback mechanism
@@ -576,5 +576,3 @@
}
static CallbackTestSuite CallbackTestSuite;
-
-} // namespace
--- a/src/core/test/command-line-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/core/test/command-line-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -27,7 +27,7 @@
#include <cstdlib>
#include <cstdarg>
-namespace ns3 {
+using namespace ns3;
// ===========================================================================
// A test base class that drives Command Line parsing
@@ -226,5 +226,3 @@
}
static CommandLineTestSuite CommandLineTestSuite;
-
-} // namespace ns3
--- a/src/core/test/config-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/core/test/config-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -34,7 +34,7 @@
#include <sstream>
-namespace ns3 {
+using namespace ns3;
// ===========================================================================
// An object with some attributes that we can play with using config.
@@ -624,5 +624,3 @@
}
static ConfigTestSuite configTestSuite;
-
-} // namespace ns3
--- a/src/core/test/int64x64-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/core/test/int64x64-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -1,8 +1,7 @@
#include "ns3/int64x64.h"
#include "ns3/test.h"
-namespace ns3
-{
+using namespace ns3;
class Int64x64FracTestCase : public TestCase
{
@@ -336,5 +335,3 @@
AddTestCase (new Int64x64InvertTestCase ());
}
} g_int64x64TestSuite;
-
-} // namespace ns3
--- a/src/core/test/ptr-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/core/test/ptr-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -21,7 +21,7 @@
#include "ns3/test.h"
#include "ns3/ptr.h"
-namespace ns3 {
+using namespace ns3;
class PtrTestCase;
@@ -272,5 +272,3 @@
AddTestCase (new PtrTestCase ());
}
} g_ptrTestSuite;
-
-} // namespace ns3
--- a/src/core/test/random-variable-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/core/test/random-variable-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -28,7 +28,8 @@
#include "ns3/integer.h"
#include "ns3/random-variable.h"
-namespace ns3 {
+using namespace ns3;
+
class BasicRandomNumberTestCase : public TestCase
{
public:
@@ -142,5 +143,3 @@
}
static BasicRandomNumberTestSuite BasicRandomNumberTestSuite;
-
-} // namespace ns3
--- a/src/core/test/simulator-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/core/test/simulator-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -24,7 +24,7 @@
#include "ns3/map-scheduler.h"
#include "ns3/calendar-scheduler.h"
-namespace ns3 {
+using namespace ns3;
class SimulatorEventsTestCase : public TestCase
{
@@ -477,5 +477,3 @@
AddTestCase (new SimulatorEventsTestCase (factory));
}
} g_simulatorTestSuite;
-
-} // namespace ns3
--- a/src/core/test/threaded-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/core/test/threaded-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -31,7 +31,7 @@
#include <list>
#include <utility>
-namespace ns3 {
+using namespace ns3;
#define MAXTHREADS 64
@@ -264,5 +264,3 @@
}
}
} g_threadedSimulatorTestSuite;
-
-} // namespace ns3
--- a/src/core/test/time-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/core/test/time-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -22,7 +22,7 @@
#include "ns3/nstime.h"
#include "ns3/test.h"
-namespace ns3 {
+using namespace ns3;
class TimeSimpleTestCase : public TestCase
{
@@ -143,5 +143,3 @@
AddTestCase (new TimesWithSignsTestCase ());
}
} g_timeTestSuite;
-
-} // namespace ns3
--- a/src/core/test/timer-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/core/test/timer-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -46,7 +46,7 @@
}
} // anonymous namespace
-namespace ns3 {
+using namespace ns3;
class TimerStateTestCase : public TestCase
{
@@ -218,7 +218,3 @@
AddTestCase (new TimerTemplateTestCase ());
}
} g_timerTestSuite;
-
-} // namespace ns3
-
-
--- a/src/core/test/type-traits-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/core/test/type-traits-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -19,7 +19,7 @@
#include "ns3/type-traits.h"
#include "ns3/test.h"
-namespace ns3 {
+using namespace ns3;
class TypeTraitsTestCase : public TestCase
{
@@ -60,5 +60,3 @@
}
static TypeTraitsTestSuite typeTraitsTestSuite;
-
-} // namespace ns3
--- a/src/core/test/watchdog-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/core/test/watchdog-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -20,7 +20,7 @@
#include "ns3/watchdog.h"
#include "ns3/test.h"
-namespace ns3 {
+using namespace ns3;
class WatchdogTestCase : public TestCase
{
@@ -77,6 +77,3 @@
AddTestCase (new WatchdogTestCase ());
}
} g_watchdogTestSuite;
-
-} // namespace ns3
-
--- a/src/internet/test/global-route-manager-impl-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/internet/test/global-route-manager-impl-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -28,7 +28,7 @@
#include "ns3/simulator.h"
#include <cstdlib> // for rand()
-namespace ns3 {
+using namespace ns3;
class GlobalRouteManagerImplTestCase : public TestCase
{
@@ -223,5 +223,3 @@
AddTestCase (new GlobalRouteManagerImplTestCase ());
}
} g_globalRoutingManagerImplTestSuite;
-
-} // namespace ns3
--- a/src/internet/test/ipv4-address-generator-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/internet/test/ipv4-address-generator-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -20,7 +20,7 @@
#include "ns3/ipv4-address-generator.h"
#include "ns3/simulation-singleton.h"
-namespace ns3 {
+using namespace ns3;
class NetworkNumberAllocatorTestCase : public TestCase
{
@@ -315,6 +315,3 @@
AddTestCase (new AddressCollisionTestCase ());
}
} g_ipv4AddressGeneratorTestSuite;
-
-} // namespace ns3
-
--- a/src/internet/test/ipv4-address-helper-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/internet/test/ipv4-address-helper-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -21,7 +21,7 @@
#include "ns3/ipv4-address-helper.h"
#include "ns3/simulator.h"
-namespace ns3 {
+using namespace ns3;
class NetworkAllocatorHelperTestCase : public TestCase
{
@@ -267,6 +267,3 @@
AddTestCase (new IpAddressHelperTestCasev4 ());
}
} g_ipv4AddressHelperTestSuite;
-
-} // namespace ns3
-
--- a/src/internet/test/ipv4-fragmentation-test.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/internet/test/ipv4-fragmentation-test.cc Fri Sep 21 13:47:41 2012 +0200
@@ -50,7 +50,7 @@
#include <limits>
#include <netinet/in.h>
-namespace ns3 {
+using namespace ns3;
class UdpSocketImpl;
@@ -410,5 +410,3 @@
AddTestCase (new Ipv4FragmentationTest);
}
} g_ipv4fragmentationTestSuite;
-
-}; // namespace ns3
--- a/src/internet/test/ipv4-header-test.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/internet/test/ipv4-header-test.cc Fri Sep 21 13:47:41 2012 +0200
@@ -45,7 +45,8 @@
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
-namespace ns3 {
+
+using namespace ns3;
static void
AddInternetStack (Ptr<Node> node)
@@ -263,5 +264,3 @@
AddTestCase (new Ipv4HeaderTest);
}
} g_ipv4HeaderTestSuite;
-
-} // namespace ns3
--- a/src/internet/test/ipv4-list-routing-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/internet/test/ipv4-list-routing-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -21,7 +21,7 @@
#include "ns3/ipv4-list-routing.h"
#include "ns3/ipv4-routing-protocol.h"
-namespace ns3 {
+using namespace ns3;
class Ipv4ARouting : public Ipv4RoutingProtocol {
public:
@@ -123,7 +123,3 @@
}
} g_ipv4ListRoutingTestSuite;
-
-} // namespace ns3
-
-
--- a/src/internet/test/ipv4-packet-info-tag-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/internet/test/ipv4-packet-info-tag-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -48,7 +48,9 @@
#include "ns3/simulator.h"
#include "ns3/node.h"
-namespace ns3 {
+using namespace ns3;
+
+namespace {
static void
AddInternetStack (Ptr<Node> node)
@@ -72,6 +74,8 @@
node->AggregateObject (udp);
}
+}
+
class Ipv4PacketInfoTagTest : public TestCase
{
public:
@@ -158,7 +162,7 @@
InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), 200);
socket->Bind (local);
socket->SetRecvPktInfo (true);
- socket->SetRecvCallback (MakeCallback (&ns3::Ipv4PacketInfoTagTest::RxCb, this));
+ socket->SetRecvCallback (MakeCallback (&Ipv4PacketInfoTagTest::RxCb, this));
// receive on loopback
Simulator::ScheduleWithContext (socket->GetNode ()->GetId (), Seconds (0),
@@ -177,7 +181,7 @@
local = InetSocketAddress (Ipv4Address::GetAny (), 0);
socket->Bind (local);
socket->SetRecvPktInfo (true);
- socket->SetRecvCallback (MakeCallback (&ns3::Ipv4PacketInfoTagTest::RxCb, this));
+ socket->SetRecvCallback (MakeCallback (&Ipv4PacketInfoTagTest::RxCb, this));
// receive on loopback
Simulator::ScheduleWithContext (socket->GetNode ()->GetId (), Seconds (0),
@@ -204,6 +208,3 @@
{
AddTestCase (new Ipv4PacketInfoTagTest ());
}
-
-
-}
--- a/src/internet/test/ipv4-raw-test.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/internet/test/ipv4-raw-test.cc Fri Sep 21 13:47:41 2012 +0200
@@ -46,7 +46,8 @@
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>
-namespace ns3 {
+
+using namespace ns3;
static void
AddInternetStack (Ptr<Node> node)
@@ -322,5 +323,3 @@
AddTestCase (new Ipv4RawSocketImplTest);
}
} g_ipv4rawTestSuite;
-
-} // namespace ns3
--- a/src/internet/test/ipv6-address-generator-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/internet/test/ipv6-address-generator-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -21,7 +21,7 @@
#include "ns3/ipv6-address-generator.h"
#include "ns3/simulation-singleton.h"
-namespace ns3 {
+using namespace ns3;
class NetworkNumber6AllocatorTestCase : public TestCase
{
@@ -286,6 +286,3 @@
AddTestCase (new AddressCollision6TestCase ());
}
} g_ipv6AddressGeneratorTestSuite;
-
-} // namespace ns3
-
--- a/src/internet/test/ipv6-dual-stack-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/internet/test/ipv6-dual-stack-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -50,7 +50,7 @@
NS_LOG_COMPONENT_DEFINE ("Ipv6DualStackTestSuite");
-namespace ns3 {
+using namespace ns3;
class DualStackTestCase : public TestCase
{
@@ -309,5 +309,3 @@
AddTestCase (new DualStackTestCase());
}
} g_ipv6DualStackTestSuite;
-
-} // namespace ns3
--- a/src/internet/test/ipv6-extension-header-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/internet/test/ipv6-extension-header-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -23,7 +23,7 @@
using namespace ns3;
// ===========================================================================
-// An empty option field must be filled with pad1 or padN header so the
+// An empty option field must be filled with pad1 or padN header so theshape
// extension header's size is a multiple of 8.
//
// 0 31
--- a/src/internet/test/ipv6-fragmentation-test.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/internet/test/ipv6-fragmentation-test.cc Fri Sep 21 13:47:41 2012 +0200
@@ -59,7 +59,7 @@
#include <limits>
#include <netinet/in.h>
-namespace ns3 {
+using namespace ns3;
class UdpSocketImpl;
@@ -426,5 +426,3 @@
AddTestCase (new Ipv6FragmentationTest);
}
} g_ipv6fragmentationTestSuite;
-
-}; // namespace ns3
--- a/src/internet/test/ipv6-list-routing-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/internet/test/ipv6-list-routing-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -22,7 +22,7 @@
#include "ns3/ipv6-route.h"
#include "ns3/ipv6-routing-protocol.h"
-namespace ns3 {
+using namespace ns3;
class Ipv6ARouting : public Ipv6RoutingProtocol {
public:
@@ -130,5 +130,3 @@
}
} g_ipv6ListRoutingTestSuite;
-
-} // namespace ns3
--- a/src/internet/test/ipv6-packet-info-tag-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/internet/test/ipv6-packet-info-tag-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -45,7 +45,7 @@
#include "ns3/boolean.h"
#include "ns3/node.h"
-namespace ns3 {
+using namespace ns3;
static void
AddInternetStack (Ptr<Node> node)
@@ -155,7 +155,7 @@
socket->SetAttribute ("Protocol", UintegerValue (Ipv6Header::IPV6_ICMPV6));
socket->Bind (local);
socket->SetRecvPktInfo (true);
- socket->SetRecvCallback (MakeCallback (&ns3::Ipv6PacketInfoTagTest::RxCb, this));
+ socket->SetRecvCallback (MakeCallback (&Ipv6PacketInfoTagTest::RxCb, this));
// receive on loopback
Simulator::ScheduleWithContext (socket->GetNode ()->GetId (), Seconds (0),
@@ -178,7 +178,7 @@
local = Inet6SocketAddress (Ipv6Address::GetAny (), 200);
socket->Bind (local);
socket->SetRecvPktInfo (true);
- socket->SetRecvCallback (MakeCallback (&ns3::Ipv6PacketInfoTagTest::RxCb, this));
+ socket->SetRecvCallback (MakeCallback (&Ipv6PacketInfoTagTest::RxCb, this));
// receive on loopback
Simulator::ScheduleWithContext (socket->GetNode ()->GetId (), Seconds (0),
@@ -209,7 +209,3 @@
{
AddTestCase (new Ipv6PacketInfoTagTest ());
}
-
-
-}
-
--- a/src/internet/test/ipv6-test.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/internet/test/ipv6-test.cc Fri Sep 21 13:47:41 2012 +0200
@@ -31,6 +31,7 @@
#include "ns3/icmpv6-l4-protocol.h"
namespace ns3 {
+
class Ipv6L3ProtocolTestCase : public TestCase
{
public:
@@ -146,4 +147,5 @@
AddTestCase (new Ipv6L3ProtocolTestCase ());
}
} g_ipv6protocolTestSuite;
+
} // namespace ns3
--- a/src/internet/test/tcp-test.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/internet/test/tcp-test.cc Fri Sep 21 13:47:41 2012 +0200
@@ -51,7 +51,7 @@
NS_LOG_COMPONENT_DEFINE ("TcpTestSuite");
-namespace ns3 {
+using namespace ns3;
class TcpTestCase : public TestCase
{
@@ -445,5 +445,3 @@
}
} g_tcpTestSuite;
-
-} // namespace ns3
--- a/src/internet/test/udp-test.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/internet/test/udp-test.cc Fri Sep 21 13:47:41 2012 +0200
@@ -50,7 +50,8 @@
#include <string>
#include <limits>
-namespace ns3 {
+
+using namespace ns3;
static void
AddInternetStack (Ptr<Node> node)
@@ -581,5 +582,3 @@
AddTestCase (new Udp6SocketLoopbackTest);
}
} g_udpTestSuite;
-
-} // namespace ns3
--- a/src/network/test/buffer-test.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/network/test/buffer-test.cc Fri Sep 21 13:47:41 2012 +0200
@@ -3,7 +3,7 @@
#include "ns3/double.h"
#include "ns3/test.h"
-namespace ns3 {
+using namespace ns3;
//-----------------------------------------------------------------------------
// Unit tests
@@ -336,5 +336,3 @@
}
static BufferTestSuite g_bufferTestSuite;
-
-} // namespace ns3
--- a/src/network/test/drop-tail-queue-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/network/test/drop-tail-queue-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -20,7 +20,7 @@
#include "ns3/drop-tail-queue.h"
#include "ns3/uinteger.h"
-namespace ns3 {
+using namespace ns3;
class DropTailQueueTestCase : public TestCase
{
@@ -86,5 +86,3 @@
AddTestCase (new DropTailQueueTestCase ());
}
} g_dropTailQueueTestSuite;
-
-} // namespace ns3
--- a/src/network/test/packet-metadata-test.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/network/test/packet-metadata-test.cc Fri Sep 21 13:47:41 2012 +0200
@@ -250,8 +250,6 @@
}
-namespace ns3 {
-
class PacketMetadataTest : public TestCase {
public:
PacketMetadataTest ();
@@ -835,4 +833,3 @@
}
PacketMetadataTestSuite g_packetMetadataTest;
-} // namespace ns3
--- a/src/network/test/packet-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/network/test/packet-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -22,7 +22,7 @@
#include <string>
#include <cstdarg>
-namespace ns3 {
+using namespace ns3;
//-----------------------------------------------------------------------------
// Unit tests
@@ -449,6 +449,3 @@
}
static PacketTestSuite g_packetTestSuite;
-
-
-} // namespace ns3
--- a/src/network/test/red-queue-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/network/test/red-queue-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -27,7 +27,7 @@
#include "ns3/log.h"
#include "ns3/simulator.h"
-namespace ns3 {
+using namespace ns3;
class RedQueueTestCase : public TestCase
{
@@ -279,5 +279,3 @@
AddTestCase (new RedQueueTestCase ());
}
} g_redQueueTestSuite;
-
-} // namespace ns3
--- a/src/network/test/sequence-number-test-suite.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/network/test/sequence-number-test-suite.cc Fri Sep 21 13:47:41 2012 +0200
@@ -24,7 +24,7 @@
#include "ns3/traced-value.h"
#include "ns3/trace-source-accessor.h"
-namespace ns3 {
+using namespace ns3;
class SequenceNumberTestObj : public Object
{
@@ -189,6 +189,3 @@
AddTestCase (new SequenceNumberTestCase ());
}
} g_seqNumTests;
-
-}
-
--- a/src/point-to-point/test/point-to-point-test.cc Thu Sep 20 10:13:28 2012 -0400
+++ b/src/point-to-point/test/point-to-point-test.cc Fri Sep 21 13:47:41 2012 +0200
@@ -4,7 +4,7 @@
#include "ns3/point-to-point-net-device.h"
#include "ns3/point-to-point-channel.h"
-namespace ns3 {
+using namespace ns3;
class PointToPointTest : public TestCase
{
@@ -69,5 +69,3 @@
}
static PointToPointTestSuite g_pointToPointTestSuite;
-
-} // namespace ns3