diff options
author | Scott Wegner <swegner@hdfgroup.org> | 2008-06-19 18:48:27 (GMT) |
---|---|---|
committer | Scott Wegner <swegner@hdfgroup.org> | 2008-06-19 18:48:27 (GMT) |
commit | f2a745a0bb9f7133af5270c537a10983499227e8 (patch) | |
tree | 80397a316b5400ecca94038e963546abc6865039 /test | |
parent | ea9b094c18566ab2a71458a86f9673451c43fe4d (diff) | |
download | hdf5-f2a745a0bb9f7133af5270c537a10983499227e8.zip hdf5-f2a745a0bb9f7133af5270c537a10983499227e8.tar.gz hdf5-f2a745a0bb9f7133af5270c537a10983499227e8.tar.bz2 |
[svn-r15241] Purpose: Port bugfix from trunk: Fix ohdr Windows timezone bug
Description:
On Windows, certain users were having trouble with the "ohdr" test, which does some processing on object header messages. The errors were hard to reproduce on our machines, and we eventually determined that the errors were timezone-specific.
The bug is triggered on Windows when processing timestamps very near the "Epoch" (midnight on 1/1/1970)-- the mktime() function does some automatic adjustment on the time to correct for timezones. In the USA, the correction adds a few hours; in Europe, it subtracts, thus giving us times pre-Epoch.
This only affects Windows because the Windows mktime() function cannot handle times before 1970-- other systems seemingly can.
The fix is to simply create timestamps only as early as 01/02/1970. This way, any timezone adjustment will still be post-Epoch.
This bug only affects the ohdr test, and shouldn't be a problem in the library. The earliest timestamps that will actually be read will be around the time HDF5 was created (~1996-7, per Quincey).
Tested:
(tested in trunk)
VS2005 on WinXP
h5committest (kagiso, linew, smirom)
Diffstat (limited to 'test')
-rw-r--r-- | test/ohdr.c | 2 | ||||
-rw-r--r-- | test/testframe.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/test/ohdr.c b/test/ohdr.c index 08fd860..0a25993 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -153,7 +153,7 @@ main(void) */ TESTING("object header overflow in memory"); for(i = 0; i < 40; i++) { - time_new = (i + 1) * 1000 + 1; + time_new = (i + 1) * 1000 + 1000000; if(H5O_msg_create(&oh_loc, H5O_MTIME_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0) FAIL_STACK_ERROR } /* end for */ diff --git a/test/testframe.c b/test/testframe.c index dd2f2f4..da48c05 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -124,7 +124,7 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con */ void TestInit(const char *ProgName, void (*private_usage)(void), int (*private_parser)(int ac, char *av[])) { -#if !(defined MAC || defined __MWERKS__ || defined SYMANTEC_C) +#if !(defined MAC || defined SYMANTEC_C) /* Un-buffer the stdout and stderr */ setbuf(stderr, NULL); setbuf(stdout, NULL); |