22 #include "ns3/nstime.h"
32 virtual void DoSetup (
void);
33 virtual void DoRun (
void);
34 virtual void DoTeardown (
void);
38 :
TestCase (
"Sanity check of common time operations")
71 "is 1ms really 1ms ?");
73 "is 1us really 1us ?");
75 Time ns = NanoSeconds (1);
78 "is 1ns really 1ns ?");
80 "is 1ps really 1ps ?");
82 "is 1fs really 1fs ?");
85 Time ten = NanoSeconds (10);
87 Time::SetResolution (Time::PS);
90 "change resolution to PS");
104 virtual void DoRun (
void);
109 :
TestCase (
"Checks times that have plus or minus signs")
121 Time timePositive (
"+1000.0");
122 Time timePositiveWithUnits (
"+1000.0ms");
124 Time timeNegative (
"-1000.0");
125 Time timeNegativeWithUnits (
"-1000.0ms");
130 "Positive time not parsed correctly.");
135 "Positive time with units not parsed correctly.");
140 "Negative time not parsed correctly.");
145 "Negative time with units not parsed correctly.");
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
keep track of time values and allow control of global simulation resolution
Time TimeStep(uint64_t ts)
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
TimeTestSuite g_timeTestSuite
virtual void DoRun(void)
Implementation to actually run this TestCase.
double GetSeconds(void) const
virtual void DoSetup(void)
Implementation to do any local setup required for this TestCase.
int64_t GetInteger(void) const
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
int64_t GetNanoSeconds(void) const
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
virtual void DoSetup(void)
Implementation to do any local setup required for this TestCase.
This test suite implements a Unit Test.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.