summaryrefslogtreecommitdiffstats
path: root/test/tmisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/tmisc.c')
-rw-r--r--test/tmisc.c151
1 files changed, 93 insertions, 58 deletions
diff --git a/test/tmisc.c b/test/tmisc.c
index f8bf602..9fa8f2f 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -190,7 +190,8 @@ typedef struct {
#define MISC14_METADATA_SIZE 4096
/* Definitions for misc. test #15 */
-#define MISC15_FILE "tmisc15.h5"
+#define MISC15_FILE "tmisc15.h5"
+#define MISC15_BUF_SIZE 1024
/* Definitions for misc. test #16 */
#define MISC16_FILE "tmisc16.h5"
@@ -1783,11 +1784,20 @@ test_misc10(void)
hid_t dcpl; /* Dataset creation property list */
hid_t space, type; /* Old dataset's dataspace & datatype */
const char *testfile = H5_get_srcdir_filename(MISC10_FILE_OLD); /* Corrected test file name */
+ hbool_t driver_is_default_compatible;
herr_t ret;
/* Output message about test being performed */
MESSAGE(5, ("Testing using old dataset creation property list\n"));
+ ret = h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible);
+ CHECK(ret, FAIL, "h5_driver_is_default_vfd_compatible");
+
+ if (!driver_is_default_compatible) {
+ HDprintf("-- SKIPPED --\n");
+ return;
+ }
+
/*
* Open the old file and the dataset and get old settings.
*/
@@ -2736,14 +2746,21 @@ test_misc14(void)
static void
test_misc15(void)
{
+ char filename[MISC15_BUF_SIZE];
hid_t file; /* File ID */
hid_t fapl; /* File access property list */
herr_t ret; /* Generic return value */
+ fapl = h5_fileaccess();
+ h5_fixname(MISC15_FILE, fapl, filename, MISC15_BUF_SIZE);
+
/* Create the file & get it's FAPL */
- file = H5Fcreate(MISC15_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
CHECK(file, FAIL, "H5Fcreate");
+ ret = H5Pclose(fapl);
+ CHECK(ret, FAIL, "H5Pclose");
+
fapl = H5Fget_access_plist(file);
CHECK(fapl, FAIL, "H5Fget_access_plist");
@@ -2754,7 +2771,7 @@ test_misc15(void)
CHECK(ret, FAIL, "H5Fclose");
/* Open the file & get it's FAPL again */
- file = H5Fopen(MISC15_FILE, H5F_ACC_RDONLY, H5P_DEFAULT);
+ file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fopen");
fapl = H5Fget_access_plist(file);
@@ -2764,13 +2781,13 @@ test_misc15(void)
CHECK(ret, FAIL, "H5Fclose");
/* Verify that the file is still OK */
- ret = H5Fis_accessible(MISC15_FILE, fapl);
- CHECK(ret, FAIL, "H5Fis_hdf5");
+ ret = H5Fis_accessible(filename, fapl);
+ CHECK(ret, FAIL, "H5Fis_accessible");
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
- file = H5Fopen(MISC15_FILE, H5F_ACC_RDONLY, H5P_DEFAULT);
+ file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file, FAIL, "H5Fopen");
ret = H5Fclose(file);
@@ -3670,11 +3687,20 @@ test_misc20(void)
unsigned version; /* Version of storage layout info */
hsize_t contig_size; /* Size of contiguous storage size from layout into */
const char *testfile = H5_get_srcdir_filename(MISC20_FILE_OLD); /* Corrected test file name */
- herr_t ret; /* Generic return value */
+ hbool_t driver_is_default_compatible;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing large dimension truncation fix\n"));
+ ret = h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible);
+ CHECK(ret, FAIL, "h5_driver_is_default_vfd_compatible");
+
+ if (!driver_is_default_compatible) {
+ HDprintf("-- SKIPPED --\n");
+ return;
+ }
+
/* Verify that chunks with dimensions that are too large get rejected */
/* Create a dataset creation property list */
@@ -4957,11 +4983,20 @@ test_misc25b(void)
hid_t fid; /* File ID */
hid_t gid; /* Group ID */
const char *testfile = H5_get_srcdir_filename(MISC25B_FILE); /* Corrected test file name */
- herr_t ret; /* Generic return value */
+ hbool_t driver_is_default_compatible;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Exercise null object header message bug\n"));
+ ret = h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible);
+ CHECK(ret, FAIL, "h5_driver_is_default_vfd_compatible");
+
+ if (!driver_is_default_compatible) {
+ HDprintf("-- SKIPPED --\n");
+ return;
+ }
+
/* Open file */
fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
@@ -5209,11 +5244,20 @@ test_misc27(void)
hid_t fid; /* File ID */
hid_t gid; /* Group ID */
const char *testfile = H5_get_srcdir_filename(MISC27_FILE); /* Corrected test file name */
- herr_t ret; /* Generic return value */
+ hbool_t driver_is_default_compatible;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Corrupt object header handling\n"));
+ ret = h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible);
+ CHECK(ret, FAIL, "h5_driver_is_default_vfd_compatible");
+
+ if (!driver_is_default_compatible) {
+ HDprintf("-- SKIPPED --\n");
+ return;
+ }
+
/* Open the file */
fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
@@ -5423,12 +5467,21 @@ test_misc28(void)
static void
test_misc29(void)
{
- hid_t fid; /* File ID */
- herr_t ret; /* Generic return value */
+ hbool_t driver_is_default_compatible;
+ hid_t fid; /* File ID */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Speculative metadata reads\n"));
+ ret = h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible);
+ CHECK(ret, FAIL, "h5_driver_is_default_vfd_compatible");
+
+ if (!driver_is_default_compatible) {
+ HDprintf("-- SKIPPED --\n");
+ return;
+ }
+
/* Make a copy of the data file from svn. */
ret = h5_make_local_copy(MISC29_ORIG_FILE, MISC29_COPY_FILE);
CHECK(ret, -1, "h5_make_local_copy");
@@ -5706,11 +5759,20 @@ test_misc33(void)
hid_t fid = -1; /* File ID */
const char *testfile = H5_get_srcdir_filename(MISC33_FILE); /* Corrected test file name */
H5O_info2_t oinfo; /* Structure for object metadata information */
- herr_t ret; /* Generic return value */
+ hbool_t driver_is_default_compatible;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing that bad offset into the heap returns error"));
+ ret = h5_driver_is_default_vfd_compatible(H5P_DEFAULT, &driver_is_default_compatible);
+ CHECK(ret, FAIL, "h5_driver_is_default_vfd_compatible");
+
+ if (!driver_is_default_compatible) {
+ HDprintf("-- SKIPPED --\n");
+ return;
+ }
+
/* Open the test file */
fid = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
@@ -6026,25 +6088,21 @@ test_misc36(void)
void
test_misc(void)
{
- hbool_t driver_uses_modified_filename = h5_driver_uses_modified_filename();
- hbool_t default_driver = h5_using_default_driver(NULL);
+ hbool_t default_driver = h5_using_default_driver(NULL);
/* Output message about test being performed */
MESSAGE(5, ("Testing Miscellaneous Routines\n"));
- test_misc1(); /* Test unlinking a dataset & immediately re-using name */
- test_misc2(); /* Test storing a VL-derived datatype in two different files */
- test_misc3(); /* Test reading from chunked dataset with non-zero fill value */
- test_misc4(); /* Test retrieving the fileno for various objects with H5Oget_info() */
- test_misc5(); /* Test several level deep nested compound & VL datatypes */
- test_misc6(); /* Test object header continuation code */
- test_misc7(); /* Test for sensible datatypes stored on disk */
- test_misc8(); /* Test storage sizes of various types of dataset storage */
- test_misc9(); /* Test for opening (not creating) core files */
-
- if (!driver_uses_modified_filename) {
- test_misc10(); /* Test for using dataset creation property lists from old files */
- }
+ test_misc1(); /* Test unlinking a dataset & immediately re-using name */
+ test_misc2(); /* Test storing a VL-derived datatype in two different files */
+ test_misc3(); /* Test reading from chunked dataset with non-zero fill value */
+ test_misc4(); /* Test retrieving the fileno for various objects with H5Oget_info() */
+ test_misc5(); /* Test several level deep nested compound & VL datatypes */
+ test_misc6(); /* Test object header continuation code */
+ test_misc7(); /* Test for sensible datatypes stored on disk */
+ test_misc8(); /* Test storage sizes of various types of dataset storage */
+ test_misc9(); /* Test for opening (not creating) core files */
+ test_misc10(); /* Test for using dataset creation property lists from old files */
if (default_driver) {
test_misc11(); /* Test for all properties of a file creation property list being stored */
@@ -6057,19 +6115,12 @@ test_misc(void)
}
test_misc14(); /* Test that deleted dataset's data is removed from sieve buffer correctly */
-
- if (!driver_uses_modified_filename) {
- test_misc15(); /* Test that checking a file's access property list more than once works */
- }
-
+ test_misc15(); /* Test that checking a file's access property list more than once works */
test_misc16(); /* Test array of fixed-length string */
test_misc17(); /* Test array of ASCII character */
test_misc18(); /* Test new object header information in H5O_info_t struct */
test_misc19(); /* Test incrementing & decrementing ref count on IDs */
-
- if (!driver_uses_modified_filename) {
- test_misc20(); /* Test problems with truncated dimensions in version 2 of storage layout message */
- }
+ test_misc20(); /* Test problems with truncated dimensions in version 2 of storage layout message */
#ifdef H5_HAVE_FILTER_SZIP
test_misc21(); /* Test that "late" allocation time is treated the same as "incremental", for chunked
@@ -6079,36 +6130,20 @@ test_misc(void)
test_misc23(); /* Test intermediate group creation */
test_misc24(); /* Test inappropriate API opens of objects */
test_misc25a(); /* Exercise null object header message merge bug */
-
- if (!driver_uses_modified_filename) {
- test_misc25b(); /* Exercise null object header message merge bug on existing file */
- }
-
+ test_misc25b(); /* Exercise null object header message merge bug on existing file */
test_misc25c(); /* Exercise another null object header message merge bug */
test_misc26(); /* Test closing property lists with long filter pipelines */
-
- if (!driver_uses_modified_filename) {
- test_misc27(); /* Test opening file with object that has bad # of object header messages */
- }
-
- test_misc28(); /* Test that chunks are cached appropriately */
-
- if (!driver_uses_modified_filename) {
- test_misc29(); /* Test that speculative metadata reads are handled correctly */
- }
-
- test_misc30(); /* Exercise local heap loading bug where free lists were getting dropped */
+ test_misc27(); /* Test opening file with object that has bad # of object header messages */
+ test_misc28(); /* Test that chunks are cached appropriately */
+ test_misc29(); /* Test that speculative metadata reads are handled correctly */
+ test_misc30(); /* Exercise local heap loading bug where free lists were getting dropped */
if (default_driver) {
test_misc31(); /* Test Reentering library through deprecated routines after H5close() */
}
test_misc32(); /* Test filter memory allocation functions */
-
- if (!driver_uses_modified_filename) {
- test_misc33(); /* Test to verify that H5HL_offset_into() returns error if offset exceeds heap block */
- }
-
+ test_misc33(); /* Test to verify that H5HL_offset_into() returns error if offset exceeds heap block */
test_misc34(); /* Test behavior of 0 and NULL in H5MM API calls */
test_misc35(); /* Test behavior of free-list & allocation statistics API calls */
test_misc36(); /* Exercise H5atclose and H5is_library_terminating */