summaryrefslogtreecommitdiffstats
path: root/test/mtime.c
diff options
context:
space:
mode:
authorraylu-hdf <60487644+raylu-hdf@users.noreply.github.com>2022-04-07 21:03:05 (GMT)
committerGitHub <noreply@github.com>2022-04-07 21:03:05 (GMT)
commit43ab4e6db135f0d0bacda7d64257b9532381e24a (patch)
tree46e512e46b1f03ffb7a25a0aabb7be1f10e6d182 /test/mtime.c
parent715cf1a29b14abd81b4a03421fc742d6f4542fd0 (diff)
parent33cfd642b55edd63f8c192b941e227b920149fdc (diff)
downloadhdf5-43ab4e6db135f0d0bacda7d64257b9532381e24a.zip
hdf5-43ab4e6db135f0d0bacda7d64257b9532381e24a.tar.gz
hdf5-43ab4e6db135f0d0bacda7d64257b9532381e24a.tar.bz2
Merge pull request #1601 from HDFGroup/raylu_onion_vfd_4
Sync with the develop branch
Diffstat (limited to 'test/mtime.c')
-rw-r--r--test/mtime.c103
1 files changed, 54 insertions, 49 deletions
diff --git a/test/mtime.c b/test/mtime.c
index 43dc502..8e89d58 100644
--- a/test/mtime.c
+++ b/test/mtime.c
@@ -60,6 +60,7 @@ main(void)
signed char buf1[32], buf2[32];
char filename[1024];
int token_cmp;
+ hbool_t driver_uses_modified_filename = h5_driver_uses_modified_filename();
h5_reset();
fapl = h5_fileaccess();
@@ -116,7 +117,7 @@ main(void)
if (0 == oi1.ctime) {
SKIPPED();
HDputs(" The modification time could not be decoded on this OS.");
- HDputs(" Modification times will be mantained in the file but");
+ HDputs(" Modification times will be maintained in the file but");
HDputs(" cannot be queried on this system. See H5O_mtime_decode().");
return 0;
}
@@ -131,63 +132,67 @@ main(void)
}
PASSED();
- /* Check opening existing file with old-style modification time information
- * and make certain that the time is correct
- */
- TESTING("accessing old modification time messages");
-
- {
- const char *testfile = H5_get_srcdir_filename(TESTFILE1); /* Corrected test file name */
-
- file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
- if (file >= 0) {
- if (H5Oget_info_by_name3(file, "/Dataset1", &oi1, H5O_INFO_TIME, H5P_DEFAULT) < 0)
- TEST_ERROR;
- if (oi1.ctime != MTIME1) {
+ if (!driver_uses_modified_filename) {
+ /* Check opening existing file with old-style modification time information
+ * and make certain that the time is correct
+ */
+ TESTING("accessing old modification time messages");
+
+ {
+ const char *testfile = H5_get_srcdir_filename(TESTFILE1); /* Corrected test file name */
+
+ file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
+ if (file >= 0) {
+ if (H5Oget_info_by_name3(file, "/Dataset1", &oi1, H5O_INFO_TIME, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+ if (oi1.ctime != MTIME1) {
+ H5_FAILED();
+ /* If this fails, examine H5Omtime.c. Modification time is very
+ * system dependent (e.g., on Windows DST must be hardcoded). */
+ HDputs(" Old modification time incorrect");
+ goto error;
+ }
+ if (H5Fclose(file) < 0)
+ TEST_ERROR;
+ }
+ else {
H5_FAILED();
- /* If this fails, examine H5Omtime.c. Modification time is very
- * system dependent (e.g., on Windows DST must be hardcoded). */
- HDputs(" Old modification time incorrect");
+ HDprintf("***cannot open the pre-created old modification test file (%s)\n", testfile);
goto error;
- }
- if (H5Fclose(file) < 0)
- TEST_ERROR;
+ } /* end else */
}
- else {
- H5_FAILED();
- HDprintf("***cannot open the pre-created old modification test file (%s)\n", testfile);
- goto error;
- } /* end else */
+ PASSED();
}
- PASSED();
- /* Check opening existing file with new-style modification time information
- * and make certain that the time is correct
- */
- TESTING("accessing new modification time messages");
-
- {
- const char *testfile = H5_get_srcdir_filename(TESTFILE2); /* Corrected test file name */
-
- file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
- if (file >= 0) {
- if (H5Oget_info_by_name3(file, "/Dataset1", &oi2, H5O_INFO_TIME, H5P_DEFAULT) < 0)
- TEST_ERROR;
- if (oi2.ctime != MTIME2) {
+ if (!driver_uses_modified_filename) {
+ /* Check opening existing file with new-style modification time information
+ * and make certain that the time is correct
+ */
+ TESTING("accessing new modification time messages");
+
+ {
+ const char *testfile = H5_get_srcdir_filename(TESTFILE2); /* Corrected test file name */
+
+ file = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
+ if (file >= 0) {
+ if (H5Oget_info_by_name3(file, "/Dataset1", &oi2, H5O_INFO_TIME, H5P_DEFAULT) < 0)
+ TEST_ERROR;
+ if (oi2.ctime != MTIME2) {
+ H5_FAILED();
+ HDputs(" Modification time incorrect.");
+ goto error;
+ }
+ if (H5Fclose(file) < 0)
+ TEST_ERROR;
+ }
+ else {
H5_FAILED();
- HDputs(" Modification time incorrect.");
+ HDprintf("***cannot open the pre-created old modification test file (%s)\n", testfile);
goto error;
- }
- if (H5Fclose(file) < 0)
- TEST_ERROR;
+ } /* end else */
}
- else {
- H5_FAILED();
- HDprintf("***cannot open the pre-created old modification test file (%s)\n", testfile);
- goto error;
- } /* end else */
+ PASSED();
}
- PASSED();
/* Verify symbol table messages are cached */
if (h5_verify_cached_stabs(FILENAME, fapl) < 0)