summaryrefslogtreecommitdiffstats
path: root/test/ohdr.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2006-07-31 19:46:16 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2006-07-31 19:46:16 (GMT)
commitbeb04ae817268a49656b5abe043627dcbba15e5d (patch)
tree557b0c0908867dbb7185c3954626b2a2da3bcaf4 /test/ohdr.c
parent70b46a1d89e7f9f4a82748a9e1cc21fb4f121ebe (diff)
downloadhdf5-beb04ae817268a49656b5abe043627dcbba15e5d.zip
hdf5-beb04ae817268a49656b5abe043627dcbba15e5d.tar.gz
hdf5-beb04ae817268a49656b5abe043627dcbba15e5d.tar.bz2
[svn-r12519] Fixed "make check-vfd"
"make check-vfd" will now run all tests in the test directory with different file drivers (at least, all of those tests that use the testing framework's FAPL). Tests that fail will be skipped. This is not a perfect fix, but is better than nothing. Along with this change, check-vfd should be added to the Daily Tests.
Diffstat (limited to 'test/ohdr.c')
-rw-r--r--test/ohdr.c59
1 files changed, 35 insertions, 24 deletions
diff --git a/test/ohdr.c b/test/ohdr.c
index 44b6361..6dd2b79 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -66,7 +66,8 @@ main(void)
H5O_loc_t oh_loc;
time_t time_new, ro;
int i;
-
+ const char *envval = NULL;
+
/* Reset library */
h5_reset();
fapl = h5_fileaccess();
@@ -286,37 +287,47 @@ main(void)
/* Test reading dataset with undefined object header message */
TESTING("reading object with unknown header message");
- {
- char testfile[512]="";
- char *srcdir = getenv("srcdir");
+ envval = HDgetenv("HDF5_DRIVER");
+ if (envval == NULL)
+ envval = "nomatch";
+ if (HDstrcmp(envval, "core") && HDstrcmp(envval, "multi") && HDstrcmp(envval, "split") && HDstrcmp(envval, "family")) {
+ {
+ char testfile[512]="";
+ char *srcdir = getenv("srcdir");
- /* Build path to test file */
- if (srcdir && ((HDstrlen(srcdir) + HDstrlen(FILE_BOGUS) + 1) < sizeof(testfile))){
- HDstrcpy(testfile, srcdir);
- HDstrcat(testfile, "/");
- }
- HDstrcat(testfile, FILE_BOGUS);
+ /* Build path to test file */
+ if (srcdir && ((HDstrlen(srcdir) + HDstrlen(FILE_BOGUS) + 1) < sizeof(testfile))){
+ HDstrcpy(testfile, srcdir);
+ HDstrcat(testfile, "/");
+ }
+ HDstrcat(testfile, FILE_BOGUS);
- if ((file=H5Fopen(testfile, H5F_ACC_RDONLY, fapl))<0)
- goto error;
+ if ((file=H5Fopen(testfile, H5F_ACC_RDONLY, fapl))<0)
+ goto error;
- /* Open the dataset with the unknown header message (generated with gen_bogus.c) */
- if((dset=H5Dopen(file,"/Dataset1"))<0)
- goto error;
- if (H5Dclose(dset)<0) goto error;
+ /* Open the dataset with the unknown header message (generated with gen_bogus.c) */
+ if((dset=H5Dopen(file,"/Dataset1"))<0)
+ goto error;
+ if (H5Dclose(dset)<0) goto error;
- if (H5Fclose(file)<0) goto error;
+ if (H5Fclose(file)<0) goto error;
+ }
+ PASSED();
+ }
+ else
+ {
+ SKIPPED();
+ puts(" Test not compatible with current Virtual File Driver");
}
- PASSED();
puts("All object header tests passed.");
h5_cleanup(FILENAME, fapl);
return 0;
- error:
- puts("*** TESTS FAILED ***");
- H5E_BEGIN_TRY {
- H5Fclose(file);
- } H5E_END_TRY;
- return 1;
+ error:
+ puts("*** TESTS FAILED ***");
+ H5E_BEGIN_TRY {
+ H5Fclose(file);
+ } H5E_END_TRY;
+ return 1;
}