21 #include "ns3/trickle-timer.h" 56 virtual void DoRun (
void);
91 :
TestCase (
"Check the Trickle Timer algorithm")
133 std::vector<Time> expirationFrequency;
137 expirationFrequency.erase (expirationFrequency.begin ());
139 int64x64_t min = (*std::min_element (expirationFrequency.begin (), expirationFrequency.end ()))/unit;
140 int64x64_t max = (*std::max_element (expirationFrequency.begin (), expirationFrequency.end ()))/unit;
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Simulation virtual time values and global simulation resolution.
High precision numerical type, implementing Q64.64 fixed precision.
std::vector< Time > m_expiredTimes
Time when TrickleTimer expired.
void ConsistentEvent()
Records a consistent event.
static void Run(void)
Run the simulation.
uint8_t GetDoublings(void) const
Get the doublings of the timer.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
TrickleTimerTestCase()
Constructor.
#define NS_TEST_EXPECT_MSG_GT_OR_EQ(actual, limit, msg)
Test that an actual value is greater than or equal to limit and report if not.
bool m_enableDataCollection
Collect data if true.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
void Reset()
Reset the timer.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
void SetFunction(FN fn)
Set the function to execute when the timer expires.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void TestRedundancy(Time unit)
Test the redundancy suppression.
void ConsistentEvent(Time interval, TrickleTimer *tricklePtr)
Inject in the timer a consistent event.
void TestSteadyState(Time unit)
Test the steady-state.
static Time Now(void)
Return the current simulation virtual time.
double max(double x, double y)
void TransientOver(void)
Function to signal that the transient is over.
Trickle Timer test suite.
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
Time Seconds(double value)
Construct a Time in the indicated unit.
double min(double x, double y)
void ExpireTimer(void)
Function to invoke when TrickleTimer expires.
void Enable()
Enable the timer.
A Trickle Timer following RFC 6206.
#define NS_TEST_EXPECT_MSG_LT_OR_EQ(actual, limit, msg)
Test that an actual value is less than or equal to a limit and report if not.
TrickleTimerTestSuite()
Constructor.
static TrickleTimerTestSuite g_trickleTimerTestSuite
TrickleTimerTestSuite instance variable.
virtual void DoRun(void)
Implementation to actually run this TestCase.