Bug 2598 - Simplify (and clarify) Simulator::Schedule asserts
Simplify (and clarify) Simulator::Schedule asserts
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: core
ns-3-dev
All All
: P3 enhancement
Assigned To: Peter Barnes
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-12-25 19:02 UTC by Tommaso Pecorella
Modified: 2018-05-29 22:40 UTC (History)
2 users (show)

See Also:


Attachments
patch (1.99 KB, patch)
2016-12-25 19:02 UTC, Tommaso Pecorella
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tommaso Pecorella 2016-12-25 19:02:05 UTC
Created attachment 2715 [details]
patch

In the Simulator::Schedule implementations there are two checks:

  Time tAbsolute = delay + TimeStep (m_currentTs);
  NS_ASSERT (tAbsolute.IsPositive ());
  NS_ASSERT (tAbsolute >= TimeStep (m_currentTs));

Since m_currentTs is always positive, one is redundant.
It is enough to check that delay is positive.

Moreover, adding a more explicit error message is needed.
Comment 1 Tom Henderson 2018-05-29 22:40:19 UTC
fixed in 13605:16a3cb910bdc