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 void Stop(void)
Tell the Simulator the calling event should be the last one executed.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Run(void)
Run the simulation.
static Time Now(void)
Return the current simulation virtual time.
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.
void Reset()
Reset the timer.
void SetFunction(FN fn)
Set the function to execute when the timer expires.
void Enable()
Enable the timer.
uint8_t GetDoublings(void) const
Get the doublings of the timer.
void ConsistentEvent()
Records a consistent event.
High precision numerical type, implementing Q64.64 fixed precision.
void TransientOver(void)
Function to signal that the transient is over.
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.
std::vector< Time > m_expiredTimes
Time when TrickleTimer expired.
virtual void DoRun(void)
Implementation to actually run this TestCase.
void ExpireTimer(void)
Function to invoke when TrickleTimer expires.
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.