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