diff options
author | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2019-01-15 17:49:07 (GMT) |
---|---|---|
committer | Binh-Minh Ribler <bmribler@hdfgroup.org> | 2019-01-15 17:49:07 (GMT) |
commit | 43bd93c4f53a4fb456391be51afbe0c2d816d3fa (patch) | |
tree | d2637f6adde48ee2668b6c8fef30ecae32f26f19 /test | |
parent | bc3d878add940845a2ec5b8873f2d45a00926ce8 (diff) | |
parent | 5fdc01ae997ce8b78e7f03acfa772e05fbd6dc0e (diff) | |
download | hdf5-43bd93c4f53a4fb456391be51afbe0c2d816d3fa.zip hdf5-43bd93c4f53a4fb456391be51afbe0c2d816d3fa.tar.gz hdf5-43bd93c4f53a4fb456391be51afbe0c2d816d3fa.tar.bz2 |
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/~bmribler/hdf5_bmr_fixbug into develop
Diffstat (limited to 'test')
-rw-r--r-- | test/accum.c | 40 | ||||
-rw-r--r-- | test/accum_swmr_reader.c | 23 | ||||
-rw-r--r-- | test/cache_image.c | 256 | ||||
-rw-r--r-- | test/cache_tagging.c | 58 | ||||
-rw-r--r-- | test/cmpd_dset.c | 4 | ||||
-rw-r--r-- | test/del_many_dense_attrs.c | 2 | ||||
-rw-r--r-- | test/dt_arith.c | 81 | ||||
-rw-r--r-- | test/efc.c | 12 | ||||
-rw-r--r-- | test/gen_bogus.c | 8 | ||||
-rw-r--r-- | test/h5test.c | 96 | ||||
-rw-r--r-- | test/h5test.h | 8 | ||||
-rw-r--r-- | test/objcopy.c | 2 | ||||
-rw-r--r-- | test/ohdr.c | 60 | ||||
-rw-r--r-- | test/tattr.c | 57 | ||||
-rw-r--r-- | test/tbogus.h5 | bin | 4512 -> 5056 bytes | |||
-rw-r--r-- | test/tfile.c | 128 | ||||
-rw-r--r-- | test/tselect.c | 80 | ||||
-rw-r--r-- | test/vol.c | 210 |
18 files changed, 767 insertions, 358 deletions
diff --git a/test/accum.c b/test/accum.c index 87628d8..7af353c 100644 --- a/test/accum.c +++ b/test/accum.c @@ -26,10 +26,13 @@ #include "H5VLprivate.h" /* Virtual Object Layer */ /* Filename */ -#define FILENAME "accum.h5" +/* (The file names are the same as the define in accum_swmr_reader.c) */ +const char *FILENAME[] = { + "accum", + "accum_swmr_big", + NULL +}; -/* The file name is the same as the define in accum_swmr_reader.c */ -#define SWMR_FILENAME "accum_swmr_big.h5" /* The reader forked by test_swmr_write_big() */ #define SWMR_READER "accum_swmr_reader" @@ -92,6 +95,7 @@ main(void) hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hid_t fid = -1; hid_t fapl = -1; /* File access property list */ + char filename[1024]; H5F_t * f = NULL; /* File for all tests */ @@ -99,15 +103,13 @@ main(void) puts("Testing the metadata accumulator"); /* File access property list */ + h5_reset(); if((fapl = h5_fileaccess()) < 0) FAIL_STACK_ERROR + h5_fixname(FILENAME[0], fapl, filename, sizeof filename); /* Create a test file */ - if((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR - - /* Closing and remove the file */ - if(H5Pclose(fapl) < 0) - FAIL_STACK_ERROR + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Push API context */ if(H5CX_push() < 0) FAIL_STACK_ERROR @@ -143,7 +145,6 @@ main(void) /* End of test code, close and delete file */ if(H5Fclose(fid) < 0) TEST_ERROR - HDremove(FILENAME); /* This test uses a different file */ nerrors += test_swmr_write_big(TRUE); @@ -152,6 +153,7 @@ main(void) if(nerrors) goto error; puts("All metadata accumulator tests passed."); + h5_cleanup(FILENAME, fapl); return 0; @@ -1828,6 +1830,7 @@ test_swmr_write_big(hbool_t newest_format) hid_t fid = -1; /* File ID */ hid_t fapl = -1; /* File access property list */ H5F_t *rf = NULL; /* File pointer */ + char filename[1024]; uint8_t *wbuf2 = NULL, *rbuf = NULL; /* Buffers for reading & writing */ uint8_t wbuf[1024]; /* Buffer for reading & writing */ unsigned u; /* Local index variable */ @@ -1865,17 +1868,18 @@ test_swmr_write_big(hbool_t newest_format) /* File access property list */ if((fapl = h5_fileaccess()) < 0) FAIL_STACK_ERROR + h5_fixname(FILENAME[1], fapl, filename, sizeof filename); /* Both cases will result in v3 superblock and version 2 object header for SWMR */ if(newest_format) { /* latest format */ if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) FAIL_STACK_ERROR - if((fid = H5Fcreate(SWMR_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR } else { /* non-latest-format */ - if((fid = H5Fcreate(SWMR_FILENAME, H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl)) < 0) + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR } /* end if */ @@ -1884,7 +1888,7 @@ test_swmr_write_big(hbool_t newest_format) FAIL_STACK_ERROR /* Open the file with SWMR_WRITE */ - if((fid = H5Fopen(SWMR_FILENAME, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0) + if((fid = H5Fopen(filename, H5F_ACC_RDWR | H5F_ACC_SWMR_WRITE, fapl)) < 0) FAIL_STACK_ERROR /* Push API context */ @@ -1979,20 +1983,19 @@ test_swmr_write_big(hbool_t newest_format) /* Flush the accumulator */ if(accum_reset(rf) < 0) FAIL_STACK_ERROR; - /* Close the property list */ - if(H5Pclose(fapl) < 0) - FAIL_STACK_ERROR; /* Close and remove the file */ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR; + /* Close the property list */ + if(H5Pclose(fapl) < 0) + FAIL_STACK_ERROR; + /* Pop API context */ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR api_ctx_pushed = FALSE; - HDremove(SWMR_FILENAME); - /* Release memory */ if(wbuf2) HDfree(wbuf2); @@ -2004,12 +2007,11 @@ test_swmr_write_big(hbool_t newest_format) error: /* Closing and remove the file */ - H5Pclose(fapl); H5Fclose(fid); if(api_ctx_pushed) H5CX_pop(); - HDremove(SWMR_FILENAME); + H5Pclose(fapl); /* Release memory */ if(wbuf2) diff --git a/test/accum_swmr_reader.c b/test/accum_swmr_reader.c index 16e0ddc..ac48a13 100644 --- a/test/accum_swmr_reader.c +++ b/test/accum_swmr_reader.c @@ -23,7 +23,12 @@ #include "H5VLprivate.h" /* Virtual Object Layer */ /* Filename: this is the same as the define in accum.c used by test_swmr_write_big() */ -#define SWMR_FILENAME "accum_swmr_big.h5" +const char *FILENAME[] = { + "accum", + "accum_swmr_big", + NULL +}; + /*------------------------------------------------------------------------- @@ -47,6 +52,7 @@ main(void) hid_t fid = -1; /* File ID */ hid_t fapl = -1; /* file access property list ID */ H5F_t *f = NULL; /* File pointer */ + char filename[1024]; unsigned u; /* Local index variable */ uint8_t rbuf[1024]; /* Buffer for reading */ uint8_t buf[1024]; /* Buffer for holding the expected data */ @@ -68,10 +74,11 @@ main(void) if((fapl = h5_fileaccess()) < 0) FAIL_STACK_ERROR + h5_fixname(FILENAME[1], fapl, filename, sizeof filename); /* Open the file with SWMR_READ */ - if((fid = H5Fopen(SWMR_FILENAME, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0) - FAIL_STACK_ERROR + if((fid = H5Fopen(filename, H5F_ACC_RDONLY | H5F_ACC_SWMR_READ, fapl)) < 0) + FAIL_STACK_ERROR /* Push API context */ if(H5CX_push() < 0) FAIL_STACK_ERROR @@ -79,21 +86,21 @@ main(void) /* Get H5F_t * to internal file structure */ if(NULL == (f = (H5F_t *)H5VL_object(fid))) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Should read in [1024, 2024] with buf data */ if(H5F_block_read(f, H5FD_MEM_DEFAULT, (haddr_t)1024, (size_t)1024, rbuf) < 0) - FAIL_STACK_ERROR; + FAIL_STACK_ERROR; /* Verify the data read is correct */ if(HDmemcmp(buf, rbuf, (size_t)1024) != 0) - TEST_ERROR; + TEST_ERROR; /* CLose the file */ if(H5Pclose(fapl) < 0) - FAIL_STACK_ERROR; + FAIL_STACK_ERROR; if(H5Fclose(fid) < 0) - FAIL_STACK_ERROR; + FAIL_STACK_ERROR; /* Pop API context */ if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR diff --git a/test/cache_image.c b/test/cache_image.c index 10e9a8a..10c37f0 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -40,27 +40,27 @@ static void attempt_swmr_open_hdf5_file(hbool_t create_file, static void verify_datasets(hid_t file_id, int min_dset, int max_dset); /* local test function declarations */ -static unsigned check_cache_image_ctl_flow_1(void); -static unsigned check_cache_image_ctl_flow_2(void); -static unsigned check_cache_image_ctl_flow_3(void); -static unsigned check_cache_image_ctl_flow_4(void); -static unsigned check_cache_image_ctl_flow_5(void); -static unsigned check_cache_image_ctl_flow_6(void); - -static unsigned cache_image_smoke_check_1(void); -static unsigned cache_image_smoke_check_2(void); -static unsigned cache_image_smoke_check_3(void); -static unsigned cache_image_smoke_check_4(void); -static unsigned cache_image_smoke_check_5(void); -static unsigned cache_image_smoke_check_6(void); - -static unsigned cache_image_api_error_check_1(void); -static unsigned cache_image_api_error_check_2(void); -static unsigned cache_image_api_error_check_3(void); -static unsigned cache_image_api_error_check_4(void); - -static unsigned get_free_sections_test(void); -static unsigned evict_on_close_test(void); +static unsigned check_cache_image_ctl_flow_1(hbool_t single_file_vfd); +static unsigned check_cache_image_ctl_flow_2(hbool_t single_file_vfd); +static unsigned check_cache_image_ctl_flow_3(hbool_t single_file_vfd); +static unsigned check_cache_image_ctl_flow_4(hbool_t single_file_vfd); +static unsigned check_cache_image_ctl_flow_5(hbool_t single_file_vfd); +static unsigned check_cache_image_ctl_flow_6(hbool_t single_file_vfd); + +static unsigned cache_image_smoke_check_1(hbool_t single_file_vfd); +static unsigned cache_image_smoke_check_2(hbool_t single_file_vfd); +static unsigned cache_image_smoke_check_3(hbool_t single_file_vfd); +static unsigned cache_image_smoke_check_4(hbool_t single_file_vfd); +static unsigned cache_image_smoke_check_5(hbool_t single_file_vfd); +static unsigned cache_image_smoke_check_6(hbool_t single_file_vfd); + +static unsigned cache_image_api_error_check_1(hbool_t single_file_vfd); +static unsigned cache_image_api_error_check_2(hbool_t single_file_vfd); +static unsigned cache_image_api_error_check_3(hbool_t single_file_vfd); +static unsigned cache_image_api_error_check_4(hbool_t single_file_vfd); + +static unsigned get_free_sections_test(hbool_t single_file_vfd); +static unsigned evict_on_close_test(hbool_t single_file_vfd); /****************************************************************************/ @@ -1329,7 +1329,7 @@ verify_datasets(hid_t file_id, int min_dset, int max_dset) */ static unsigned -check_cache_image_ctl_flow_1(void) +check_cache_image_ctl_flow_1(hbool_t single_file_vfd) { const char * fcn_name = "check_cache_image_ctl_flow_1()"; char filename[512]; @@ -1341,6 +1341,13 @@ check_cache_image_ctl_flow_1(void) TESTING("metadata cache image control flow test 1"); + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) @@ -1608,7 +1615,7 @@ check_cache_image_ctl_flow_1(void) */ static unsigned -check_cache_image_ctl_flow_2(void) +check_cache_image_ctl_flow_2(hbool_t single_file_vfd) { const char * fcn_name = "check_cache_image_ctl_flow_2()"; char filename[512]; @@ -1620,6 +1627,13 @@ check_cache_image_ctl_flow_2(void) TESTING("metadata cache image control flow test 2"); + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) @@ -1871,7 +1885,7 @@ check_cache_image_ctl_flow_2(void) */ static unsigned -check_cache_image_ctl_flow_3(void) +check_cache_image_ctl_flow_3(hbool_t single_file_vfd) { const char * fcn_name = "check_cache_image_ctl_flow_3()"; char filename[512]; @@ -1883,6 +1897,13 @@ check_cache_image_ctl_flow_3(void) TESTING("metadata cache image control flow test 3"); + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) /* 0 */ @@ -2242,7 +2263,7 @@ check_cache_image_ctl_flow_3(void) */ static unsigned -check_cache_image_ctl_flow_4(void) +check_cache_image_ctl_flow_4(hbool_t single_file_vfd) { const char * fcn_name = "check_cache_image_ctl_flow_4()"; char filename[512]; @@ -2254,6 +2275,13 @@ check_cache_image_ctl_flow_4(void) TESTING("metadata cache image control flow test 4"); + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) /* 0 */ @@ -2573,7 +2601,7 @@ check_cache_image_ctl_flow_4(void) */ static unsigned -check_cache_image_ctl_flow_5(void) +check_cache_image_ctl_flow_5(hbool_t single_file_vfd) { const char * fcn_name = "check_cache_image_ctl_flow_5()"; char filename[512]; @@ -2585,6 +2613,13 @@ check_cache_image_ctl_flow_5(void) TESTING("metadata cache image control flow test 5"); + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) /* 0 */ @@ -2854,7 +2889,7 @@ check_cache_image_ctl_flow_5(void) */ static unsigned -check_cache_image_ctl_flow_6(void) +check_cache_image_ctl_flow_6(hbool_t single_file_vfd) { const char * fcn_name = "check_cache_image_ctl_flow_6()"; char filename[512]; @@ -2866,6 +2901,13 @@ check_cache_image_ctl_flow_6(void) TESTING("metadata cache image control flow test 6"); + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) /* 0 */ @@ -3139,7 +3181,7 @@ check_cache_image_ctl_flow_6(void) */ static unsigned -cache_image_smoke_check_1(void) +cache_image_smoke_check_1(hbool_t single_file_vfd) { const char * fcn_name = "cache_image_smoke_check_1()"; char filename[512]; @@ -3151,6 +3193,13 @@ cache_image_smoke_check_1(void) TESTING("metadata cache image smoke check 1"); + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) @@ -3562,7 +3611,7 @@ cache_image_smoke_check_1(void) */ static unsigned -cache_image_smoke_check_2(void) +cache_image_smoke_check_2(hbool_t single_file_vfd) { const char * fcn_name = "cache_image_smoke_check_2()"; char filename[512]; @@ -3574,6 +3623,13 @@ cache_image_smoke_check_2(void) TESTING("metadata cache image smoke check 2"); + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) @@ -3863,7 +3919,7 @@ cache_image_smoke_check_2(void) */ static unsigned -cache_image_smoke_check_3(void) +cache_image_smoke_check_3(hbool_t single_file_vfd) { const char * fcn_name = "cache_image_smoke_check_3()"; char filename[512]; @@ -3875,6 +3931,13 @@ cache_image_smoke_check_3(void) TESTING("metadata cache image smoke check 3"); + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) @@ -4248,7 +4311,7 @@ cache_image_smoke_check_3(void) */ static unsigned -cache_image_smoke_check_4(void) +cache_image_smoke_check_4(hbool_t single_file_vfd) { const char * fcn_name = "cache_image_smoke_check_4()"; char filename[512]; @@ -4262,6 +4325,13 @@ cache_image_smoke_check_4(void) TESTING("metadata cache image smoke check 4"); + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) @@ -4653,7 +4723,7 @@ cache_image_smoke_check_4(void) #define MAX_NUM_GROUPS 128 static unsigned -cache_image_smoke_check_5(void) +cache_image_smoke_check_5(hbool_t single_file_vfd) { const char * fcn_name = "cache_image_smoke_check_5()"; char filename[512]; @@ -4670,6 +4740,13 @@ cache_image_smoke_check_5(void) TESTING("metadata cache image smoke check 5"); + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) @@ -5168,7 +5245,7 @@ cache_image_smoke_check_5(void) */ static unsigned -cache_image_smoke_check_6(void) +cache_image_smoke_check_6(hbool_t single_file_vfd) { const char * fcn_name = "cache_image_smoke_check_6()"; char filename[512]; @@ -5183,6 +5260,13 @@ cache_image_smoke_check_6(void) TESTING("metadata cache image smoke check 6"); + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) @@ -5578,7 +5662,7 @@ cache_image_smoke_check_6(void) */ static unsigned -cache_image_api_error_check_1(void) +cache_image_api_error_check_1(hbool_t single_file_vfd) { const char * fcn_name = "cache_image_api_error_check_1()"; char filename[512]; @@ -5590,6 +5674,13 @@ cache_image_api_error_check_1(void) TESTING("metadata cache image api error check 1"); + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) @@ -5954,7 +6045,7 @@ cache_image_api_error_check_1(void) */ static unsigned -cache_image_api_error_check_2(void) +cache_image_api_error_check_2(hbool_t single_file_vfd) { const char * fcn_name = "cache_image_api_error_check_2()"; char filename[512]; @@ -5966,6 +6057,13 @@ cache_image_api_error_check_2(void) TESTING("metadata cache image api error check 2"); + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) @@ -6365,7 +6463,7 @@ cache_image_api_error_check_2(void) */ static unsigned -cache_image_api_error_check_3(void) +cache_image_api_error_check_3(hbool_t single_file_vfd) { const char * fcn_name = "cache_image_api_error_check_3()"; char filename[512]; @@ -6377,6 +6475,13 @@ cache_image_api_error_check_3(void) TESTING("metadata cache image api error check 3"); + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) @@ -6649,7 +6754,7 @@ cache_image_api_error_check_3(void) */ static unsigned -cache_image_api_error_check_4(void) +cache_image_api_error_check_4(hbool_t single_file_vfd) { const char * fcn_name = "cache_image_api_error_check_4()"; char filename[512]; @@ -6663,6 +6768,13 @@ cache_image_api_error_check_4(void) TESTING("metadata cache image api error check 4"); + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) @@ -7238,7 +7350,7 @@ cache_image_api_error_check_4(void) *------------------------------------------------------------------------- */ static unsigned -get_free_sections_test(void) +get_free_sections_test(hbool_t single_file_vfd) { const char * fcn_name = "get_free_sections_test()"; char filename[512]; @@ -7251,6 +7363,13 @@ get_free_sections_test(void) TESTING("Cache image / H5Fget_free_sections() interaction"); + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) @@ -7710,7 +7829,7 @@ get_free_sections_test(void) *------------------------------------------------------------------------- */ static unsigned -evict_on_close_test(void) +evict_on_close_test(hbool_t single_file_vfd) { #ifndef H5_HAVE_PARALLEL const char * fcn_name = "evict_on_close_test()"; @@ -7731,6 +7850,13 @@ evict_on_close_test(void) return 0; #else + /* Check for VFD that is a single file */ + if(!single_file_vfd) { + SKIPPED(); + HDputs(" Cache image not supported with the current VFD."); + return 0; + } + pass = TRUE; if ( show_progress ) @@ -8041,9 +8167,16 @@ evict_on_close_test(void) int main(void) { + const char *env_h5_drvr; /* File driver value from environment */ + hbool_t single_file_vfd; /* Whether VFD used stores data in a single file */ unsigned nerrs = 0; int express_test; + /* Get the VFD to use */ + env_h5_drvr = HDgetenv("HDF5_DRIVER"); + if(env_h5_drvr == NULL) + env_h5_drvr = "nomatch"; + H5open(); express_test = GetTestExpress(); @@ -8053,27 +8186,30 @@ main(void) printf(" express_test = %d\n", express_test); printf("=========================================\n"); - nerrs += check_cache_image_ctl_flow_1(); - nerrs += check_cache_image_ctl_flow_2(); - nerrs += check_cache_image_ctl_flow_3(); - nerrs += check_cache_image_ctl_flow_4(); - nerrs += check_cache_image_ctl_flow_5(); - nerrs += check_cache_image_ctl_flow_6(); - - nerrs += cache_image_smoke_check_1(); - nerrs += cache_image_smoke_check_2(); - nerrs += cache_image_smoke_check_3(); - nerrs += cache_image_smoke_check_4(); - nerrs += cache_image_smoke_check_5(); - nerrs += cache_image_smoke_check_6(); - - nerrs += cache_image_api_error_check_1(); - nerrs += cache_image_api_error_check_2(); - nerrs += cache_image_api_error_check_3(); - nerrs += cache_image_api_error_check_4(); - - nerrs += get_free_sections_test(); - nerrs += evict_on_close_test(); + /* Check for VFD which stores data in multiple files */ + single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")); + + nerrs += check_cache_image_ctl_flow_1(single_file_vfd); + nerrs += check_cache_image_ctl_flow_2(single_file_vfd); + nerrs += check_cache_image_ctl_flow_3(single_file_vfd); + nerrs += check_cache_image_ctl_flow_4(single_file_vfd); + nerrs += check_cache_image_ctl_flow_5(single_file_vfd); + nerrs += check_cache_image_ctl_flow_6(single_file_vfd); + + nerrs += cache_image_smoke_check_1(single_file_vfd); + nerrs += cache_image_smoke_check_2(single_file_vfd); + nerrs += cache_image_smoke_check_3(single_file_vfd); + nerrs += cache_image_smoke_check_4(single_file_vfd); + nerrs += cache_image_smoke_check_5(single_file_vfd); + nerrs += cache_image_smoke_check_6(single_file_vfd); + + nerrs += cache_image_api_error_check_1(single_file_vfd); + nerrs += cache_image_api_error_check_2(single_file_vfd); + nerrs += cache_image_api_error_check_3(single_file_vfd); + nerrs += cache_image_api_error_check_4(single_file_vfd); + + nerrs += get_free_sections_test(single_file_vfd); + nerrs += evict_on_close_test(single_file_vfd); return(nerrs > 0); diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 752dd27..b91f013 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -448,7 +448,7 @@ check_file_creation_tags(hid_t fcpl_id, int type) TESTING("tag application during file creation"); /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl)) < 0 ) TEST_ERROR; @@ -539,7 +539,7 @@ check_file_open_tags(hid_t fcpl, int type) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -652,7 +652,7 @@ check_group_creation_tags(void) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -751,7 +751,7 @@ check_multi_group_creation_tags(void) TESTING("tag application during multiple group creation"); /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Set latest version of library */ if ( H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) TEST_ERROR; @@ -881,7 +881,7 @@ check_link_iteration_tags(void) TESTING("tag application during iteration over links in a group"); /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* =========== */ /* Create File */ @@ -1000,7 +1000,7 @@ check_dense_attribute_tags(void) TESTING("tag application during dense attribute manipulation"); /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; if ( H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) TEST_ERROR; /* Create Dcpl */ @@ -1184,7 +1184,7 @@ check_group_open_tags(void) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -1295,7 +1295,7 @@ check_attribute_creation_tags(hid_t fcpl, int type) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -1429,7 +1429,7 @@ check_attribute_open_tags(hid_t fcpl, int type) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -1576,7 +1576,7 @@ check_attribute_rename_tags(hid_t fcpl, int type) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -1761,7 +1761,7 @@ check_attribute_delete_tags(hid_t fcpl, int type) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -1917,7 +1917,7 @@ check_dataset_creation_tags(hid_t fcpl, int type) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -2051,7 +2051,7 @@ check_dataset_creation_earlyalloc_tags(hid_t fcpl, int type) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -2187,7 +2187,7 @@ check_dataset_open_tags(void) /* ========= */ /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -2318,7 +2318,7 @@ check_dataset_write_tags(void) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -2457,7 +2457,7 @@ check_attribute_write_tags(hid_t fcpl, int type) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file with provided fcpl_t */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -2613,7 +2613,7 @@ check_dataset_read_tags(void) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -2751,7 +2751,7 @@ check_dataset_size_retrieval(void) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -2890,7 +2890,7 @@ check_dataset_extend_tags(void) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -3017,7 +3017,7 @@ check_object_info_tags(void) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -3126,7 +3126,7 @@ check_object_copy_tags(void) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -3257,7 +3257,7 @@ check_link_removal_tags(hid_t fcpl, int type) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl)) < 0 ) TEST_ERROR; @@ -3416,7 +3416,7 @@ check_link_getname_tags(void) if ( (NULL == (data = (int *)HDcalloc(DIMS * DIMS, sizeof(int)))) ) TEST_ERROR; /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -3553,7 +3553,7 @@ check_external_link_creation_tags(void) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -3660,7 +3660,7 @@ check_external_link_open_tags(void) /* ===== */ /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; @@ -3671,8 +3671,6 @@ check_external_link_open_tags(void) /* Create a second file */ if ( (fid2 = H5Fcreate(FILENAME2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; - if ( H5Pclose(fapl) < 0 ) TEST_ERROR; - /* determine tag value of root group's object header */ if ( get_object_header_tag(fid2, &root2_tag) < 0 ) TEST_ERROR; @@ -3688,7 +3686,9 @@ check_external_link_open_tags(void) /* Close and Reopen the file */ if ( H5Fclose(fid) < 0 ) TEST_ERROR; - if ( (fid = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT)) < 0 ) TEST_ERROR; + if ( (fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl)) < 0 ) TEST_ERROR; + + if ( H5Pclose(fapl) < 0 ) TEST_ERROR; /* Evict as much as we can from the cache so we can track full tag path */ if ( evict_entries(fid) < 0 ) TEST_ERROR; @@ -3787,7 +3787,7 @@ check_invalid_tag_application(void) #if H5C_DO_TAGGING_SANITY_CHECKS /* Create Fapl */ - if ( (fapl = h5_fileaccess()) < 0 ) TEST_ERROR; + if ( (fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0 ) TEST_ERROR; /* Create a test file */ if ( (fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0 ) TEST_ERROR; diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index b011bc2..a8baeac 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -2070,7 +2070,7 @@ test_ooo_order(char *filename, hid_t fapl_id) /* Close and reopen the file */ if(H5Tclose(dtype)) TEST_ERROR if(H5Fclose(file)) TEST_ERROR - if((file = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR + if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0) TEST_ERROR /* Open the type */ if((dtype_tmp = H5Topen2(file, "dtype", H5P_DEFAULT)) < 0) TEST_ERROR @@ -2123,7 +2123,7 @@ test_ooo_order(char *filename, hid_t fapl_id) if(H5Tclose(dtype_tmp)) TEST_ERROR if(H5Tclose(dtype)) TEST_ERROR if(H5Fclose(file)) TEST_ERROR - if((file = H5Fopen(filename, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) TEST_ERROR + if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl_id)) < 0) TEST_ERROR /* Open the type, and verify status */ if((dtype_tmp = H5Topen2(file, "dtype2", H5P_DEFAULT)) < 0) TEST_ERROR diff --git a/test/del_many_dense_attrs.c b/test/del_many_dense_attrs.c index bbae48d..d88045c 100644 --- a/test/del_many_dense_attrs.c +++ b/test/del_many_dense_attrs.c @@ -163,7 +163,7 @@ main(void) TEST_ERROR /* Open the group */ - if((gid = H5Gopen(fid, "group", H5P_DEFAULT)) < 0) + if((gid = H5Gopen2(fid, "group", H5P_DEFAULT)) < 0) TEST_ERROR /* Delete the attributes */ diff --git a/test/dt_arith.c b/test/dt_arith.c index c7f2986..2729ba1 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -4883,7 +4883,24 @@ run_fp_tests(const char *name) #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_FLOAT, H5T_NATIVE_LDOUBLE); nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_DOUBLE, H5T_NATIVE_LDOUBLE); +#ifndef H5_DISABLE_SOME_LDOUBLE_CONV nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_LDOUBLE, H5T_NATIVE_FLOAT); +#else + { + char str[256]; /*string */ + + HDsnprintf(str, sizeof(str), "Testing %s denormalized %s -> %s conversions", + name, "long double", "float"); + printf("%-70s", str); + SKIPPED(); +#if H5_SIZEOF_LONG_DOUBLE!=0 + HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); +#else + HDputs(" Test skipped due to disabled long double."); +#endif + } +#endif + nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE); #endif @@ -4893,8 +4910,24 @@ run_fp_tests(const char *name) #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_FLOAT, H5T_NATIVE_LDOUBLE); nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_DOUBLE, H5T_NATIVE_LDOUBLE); +#ifndef H5_DISABLE_SOME_LDOUBLE_CONV nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_FLOAT); nerrors += test_conv_flt_1(name, TEST_SPECIAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE); +#else + { + char str[256]; /*string */ + + HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", + name, "long double", "float or double"); + printf("%-70s", str); + SKIPPED(); +#if H5_SIZEOF_LONG_DOUBLE!=0 + HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); +#else + HDputs(" Test skipped due to disabled long double."); +#endif + } +#endif #endif done: @@ -4963,7 +4996,7 @@ run_int_fp_conv(const char *name) nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_INT, H5T_NATIVE_LDOUBLE); nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_UINT, H5T_NATIVE_LDOUBLE); #if H5_SIZEOF_LONG!=H5_SIZEOF_INT -#ifndef H5_LONG_TO_LDOUBLE_SPECIAL +#if !defined(H5_LONG_TO_LDOUBLE_SPECIAL) && !defined(H5_DISABLE_SOME_LDOUBLE_CONV) nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LONG, H5T_NATIVE_LDOUBLE); nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_ULONG, H5T_NATIVE_LDOUBLE); #else @@ -5077,16 +5110,46 @@ run_fp_int_conv(const char *name) #endif #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UCHAR); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SHORT); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_USHORT); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_INT); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UINT); + if(test_values != TEST_SPECIAL) { + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SHORT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_USHORT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_INT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UINT); + } else { +#ifndef H5_DISABLE_SOME_LDOUBLE_CONV + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SHORT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_USHORT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_INT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UINT); +#else + char str[256]; /*string */ + + HDsnprintf(str, sizeof(str), "Testing %s special %s -> %s conversions", + name, "long double", "signed and unsigned char, short, int, long"); + printf("%-70s", str); + SKIPPED(); +#if H5_SIZEOF_LONG_DOUBLE!=0 + HDputs(" Test skipped due to the conversion problem on IBM ppc64le cpu."); +#else + HDputs(" Test skipped due to disabled long double."); +#endif +#endif + } #if H5_SIZEOF_LONG!=H5_SIZEOF_INT && H5_SIZEOF_LONG_DOUBLE!=0 #ifndef H5_LDOUBLE_TO_LONG_SPECIAL - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LONG); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULONG); + if(test_values != TEST_SPECIAL && test_values != TEST_NORMAL) { + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LONG); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULONG); + } else { +#ifndef H5_DISABLE_SOME_LDOUBLE_CONV + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LONG); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULONG); +#endif + } #else { char str[256]; /*string */ @@ -20,6 +20,7 @@ #include "H5Fpkg.h" #include "H5CXprivate.h" /* API Contexts */ #include "H5Iprivate.h" +#include "H5Pprivate.h" /* Property lists */ const char *FILENAME[] = { "efc0", @@ -2896,6 +2897,8 @@ int main(void) { unsigned nerrors = 0; /* track errors */ + H5P_genplist_t *plist; /* Property list pointer for FAPL */ + H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Test Setup */ @@ -2917,6 +2920,15 @@ main(void) if(H5CX_push() < 0) FAIL_STACK_ERROR api_ctx_pushed = TRUE; + /* Get the VOL info from the fapl */ + plist = (H5P_genplist_t *)H5I_object(fapl_id); + H5P_peek(plist, H5F_ACS_VOL_CONN_NAME, &connector_prop); + + /* Stash a copy of the "top-level" connector property, before any pass-through + * connectors modify or unwrap it. + */ + H5CX_set_vol_connector_prop(&connector_prop); + /* Test Functions */ nerrors += test_single(); nerrors += test_graph_nocycle(); diff --git a/test/gen_bogus.c b/test/gen_bogus.c index ec29eb9..237b024 100644 --- a/test/gen_bogus.c +++ b/test/gen_bogus.c @@ -89,6 +89,14 @@ generate_datasets(hid_t loc_id, unsigned bogus_id) if((did = H5Dcreate2(loc_id, "Dataset4", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; if(H5Dclose(did) < 0) goto error; + /* Set "shareable" message flag for bogus message */ + bogus_flags = H5O_MSG_FLAG_SHAREABLE; + if(H5Pset(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) goto error; + + /* Create fourth dataset, with "shareable" message flag */ + if((did = H5Dcreate2(loc_id, "Dataset5", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; + if(H5Dclose(did) < 0) goto error; + /* Close dataset creation property list */ if(H5Pclose(dcpl) < 0) goto error; diff --git a/test/h5test.c b/test/h5test.c index 32638e6..dfa6a31 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -803,6 +803,50 @@ error: /*------------------------------------------------------------------------- + * Function: h5_fileaccess_flags + * + * Purpose: Returns a file access template which is the default template + * but with a file driver, VOL connector, or libver bound set + * according to a constant or environment variable + * + * Return: Success: A file access property list + * Failure: H5I_INVALID_HID + * + * Programmer: Robb Matzke + * Thursday, November 19, 1998 + * + *------------------------------------------------------------------------- + */ +hid_t +h5_fileaccess_flags(unsigned flags) +{ + hid_t fapl_id = H5I_INVALID_HID; + + if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Attempt to set up a file driver first */ + if((flags & H5_FILEACCESS_VFD) && h5_get_vfd_fapl(fapl_id) < 0) + goto error; + + /* Next, try to set up a VOL connector */ + if((flags & H5_FILEACCESS_VOL) && h5_get_vol_fapl(fapl_id) < 0) + goto error; + + /* Finally, check for libver bounds */ + if((flags & H5_FILEACCESS_LIBVER) && h5_get_libver_fapl(fapl_id) < 0) + goto error; + + return fapl_id; + +error: + if(fapl_id != H5I_INVALID_HID) + H5Pclose(fapl_id); + return H5I_INVALID_HID; +} /* end h5_fileaccess_flags() */ + + +/*------------------------------------------------------------------------- * Function: h5_get_vfd_fapl * * Purpose: Sets the file driver for a FAPL according to the value specified @@ -1894,6 +1938,42 @@ static herr_t dummy_vfd_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UN static herr_t dummy_vfd_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf); static herr_t dummy_vfd_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf) { return FAIL; } +/* Dummy VFD with the minimum parameters to make a VFD that can be registered */ +static const H5FD_class_t H5FD_dummy_g = { + "dummy", /* name */ + 1, /* maxaddr */ + H5F_CLOSE_WEAK, /* fc_degree */ + NULL, /* terminate */ + NULL, /* sb_size */ + NULL, /* sb_encode */ + NULL, /* sb_decode */ + 0, /* fapl_size */ + NULL, /* fapl_get */ + NULL, /* fapl_copy */ + NULL, /* fapl_free */ + 0, /* dxpl_size */ + NULL, /* dxpl_copy */ + NULL, /* dxpl_free */ + dummy_vfd_open, /* open */ + dummy_vfd_close, /* close */ + NULL, /* cmp */ + NULL, /* query */ + NULL, /* get_type_map */ + NULL, /* alloc */ + NULL, /* free */ + dummy_vfd_get_eoa, /* get_eoa */ + dummy_vfd_set_eoa, /* set_eoa */ + dummy_vfd_get_eof, /* get_eof */ + NULL, /* get_handle */ + dummy_vfd_read, /* read */ + dummy_vfd_write, /* write */ + NULL, /* flush */ + NULL, /* truncate */ + NULL, /* lock */ + NULL, /* unlock */ + H5FD_FLMAP_DICHOTOMY /* fl_map */ +}; + /*------------------------------------------------------------------------- * Function: h5_get_dummy_vfd_class() @@ -1921,21 +2001,11 @@ h5_get_dummy_vfd_class(void) H5FD_class_t *vfd_class = NULL; /* Dummy VFD that will be returned */ /* Create the class and initialize everything to zero/NULL */ - if(NULL == (vfd_class = (H5FD_class_t *)HDcalloc((size_t)1, sizeof(H5FD_class_t)))) + if(NULL == (vfd_class = (H5FD_class_t *)HDmalloc(sizeof(H5FD_class_t)))) TEST_ERROR; - /* Fill in the minimum parameters to make a VFD that - * can be registered. - */ - vfd_class->name = "dummy"; - vfd_class->maxaddr = 1; - vfd_class->open = dummy_vfd_open; - vfd_class->close = dummy_vfd_close; - vfd_class->get_eoa = dummy_vfd_get_eoa; - vfd_class->set_eoa = dummy_vfd_set_eoa; - vfd_class->get_eof = dummy_vfd_get_eof; - vfd_class->read = dummy_vfd_read; - vfd_class->write = dummy_vfd_write; + /* Copy the dummy VFD */ + HDmemcpy(vfd_class, &H5FD_dummy_g, sizeof(H5FD_class_t)); return vfd_class; diff --git a/test/h5test.h b/test/h5test.h index c72f389..66a7863 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -102,7 +102,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ * the H5_FAILED() macro is invoked automatically when an API function fails. */ #define TESTING(WHAT) {printf("Testing %-62s",WHAT); fflush(stdout);} -#define TESTING_2(WHAT) {printf(" Testing %-62s",WHAT); fflush(stdout);} +#define TESTING_2(WHAT) {printf(" Testing %-60s",WHAT); fflush(stdout);} #define PASSED() {puts(" PASSED");fflush(stdout);} #define H5_FAILED() {puts("*FAILED*");fflush(stdout);} #define H5_WARNING() {puts("*WARNING*");fflush(stdout);} @@ -121,6 +121,11 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ #define ALARM_ON TestAlarmOn() #define ALARM_OFF HDalarm(0) +/* Flags for h5_fileaccess_flags() */ +#define H5_FILEACCESS_VFD 0x01 +#define H5_FILEACCESS_VOL 0x02 +#define H5_FILEACCESS_LIBVER 0x04 + #ifdef __cplusplus extern "C" { #endif @@ -132,6 +137,7 @@ H5TEST_DLL char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, s H5TEST_DLL char *h5_fixname_no_suffix(const char *base_name, hid_t fapl, char *fullname, size_t size); H5TEST_DLL char *h5_fixname_printf(const char *base_name, hid_t fapl, char *fullname, size_t size); H5TEST_DLL hid_t h5_fileaccess(void); +H5TEST_DLL hid_t h5_fileaccess_flags(unsigned flags); H5TEST_DLL void h5_no_hwconv(void); H5TEST_DLL const char *h5_rmprefix(const char *filename); H5TEST_DLL void h5_reset(void); diff --git a/test/objcopy.c b/test/objcopy.c index 6ee2f72..eb4927f 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -7871,7 +7871,7 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open) addr_reset(); /* Setup */ - if((src_fapl = h5_fileaccess()) < 0) TEST_ERROR + if((src_fapl = h5_fileaccess_flags(H5_FILEACCESS_VOL | H5_FILEACCESS_LIBVER)) < 0) TEST_ERROR /* open source file (read-only) */ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR diff --git a/test/ohdr.c b/test/ohdr.c index 57edaf5..85554a5 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -521,6 +521,16 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) PASSED(); + TESTING("object with unknown header message & 'shareable' flag set"); + + /* Open the dataset with the unknown header message, adn "shareable" flag */ + if((did = H5Dopen2(loc_bogus, "Dataset5", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if(H5Dclose(did) < 0) + FAIL_STACK_ERROR + + PASSED(); + TESTING("object in r/o file with unknown header message & 'fail if unknown and open for write' flag set"); /* Open the dataset with the unknown header message, and "fail if unknown and open for write" flag */ @@ -850,7 +860,7 @@ test_minimized_dset_ohdr_attribute_addition(hid_t fapl_id) * SETUP * *********/ - if(h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename)) == NULL) + if(h5_fixname(FILENAME[1], fapl_id, filename, sizeof(filename)) == NULL) TEST_ERROR dspace_id = H5Screate_simple(1, array_10, NULL); @@ -1081,10 +1091,10 @@ test_minimized_dset_ohdr_size_comparisons(hid_t fapl_id) * SETUP * *********/ - if(h5_fixname(FILENAME[1], H5P_DEFAULT, filename_a, sizeof(filename_a)) == NULL) + if(h5_fixname(FILENAME[1], fapl_id, filename_a, sizeof(filename_a)) == NULL) TEST_ERROR - if(h5_fixname(FILENAME[2], H5P_DEFAULT, filename_b, sizeof(filename_b)) == NULL) + if(h5_fixname(FILENAME[2], fapl_id, filename_b, sizeof(filename_b)) == NULL) TEST_ERROR for (compact = 0; compact < 2; compact++) { /* 0 or 1 */ @@ -1244,7 +1254,7 @@ test_minimized_dset_ohdr_with_filter(hid_t fapl_id) * SETUP * *********/ - if(h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename)) == NULL) + if(h5_fixname(FILENAME[1], fapl_id, filename, sizeof(filename)) == NULL) TEST_ERROR dcpl_mx_id = H5Pcreate(H5P_DATASET_CREATE); @@ -1383,7 +1393,7 @@ test_minimized_dset_ohdr_modification_times(hid_t _fapl_id) * SETUP * *********/ - if(h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename)) == NULL) + if(h5_fixname(FILENAME[1], _fapl_id, filename, sizeof(filename)) == NULL) TEST_ERROR dcpl_mx_id = H5Pcreate(H5P_DATASET_CREATE); @@ -1426,8 +1436,6 @@ test_minimized_dset_ohdr_modification_times(hid_t _fapl_id) if(fapl_id < 0) TEST_ERROR if(cases[i].oh_version > 1) { - fapl_id = H5Pcreate(H5P_FILE_ACCESS); - if(fapl_id < 0) TEST_ERROR ret = H5Pset_libver_bounds(fapl_id, H5F_LIBVER_V18, H5F_LIBVER_V110); if(ret < 0) TEST_ERROR } @@ -1534,7 +1542,10 @@ test_minimized_dset_ohdr_fillvalue_backwards_compatability(hid_t _fapl_id) TESTING("minimized dset object headers with fill values and different libver support"); - if(h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename)) == NULL) + fapl_id = H5Pcopy(_fapl_id); + if(fapl_id < 0) TEST_ERROR + + if(h5_fixname(FILENAME[1], fapl_id, filename, sizeof(filename)) == NULL) TEST_ERROR dspace_id = H5Screate_simple(1, extents, extents); @@ -1552,9 +1563,6 @@ test_minimized_dset_ohdr_fillvalue_backwards_compatability(hid_t _fapl_id) ret = H5Pset_fill_value(dcpl_id, dtype_id, fill); if(ret == FAIL) TEST_ERROR; - fapl_id = H5Pcopy(_fapl_id); - if(fapl_id < 0) TEST_ERROR - ret = H5Pset_libver_bounds(fapl_id, H5F_LIBVER_EARLIEST, H5F_LIBVER_LATEST); if(ret == FAIL) TEST_ERROR; @@ -1678,6 +1686,8 @@ main(void) hid_t fapl = -1; hid_t file = -1; H5F_t *f = NULL; + const char *env_h5_drvr; /* File driver value from environment */ + hbool_t single_file_vfd; /* Whether VFD used stores data in a single file */ char filename[1024]; H5O_hdr_info_t hdr_info; /* Object info */ H5O_loc_t oh_loc; /* Object header locations */ @@ -1688,6 +1698,14 @@ main(void) hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ herr_t ret; /* Generic return value */ + /* Get the VFD to use */ + env_h5_drvr = HDgetenv("HDF5_DRIVER"); + if(env_h5_drvr == NULL) + env_h5_drvr = "nomatch"; + + /* Check for VFD which stores data in multiple files */ + single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")); + /* Reset library */ h5_reset(); fapl = h5_fileaccess(); @@ -1906,11 +1924,23 @@ main(void) * and the various "fail/mark if unknown" object header message flags */ HDputs("Accessing objects with unknown header messages: H5O_BOGUS_VALID_ID"); - if(test_unknown(H5O_BOGUS_VALID_ID, filename, fapl) < 0) - TEST_ERROR + if(single_file_vfd) { + if(test_unknown(H5O_BOGUS_VALID_ID, filename, fapl) < 0) + TEST_ERROR + } /* end if */ + else { + SKIPPED(); + HDputs(" Unknown header message test not supported with the current VFD."); + } /* end else */ HDputs("Accessing objects with unknown header messages: H5O_BOGUS_INVALID_ID"); - if(test_unknown(H5O_BOGUS_INVALID_ID, filename, fapl) < 0) - TEST_ERROR + if(single_file_vfd) { + if(test_unknown(H5O_BOGUS_INVALID_ID, filename, fapl) < 0) + TEST_ERROR + } /* end if */ + else { + SKIPPED(); + HDputs(" Unknown header message test not supported with the current VFD."); + } /* end else */ /* Test object header creation metadata cache issues */ if(test_ohdr_cache(filename, fapl) < 0) diff --git a/test/tattr.c b/test/tattr.c index c1167c6..454ea71 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -150,6 +150,8 @@ float attr_data5=-5.123F; /* Test data for 5th attribute */ #define INVALID_RENAME_TEST_ATTR_NAME "InvalidRenameTestAttr" #define INVALID_RENAME_TEST_NEW_ATTR_NAME "InvalidRenameTestNewAttr" +/* Used by test_attr_get_name_invalid_buf() */ +#define GET_NAME_INVALID_BUF_TEST_ATTR_NAME "InvalidNameBufferTestAttr" /* Attribute iteration struct */ typedef struct { @@ -6138,6 +6140,60 @@ test_attr_rename_invalid_name(hid_t fcpl, hid_t fapl) } +/*************************************************************** +** +** test_attr_get_name_invalid_buf(): A test to ensure that +** passing a NULL buffer to H5Aget_name(_by_idx) when +** the 'size' parameter is non-zero doesn't cause bad +** behavior. +** +****************************************************************/ +static void +test_attr_get_name_invalid_buf(hid_t fcpl, hid_t fapl) +{ + ssize_t err_ret = -1; + hid_t fid; + hid_t attr; + hid_t sid; + + /* Create dataspace for attribute */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Create file */ + fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create attribute */ + attr = H5Acreate2(fid, GET_NAME_INVALID_BUF_TEST_ATTR_NAME, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(attr, FAIL, "H5Acreate2"); + + H5E_BEGIN_TRY { + err_ret = H5Aget_name(attr, 1, NULL); + } H5E_END_TRY; + + VERIFY(err_ret, FAIL, "H5Aget_name"); + + H5E_BEGIN_TRY { + err_ret = H5Aget_name_by_idx(fid, ".", H5_INDEX_NAME, H5_ITER_INC, 0, NULL, 1, H5P_DEFAULT); + } H5E_END_TRY; + + VERIFY(err_ret, FAIL, "H5Aget_name_by_idx"); + + /* Close dataspace */ + err_ret = H5Sclose(sid); + CHECK(err_ret, FAIL, "H5Sclose"); + + /* Close attribute */ + err_ret = H5Aclose(attr); + CHECK(err_ret, FAIL, "H5Aclose"); + + /* Close file */ + err_ret = H5Fclose(fid); + CHECK(err_ret, FAIL, "H5Fclose"); +} + + /**************************************************************** ** ** test_attr_delete_by_idx(): Test basic H5A (attribute) code. @@ -11176,6 +11232,7 @@ test_attr(void) test_attr_many(new_format, my_fcpl, my_fapl); /* Test storing lots of attributes */ test_attr_info_null_info_pointer(my_fcpl, my_fapl); /* Test passing a NULL attribute info pointer to H5Aget_info(_by_name/_by_idx) */ test_attr_rename_invalid_name(my_fcpl, my_fapl); /* Test passing a NULL or empty attribute name to H5Arename(_by_name) */ + test_attr_get_name_invalid_buf(my_fcpl, my_fapl); /* Test passing NULL buffer to H5Aget_name(_by_idx) */ /* New attribute API routine tests */ diff --git a/test/tbogus.h5 b/test/tbogus.h5 Binary files differindex 91ab76f..efcbd79 100644 --- a/test/tbogus.h5 +++ b/test/tbogus.h5 diff --git a/test/tfile.c b/test/tfile.c index 5338c32..c5e913c 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1595,16 +1595,18 @@ test_file_perm2(void) ** *****************************************************************/ static void -test_file_is_accessible(void) +test_file_is_accessible(const char *env_h5_drvr) { hid_t fid; /* File opened with read-write permission */ hid_t fcpl_id; /* File creation property list */ hid_t fapl = -1; /* File access property list */ int fd; /* POSIX file descriptor */ + char filename[FILENAME_LEN]; /* Filename to use */ ssize_t nbytes; /* Number of bytes written */ unsigned u; /* Local index variable */ unsigned char buf[1024]; /* Buffer of data to write */ htri_t status; /* Whether a file is an HDF5 file */ + hbool_t single_file_vfd; /* Whether VFD used is a single file */ herr_t ret; /* Output message about test being performed */ @@ -1613,9 +1615,10 @@ test_file_is_accessible(void) /* Get FAPL */ fapl = h5_fileaccess(); CHECK(fapl, FAIL, "H5Pcreate"); + h5_fixname(FILE1, fapl, filename, sizeof filename); /* Create a file */ - fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(fid, FAIL, "H5Fcreate"); /* Close file */ @@ -1623,53 +1626,60 @@ test_file_is_accessible(void) CHECK(ret, FAIL, "H5Fclose"); /* Verify that the file is an HDF5 file */ - status = H5Fis_accessible(FILE1, fapl); + status = H5Fis_accessible(filename, fapl); VERIFY(status, TRUE, "H5Fis_accessible"); - /* Create a file creation property list with a non-default user block size */ - fcpl_id = H5Pcreate(H5P_FILE_CREATE); - CHECK(fcpl_id, FAIL, "H5Pcreate"); + /* This test is not currently working for the family VFD */ + if(0 != HDstrcmp(env_h5_drvr, "family")) { + /* Create a file creation property list with a non-default user block size */ + fcpl_id = H5Pcreate(H5P_FILE_CREATE); + CHECK(fcpl_id, FAIL, "H5Pcreate"); - ret = H5Pset_userblock(fcpl_id, (hsize_t)2048); - CHECK(ret, FAIL, "H5Pset_userblock"); + ret = H5Pset_userblock(fcpl_id, (hsize_t)2048); + CHECK(ret, FAIL, "H5Pset_userblock"); - /* Create file with non-default user block */ - fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl_id, fapl); - CHECK(fid, FAIL, "H5Fcreate"); + /* Create file with non-default user block */ + fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, fapl); + CHECK(fid, FAIL, "H5Fcreate"); - /* Release file-creation property list */ - ret = H5Pclose(fcpl_id); - CHECK(ret, FAIL, "H5Pclose"); + /* Release file-creation property list */ + ret = H5Pclose(fcpl_id); + CHECK(ret, FAIL, "H5Pclose"); - /* Close file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Close file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); - /* Verify that the file is an HDF5 file */ - status = H5Fis_accessible(FILE1, fapl); - VERIFY(status, TRUE, "H5Fis_accessible"); + /* Verify that the file is an HDF5 file */ + status = H5Fis_accessible(filename, fapl); + VERIFY(status, TRUE, "H5Fis_accessible"); + } /* end if */ - /* Create non-HDF5 file and check it */ - fd = HDopen(FILE1, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW); - CHECK(fd, FAIL, "HDopen"); + /* This test only works for VFDs with a single file */ + single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")); + if(single_file_vfd) { + /* Create non-HDF5 file and check it */ + fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW); + CHECK(fd, FAIL, "HDopen"); - /* Initialize information to write */ - for (u=0; u<1024; u++) - buf[u]=(unsigned char)u; + /* Initialize information to write */ + for (u=0; u<1024; u++) + buf[u]=(unsigned char)u; - /* Write some information */ - nbytes = HDwrite(fd, buf, (size_t)1024); - VERIFY(nbytes, 1024, "HDwrite"); + /* Write some information */ + nbytes = HDwrite(fd, buf, (size_t)1024); + VERIFY(nbytes, 1024, "HDwrite"); - /* Close the file */ - ret = HDclose(fd); - CHECK(ret, FAIL, "HDclose"); + /* Close the file */ + ret = HDclose(fd); + CHECK(ret, FAIL, "HDclose"); - /* Verify that the file is not an HDF5 file */ - status = H5Fis_accessible(FILE1, fapl); - VERIFY(status, FALSE, "H5Fis_accessible"); + /* Verify that the file is not an HDF5 file */ + status = H5Fis_accessible(filename, fapl); + VERIFY(status, FALSE, "H5Fis_accessible"); + } /* end if */ /* Close property list */ ret = H5Pclose(fapl); @@ -1693,6 +1703,7 @@ test_file_ishdf5(void) hid_t fcpl; /* File creation property list */ hid_t fapl = -1; /* File access property list */ int fd; /* File Descriptor */ + char filename[FILENAME_LEN]; /* Filename to use */ ssize_t nbytes; /* Number of bytes written */ unsigned u; /* Local index variable */ unsigned char buf[1024]; /* Buffer of data to write */ @@ -1705,9 +1716,10 @@ test_file_ishdf5(void) /* Get FAPL */ fapl = h5_fileaccess(); CHECK(fapl, FAIL, "H5Pcreate"); + h5_fixname(FILE1, fapl, filename, sizeof filename); /* Create a file */ - file = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(file, FAIL, "H5Fcreate"); /* Close file */ @@ -1715,7 +1727,7 @@ test_file_ishdf5(void) CHECK(ret, FAIL, "H5Fclose"); /* Verify that the file is an HDF5 file */ - status = H5Fis_hdf5(FILE1); + status = H5Fis_hdf5(filename); VERIFY(status, TRUE, "H5Fis_hdf5"); @@ -1727,7 +1739,7 @@ test_file_ishdf5(void) CHECK(ret, FAIL, "H5Pset_userblock"); /* Create file with non-default user block */ - file = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl); + file = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); CHECK(file, FAIL, "H5Fcreate"); /* Release file-creation property list */ @@ -1739,12 +1751,12 @@ test_file_ishdf5(void) CHECK(ret, FAIL, "H5Fclose"); /* Verify that the file is an HDF5 file */ - status = H5Fis_hdf5(FILE1); + status = H5Fis_hdf5(filename); VERIFY(status, TRUE, "H5Fis_hdf5"); /* Create non-HDF5 file and check it */ - fd = HDopen(FILE1, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW); + fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW); CHECK(fd, FAIL, "HDopen"); /* Initialize information to write */ @@ -1760,7 +1772,7 @@ test_file_ishdf5(void) CHECK(ret, FAIL, "HDclose"); /* Verify that the file is not an HDF5 file */ - status = H5Fis_hdf5(FILE1); + status = H5Fis_hdf5(filename); VERIFY(status, FALSE, "H5Fis_hdf5"); /* Close property list */ @@ -2247,6 +2259,7 @@ test_file_double_file_dataset_open(hbool_t new_format) hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes for v2 B-tree index */ hsize_t chunks[1] = {2}, chunks2[2] = {4, 5}; /* Chunk dimension sizes */ hsize_t size; /* File size */ + char filename[FILENAME_LEN]; /* Filename to use */ const char* data[] = {"String 1", "String 2", "String 3", "String 4", "String 5"}; /* Input Data */ const char* e_data[] = {"String 1", "String 2", "String 3", "String 4", "String 5", "String 6", "String 7"}; /* Input Data */ char* buffer[5]; /* Output buffer */ @@ -2263,9 +2276,10 @@ test_file_double_file_dataset_open(hbool_t new_format) ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); CHECK(ret, FAIL, "H5Pset_libver_bounds"); } /* end if */ + h5_fixname(FILE1, fapl, filename, sizeof filename); /* Create the test file */ - fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); CHECK(fid1, FAIL, "H5Fcreate"); /* Create a chunked dataset with fixed array indexing */ @@ -2347,8 +2361,6 @@ test_file_double_file_dataset_open(hbool_t new_format) CHECK(ret, FAIL, "H5Sclose"); ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - ret = H5Pclose(fapl); - CHECK(ret, FAIL, "H5Pclose"); ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -2357,7 +2369,7 @@ test_file_double_file_dataset_open(hbool_t new_format) */ /* First file open */ - fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); + fid1 = H5Fopen(filename, H5F_ACC_RDWR, fapl); CHECK(fid1, FAIL, "H5Fopen"); /* First file's dataset open */ @@ -2372,7 +2384,7 @@ test_file_double_file_dataset_open(hbool_t new_format) CHECK(ret, FAIL, "H5Dwrite"); /* Second file open */ - fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); + fid2 = H5Fopen(filename, H5F_ACC_RDWR, fapl); CHECK(fid2, FAIL, "H5Fopen"); /* Second file's dataset open */ @@ -2413,11 +2425,11 @@ test_file_double_file_dataset_open(hbool_t new_format) */ /* First file open */ - fid1 = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT); + fid1 = H5Fopen(filename, H5F_ACC_RDONLY, fapl); CHECK(fid1, FAIL, "H5Fopen"); /* Second file open */ - fid2 = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT); + fid2 = H5Fopen(filename, H5F_ACC_RDONLY, fapl); CHECK(fid2, FAIL, "H5Fopen"); /* Second file's dataset open */ @@ -2478,7 +2490,7 @@ test_file_double_file_dataset_open(hbool_t new_format) */ /* First file open */ - fid1 = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT); + fid1 = H5Fopen(filename, H5F_ACC_RDONLY, fapl); CHECK(fid1, FAIL, "H5Fopen"); /* First file's dataset open */ @@ -2490,7 +2502,7 @@ test_file_double_file_dataset_open(hbool_t new_format) CHECK(size, 0, "H5Dget_storage_size"); /* Second file open */ - fid2 = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT); + fid2 = H5Fopen(filename, H5F_ACC_RDONLY, fapl); CHECK(fid2, FAIL, "H5Fopen"); /* Second file's dataset open */ @@ -2523,7 +2535,7 @@ test_file_double_file_dataset_open(hbool_t new_format) * from second call to H5Dset_extent->...H5D__earray_idx_remove->H5EA_get...H5EA__iblock_protect...H5AC_protect */ /* First file open */ - fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); + fid1 = H5Fopen(filename, H5F_ACC_RDWR, fapl); CHECK(fid1, FAIL, "H5Fopen"); /* First file's dataset open */ @@ -2542,7 +2554,7 @@ test_file_double_file_dataset_open(hbool_t new_format) CHECK(ret, FAIL, "H5Dwrite"); /* Second file open */ - fid2 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); + fid2 = H5Fopen(filename, H5F_ACC_RDWR, fapl); CHECK(fid2, FAIL, "H5Fopen"); /* Second file's dataset open */ @@ -2573,6 +2585,9 @@ test_file_double_file_dataset_open(hbool_t new_format) ret = H5Tclose(tid1); CHECK(ret, FAIL, "H5Tclose"); + /* Close FAPL */ + ret = H5Pclose(fapl); + CHECK(ret, FAIL, "H5Pclose"); } /* end test_file_double_dataset_open() */ /**************************************************************** @@ -7500,6 +7515,7 @@ test_deprec(void) void test_file(void) { + hbool_t single_file_vfd; /* Whether VFD used is a single file */ const char *env_h5_drvr; /* File Driver value from environment */ /* Output message about test being performed */ @@ -7509,6 +7525,7 @@ test_file(void) env_h5_drvr = HDgetenv("HDF5_DRIVER"); if(env_h5_drvr == NULL) env_h5_drvr = "nomatch"; + single_file_vfd = (hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")); test_file_create(); /* Test file creation(also creation templates)*/ test_file_open(); /* Test file opening */ @@ -7518,7 +7535,7 @@ test_file(void) test_get_obj_ids(); /* Test H5Fget_obj_ids for Jira Issue 8528 */ test_file_perm(); /* Test file access permissions */ test_file_perm2(); /* Test file access permission again */ - test_file_is_accessible(); /* Test detecting HDF5 files correctly */ + test_file_is_accessible(env_h5_drvr); /* Test detecting HDF5 files correctly */ test_file_open_dot(); /* Test opening objects with "." for a name */ test_file_open_overlap(); /* Test opening files in an overlapping manner */ test_file_getname(); /* Test basic H5Fget_name() functionality */ @@ -7554,7 +7571,10 @@ test_file(void) test_incr_filesize(); /* Test H5Fincrement_filesize() and H5Fget_eoa() */ test_min_dset_ohdr(); /* Test datset object header minimization */ #ifndef H5_NO_DEPRECATED_SYMBOLS - test_file_ishdf5(); /* Test detecting HDF5 files correctly */ + if(single_file_vfd) + test_file_ishdf5(); /* Test detecting HDF5 files correctly */ + else + MESSAGE(5, ("Skipping testing detection of HDF5 Files (using deprecated H5Fis_hdf5() call for non-single file VFDs)\n")); test_deprec(); /* Test deprecated routines */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* test_file() */ diff --git a/test/tselect.c b/test/tselect.c index 3c93e7a..bcc2a5b 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -1308,14 +1308,8 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Dread"); /* Compare data read with data written out */ - if(HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 30 * 12)) { + if(HDmemcmp(rbuf, wbuf, sizeof(uint16_t) * 30 * 12)) TestErrPrintf("hyperslab values don't match! Line=%d\n",__LINE__); -#ifdef QAK - for(i=0, tbuf=wbuf; i<12; i++) - for(j=0; j<30; j++) - printf("i=%d, j=%d, *wbuf=%u, *rbuf=%u\n",i,j,(unsigned)*(wbuf+i*30+j),(unsigned)*(rbuf+i*30+j)); -#endif /* QAK */ - } /* end if */ /* Close memory dataspace */ ret = H5Sclose(sid2); @@ -1432,14 +1426,8 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist) CHECK(ret, FAIL, "H5Dread"); /* Compare data read with data written out */ - if(HDmemcmp(rbuf,wbuf,sizeof(uint16_t)*2*SPACE8_DIM3*SPACE8_DIM2*SPACE8_DIM1)) { + if(HDmemcmp(rbuf,wbuf,sizeof(uint16_t)*2*SPACE8_DIM3*SPACE8_DIM2*SPACE8_DIM1)) TestErrPrintf("Error: hyperslab values don't match!\n"); -#ifdef QAK - for(i=0, tbuf=wbuf; i<12; i++) - for(j=0; j<30; j++) - printf("i=%d, j=%d, *wbuf=%u, *rbuf=%u\n",i,j,(unsigned)*(wbuf+i*30+j),(unsigned)*(rbuf+i*30+j)); -#endif /* QAK */ - } /* end if */ /* Close memory dataspace */ ret = H5Sclose(sid2); @@ -3743,15 +3731,8 @@ test_select_hyper_copy(void) CHECK(ret, FAIL, "H5Dread"); /* Compare data read with data written out */ - if(HDmemcmp(rbuf,rbuf2,sizeof(uint16_t)*SPACE3_DIM1*SPACE3_DIM2)) { + if(HDmemcmp(rbuf,rbuf2,sizeof(uint16_t)*SPACE3_DIM1*SPACE3_DIM2)) TestErrPrintf("hyperslab values don't match! Line=%d\n",__LINE__); -#ifdef QAK - for(i=0; i<SPACE3_DIM1; i++) - for(j=0; j<SPACE3_DIM2; j++) - if((unsigned)*(rbuf+i*SPACE3_DIM2+j)!=(unsigned)*(rbuf2+i*SPACE3_DIM2+j)) - printf("i=%d, j=%d, *rbuf=%u, *rbuf2=%u\n",i,j,(unsigned)*(rbuf+i*SPACE3_DIM2+j),(unsigned)*(rbuf2+i*SPACE3_DIM2+j)); -#endif /* QAK */ - } /* end if */ /* Close memory dataspace */ ret = H5Sclose(sid2); @@ -5220,7 +5201,7 @@ test_select_hyper_union_3d(void) tmp2_space = H5Scombine_select(sid2,H5S_SELECT_OR,tmp_space); CHECK(tmp2_space, FAIL, "H5Scombin_select"); - npoints = H5Sget_select_npoints(tmp2_space); + npoints = (hsize_t)H5Sget_select_npoints(tmp2_space); VERIFY(npoints, 15*26, "H5Sget_select_npoints"); /* Create a dataset */ @@ -5902,37 +5883,20 @@ test_select_hyper_union_random_5d(hid_t read_plist) CHECK(sid2, FAIL, "H5Screate_simple"); /* Get initial random # seed */ - seed=(unsigned)time(NULL)+(unsigned)clock(); + seed = (unsigned)HDtime(NULL) + (unsigned)HDclock(); /* Crunch through a bunch of random hyperslab reads from the file dataset */ for(test_num=0; test_num<NRAND_HYPER; test_num++) { /* Save random # seed for later use */ /* (Used in case of errors, to regenerate the hyperslab sequence) */ -#ifndef QAK - seed+=(unsigned)clock(); -#else /* QAK */ - seed=987909620; -#endif /* QAK */ + seed += (unsigned)HDclock(); HDsrandom(seed); -#ifdef QAK -printf("test_num=%d, seed=%u\n",test_num,seed); -#endif /* QAK */ -#ifndef QAK for(i=0; i<NHYPERSLABS; i++) { -#else /* QAK */ - for(i=0; i<2; i++) { -#endif /* QAK */ -#ifdef QAK -printf("hyperslab=%d\n",i); -#endif /* QAK */ /* Select random hyperslab location & size for selection */ for(j=0; j<SPACE5_RANK; j++) { start[j] = ((hsize_t)HDrandom() % dims1[j]); count[j] = (((hsize_t)HDrandom() % (dims1[j] - start[j])) + 1); -#ifdef QAK -printf("start[%d]=%d, count[%d]=%d (end[%d]=%d)\n",j,(int)start[j],j,(int)count[j],j,(int)(start[j]+count[j]-1)); -#endif /* QAK */ } /* end for */ /* Select hyperslab */ @@ -5953,41 +5917,9 @@ printf("start[%d]=%d, count[%d]=%d (end[%d]=%d)\n",j,(int)start[j],j,(int)count[ npoints2 = H5Sget_select_npoints(sid2); VERIFY(npoints, npoints2, "H5Sget_select_npoints"); -#ifdef QAK -printf("random I/O, before H5Dread(), npoints=%lu\n",(unsigned long)npoints); -{ - hsize_t blocks[128][2][SPACE5_RANK]; - hssize_t nblocks; - int k; - - nblocks=H5Sget_select_hyper_nblocks(sid1); - printf("nblocks=%d\n",(int)nblocks); - H5Sget_select_hyper_blocklist(sid1,0,nblocks,blocks); - for(j=0; j<nblocks; j++) { - printf("Block #%d, start = {",j); - for(k=0; k<SPACE5_RANK; k++) { - printf("%d",blocks[j][0][k]); - if(k<(SPACE5_RANK-1)) - printf(", "); - else - printf("}, end = {"); - } /* end for */ - for(k=0; k<SPACE5_RANK; k++) { - printf("%d",blocks[j][1][k]); - if(k<(SPACE5_RANK-1)) - printf(", "); - else - printf("}\n"); - } /* end for */ - } /* end for */ -} -#endif /* QAK */ /* Read selection from disk */ ret=H5Dread(dataset,H5T_NATIVE_INT,sid2,sid1,read_plist,rbuf); CHECK(ret, FAIL, "H5Dread"); -#ifdef QAK -printf("random I/O, after H5Dread()\n"); -#endif /* QAK */ /* Compare data read with data written out */ tbuf=rbuf; @@ -20,8 +20,12 @@ #include "h5test.h" +/* Filename */ +const char *FILENAME[] = { + "native_vol_test", + NULL +}; -#define NATIVE_VOL_TEST_FILENAME "native_vol_test" #define NATIVE_VOL_TEST_GROUP_NAME "test_group" #define NATIVE_VOL_TEST_DATASET_NAME "test_dataset" #define NATIVE_VOL_TEST_ATTRIBUTE_NAME "test_dataset" @@ -237,7 +241,7 @@ error: *------------------------------------------------------------------------- */ static herr_t -test_basic_file_operation(void) +test_basic_file_operation(const char *env_h5_drvr) { hid_t fid = H5I_INVALID_HID; hid_t fid_reopen = H5I_INVALID_HID; @@ -245,6 +249,7 @@ test_basic_file_operation(void) hid_t fapl_id2 = H5I_INVALID_HID; hid_t fcpl_id = H5I_INVALID_HID; + char filename[1024]; ssize_t obj_count; hid_t obj_id_list[1]; hsize_t file_size; @@ -257,6 +262,7 @@ test_basic_file_operation(void) /* Retrieve the file access property for testing */ fapl_id = h5_fileaccess(); + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); /* Set the file close degree to a non-default value, to make the H5Pequal * work out. This is kinda odd, but the library's current behavior with @@ -273,7 +279,7 @@ test_basic_file_operation(void) FAIL_STACK_ERROR /* H5Fcreate */ - if ((fid = H5Fcreate(NATIVE_VOL_TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) + if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) TEST_ERROR; /* H5Fget_obj_count */ @@ -290,13 +296,16 @@ test_basic_file_operation(void) if ((obj_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_DATASET, 2, obj_id_list)) < 0) TEST_ERROR; - /* H5Fget_access_plist */ - if ((fapl_id2 = H5Fget_access_plist(fid)) < 0) - TEST_ERROR; - if (H5Pequal(fapl_id, fapl_id2) != TRUE) - TEST_ERROR; - if (H5Pclose(fapl_id2) < 0) - TEST_ERROR; + /* Can't compare VFD properties for split / multi / family VFDs */ + if((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family"))) { + /* H5Fget_access_plist */ + if ((fapl_id2 = H5Fget_access_plist(fid)) < 0) + TEST_ERROR; + if (H5Pequal(fapl_id, fapl_id2) != TRUE) + TEST_ERROR; + if (H5Pclose(fapl_id2) < 0) + TEST_ERROR; + } /* end if */ /* H5Fget_create_plist */ if ((fcpl_id = H5Fget_create_plist(fid)) < 0) @@ -308,9 +317,12 @@ test_basic_file_operation(void) if (H5Fget_filesize(fid, &file_size) < 0) TEST_ERROR; - /* H5Fget_vfd_handle */ - if (H5Fget_vfd_handle(fid, H5P_DEFAULT, &os_file_handle) < 0) - TEST_ERROR; + /* Can't retrieve VFD handle for split / multi / family VFDs */ + if((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family"))) { + /* H5Fget_vfd_handle */ + if (H5Fget_vfd_handle(fid, H5P_DEFAULT, &os_file_handle) < 0) + TEST_ERROR; + } /* end if */ /* H5Fget_intent */ if (H5Fget_intent(fid, &intent) < 0) @@ -337,43 +349,49 @@ test_basic_file_operation(void) TEST_ERROR; /* H5Fis_accessible */ - if (H5Fis_accessible(NATIVE_VOL_TEST_FILENAME, fapl_id) < 0) + if (H5Fis_accessible(filename, fapl_id) < 0) TEST_ERROR; /* H5Fopen */ - if ((fid = H5Fopen(NATIVE_VOL_TEST_FILENAME, H5F_ACC_RDWR, fapl_id)) < 0) + if ((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl_id)) < 0) TEST_ERROR; - /* H5Fget_access_plist */ - if ((fapl_id2 = H5Fget_access_plist(fid)) < 0) - TEST_ERROR; - if (H5Pequal(fapl_id, fapl_id2) != TRUE) - TEST_ERROR; - if (H5Pclose(fapl_id2) < 0) - TEST_ERROR; + /* Can't compare VFD properties for split / multi / family VFDs */ + if((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family"))) { + /* H5Fget_access_plist */ + if((fapl_id2 = H5Fget_access_plist(fid)) < 0) + TEST_ERROR; + if(H5Pequal(fapl_id, fapl_id2) != TRUE) + TEST_ERROR; + if(H5Pclose(fapl_id2) < 0) + TEST_ERROR; + } /* end if */ if ((fid_reopen = H5Freopen(fid)) < 0) TEST_ERROR; - /* H5Fget_access_plist */ - if ((fapl_id2 = H5Fget_access_plist(fid_reopen)) < 0) - TEST_ERROR; - if (H5Pequal(fapl_id, fapl_id2) != TRUE) - TEST_ERROR; - if (H5Pclose(fapl_id2) < 0) - TEST_ERROR; + /* Can't compare VFD properties for split / multi / family VFDs */ + if((hbool_t)(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family"))) { + /* H5Fget_access_plist */ + if((fapl_id2 = H5Fget_access_plist(fid_reopen)) < 0) + TEST_ERROR; + if(H5Pequal(fapl_id, fapl_id2) != TRUE) + TEST_ERROR; + if(H5Pclose(fapl_id2) < 0) + TEST_ERROR; + } /* end if */ if (H5Fclose(fid) < 0) TEST_ERROR; if (H5Fclose(fid_reopen) < 0) TEST_ERROR; + h5_delete_test_file(FILENAME[0], fapl_id); + /* H5Pclose */ if (H5Pclose(fapl_id) < 0) TEST_ERROR; - HDremove(NATIVE_VOL_TEST_FILENAME); - PASSED(); return SUCCEED; @@ -404,14 +422,20 @@ static herr_t test_basic_group_operation(void) { hid_t fid = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; hid_t gid = H5I_INVALID_HID; hid_t gid_a = H5I_INVALID_HID; hid_t gcpl_id = H5I_INVALID_HID; + char filename[1024]; H5G_info_t info; TESTING("Basic VOL group operations"); - if ((fid = H5Fcreate(NATIVE_VOL_TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + /* Retrieve the file access property for testing */ + fapl_id = h5_fileaccess(); + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); + + if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) TEST_ERROR; /* H5Gcreate */ @@ -465,7 +489,11 @@ test_basic_group_operation(void) if (H5Fclose(fid) < 0) TEST_ERROR; - HDremove(NATIVE_VOL_TEST_FILENAME); + h5_delete_test_file(FILENAME[0], fapl_id); + + /* H5Pclose */ + if (H5Pclose(fapl_id) < 0) + TEST_ERROR; PASSED(); return SUCCEED; @@ -474,6 +502,7 @@ error: H5E_BEGIN_TRY { H5Fclose(fid); H5Gclose(gid); + H5Pclose(fapl_id); H5Pclose(gcpl_id); } H5E_END_TRY; @@ -495,6 +524,7 @@ static herr_t test_basic_dataset_operation(void) { hid_t fid = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; hid_t dcpl_id = H5I_INVALID_HID; hid_t dapl_id = H5I_INVALID_HID; hid_t did = H5I_INVALID_HID; @@ -502,6 +532,8 @@ test_basic_dataset_operation(void) hid_t sid = H5I_INVALID_HID; hid_t tid = H5I_INVALID_HID; + char filename[1024]; + hsize_t curr_dims = 0; hsize_t max_dims = H5S_UNLIMITED; @@ -516,7 +548,11 @@ test_basic_dataset_operation(void) TESTING("Basic VOL dataset operations"); - if ((fid = H5Fcreate(NATIVE_VOL_TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + /* Retrieve the file access property for testing */ + fapl_id = h5_fileaccess(); + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); + + if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) TEST_ERROR; for (i = 0; i < N_ELEMENTS; i++) { in_buf[i] = i; @@ -630,7 +666,11 @@ test_basic_dataset_operation(void) if (H5Fclose(fid) < 0) TEST_ERROR; - HDremove(NATIVE_VOL_TEST_FILENAME); + h5_delete_test_file(FILENAME[0], fapl_id); + + /* H5Pclose */ + if (H5Pclose(fapl_id) < 0) + TEST_ERROR; PASSED(); return SUCCEED; @@ -642,6 +682,7 @@ error: H5Dclose(did_a); H5Sclose(sid); H5Tclose(tid); + H5Pclose(fapl_id); H5Pclose(dapl_id); H5Pclose(dcpl_id); } H5E_END_TRY; @@ -664,11 +705,14 @@ static herr_t test_basic_attribute_operation(void) { hid_t fid = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; hid_t gid = H5I_INVALID_HID; hid_t aid = H5I_INVALID_HID; hid_t aid_name = H5I_INVALID_HID; hid_t sid = H5I_INVALID_HID; + char filename[1024]; + hsize_t dims = 1; int data_in = 42; @@ -676,7 +720,11 @@ test_basic_attribute_operation(void) TESTING("Basic VOL attribute operations"); - if ((fid = H5Fcreate(NATIVE_VOL_TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + /* Retrieve the file access property for testing */ + fapl_id = h5_fileaccess(); + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); + + if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) TEST_ERROR; if ((gid = H5Gcreate2(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; @@ -730,7 +778,11 @@ test_basic_attribute_operation(void) if (H5Fclose(fid) < 0) TEST_ERROR; - HDremove(NATIVE_VOL_TEST_FILENAME); + h5_delete_test_file(FILENAME[0], fapl_id); + + /* H5Pclose */ + if (H5Pclose(fapl_id) < 0) + TEST_ERROR; PASSED(); return SUCCEED; @@ -738,6 +790,7 @@ test_basic_attribute_operation(void) error: H5E_BEGIN_TRY { H5Fclose(fid); + H5Pclose(fapl_id); H5Gclose(gid); H5Sclose(sid); H5Aclose(aid); @@ -762,14 +815,20 @@ static herr_t test_basic_object_operation(void) { hid_t fid = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; hid_t gid = H5I_INVALID_HID; hid_t oid = H5I_INVALID_HID; + char filename[1024]; H5O_info_t object_info; TESTING("Basic VOL object operations"); - if ((fid = H5Fcreate(NATIVE_VOL_TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + /* Retrieve the file access property for testing */ + fapl_id = h5_fileaccess(); + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); + + if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) TEST_ERROR; if ((gid = H5Gcreate2(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; @@ -797,7 +856,12 @@ test_basic_object_operation(void) if (H5Gclose(gid) < 0) TEST_ERROR; - HDremove(NATIVE_VOL_TEST_FILENAME); + h5_delete_test_file(FILENAME[0], fapl_id); + + /* H5Pclose */ + if (H5Pclose(fapl_id) < 0) + TEST_ERROR; + PASSED(); return SUCCEED; @@ -805,6 +869,7 @@ test_basic_object_operation(void) error: H5E_BEGIN_TRY { H5Fclose(fid); + H5Pclose(fapl_id); H5Gclose(gid); } H5E_END_TRY; @@ -827,10 +892,16 @@ test_basic_link_operation(void) { hid_t fid = H5I_INVALID_HID; hid_t gid = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; + char filename[1024]; TESTING("Basic VOL link operations"); - if ((fid = H5Fcreate(NATIVE_VOL_TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + /* Retrieve the file access property for testing */ + fapl_id = h5_fileaccess(); + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); + + if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) TEST_ERROR; if ((gid = H5Gcreate2(fid, NATIVE_VOL_TEST_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; @@ -862,7 +933,12 @@ test_basic_link_operation(void) if (H5Gclose(gid) < 0) TEST_ERROR; - HDremove(NATIVE_VOL_TEST_FILENAME); + h5_delete_test_file(FILENAME[0], fapl_id); + + /* H5Pclose */ + if (H5Pclose(fapl_id) < 0) + TEST_ERROR; + PASSED(); return SUCCEED; @@ -871,6 +947,7 @@ error: H5E_BEGIN_TRY { H5Fclose(fid); H5Fclose(gid); + H5Pclose(fapl_id); } H5E_END_TRY; return FAIL; @@ -891,13 +968,19 @@ static herr_t test_basic_datatype_operation(void) { hid_t fid = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; hid_t tid = H5I_INVALID_HID; hid_t tid_anon = H5I_INVALID_HID; hid_t tcpl_id = H5I_INVALID_HID; + char filename[1024]; TESTING("Basic VOL datatype operations"); - if ((fid = H5Fcreate(NATIVE_VOL_TEST_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + /* Retrieve the file access property for testing */ + fapl_id = h5_fileaccess(); + h5_fixname(FILENAME[0], fapl_id, filename, sizeof filename); + + if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) TEST_ERROR; if ((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR; @@ -941,7 +1024,11 @@ test_basic_datatype_operation(void) if (H5Fclose(fid) < 0) TEST_ERROR; - HDremove(NATIVE_VOL_TEST_FILENAME); + h5_delete_test_file(FILENAME[0], fapl_id); + + /* H5Pclose */ + if (H5Pclose(fapl_id) < 0) + TEST_ERROR; PASSED(); return SUCCEED; @@ -950,6 +1037,7 @@ error: H5E_BEGIN_TRY { H5Pclose(tcpl_id); H5Fclose(fid); + H5Pclose(fapl_id); H5Tclose(tid); H5Tclose(tid_anon); } H5E_END_TRY; @@ -958,34 +1046,6 @@ error: } /* end test_basic_datatype_operation() */ -#if 0 - -/*------------------------------------------------------------------------- - * Function: test_echo_vol_operation() - * - * Purpose: Uses the echo VOL connector to test basic VOL operations - * via the H5VL public API. - * - * Return: SUCCEED/FAIL - * - *------------------------------------------------------------------------- - */ -static herr_t -test_echo_vol_operation(void) -{ - char name[25]; - - TESTING("Echo VOL operations"); - - PASSED(); - return SUCCEED; - -error: - return FAIL; - -} /* end test_basic_vol_operation() */ -#endif - /*------------------------------------------------------------------------- * Function: main @@ -999,15 +1059,21 @@ error: int main(void) { + const char *env_h5_drvr; /* File driver value from environment */ int nerrors = 0; + /* Get the VFD to use */ + env_h5_drvr = HDgetenv("HDF5_DRIVER"); + if(env_h5_drvr == NULL) + env_h5_drvr = "nomatch"; + h5_reset(); HDputs("Testing basic Virtual Object Layer (VOL) functionality."); nerrors += test_vol_registration() < 0 ? 1 : 0; nerrors += test_native_vol_init() < 0 ? 1 : 0; - nerrors += test_basic_file_operation() < 0 ? 1 : 0; + nerrors += test_basic_file_operation(env_h5_drvr) < 0 ? 1 : 0; nerrors += test_basic_group_operation() < 0 ? 1 : 0; nerrors += test_basic_dataset_operation() < 0 ? 1 : 0; nerrors += test_basic_attribute_operation() < 0 ? 1 : 0; |