summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Wegner <swegner@hdfgroup.org>2008-06-19 20:22:33 (GMT)
committerScott Wegner <swegner@hdfgroup.org>2008-06-19 20:22:33 (GMT)
commit2745aac56509da31cc3466d4cd6717ee13aa596c (patch)
treea9b639058d41ca7a94614901255f29f5f3e76b65
parent90e092b4281317e0f3baf2b90ff9f194837f13f6 (diff)
downloadhdf5-2745aac56509da31cc3466d4cd6717ee13aa596c.zip
hdf5-2745aac56509da31cc3466d4cd6717ee13aa596c.tar.gz
hdf5-2745aac56509da31cc3466d4cd6717ee13aa596c.tar.bz2
[svn-r15243] 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: h5committest (kagiso, linew, smirom)
-rw-r--r--test/ohdr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/ohdr.c b/test/ohdr.c
index 6fe7535..4918696 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -213,7 +213,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_modify(&oh_ent, H5O_MTIME_ID, H5O_NEW_MESG, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) {
H5_FAILED();
H5Eprint(stdout);