Bug 2598

Summary: Simplify (and clarify) Simulator::Schedule asserts
Product: ns-3 Reporter: Tommaso Pecorella <tommaso.pecorella>
Component: coreAssignee: Peter Barnes <pdbarnes>
Status: RESOLVED FIXED    
Severity: enhancement CC: ns-bugs, tomh
Priority: P3    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: patch

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