21 #include "ns3/simulator.h" 22 #include "ns3/list-scheduler.h" 23 #include "ns3/heap-scheduler.h" 24 #include "ns3/map-scheduler.h" 25 #include "ns3/calendar-scheduler.h" 33 virtual void DoRun (
void);
38 void Eventfoo0 (
void);
39 uint64_t NowUs (
void);
52 :
TestCase (
"Check that basic event handling is working with " +
53 schedulerFactory.GetTypeId ().GetName ()),
54 m_schedulerFactory (schedulerFactory)
74 if (b != 2 ||
NowUs () != 11)
82 Simulator::Remove (
m_idC);
96 if (d != 4 ||
NowUs () != (11+10))
134 Simulator::Cancel (a);
146 Simulator::Remove (anId);
168 Simulator::Destroy ();
181 virtual void DoRun (
void);
187 void bar4 (
int,
int,
int,
int) {}
188 void bar5 (
int,
int,
int,
int,
int) {}
191 void baz3 (
int &,
int &,
int &) {}
192 void baz4 (
int &,
int &,
int &,
int &) {}
193 void baz5 (
int &,
int &,
int &,
int &,
int &) {}
195 void cbaz2 (
const int &,
const int &) {}
196 void cbaz3 (
const int &,
const int &,
const int &) {}
197 void cbaz4 (
const int &,
const int &,
const int &,
const int &) {}
198 void cbaz5 (
const int &,
const int &,
const int &,
const int &,
const int &) {}
204 void bar4c (
int,
int,
int,
int)
const {}
205 void bar5c (
int,
int,
int,
int,
int)
const {}
208 void baz3c (
int &,
int &,
int &)
const {}
209 void baz4c (
int &,
int &,
int &,
int &)
const {}
210 void baz5c (
int &,
int &,
int &,
int &,
int &)
const {}
212 void cbaz2c (
const int &,
const int &)
const {}
213 void cbaz3c (
const int &,
const int &,
const int &)
const {}
214 void cbaz4c (
const int &,
const int &,
const int &,
const int &)
const {}
215 void cbaz5c (
const int &,
const int &,
const int &,
const int &,
const int &)
const {}
225 static void foo3 (
int,
int,
int)
227 static void foo4 (
int,
int,
int,
int)
229 static void foo5 (
int,
int,
int,
int,
int)
233 static void ber2 (
int &,
int &)
235 static void ber3 (
int &,
int &,
int &)
237 static void ber4 (
int &,
int &,
int &,
int &)
239 static void ber5 (
int &,
int &,
int &,
int &,
int &)
243 static void cber2 (
const int &,
const int &)
245 static void cber3 (
const int &,
const int &,
const int &)
247 static void cber4 (
const int &,
const int &,
const int &,
const int &)
249 static void cber5 (
const int &,
const int &,
const int &,
const int &,
const int &)
253 :
TestCase (
"Check that all templates are instantiated correctly. This is a compilation test, it cannot fail at runtime.")
334 Simulator::Schedule (
Seconds (0.0), &
foo3, 0, 0, 0);
335 Simulator::Schedule (
Seconds (0.0), &
foo4, 0, 0, 0, 0);
336 Simulator::Schedule (
Seconds (0.0), &
foo5, 0, 0, 0, 0, 0);
340 Simulator::Schedule (
Seconds (0.0), &
cber4, 0, 0, 0, 0);
341 Simulator::Schedule (
Seconds (0.0), &
cber5, 0, 0, 0, 0, 0);
342 Simulator::ScheduleNow (&
foo0);
343 Simulator::ScheduleNow (&
foo1, 0);
344 Simulator::ScheduleNow (&
foo2, 0, 0);
345 Simulator::ScheduleNow (&
foo3, 0, 0, 0);
346 Simulator::ScheduleNow (&
foo4, 0, 0, 0, 0);
347 Simulator::ScheduleNow (&
foo5, 0, 0, 0, 0, 0);
348 Simulator::ScheduleNow (&
cber1, 0);
349 Simulator::ScheduleNow (&
cber2, 0, 0);
350 Simulator::ScheduleNow (&
cber3, 0, 0, 0);
351 Simulator::ScheduleNow (&
cber4, 0, 0, 0, 0);
352 Simulator::ScheduleNow (&
cber5, 0, 0, 0, 0, 0);
353 Simulator::ScheduleDestroy (&
foo0);
354 Simulator::ScheduleDestroy (&
foo1, 0);
355 Simulator::ScheduleDestroy (&
foo2, 0, 0);
356 Simulator::ScheduleDestroy (&
foo3, 0, 0, 0);
357 Simulator::ScheduleDestroy (&
foo4, 0, 0, 0, 0);
358 Simulator::ScheduleDestroy (&
foo5, 0, 0, 0, 0, 0);
359 Simulator::ScheduleDestroy (&
cber1, 0);
360 Simulator::ScheduleDestroy (&
cber2, 0, 0);
361 Simulator::ScheduleDestroy (&
cber3, 0, 0, 0);
362 Simulator::ScheduleDestroy (&
cber4, 0, 0, 0, 0);
363 Simulator::ScheduleDestroy (&
cber5, 0, 0, 0, 0, 0);
430 Simulator::Schedule (
Seconds (0.0), &
ber3, 0, 0, 0);
431 Simulator::Schedule (
Seconds (0.0), &
ber4, 0, 0, 0, 0);
432 Simulator::Schedule (
Seconds (0.0), &
ber5, 0, 0, 0, 0, 0);
438 Simulator::ScheduleNow (&
ber1, 0);
439 Simulator::ScheduleNow (&
ber2, 0, 0);
440 Simulator::ScheduleNow (&
ber3, 0, 0, 0);
441 Simulator::ScheduleNow (&
ber4, 0, 0, 0, 0);
442 Simulator::ScheduleNow (&
ber5, 0, 0, 0, 0, 0);
448 Simulator::ScheduleDestroy (&
ber1, 0);
449 Simulator::ScheduleDestroy (&
ber2, 0, 0);
450 Simulator::ScheduleDestroy (&
ber3, 0, 0, 0);
451 Simulator::ScheduleDestroy (&
ber4, 0, 0, 0, 0);
452 Simulator::ScheduleDestroy (&
ber5, 0, 0, 0, 0, 0);
461 Simulator::Destroy ();
471 factory.
SetTypeId (ListScheduler::GetTypeId ());
474 factory.
SetTypeId (MapScheduler::GetTypeId ());
476 factory.
SetTypeId (HeapScheduler::GetTypeId ());
478 factory.
SetTypeId (CalendarScheduler::GetTypeId ());
static void ber5(int &, int &, int &, int &, int &)
Smart pointer class similar to boost::intrusive_ptr.
static void cber4(const int &, const int &, const int &, const int &)
void bar4(int, int, int, int)
static void ber4(int &, int &, int &, int &)
void baz3(int &, int &, int &)
void baz5c(int &, int &, int &, int &, int &) const
ObjectFactory m_schedulerFactory
static void foo5(int, int, int, int, int)
static void cber5(const int &, const int &, const int &, const int &, const int &)
void baz5(int &, int &, int &, int &, int &)
void bar3c(int, int, int) const
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
#define NS_UNUSED(x)
Mark a local variable as unused.
SimulatorEventsTestCase(ObjectFactory schedulerFactory)
bool IsExpired(void) const
This method is syntactic sugar for the ns3::Simulator::IsExpired method.
void cbaz5c(const int &, const int &, const int &, const int &, const int &) const
virtual void DoRun(void)
Implementation to actually run this TestCase.
void cbaz3c(const int &, const int &, const int &) const
SimulatorTemplateTestCase()
void baz3c(int &, int &, int &) const
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
static void ber3(int &, int &, int &)
static void foo3(int, int, int)
void baz4c(int &, int &, int &, int &) const
void bar2c(int, int) const
void bar5c(int, int, int, int, int) const
void bar4c(int, int, int, int) const
void cbaz5(const int &, const int &, const int &, const int &, const int &)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
void baz4(int &, int &, int &, int &)
virtual void DoRun(void)
Implementation to actually run this TestCase.
static void cber3(const int &, const int &, const int &)
void bar5(int, int, int, int, int)
SimulatorTestSuite g_simulatorTestSuite
Instantiate subclasses of ns3::Object.
void baz2c(int &, int &) const
static void cber1(const int &)
An identifier for simulation events.
void cbaz4(const int &, const int &, const int &, const int &)
Time Seconds(double value)
Construct a Time in the indicated unit.
static void ber2(int &, int &)
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
void cbaz1c(const int &) const
static void foo2(int, int)
static void cber2(const int &, const int &)
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
void cbaz2c(const int &, const int &) const
void cbaz3(const int &, const int &, const int &)
void cbaz2(const int &, const int &)
static void foo4(int, int, int, int)
void cbaz4c(const int &, const int &, const int &, const int &) const