views:

73

answers:

0

After ncovering an ugly bug I wouldn't have caught in winter, I've started to centralize conversions between different time formats. I've already found some bugs by comparing different conversion paths, but need something more systematic.

Test goals are correct conversion on all paths (of course), and errors on rimes not represented correctly (which I still have to figure out and implement on the custom conversions).

How can I find correct representations of given times to test in different formats?

(e.g. if I have June 6, 1990, 12:20:35, how do I find the correct representation to validate against as time_t, FILETIME, OLE Date/Time / ..) ?

Do you have any other idea to test this?

My converison matrix is this (full res): alt text

I tagged win32 since some conversions are through Win32 API versions. The API to test is

bool Convert(time_const_ref from, time_ref to)

where time_(const)_ref accepts a (const) reference to any of the types.