Fix libmonit Time unit test

Issue #50 resolved
Tildeslash repo owner created an issue

Time_parse returns Unix timestamp in local time via mktime. Unfortunately the Time unit test assert against a Unix timestamp which is only valid in CET. That is, the unit test will fail if run in a different timezone. Possible solutions in recommended order

  • Remove Time_parse which is not used in Monit along with other Time functions not used
  • Parse in GMT via timegm which strictly speaking is more correct and safe
  • Set timezone explicit (via tzset) to CET in the test

Comments (4)

  1. Log in to comment