summaryrefslogtreecommitdiffstats
path: root/test/tmisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/tmisc.c')
-rw-r--r--test/tmisc.c104
1 files changed, 73 insertions, 31 deletions
diff --git a/test/tmisc.c b/test/tmisc.c
index b267330..f8bf602 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -287,7 +287,7 @@ typedef struct {
#define MISC25C_ATTRNAME2 "ab"
/* Definitions for misc. test #26 */
-#define MISC26_FILE "dcpl_file"
+#define MISC26_FILE "dcpl_file.h5"
/* Definitions for misc. test #27 */
/* (Note that this test file is generated by the "gen_bad_ohdr.c" code) */
@@ -1083,7 +1083,7 @@ test_misc6(void)
/* Loop through adding attributes to each dataset */
for (u = 0; u < MISC6_NUMATTR; u++) {
/* Create name for attribute */
- HDsprintf(attr_name, "Attr#%u", u);
+ HDsnprintf(attr_name, sizeof(attr_name), "Attr#%u", u);
/* Open the file */
loc_id = H5Fopen(MISC6_FILE, H5F_ACC_RDWR, H5P_DEFAULT);
@@ -1280,7 +1280,7 @@ test_misc8(void)
for (v = 0; v < MISC8_DIM1; v++)
*tdata++ = (int)(((u * MISC8_DIM1) + v) % 13);
- /* Create a file acccess property list */
+ /* Create a file access property list */
fapl = H5Pcreate(H5P_FILE_ACCESS);
CHECK(fapl, FAIL, "H5Pcreate");
@@ -3034,7 +3034,7 @@ test_misc18(void)
/* Loop creating attributes on each dataset, flushing them to the file each time */
for (u = 0; u < 10; u++) {
/* Set up attribute name */
- HDsprintf(attr_name, "Attr %u", u);
+ HDsnprintf(attr_name, sizeof(attr_name), "Attr %u", u);
/* Create & close attribute on first dataset */
aid = H5Acreate2(did1, attr_name, H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT);
@@ -3892,7 +3892,7 @@ test_misc21(void)
/****************************************************************
**
-** test_misc22(): Test SZIP bits-per-pixel paramter.
+** test_misc22(): Test SZIP bits-per-pixel parameter.
** This should be set according to the datatype.
** Tests for precision and offset combo's.
**
@@ -5504,7 +5504,7 @@ test_misc30(void)
CHECK(ret, FAIL, "test_misc30_get_info");
}
- HDsprintf(gname, "/g0/group%d", i);
+ HDsnprintf(gname, sizeof(gname), "/g0/group%d", i);
gid = H5Gcreate2(fid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(gid, FAIL, "H5Gcreate2");
@@ -6026,29 +6026,51 @@ 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);
+
/* 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 */
- test_misc10(); /* Test for using dataset creation property lists from old files */
- test_misc11(); /* Test for all properties of a file creation property list being stored */
+ 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 */
+ }
+
+ if (default_driver) {
+ test_misc11(); /* Test for all properties of a file creation property list being stored */
+ }
+
test_misc12(); /* Test VL-strings in chunked datasets operating correctly */
- test_misc13(); /* Test that a user block can be insert in front of file contents */
+
+ if (default_driver) {
+ test_misc13(); /* Test that a user block can be insert in front of file contents */
+ }
+
test_misc14(); /* Test that deleted dataset's data is removed from sieve buffer correctly */
- test_misc15(); /* Test that checking a file's access property list more than once works */
+
+ if (!driver_uses_modified_filename) {
+ 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 */
- test_misc20(); /* Test problems with truncated dimensions in version 2 of storage layout message */
+
+ if (!driver_uses_modified_filename) {
+ 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
datasets w/a filters */
@@ -6057,19 +6079,39 @@ 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 */
- test_misc25b(); /* Exercise null object header message merge bug on existing file */
+
+ if (!driver_uses_modified_filename) {
+ 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 */
- 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 */
- test_misc31(); /* Test Reentering library through deprecated routines after H5close() */
- test_misc32(); /* Test filter memory allocation functions */
- 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 */
+
+ 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 */
+
+ 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_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 */
} /* test_misc() */