Opened 6 years ago

Closed 6 years ago

#9539 closed defect (fixed)

wxTimeSpan::IsShorterThan() returns true for equal timespans

Reported by: pmendl Owned by:
Priority: normal Milestone:
Component: base Version: 2.8.7
Keywords: wxTimeSpan, IsShorterThan Cc:
Blocked By: Blocking:
Patch: no

Description

The following piece of code

#define MAX_POLLING_PERIOD (10*1000)
//...
*logTextCtrl << (wxTimeSpan::Milliseconds(MAX_POLLING_PERIOD).IsShorterThan(wxTimeSpan::Milliseconds(MAX_POLLING_PERIOD))?_("IsShorterThan() = true\n"):_("IsShorterThan() = false\n"));

produces output

IsShorterThan() = true

while I would expect

IsShorterThan() = false


Change History (1)

comment:1 Changed 6 years ago by vadz

  • Resolution set to fixed
  • Status changed from new to closed

This is clearly a bug as it directly contradicts the documentation, corrected in the trunk, thanks (I hesitate to change this in 2.8 as, bug or not, existing programs could rely on this behaviour so I'd rather not change it there).

Note: See TracTickets for help on using tickets.