Added an additional conversion function #584
- timeval to TimeOfDay_t
- Added Mutex for gmtime calls: (compare http://www.opengate.at/blog/2020/01/timeless/)
- Moved the statics used by Clock in ClockCommon.cpp to this file.
- Introduced better check for leapSeconds
- Added Unittests for Clock (only getter)
- Added Unittests for timevalOperations
- Applied clang format.
Can you replace calls to:
ReturnValue_t CCSDSTime::convertTimevalToTimeOfDay(Clock::TimeOfDay_t* to, timeval* from)
with this function and remove the CCSDSTime one? Afterwards it would be very easy to add an unittest. (If you don't have time I can do that).
I'm not sure about gmtime being available in any case. Some recommend gmtime_s but this seems to be broken at least for Windows (inverse parameter order) or unavailable in some cases.
Hmm I didn't even see that there already is an (empty) implementation. Would have been interesting to see why this is tricky according to the comment. I implemented the suggestions and added an informative comment about the Windows CRT incompatibility. Theoretically shouldn't be an issue since
gmtime_s is not used.
It would be great if you could add unittests :)
(My review is subjective as I have written parts of this code.)
No due date set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?