8#include "ns3/calendar-scheduler.h"
9#include "ns3/heap-scheduler.h"
10#include "ns3/list-scheduler.h"
11#include "ns3/map-scheduler.h"
12#include "ns3/priority-queue-scheduler.h"
13#include "ns3/simulator.h"
42 void DoRun()
override;
85 :
TestCase(
"Check that basic event handling is working with " +
86 schedulerFactory.GetTypeId().GetName()),
87 m_schedulerFactory(schedulerFactory)
121 m_d = !(d != 4 ||
NowUs() != (11 + 10));
170 "Event should not have expired yet.");
182 "Event was canceled: should have expired now");
189 "Event was canceled: should have expired now");
231 void DoRun()
override;
242 void bar4(
int,
int,
int,
int){};
243 void bar5(
int,
int,
int,
int,
int){};
247 void baz4(
int&,
int&,
int&,
int&){};
248 void baz5(
int&,
int&,
int&,
int&,
int&){};
250 void cbaz2(
const int&,
const int&){};
251 void cbaz3(
const int&,
const int&,
const int&){};
252 void cbaz4(
const int&,
const int&,
const int&,
const int&){};
253 void cbaz5(
const int&,
const int&,
const int&,
const int&,
const int&){};
259 void bar4c(
int,
int,
int,
int)
const {};
260 void bar5c(
int,
int,
int,
int,
int)
const {};
263 void baz3c(
int&,
int&,
int&)
const {};
264 void baz4c(
int&,
int&,
int&,
int&)
const {};
265 void baz5c(
int&,
int&,
int&,
int&,
int&)
const {};
267 void cbaz2c(
const int&,
const int&)
const {};
268 void cbaz3c(
const int&,
const int&,
const int&)
const {};
269 void cbaz4c(
const int&,
const int&,
const int&,
const int&)
const {};
270 void cbaz5c(
const int&,
const int&,
const int&,
const int&,
const int&)
const {};
330ber5(
int&,
int&,
int&,
int&,
int&)
345cber3(
const int&,
const int&,
const int&)
350cber4(
const int&,
const int&,
const int&,
const int&)
355cber5(
const int&,
const int&,
const int&,
const int&,
const int&)
362 :
TestCase(
"Check that all templates are instantiated correctly. This is a compilation test, "
363 "it cannot fail at runtime.")
Check that basic event handling is working with different Simulator implementations.
void EventD(int value)
Test Event.
void Destroy()
Checks that the events has been destroyed.
uint64_t NowUs()
Get the simulator time.
void DoRun() override
Implementation to actually run this TestCase.
void EventC(int value)
Test Event.
bool m_c
Checks that events are properly handled.
SimulatorEventsTestCase(ObjectFactory schedulerFactory)
Constructor.
bool m_a
Checks that events are properly handled.
bool m_destroy
Checks that events are properly handled.
void Eventfoo0()
Test Event.
bool m_b
Checks that events are properly handled.
void EventB(int value)
Test Event.
ObjectFactory m_schedulerFactory
Scheduler factory.
EventId m_destroyId
Event to check event lifetime.
void EventA(int value)
Test Event.
bool m_d
Checks that events are properly handled.
Check that all templates are instantiated correctly.
void bar2(int, int)
Function used for scheduling.
void bar4(int, int, int, int)
Function used for scheduling.
void bar1c(int) const
Function used for scheduling.
void bar0()
Function used for scheduling.
void cbaz2(const int &, const int &)
Function used for scheduling.
void Ref() const
Ref and Unref - only here for testing of Ptr<>
void Unref() const
Ref and Unref - only here for testing of Ptr<>
void baz5c(int &, int &, int &, int &, int &) const
Function used for scheduling.
void baz1(int &)
Function used for scheduling.
void cbaz4c(const int &, const int &, const int &, const int &) const
Function used for scheduling.
void baz3c(int &, int &, int &) const
Function used for scheduling.
void baz4c(int &, int &, int &, int &) const
Function used for scheduling.
void cbaz2c(const int &, const int &) const
Function used for scheduling.
void baz4(int &, int &, int &, int &)
Function used for scheduling.
void baz1c(int &) const
Function used for scheduling.
void cbaz5c(const int &, const int &, const int &, const int &, const int &) const
Function used for scheduling.
SimulatorTemplateTestCase()
void cbaz5(const int &, const int &, const int &, const int &, const int &)
Function used for scheduling.
void bar5(int, int, int, int, int)
Function used for scheduling.
void baz2c(int &, int &) const
Function used for scheduling.
void baz5(int &, int &, int &, int &, int &)
Function used for scheduling.
void bar1(int)
Function used for scheduling.
void cbaz1(const int &)
Function used for scheduling.
void cbaz3(const int &, const int &, const int &)
Function used for scheduling.
void bar4c(int, int, int, int) const
Function used for scheduling.
void bar3c(int, int, int) const
Function used for scheduling.
void bar0c() const
Function used for scheduling.
void DoRun() override
Implementation to actually run this TestCase.
void cbaz3c(const int &, const int &, const int &) const
Function used for scheduling.
void cbaz1c(const int &) const
Function used for scheduling.
void cbaz4(const int &, const int &, const int &, const int &)
Function used for scheduling.
void baz2(int &, int &)
Function used for scheduling.
void bar5c(int, int, int, int, int) const
Function used for scheduling.
void bar2c(int, int) const
Function used for scheduling.
void bar3(int, int, int)
Function used for scheduling.
void baz3(int &, int &, int &)
Function used for scheduling.
The simulator Test Suite.
static TypeId GetTypeId()
Register this type.
An identifier for simulation events.
void Cancel()
This method is syntactic sugar for the ns3::Simulator::Cancel method.
bool IsExpired() const
This method is syntactic sugar for the ns3::Simulator::IsExpired method.
static TypeId GetTypeId()
Register this type.
static TypeId GetTypeId()
Register this type.
static TypeId GetTypeId()
Register this type.
Instantiate subclasses of ns3::Object.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
static TypeId GetTypeId()
Register this type.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Cancel(const EventId &id)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
static EventId ScheduleDestroy(FUNC f, Ts &&... args)
Schedule an event to run at the end of the simulation, when Simulator::Destroy() is called.
static void SetScheduler(ObjectFactory schedulerFactory)
Set the scheduler type with an ObjectFactory.
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
static void Remove(const EventId &id)
Remove an event from the event list.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
int64_t GetNanoSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Time Now()
create an ns3::Time instance which contains the current simulation time.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static void ber5(int &, int &, int &, int &, int &)
Function used for scheduling.
static void foo3(int, int, int)
Function used for scheduling.
static void ber4(int &, int &, int &, int &)
Function used for scheduling.
static void cber5(const int &, const int &, const int &, const int &, const int &)
Function used for scheduling.
static void cber1(const int &)
Function used for scheduling.
static void ber3(int &, int &, int &)
Function used for scheduling.
static SimulatorTestSuite g_simulatorTestSuite
Static variable for test initialization.
static void cber3(const int &, const int &, const int &)
Function used for scheduling.
static void foo4(int, int, int, int)
Function used for scheduling.
static void foo2(int, int)
Function used for scheduling.
static void cber2(const int &, const int &)
Function used for scheduling.
static void cber4(const int &, const int &, const int &, const int &)
Function used for scheduling.
static void ber1(int &)
Function used for scheduling.
static void foo5(int, int, int, int, int)
Function used for scheduling.
static void foo1(int)
Function used for scheduling.
static void foo0()
Function used for scheduling.
static void ber2(int &, int &)
Function used for scheduling.