diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2018-02-14 20:23:31 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2018-02-14 20:23:31 (GMT) |
commit | 8ad35726eab12d8ca27b65cf62e5bddbcf86c4c0 (patch) | |
tree | d482d9e6e5bb06e696ccd5706583b87a1f4d52a0 /test | |
parent | 23cf3a42989e6fd4c258e4cc8d58f0cf9a9336ce (diff) | |
parent | e09ccc4a2168e79b9f7500b8ec68ed5f829c8604 (diff) | |
download | hdf5-8ad35726eab12d8ca27b65cf62e5bddbcf86c4c0.zip hdf5-8ad35726eab12d8ca27b65cf62e5bddbcf86c4c0.tar.gz hdf5-8ad35726eab12d8ca27b65cf62e5bddbcf86c4c0.tar.bz2 |
Merge pull request #895 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit 'e09ccc4a2168e79b9f7500b8ec68ed5f829c8604':
More includes cleanup
Cleanup overuse of include files
Diffstat (limited to 'test')
-rw-r--r-- | test/chunk_info.c | 1 | ||||
-rw-r--r-- | test/dangle.c | 103 | ||||
-rw-r--r-- | test/dsets.c | 155 | ||||
-rw-r--r-- | test/gen_cross.c | 45 | ||||
-rw-r--r-- | test/gheap.c | 396 | ||||
-rw-r--r-- | test/h5test.h | 5 | ||||
-rw-r--r-- | test/hyperslab.c | 412 | ||||
-rw-r--r-- | test/istore.c | 500 | ||||
-rw-r--r-- | test/objcopy.c | 1623 | ||||
-rw-r--r-- | test/swmr.c | 1 | ||||
-rw-r--r-- | test/tarray.c | 40 | ||||
-rw-r--r-- | test/tattr.c | 96 | ||||
-rw-r--r-- | test/tconfig.c | 57 | ||||
-rw-r--r-- | test/testhdf5.h | 27 | ||||
-rw-r--r-- | test/tfile.c | 827 | ||||
-rw-r--r-- | test/tgenprop.c | 154 | ||||
-rw-r--r-- | test/th5s.c | 272 | ||||
-rw-r--r-- | test/tid.c | 273 | ||||
-rw-r--r-- | test/titerate.c | 44 | ||||
-rw-r--r-- | test/tmisc.c | 103 | ||||
-rw-r--r-- | test/trefer.c | 178 | ||||
-rw-r--r-- | test/ttime.c | 14 | ||||
-rw-r--r-- | test/ttsafe.h | 3 | ||||
-rw-r--r-- | test/tvlstr.c | 58 | ||||
-rw-r--r-- | test/tvltypes.c | 137 |
25 files changed, 2744 insertions, 2780 deletions
diff --git a/test/chunk_info.c b/test/chunk_info.c index 1f19963..e3006cc 100644 --- a/test/chunk_info.c +++ b/test/chunk_info.c @@ -21,7 +21,6 @@ */ -#include "hdf5.h" #include "h5test.h" #define PRINT_DATA diff --git a/test/dangle.c b/test/dangle.c index 1717d12..75e9c84 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -15,10 +15,9 @@ * Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu> * Tuesday, May 13, 2003 * - * Purpose: Test dangling IDs + * Purpose: Test dangling IDs */ #include "h5test.h" -#include "H5private.h" const char *FILENAME[] = { "dangle", @@ -32,17 +31,17 @@ const char *FILENAME[] = { #define TYPENAME "Type" #define ATTRNAME "Attribute" - + /*------------------------------------------------------------------------- - * Function: test_dangle_dataset + * Function: test_dangle_dataset * - * Purpose: Check for dangling dataset IDs causing problems on library + * Purpose: Check for dangling dataset IDs causing problems on library * shutdown * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * * Modifications: @@ -52,7 +51,7 @@ const char *FILENAME[] = { static int test_dangle_dataset(H5F_close_degree_t degree) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t fapl; /* File access property list */ hid_t dsid; /* Dataset ID */ @@ -128,17 +127,17 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_dangle_group + * Function: test_dangle_group * - * Purpose: Check for dangling group IDs causing problems on library + * Purpose: Check for dangling group IDs causing problems on library * shutdown * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * * Modifications: @@ -148,7 +147,7 @@ error: static int test_dangle_group(H5F_close_degree_t degree) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t fapl; /* File access property list */ hid_t gid; /* Group ID */ @@ -219,17 +218,17 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_dangle_datatype1 + * Function: test_dangle_datatype1 * - * Purpose: Check for dangling datatype IDs causing problems on library + * Purpose: Check for dangling datatype IDs causing problems on library * shutdown * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * * Modifications: @@ -239,7 +238,7 @@ error: static int test_dangle_datatype1(H5F_close_degree_t degree) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t fapl; /* File access property list */ hid_t tid; /* Datatype ID */ @@ -315,17 +314,17 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_dangle_datatype2 + * Function: test_dangle_datatype2 * - * Purpose: Check for dangling datatype IDs causing problems on library + * Purpose: Check for dangling datatype IDs causing problems on library * shutdown * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, August 25, 2005 * * Modifications: @@ -335,7 +334,7 @@ error: static int test_dangle_datatype2(H5F_close_degree_t degree) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t fapl; /* File access property list */ hid_t did; /* Dataset ID */ @@ -402,17 +401,17 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_dangle_attribute + * Function: test_dangle_attribute * - * Purpose: Check for dangling attribute IDs causing problems on library + * Purpose: Check for dangling attribute IDs causing problems on library * shutdown * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, June 18, 2003 * * Modifications: @@ -422,7 +421,7 @@ error: static int test_dangle_attribute(H5F_close_degree_t degree) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t fapl; /* File access property list */ hid_t dsid; /* Dataset ID */ @@ -509,17 +508,17 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: test_dangle_force + * Function: test_dangle_force * - * Purpose: Shut down all danging IDs with generic file & ID routines, + * Purpose: Shut down all danging IDs with generic file & ID routines, * instead of letting library shut then down. * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Friday, October 29, 2010 * *------------------------------------------------------------------------- @@ -527,7 +526,7 @@ error: static int test_dangle_force(void) { - char filename[1024]; + char filename[1024]; hid_t fid; /* File ID */ hid_t gid, gid2; /* Group IDs */ hid_t dsid, dsid2; /* Dataset IDs */ @@ -625,7 +624,7 @@ test_dangle_force(void) /* Release object ID array */ HDfree(objs); - + PASSED(); return 0; @@ -635,16 +634,16 @@ error: return 1; } - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Executes dangling ID tests + * Purpose: Executes dangling ID tests * - * Return: Success: zero - * Failure: non-zero + * Return: Success: zero + * Failure: non-zero * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 13, 2003 * * Modifications: @@ -654,7 +653,7 @@ error: int main(void) { - int nerrors=0; + int nerrors=0; /* Run tests w/weak file close */ puts("Testing dangling objects with weak file close:"); diff --git a/test/dsets.c b/test/dsets.c index 09f553e..17cf23c 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -24,7 +24,6 @@ #define H5Z_FRIEND /*suppress error about including H5Zpkg */ -#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" @@ -316,7 +315,7 @@ const H5Z_class2_t H5Z_COUNT[1] = {{ filter_count, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: filter_count * @@ -341,7 +340,7 @@ filter_count(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, return nbytes; } - + /*------------------------------------------------------------------------- * Function: test_create * @@ -488,7 +487,7 @@ test_create(hid_t file) return -1; } - + /*------------------------------------------------------------------------- * Function: test_simple_io * @@ -624,7 +623,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_userblock_offset * @@ -730,7 +729,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_compact_io * @@ -823,7 +822,7 @@ test_compact_io(hid_t fapl) if(H5Fclose(file) < 0) TEST_ERROR /************************************** - * Additional test for version bounds * + * Additional test for version bounds * **************************************/ /* Create a copy of file access property list */ @@ -923,7 +922,7 @@ test_compact_io(hid_t fapl) return -1; } - + /*------------------------------------------------------------------------- * Function: test_max_compact * @@ -1076,7 +1075,7 @@ error: return -1; } /* end test_max_compact() */ - + /*------------------------------------------------------------------------- * Function: test_layout_extend * @@ -1199,7 +1198,7 @@ error: return -1; } /* end test_layout_extend() */ - + /*------------------------------------------------------------------------- * Function: test_conv_buffer * @@ -1338,7 +1337,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_tconv * @@ -1433,7 +1432,7 @@ const H5Z_class2_t H5Z_BOGUS[1] = {{ filter_bogus, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: can_apply_bogus * @@ -1455,7 +1454,7 @@ can_apply_bogus(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSE return -1; } - + /*------------------------------------------------------------------------- * Function: filter_bogus * @@ -1473,7 +1472,7 @@ filter_bogus(unsigned int H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts, return nbytes; } - + /*------------------------------------------------------------------------- * Function: set_local_bogus2 * @@ -1519,7 +1518,7 @@ set_local_bogus2(hid_t dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) return(SUCCEED); } /* end set_local_bogus2() */ - + /*------------------------------------------------------------------------- * Function: filter_bogus2 * @@ -1573,7 +1572,7 @@ filter_bogus2(unsigned int flags, size_t cd_nelmts, return(nbytes); } - + /*------------------------------------------------------------------------- * Function: filter_bogus3 * @@ -1602,7 +1601,7 @@ const H5Z_class2_t H5Z_CORRUPT[1] = {{ filter_corrupt, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: filter_corrupt * @@ -1661,7 +1660,7 @@ error: return ret_value; } /* end filter_corrupt() */ - + /*------------------------------------------------------------------------- * Function: filter_cb_cont * @@ -1680,7 +1679,7 @@ filter_cb_cont(H5Z_filter_t filter, void H5_ATTR_UNUSED *buf, size_t H5_ATTR_UNU return H5Z_CB_FAIL; } - + /*------------------------------------------------------------------------- * Function: filter_cb_fail * @@ -1699,7 +1698,7 @@ filter_cb_fail(H5Z_filter_t filter, void H5_ATTR_UNUSED *buf, size_t H5_ATTR_UNU return H5Z_CB_CONT; } - + /*------------------------------------------------------------------------- * Function: test_filter_internal * @@ -2510,7 +2509,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_missing_filter * @@ -2838,7 +2837,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_int * @@ -2956,7 +2955,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_float * @@ -3074,7 +3073,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_double * @@ -3206,7 +3205,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_array * @@ -3333,7 +3332,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_compound * @@ -3550,7 +3549,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_compound_2 * @@ -3895,7 +3894,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_compound_3 * @@ -4075,7 +4074,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_int_size * @@ -4242,7 +4241,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_nbit_flt_size * @@ -4438,7 +4437,7 @@ test_nbit_flt_size(hid_t file) error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_int * @@ -4550,7 +4549,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_int_2 * @@ -4678,7 +4677,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_float * @@ -4791,7 +4790,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_float_2 * @@ -4920,7 +4919,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_double * @@ -5033,7 +5032,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_scaleoffset_double_2 * @@ -5163,7 +5162,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_multiopen * @@ -5230,7 +5229,7 @@ test_multiopen (hid_t file) return -1; } - + /*------------------------------------------------------------------------- * Function: test_types * @@ -5337,7 +5336,7 @@ const H5Z_class2_t H5Z_CAN_APPLY_TEST[1] = {{ filter_bogus, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: test_can_apply * @@ -5518,7 +5517,7 @@ const H5Z_class2_t H5Z_CAN_APPLY_TEST2[1] = {{ filter_bogus3, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: test_can_apply2 * @@ -5667,7 +5666,7 @@ error: } /* end test_can_apply2() */ - + /*------------------------------------------------------------------------- * Function: test_can_apply_szip * @@ -5872,7 +5871,7 @@ const H5Z_class2_t H5Z_SET_LOCAL_TEST[1] = {{ filter_bogus2, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: test_set_local * @@ -6137,7 +6136,7 @@ error: return -1; } /* end test_set_local() */ - + /*------------------------------------------------------------------------- * Function: test_compare_dcpl * @@ -6222,7 +6221,7 @@ error: return -1; } /* end test_compare_dcpl() */ - + /*------------------------------------------------------------------------- * Function: test_copy_dcpl * @@ -6354,7 +6353,7 @@ error: return -1; } /* end test_copy_dcpl() */ - + /*------------------------------------------------------------------------- * Function: test_filter_delete * @@ -6481,7 +6480,7 @@ error: } /* end test_filter_delete() */ - + /*------------------------------------------------------------------------- * Function: auxread_fdata * @@ -6565,7 +6564,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_filters_endianess * @@ -6635,7 +6634,7 @@ error: return -1; } /* end test_filters_endianess() */ - + /*------------------------------------------------------------------------- * Function: test_zero_dims * @@ -6799,7 +6798,7 @@ error: return -1; } /* end test_zero_dims() */ - + /*------------------------------------------------------------------------- * Function: test_missing_chunk * @@ -6991,7 +6990,7 @@ error: return -1; } /* end test_missing_chunk() */ - + /*------------------------------------------------------------------------- * Function: test_random_chunks_real * @@ -7359,7 +7358,7 @@ error: return -1; } /* end test_random_chunks_real() */ - + /*------------------------------------------------------------------------- * Function: test_random_chunks * @@ -7419,7 +7418,7 @@ const H5Z_class1_t H5Z_DEPREC[1] = {{ filter_bogus, /* The actual filter function */ }}; - + /*------------------------------------------------------------------------- * Function: test_deprec * @@ -7610,7 +7609,7 @@ test_deprec(hid_t file) } /* end test_deprec() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ - + /*------------------------------------------------------------------------- * Function: test_huge_chunks * @@ -7722,7 +7721,7 @@ error: return -1; } /* end test_huge_chunks() */ - + /*------------------------------------------------------------------------- * Function: test_chunk_cache * @@ -7930,7 +7929,7 @@ error: return -1; } /* end test_chunk_cache() */ - + /*------------------------------------------------------------------------- * Function: test_big_chunks_bypass_cache * @@ -8223,7 +8222,7 @@ error: return -1; } /* end test_big_chunks_bypass_cache() */ - + /*------------------------------------------------------------------------- * Function: test_chunk_fast * @@ -8570,7 +8569,7 @@ error: return -1; } /* end test_chunk_fast() */ - + /*------------------------------------------------------------------------- * Function: test_reopen_chunk_fast * @@ -8693,7 +8692,7 @@ error: return -1; } /* end test_reopen_chunk_fast() */ - + /*------------------------------------------------------------------------- * Function: test_chunk_fast_bug1 * @@ -8815,7 +8814,7 @@ const H5Z_class2_t H5Z_EXPAND[1] = {{ /* Global "expansion factor" for filter_expand() routine */ static size_t filter_expand_factor_g = 0; - + /*------------------------------------------------------------------------- * Function: filter_expand * @@ -8864,7 +8863,7 @@ filter_expand(unsigned int flags, size_t H5_ATTR_UNUSED cd_nelmts, return ret_value; } /* end filter_expand() */ - + /*------------------------------------------------------------------------- * Function: test_chunk_expand * @@ -9260,7 +9259,7 @@ error: return -1; } /* end test_chunk_expand() */ - + /*------------------------------------------------------------------------- * Function: test_fixed_array * @@ -9679,7 +9678,7 @@ error: return -1; } /* end test_fixed_array() */ - + /*------------------------------------------------------------------------- * Function: test_single_chunk * @@ -9943,7 +9942,7 @@ error: return -1; } /* end test_single_chunk() */ - + /*------------------------------------------------------------------------- * * test_idx_compatible(): @@ -10156,7 +10155,7 @@ error: return -1; } /* test_unfiltered_edge_chunks */ - + /*------------------------------------------------------------------------- * Function: test_large_chunk_shrink * @@ -10271,7 +10270,7 @@ error: return -1; } /* end test_large_chunk_shrink() */ - + /*------------------------------------------------------------------------- * Function: test_zero_dim_dset * @@ -10364,7 +10363,7 @@ error: return -1; } /* end test_zero_dim_dset() */ - + /*------------------------------------------------------------------------- * Function: test_swmr_non_latest * @@ -10613,7 +10612,7 @@ error: return -1; } /* test_swmr_non_latest() */ - + /*------------------------------------------------------------------------- * Function: test_earray_hdr_fd * @@ -10733,7 +10732,7 @@ error: return -1; } /* test_earray_hdr_fd() */ - + /*------------------------------------------------------------------------- * Function: test_farray_hdr_fd * @@ -10853,7 +10852,7 @@ error: return -1; } /* test_farray_hdr_fd() */ - + /*------------------------------------------------------------------------- * Function: test_bt2_hdr_fd * @@ -10973,7 +10972,7 @@ error: return -1; } /* test_bt2_hdr_fd() */ - + /*------------------------------------------------------------------------- * Function: test_storage_size * @@ -11367,7 +11366,7 @@ error: return -1; } /* end test_storage_size() */ - + /*------------------------------------------------------------------------- * Function: test_power2up * @@ -11458,7 +11457,7 @@ error: return -1; } /* end test_power2up() */ - + /*------------------------------------------------------------------------- * Function: test_scatter * @@ -11776,7 +11775,7 @@ error: return -1; } /* end test_scatter() */ - + /*------------------------------------------------------------------------- * Function: test_gather * @@ -12138,7 +12137,7 @@ error: return -1; } /* end test_gather() */ - + /*------------------------------------------------------------------------- * Function: test_scatter_error * @@ -12341,7 +12340,7 @@ error: return -1; } /* end test_scatter_error() */ - + /*------------------------------------------------------------------------- * Function: test_gather_error * @@ -12868,7 +12867,7 @@ error: return -1; } /* test_compact_open_close_dirty() */ - + /*------------------------------------------------------------------------- * Function: test_versionbounds * @@ -12940,7 +12939,7 @@ test_versionbounds() /* Loop through all the combinations of low/high library format bounds */ /* Create a source file and a dataset in it. Create a virtual file and - virtual dataset. Creation of virtual dataset should only succeed in + virtual dataset. Creation of virtual dataset should only succeed in H5F_LIBVER_V110 */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { @@ -13021,7 +13020,7 @@ test_versionbounds() return -1; } /* test_versionbounds() */ - + /*------------------------------------------------------------------------- * Function: main * diff --git a/test/gen_cross.c b/test/gen_cross.c index cf3fc35..f7a1938 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -26,7 +26,6 @@ * worth keeping around for now. */ -#include <stdio.h> #include "h5test.h" #define H5FILE_NAME "data.h5" @@ -79,7 +78,7 @@ int create_szip_dsets_float(hid_t fid, hid_t fsid, hid_t msid); int create_shuffle_dsets_float(hid_t fid, hid_t fsid, hid_t msid); int create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid); - + /*------------------------------------------------------------------------- * Function: create_normal_dset * @@ -108,8 +107,8 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid) * Data and output buffer initialization. */ for (j = 0; j < NX; j++) { - for (i = 0; i < NY; i++) - data[j][i] = ((float)(i + j + 1)) / 3; + for (i = 0; i < NY; i++) + data[j][i] = ((float)(i + j + 1)) / 3; } /* * 1/3 2/3 3/3 4/3 5/3 6/3 @@ -143,7 +142,7 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid) if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) TEST_ERROR - /* + /* * Close dataset */ if(H5Dclose(dataset) < 0) @@ -163,7 +162,7 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid) if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, msid, fsid, H5P_DEFAULT, data) < 0) TEST_ERROR - /* + /* * Close dataset */ if(H5Dclose(dataset) < 0) @@ -186,7 +185,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dsets_float * @@ -277,7 +276,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dsets_double * @@ -307,8 +306,8 @@ create_scale_offset_dsets_double(hid_t fid, hid_t fsid, hid_t msid) * Data and output buffer initialization. */ for (j = 0; j < NX; j++) { - for (i = 0; i < NY; i++) - data[j][i] = ((double)(i + j + 1))/3; + for (i = 0; i < NY; i++) + data[j][i] = ((double)(i + j + 1))/3; } /* @@ -368,7 +367,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dset_char * @@ -467,7 +466,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dset_short * @@ -566,7 +565,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dset_int * @@ -596,8 +595,8 @@ create_scale_offset_dsets_int(hid_t fid, hid_t fsid, hid_t msid) * Data and output buffer initialization. */ for (j = 0; j < NX; j++) { - for (i = 0; i < NY; i++) - data[j][i] = i + j; + for (i = 0; i < NY; i++) + data[j][i] = i + j; } /* * 0 1 2 3 4 5 @@ -665,7 +664,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_scale_offset_dset_long_long * @@ -765,7 +764,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_fletcher_dsets_float * @@ -856,7 +855,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_deflate_dsets_float * @@ -957,7 +956,7 @@ error: } #ifdef H5_HAVE_FILTER_SZIP - + /*------------------------------------------------------------------------- * Function: create_szip_dsets_float * @@ -1049,7 +1048,7 @@ error: } #endif /* H5_HAVE_FILTER_SZIP */ - + /*------------------------------------------------------------------------- * Function: create_shuffle_dsets_float * @@ -1140,7 +1139,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: create_nbit_dsets_float * @@ -1225,7 +1224,7 @@ create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid) TEST_ERROR /* Now create a dataset with a big-endian type */ - if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) + if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) TEST_ERROR if((dataset = H5Dcreate2(fid, DATASETNAME23, datatype, fsid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) @@ -1252,7 +1251,7 @@ error: return -1; } - + /*------------------------------------------------------------------------- * Function: main * diff --git a/test/gheap.c b/test/gheap.c index 7564afa..110255b 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -15,14 +15,12 @@ * Programmer: Robb Matzke <matzke@llnl.gov> * Tuesday, March 31, 1998 * - * Purpose: Tests the global heap. The global heap is the set of all - * collections but the collections are not related to one - * another by anything that appears in the file format. + * Purpose: Tests the global heap. The global heap is the set of all + * collections but the collections are not related to one + * another by anything that appears in the file format. */ #include "h5test.h" -#include "H5private.h" #include "H5ACprivate.h" -#include "H5Eprivate.h" #include "H5Fprivate.h" #include "H5Gprivate.h" #include "H5HGprivate.h" @@ -56,18 +54,18 @@ const char *FILENAME[] = { NULL }; - + /*------------------------------------------------------------------------- - * Function: test_1 + * Function: test_1 * - * Purpose: Writes a sequence of objects to the global heap where each - * object is larger than the one before. + * Purpose: Writes a sequence of objects to the global heap where each + * object is larger than the one before. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Modifications: @@ -77,16 +75,16 @@ const char *FILENAME[] = { static int test_1 (hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - H5HG_t *obj = NULL; - uint8_t out[GHEAP_TEST_NOBJS]; - uint8_t in[GHEAP_TEST_NOBJS]; - size_t u; - size_t size; - herr_t status; - int nerrors = 0; - char filename[1024]; + hid_t file = -1; + H5F_t *f = NULL; + H5HG_t *obj = NULL; + uint8_t out[GHEAP_TEST_NOBJS]; + uint8_t in[GHEAP_TEST_NOBJS]; + size_t u; + size_t size; + herr_t status; + int nerrors = 0; + char filename[1024]; TESTING("monotonically increasing lengths"); @@ -97,11 +95,11 @@ test_1 (hid_t fapl) /* Open a clean file */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { - H5_FAILED(); - puts(" Unable to create file"); - goto error; + H5_FAILED(); + puts(" Unable to create file"); + goto error; } /* @@ -110,37 +108,37 @@ test_1 (hid_t fapl) * be monotonically increasing. */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - size = u + 1; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - status = H5HG_insert(f, H5AC_ind_read_dxpl_id, size, out, obj + u); - if(status < 0) { - H5_FAILED(); - puts(" Unable to insert object into global heap"); - nerrors++; - } else if(u && H5F_addr_gt(obj[u - 1].addr, obj[u].addr)) { - H5_FAILED(); - puts(" Collection addresses are not monotonically increasing"); - nerrors++; - } + size = u + 1; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + status = H5HG_insert(f, H5AC_ind_read_dxpl_id, size, out, obj + u); + if(status < 0) { + H5_FAILED(); + puts(" Unable to insert object into global heap"); + nerrors++; + } else if(u && H5F_addr_gt(obj[u - 1].addr, obj[u].addr)) { + H5_FAILED(); + puts(" Collection addresses are not monotonically increasing"); + nerrors++; + } } /* * Now try to read each object back. */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - size = u + 1; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - if(NULL == H5HG_read(f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) { - H5_FAILED(); - puts(" Unable to read object"); - nerrors++; - } else if(HDmemcmp(in, out, size)) { - H5_FAILED(); - puts(" Value read doesn't match value written"); - nerrors++; - } + size = u + 1; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + if(NULL == H5HG_read(f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) { + H5_FAILED(); + puts(" Unable to read object"); + nerrors++; + } else if(HDmemcmp(in, out, size)) { + H5_FAILED(); + puts(" Value read doesn't match value written"); + nerrors++; + } } /* Release buffer */ @@ -155,25 +153,25 @@ test_1 (hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); return MAX(1, nerrors); } - + /*------------------------------------------------------------------------- - * Function: test_2 + * Function: test_2 * - * Purpose: Writes a sequence of objects to the global heap where each - * object is smaller than the one before. + * Purpose: Writes a sequence of objects to the global heap where each + * object is smaller than the one before. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Modifications: @@ -183,15 +181,15 @@ error: static int test_2 (hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - H5HG_t *obj = NULL; - uint8_t out[GHEAP_TEST_NOBJS]; - uint8_t in[GHEAP_TEST_NOBJS]; - size_t u; - size_t size; - int nerrors = 0; - char filename[1024]; + hid_t file = -1; + H5F_t *f = NULL; + H5HG_t *obj = NULL; + uint8_t out[GHEAP_TEST_NOBJS]; + uint8_t in[GHEAP_TEST_NOBJS]; + size_t u; + size_t size; + int nerrors = 0; + char filename[1024]; TESTING("monotonically decreasing lengths"); @@ -202,43 +200,43 @@ test_2 (hid_t fapl) /* Open a clean file */ h5_fixname(FILENAME[1], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { - H5_FAILED(); - puts(" Unable to create file"); - goto error; + H5_FAILED(); + puts(" Unable to create file"); + goto error; } /* * Write the objects, monotonically decreasing in length. */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - size = GHEAP_TEST_NOBJS - u; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - if (H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u) < 0) { - H5_FAILED(); - puts(" Unable to insert object into global heap"); - nerrors++; - } + size = GHEAP_TEST_NOBJS - u; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + if (H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u) < 0) { + H5_FAILED(); + puts(" Unable to insert object into global heap"); + nerrors++; + } } /* * Now try to read each object back. */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - size = GHEAP_TEST_NOBJS - u; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - if (NULL==H5HG_read (f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) { - H5_FAILED(); - puts(" Unable to read object"); - nerrors++; - } else if (memcmp (in, out, size)) { - H5_FAILED(); - puts(" Value read doesn't match value written"); - nerrors++; - } + size = GHEAP_TEST_NOBJS - u; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + if (NULL==H5HG_read (f, H5AC_ind_read_dxpl_id, obj + u, in, NULL)) { + H5_FAILED(); + puts(" Unable to read object"); + nerrors++; + } else if (memcmp (in, out, size)) { + H5_FAILED(); + puts(" Value read doesn't match value written"); + nerrors++; + } } /* Release buffer */ @@ -253,25 +251,25 @@ test_2 (hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); return MAX(1, nerrors); } - + /*------------------------------------------------------------------------- - * Function: test_3 + * Function: test_3 * - * Purpose: Creates a few global heap objects and then removes them all. - * The collection should also be removed. + * Purpose: Creates a few global heap objects and then removes them all. + * The collection should also be removed. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Modifications: @@ -281,15 +279,15 @@ test_2 (hid_t fapl) static int test_3 (hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - H5HG_t *obj = NULL; - uint8_t out[GHEAP_TEST_NOBJS]; - size_t u; - size_t size; - herr_t status; - int nerrors = 0; - char filename[1024]; + hid_t file = -1; + H5F_t *f = NULL; + H5HG_t *obj = NULL; + uint8_t out[GHEAP_TEST_NOBJS]; + size_t u; + size_t size; + herr_t status; + int nerrors = 0; + char filename[1024]; TESTING("complete object removal"); @@ -300,34 +298,34 @@ test_3 (hid_t fapl) /* Open a clean file */ h5_fixname(FILENAME[2], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { - H5_FAILED(); - puts(" Unable to create file"); - goto error; + H5_FAILED(); + puts(" Unable to create file"); + goto error; } /* Create some stuff */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - size = u % 30 + 100; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u); - if (status<0) { - H5_FAILED(); - puts(" Unable to insert object into global heap"); - nerrors++; - } + size = u % 30 + 100; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u); + if (status<0) { + H5_FAILED(); + puts(" Unable to insert object into global heap"); + nerrors++; + } } /* Remove everything */ for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u); - if (status<0) { - H5_FAILED(); - puts(" Unable to remove object"); - nerrors++; - } + status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u); + if (status<0) { + H5_FAILED(); + puts(" Unable to remove object"); + nerrors++; + } } /* Release buffer */ @@ -342,26 +340,26 @@ test_3 (hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); return MAX(1, nerrors); } - + /*------------------------------------------------------------------------- - * Function: test_4 + * Function: test_4 * - * Purpose: Tests the H5HG_remove() feature by writing lots of objects - * and occassionally removing some. When we're done they're all - * removed. + * Purpose: Tests the H5HG_remove() feature by writing lots of objects + * and occassionally removing some. When we're done they're all + * removed. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Modifications: @@ -371,15 +369,15 @@ test_3 (hid_t fapl) static int test_4 (hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - H5HG_t *obj = NULL; - uint8_t out[GHEAP_TEST_NOBJS]; - size_t u; - size_t size; - herr_t status; - int nerrors = 0; - char filename[1024]; + hid_t file = -1; + H5F_t *f = NULL; + H5HG_t *obj = NULL; + uint8_t out[GHEAP_TEST_NOBJS]; + size_t u; + size_t size; + herr_t status; + int nerrors = 0; + char filename[1024]; TESTING("partial object removal"); @@ -390,40 +388,40 @@ test_4 (hid_t fapl) /* Open a clean file */ h5_fixname(FILENAME[3], fapl, filename, sizeof filename); if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; if(NULL == (f = (H5F_t *)H5I_object(file))) { - H5_FAILED(); - puts(" Unable to create file"); - goto error; + H5_FAILED(); + puts(" Unable to create file"); + goto error; } for(u = 0; u < GHEAP_TEST_NOBJS; u++) { - /* Insert */ - size = u % 30 + 100; - HDmemset(out, (int)('A' + u % 26), size); - H5Eclear2(H5E_DEFAULT); - status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u); - if (status<0) { - H5_FAILED(); - puts(" Unable to insert object into global heap"); - nerrors++; - } - - /* - * Remove every third one beginning with the second, but after the - * next one has already been inserted. That is, insert A, B, C; - * remove B, insert D, E, F; remove E; etc. - */ - if(1 == (u % 3)) { - H5Eclear2(H5E_DEFAULT); - status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u - 1); - if (status<0) { - H5_FAILED(); - puts(" Unable to remove object"); - nerrors++; - } - HDmemset(obj + u - 1, 0, sizeof *obj); - } + /* Insert */ + size = u % 30 + 100; + HDmemset(out, (int)('A' + u % 26), size); + H5Eclear2(H5E_DEFAULT); + status = H5HG_insert (f, H5AC_ind_read_dxpl_id, size, out, obj + u); + if (status<0) { + H5_FAILED(); + puts(" Unable to insert object into global heap"); + nerrors++; + } + + /* + * Remove every third one beginning with the second, but after the + * next one has already been inserted. That is, insert A, B, C; + * remove B, insert D, E, F; remove E; etc. + */ + if(1 == (u % 3)) { + H5Eclear2(H5E_DEFAULT); + status = H5HG_remove (f, H5AC_ind_read_dxpl_id, obj + u - 1); + if (status<0) { + H5_FAILED(); + puts(" Unable to remove object"); + nerrors++; + } + HDmemset(obj + u - 1, 0, sizeof *obj); + } } /* Release buffer */ @@ -438,27 +436,27 @@ test_4 (hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); return MAX(1, nerrors); } - + /*------------------------------------------------------------------------- - * Function: test_ooo_indices + * Function: test_ooo_indices * - * Purpose: Tests that indices can be stored out of order. This can + * Purpose: Tests that indices can be stored out of order. This can * happen when the indices "wrap around" due to many * insertions and deletions (for example, from rewriting a * VL dataset). * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: number of errors + * Failure: number of errors * - * Programmer: Neil Fortner + * Programmer: Neil Fortner * Monday, October 26, 2009 * * Modifications: @@ -468,13 +466,13 @@ test_4 (hid_t fapl) static int test_ooo_indices(hid_t fapl) { - hid_t file = -1; - H5F_t *f = NULL; - unsigned i, j; - H5HG_t *obj = NULL; - herr_t status; - int nerrors=0; - char filename[1024]; + hid_t file = -1; + H5F_t *f = NULL; + unsigned i, j; + H5HG_t *obj = NULL; + herr_t status; + int nerrors=0; + char filename[1024]; TESTING("out of order indices"); @@ -552,24 +550,24 @@ test_ooo_indices(hid_t fapl) error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; if(obj) HDfree(obj); return MAX(1, nerrors); } /* end test_ooo_indices */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Tests global heap. + * Purpose: Tests global heap. * - * Return: Success: zero + * Return: Success: zero * - * Failure: non-zero + * Failure: non-zero * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Tuesday, March 31, 1998 * * Modifications: @@ -579,8 +577,8 @@ test_ooo_indices(hid_t fapl) int main (void) { - int nerrors=0; - hid_t fapl; + int nerrors=0; + hid_t fapl; h5_reset(); fapl = h5_fileaccess(); diff --git a/test/h5test.h b/test/h5test.h index ce5c64d..8e87192 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -20,8 +20,13 @@ #ifndef _H5TEST_H #define _H5TEST_H +/* + * Include required headers. This file tests internal library functions, + * so we include the private headers here. + */ #include "hdf5.h" #include "H5private.h" +#include "H5Eprivate.h" /* * Predefined test verbosity levels. diff --git a/test/hyperslab.c b/test/hyperslab.c index c28d872..feb96bd 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -11,110 +11,108 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke <matzke@llnl.gov> - * Friday, October 10, 1997 +/* Programmer: Robb Matzke <matzke@llnl.gov> + * Friday, October 10, 1997 * - * Purpose: Hyperslab operations are rather complex, so this file - * attempts to test them extensively so we can be relatively - * sure they really work. We only test 1d, 2d, and 3d cases - * because testing general dimensionalities would require us to - * rewrite much of the hyperslab stuff. + * Purpose: Hyperslab operations are rather complex, so this file + * attempts to test them extensively so we can be relatively + * sure they really work. We only test 1d, 2d, and 3d cases + * because testing general dimensionalities would require us to + * rewrite much of the hyperslab stuff. */ #include "h5test.h" -#include "H5private.h" -#include "H5Eprivate.h" #include "H5VMprivate.h" -#define TEST_SMALL 0x0001 -#define TEST_MEDIUM 0x0002 +#define TEST_SMALL 0x0001 +#define TEST_MEDIUM 0x0002 -#define VARIABLE_SRC 0 -#define VARIABLE_DST 1 -#define VARIABLE_BOTH 2 +#define VARIABLE_SRC 0 +#define VARIABLE_DST 1 +#define VARIABLE_BOTH 2 #define ARRAY_FILL_SIZE 4 #define ARRAY_OFFSET_NDIMS 3 - + /*------------------------------------------------------------------------- - * Function: init_full + * Function: init_full * - * Purpose: Initialize full array. + * Purpose: Initialize full array. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * *------------------------------------------------------------------------- */ static unsigned init_full(uint8_t *array, size_t nx, size_t ny, size_t nz) { - uint8_t acc = 128; - unsigned total = 0; - size_t i, j, k; + uint8_t acc = 128; + unsigned total = 0; + size_t i, j, k; for(i = 0; i < nx; i++) - for(j = 0; j < ny; j++) - for(k = 0; k < nz; k++) { - total += acc; - *array = acc; - acc++; - array++; - } /* end for */ + for(j = 0; j < ny; j++) + for(k = 0; k < nz; k++) { + total += acc; + *array = acc; + acc++; + array++; + } /* end for */ return total; } /* end init_full() */ - + /*------------------------------------------------------------------------- - * Function: print_array + * Function: print_array * - * Purpose: Prints the values in an array + * Purpose: Prints the values in an array * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * *------------------------------------------------------------------------- */ static void print_array(uint8_t *array, size_t nx, size_t ny, size_t nz) { - size_t i, j, k; + size_t i, j, k; for(i = 0; i < nx; i++) { - if(nz > 1) - printf("i=%lu:\n", (unsigned long)i); - else - printf("%03lu:", (unsigned long)i); - - for(j = 0; j < ny; j++) { - if(nz > 1) - printf("%03lu:", (unsigned long)j); - for(k = 0; k < nz; k++) - printf(" %3d", *array++); - if(nz > 1) - printf("\n"); - } /* end for */ - printf("\n"); + if(nz > 1) + printf("i=%lu:\n", (unsigned long)i); + else + printf("%03lu:", (unsigned long)i); + + for(j = 0; j < ny; j++) { + if(nz > 1) + printf("%03lu:", (unsigned long)j); + for(k = 0; k < nz; k++) + printf(" %3d", *array++); + if(nz > 1) + printf("\n"); + } /* end for */ + printf("\n"); } /* end for */ } /* end print_array() */ - + /*------------------------------------------------------------------------- - * Function: print_ref + * Function: print_ref * - * Purpose: Prints the reference value + * Purpose: Prints the reference value * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: + * Failure: * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * *------------------------------------------------------------------------- */ @@ -131,37 +129,37 @@ print_ref(size_t nx, size_t ny, size_t nz) } /* end if */ } /* end print_ref() */ - + /*------------------------------------------------------------------------- - * Function: test_fill + * Function: test_fill * - * Purpose: Tests the H5VM_hyper_fill() function. + * Purpose: Tests the H5VM_hyper_fill() function. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Saturday, October 11, 1997 + * Programmer: Robb Matzke + * Saturday, October 11, 1997 * *------------------------------------------------------------------------- */ static herr_t test_fill(size_t nx, size_t ny, size_t nz, - size_t di, size_t dj, size_t dk, - size_t ddx, size_t ddy, size_t ddz) + size_t di, size_t dj, size_t dk, + size_t ddx, size_t ddy, size_t ddz) { - uint8_t *dst = NULL; /*destination array */ - hsize_t hs_size[3]; /*hyperslab size */ - hsize_t dst_size[3]; /*destination total size */ + uint8_t *dst = NULL; /*destination array */ + hsize_t hs_size[3]; /*hyperslab size */ + hsize_t dst_size[3]; /*destination total size */ hsize_t dst_offset[3]; /*offset of hyperslab in dest */ - unsigned ref_value; /*reference value */ - unsigned acc; /*accumulator */ - size_t i, j, k, dx, dy, dz; /*counters */ + unsigned ref_value; /*reference value */ + unsigned acc; /*accumulator */ + size_t i, j, k, dx, dy, dz; /*counters */ size_t u, v, w; - unsigned ndims; /*hyperslab dimensionality */ - char dim[64], s[256]; /*temp string */ - unsigned fill_value; /*fill value */ + unsigned ndims; /*hyperslab dimensionality */ + char dim[64], s[256]; /*temp string */ + unsigned fill_value; /*fill value */ /* * Dimensionality. @@ -190,7 +188,7 @@ test_fill(size_t nx, size_t ny, size_t nz, /* Allocate array */ if(NULL == (dst = (uint8_t *)HDcalloc((size_t)1, nx * ny * nz))) TEST_ERROR - + init_full(dst, nx, ny, nz); for(i = 0; i < nx; i += di) { @@ -279,52 +277,52 @@ error: return FAIL; } /* end test_fill() */ - + /*------------------------------------------------------------------------- - * Function: test_copy + * Function: test_copy * - * Purpose: Tests H5VM_hyper_copy(). + * Purpose: Tests H5VM_hyper_copy(). * - * The NX, NY, and NZ arguments are the size for the source and - * destination arrays. You may pass zero for NZ or for NY and - * NZ to test the 2-d and 1-d cases respectively. + * The NX, NY, and NZ arguments are the size for the source and + * destination arrays. You may pass zero for NZ or for NY and + * NZ to test the 2-d and 1-d cases respectively. * - * A hyperslab is copied from/to (depending on MODE) various - * places in SRC and DST beginning at 0,0,0 and increasing - * location by DI,DJ,DK in the x, y, and z directions. + * A hyperslab is copied from/to (depending on MODE) various + * places in SRC and DST beginning at 0,0,0 and increasing + * location by DI,DJ,DK in the x, y, and z directions. * - * For each hyperslab location, various sizes of hyperslabs are - * tried beginning with 1x1x1 and increasing the size in each - * dimension by DDX,DDY,DDZ. + * For each hyperslab location, various sizes of hyperslabs are + * tried beginning with 1x1x1 and increasing the size in each + * dimension by DDX,DDY,DDZ. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * *------------------------------------------------------------------------- */ static herr_t test_copy(int mode, - size_t nx, size_t ny, size_t nz, - size_t di, size_t dj, size_t dk, - size_t ddx, size_t ddy, size_t ddz) + size_t nx, size_t ny, size_t nz, + size_t di, size_t dj, size_t dk, + size_t ddx, size_t ddy, size_t ddz) { - uint8_t *src = NULL; /*source array */ - uint8_t *dst = NULL; /*destination array */ - hsize_t hs_size[3]; /*hyperslab size */ - hsize_t dst_size[3]; /*destination total size */ - hsize_t src_size[3]; /*source total size */ - hsize_t dst_offset[3]; /*offset of hyperslab in dest */ + uint8_t *src = NULL; /*source array */ + uint8_t *dst = NULL; /*destination array */ + hsize_t hs_size[3]; /*hyperslab size */ + hsize_t dst_size[3]; /*destination total size */ + hsize_t src_size[3]; /*source total size */ + hsize_t dst_offset[3]; /*offset of hyperslab in dest */ hsize_t src_offset[3]; /*offset of hyperslab in source */ - unsigned ref_value; /*reference value */ - unsigned acc; /*accumulator */ - hsize_t i, j, k, dx, dy, dz; /*counters */ + unsigned ref_value; /*reference value */ + unsigned acc; /*accumulator */ + hsize_t i, j, k, dx, dy, dz; /*counters */ hsize_t u, v, w; - unsigned ndims; /*hyperslab dimensionality */ - char dim[64], s[256]; /*temp string */ + unsigned ndims; /*hyperslab dimensionality */ + char dim[64], s[256]; /*temp string */ const char *sub; /* @@ -493,7 +491,7 @@ test_copy(int mode, (unsigned long)dy, (unsigned long)dz); print_ref(nx, ny, nz); - printf("\n Destination array is:\n"); + printf("\n Destination array is:\n"); print_array(dst, nx, ny, nz); } /* end if */ goto error; @@ -535,7 +533,7 @@ test_copy(int mode, (unsigned long)dy, (unsigned long)dz); print_ref(nx, ny, nz); - printf("\n Destination array is:\n"); + printf("\n Destination array is:\n"); print_array(dst, nx, ny, nz); } /* end if */ goto error; @@ -563,38 +561,38 @@ error: return FAIL; } /* end test_copy() */ - + /*------------------------------------------------------------------------- - * Function: test_multifill + * Function: test_multifill * - * Purpose: Tests the H5VM_stride_copy() function by using it to fill a - * hyperslab by replicating a multi-byte sequence. This might - * be useful to initialize an array of structs with a default - * struct value, or to initialize an array of floating-point - * values with a default bit-pattern. + * Purpose: Tests the H5VM_stride_copy() function by using it to fill a + * hyperslab by replicating a multi-byte sequence. This might + * be useful to initialize an array of structs with a default + * struct value, or to initialize an array of floating-point + * values with a default bit-pattern. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Saturday, October 11, 1997 + * Programmer: Robb Matzke + * Saturday, October 11, 1997 * *------------------------------------------------------------------------- */ static herr_t test_multifill(size_t nx) { - hsize_t size; - hsize_t src_stride; - hsize_t dst_stride; - char s[64]; + hsize_t size; + hsize_t src_stride; + hsize_t dst_stride; + char s[64]; struct a_struct { int left; double mid; int right; } fill, *src = NULL, *dst = NULL; - hsize_t i, j; + hsize_t i, j; printf("%-70s", "Testing multi-byte fill value"); fflush(stdout); @@ -615,7 +613,7 @@ test_multifill(size_t nx) } /* end for */ /* - * Describe the fill value. The zero stride says to read the same thing + * Describe the fill value. The zero stride says to read the same thing * over and over again. */ fill.left = 55555555; @@ -684,32 +682,32 @@ error: return FAIL; } /* end test_multifill() */ - + /*------------------------------------------------------------------------- - * Function: test_endian + * Function: test_endian * - * Purpose: Tests the H5VM_stride_copy() function by using it to copy an - * array of integers and swap the byte ordering from little - * endian to big endian or vice versa depending on the hardware. + * Purpose: Tests the H5VM_stride_copy() function by using it to copy an + * array of integers and swap the byte ordering from little + * endian to big endian or vice versa depending on the hardware. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Saturday, October 11, 1997 + * Programmer: Robb Matzke + * Saturday, October 11, 1997 * *------------------------------------------------------------------------- */ static herr_t test_endian(size_t nx) { - uint8_t *src = NULL; /*source array */ - uint8_t *dst = NULL; /*destination array */ - hssize_t src_stride[2]; /*source strides */ - hssize_t dst_stride[2]; /*destination strides */ - hsize_t size[2]; /*size vector */ - hsize_t i, j; + uint8_t *src = NULL; /*source array */ + uint8_t *dst = NULL; /*destination array */ + hssize_t src_stride[2]; /*source strides */ + hssize_t dst_stride[2]; /*destination strides */ + hsize_t size[2]; /*size vector */ + hsize_t i, j; printf("%-70s", "Testing endian conversion by stride"); fflush(stdout); @@ -747,7 +745,7 @@ test_endian(size_t nx) printf(" i=%lu, j=%lu\n", (unsigned long)i, (unsigned long)j); printf(" Source array is:\n"); print_array(src, nx, (size_t)4, (size_t)1); - printf("\n Result is:\n"); + printf("\n Result is:\n"); print_array(dst, nx, (size_t)4, (size_t)1); } /* end if */ goto error; @@ -771,31 +769,31 @@ error: return FAIL; } /* end test_endian() */ - + /*------------------------------------------------------------------------- - * Function: test_transpose + * Function: test_transpose * - * Purpose: Copy a 2d array from here to there and transpose the elements - * as it's copied. + * Purpose: Copy a 2d array from here to there and transpose the elements + * as it's copied. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Saturday, October 11, 1997 + * Programmer: Robb Matzke + * Saturday, October 11, 1997 * *------------------------------------------------------------------------- */ static herr_t test_transpose(size_t nx, size_t ny) { - int *src = NULL; - int *dst = NULL; - hsize_t src_stride[2], dst_stride[2]; - hsize_t size[2]; - char s[256]; - hsize_t i, j; + int *src = NULL; + int *dst = NULL; + hsize_t src_stride[2], dst_stride[2]; + hsize_t size[2]; + char s[256]; + hsize_t i, j; sprintf(s, "Testing 2d transpose by stride %4lux%-lud", (unsigned long)nx, (unsigned long)ny); @@ -843,7 +841,7 @@ test_transpose(size_t nx, size_t ny) printf(" %6d", src[i * ny + j]); printf("\n"); } /* end for */ - printf("\n Destination is:\n"); + printf("\n Destination is:\n"); for (i = 0; i < ny; i++) { printf("%3lu:", (unsigned long)i); for(j = 0; j < nx; j++) @@ -872,35 +870,35 @@ error: return FAIL; } /* end test_transpose() */ - + /*------------------------------------------------------------------------- - * Function: test_sub_super + * Function: test_sub_super * - * Purpose: Tests H5VM_stride_copy() to reduce the resolution of an image - * by copying half the pixels in the X and Y directions. Then - * we use the small image and duplicate every pixel to result in - * a 2x2 square. + * Purpose: Tests H5VM_stride_copy() to reduce the resolution of an image + * by copying half the pixels in the X and Y directions. Then + * we use the small image and duplicate every pixel to result in + * a 2x2 square. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Monday, October 13, 1997 + * Programmer: Robb Matzke + * Monday, October 13, 1997 * *------------------------------------------------------------------------- */ static herr_t test_sub_super(size_t nx, size_t ny) { - uint8_t *full = NULL; /*original image */ - uint8_t *half = NULL; /*image at 1/2 resolution */ - uint8_t *twice = NULL; /*2x2 pixels */ - hsize_t src_stride[4]; /*source stride info */ - hsize_t dst_stride[4]; /*destination stride info */ - hsize_t size[4]; /*number of sample points */ - hsize_t i, j; - char s[256]; + uint8_t *full = NULL; /*original image */ + uint8_t *half = NULL; /*image at 1/2 resolution */ + uint8_t *twice = NULL; /*2x2 pixels */ + hsize_t src_stride[4]; /*source stride info */ + hsize_t dst_stride[4]; /*destination stride info */ + hsize_t size[4]; /*number of sample points */ + hsize_t i, j; + char s[256]; sprintf(s, "Testing image sampling %4lux%-4lu to %4lux%-4lu ", (unsigned long)(2 * nx), (unsigned long)(2 * ny), @@ -942,7 +940,7 @@ test_sub_super(size_t nx, size_t ny) (unsigned long)i, (unsigned long)j); printf(" full is:\n"); print_array(full, 2 * nx, 2 * ny, (size_t)1); - printf("\n half is:\n"); + printf("\n half is:\n"); print_array(half, nx, ny, (size_t)1); } /* end if */ goto error; @@ -1005,7 +1003,7 @@ test_sub_super(size_t nx, size_t ny) AT(); printf(" %s\n Half is:\n", s); print_array(half, nx, ny, (size_t)1); - printf("\n Twice is:\n"); + printf("\n Twice is:\n"); print_array(twice, 2 * nx, 2 * ny, (size_t)1); } /* end if */ goto error; @@ -1032,20 +1030,20 @@ error: return FAIL; } /* test_sub_super() */ - + /*------------------------------------------------------------------------- - * Function: test_array_fill + * Function: test_array_fill * - * Purpose: Tests H5VM_array_fill routine by copying a multibyte value + * Purpose: Tests H5VM_array_fill routine by copying a multibyte value * (an array of ints, in our case) into all the elements of an * array. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Quincey Koziol - * Monday, April 21, 2003 + * Programmer: Quincey Koziol + * Monday, April 21, 2003 * *------------------------------------------------------------------------- */ @@ -1054,8 +1052,8 @@ test_array_fill(size_t lo, size_t hi) { int *dst = NULL; /* Destination */ int src[ARRAY_FILL_SIZE]; /* Source to duplicate */ - size_t u, v, w; /* Local index variables */ - char s[256]; + size_t u, v, w; /* Local index variables */ + char s[256]; sprintf(s, "array filling %4lu-%-4lu elements", (unsigned long)lo,(unsigned long)hi); TESTING(s); @@ -1093,20 +1091,20 @@ error: return FAIL; } /* end test_array_fill() */ - + /*------------------------------------------------------------------------- - * Function: test_array_offset_n_calc + * Function: test_array_offset_n_calc * - * Purpose: Tests H5VM_array_offset and H5VM_array_calc routines by comparing + * Purpose: Tests H5VM_array_offset and H5VM_array_calc routines by comparing * computed array offsets against calculated ones and then going * back to the coordinates from the offset and checking those. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Quincey Koziol - * Monday, April 21, 2003 + * Programmer: Quincey Koziol + * Monday, April 21, 2003 * *------------------------------------------------------------------------- */ @@ -1116,11 +1114,11 @@ test_array_offset_n_calc(size_t n, size_t x, size_t y, size_t z) hsize_t *a = NULL; hsize_t *temp_a; /* Array for stored calculated offsets */ hsize_t off; /* Offset in array */ - size_t u, v, w; /* Local index variables */ + size_t u, v, w; /* Local index variables */ hsize_t dims[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates of array to check */ hsize_t coords[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates to check offset of */ hsize_t new_coords[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates of offset */ - char s[256]; + char s[256]; sprintf(s, "array offset %4lux%4lux%4lu elements", (unsigned long)z,(unsigned long)y,(unsigned long)x); TESTING(s); @@ -1178,29 +1176,29 @@ error: return FAIL; } /* end test_array_offset_n_calc() */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Test various hyperslab operations. Give the words - * `small' and/or `medium' on the command line or only `small' - * is assumed. + * Purpose: Test various hyperslab operations. Give the words + * `small' and/or `medium' on the command line or only `small' + * is assumed. * - * Return: Success: exit(EXIT_SUCCESS) + * Return: Success: exit(EXIT_SUCCESS) * - * Failure: exit(EXIT_FAILURE) + * Failure: exit(EXIT_FAILURE) * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * *------------------------------------------------------------------------- */ int main(int argc, char *argv[]) { - herr_t status; - int nerrors = 0; - unsigned size_of_test; + herr_t status; + int nerrors = 0; + unsigned size_of_test; /* Parse arguments or assume `small' & `medium' */ if(1 == argc) diff --git a/test/istore.c b/test/istore.c index c401e87..f100fe4 100644 --- a/test/istore.c +++ b/test/istore.c @@ -11,24 +11,22 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* Programmer: Robb Matzke <matzke@llnl.gov> - * Wednesday, October 15, 1997 +/* Programmer: Robb Matzke <matzke@llnl.gov> + * Wednesday, October 15, 1997 * - * Purpose: Tests various aspects of indexed raw data storage. + * Purpose: Tests various aspects of indexed raw data storage. */ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #include "h5test.h" -#include "H5private.h" + #include "H5Dprivate.h" -#include "H5Eprivate.h" #include "H5Iprivate.h" #include "H5Pprivate.h" #include "H5Fpkg.h" #include "H5Gprivate.h" #include "H5Oprivate.h" -#include "H5Pprivate.h" #include "H5VMprivate.h" const char *FILENAME[] = { @@ -37,9 +35,9 @@ const char *FILENAME[] = { }; -#define TEST_SMALL 0x0001 -#define TEST_MEDIUM 0x0002 -#define TEST_LARGE 0x0004 +#define TEST_SMALL 0x0001 +#define TEST_MEDIUM 0x0002 +#define TEST_LARGE 0x0004 /* The datatype of the dataset operated on by this test */ #define TEST_DATATYPE H5T_NATIVE_UCHAR @@ -50,19 +48,19 @@ const char *FILENAME[] = { hsize_t chunk_dims[H5O_LAYOUT_NDIMS]; hsize_t zero[H5O_LAYOUT_NDIMS]; - + /*------------------------------------------------------------------------- - * Function: is_sparse + * Function: is_sparse * - * Purpose: Determines if the file system of the current working - * directory supports holes. + * Purpose: Determines if the file system of the current working + * directory supports holes. * - * Return: Success: Non-zero if holes are supported; zero - * otherwise. + * Return: Success: Non-zero if holes are supported; zero + * otherwise. * - * Failure: zero + * Failure: zero * - * Programmer: Robb Matzke + * Programmer: Robb Matzke * Wednesday, July 15, 1998 * *------------------------------------------------------------------------- @@ -70,8 +68,8 @@ hsize_t zero[H5O_LAYOUT_NDIMS]; static int is_sparse(void) { - int fd; - h5_stat_t sb; + int fd; + h5_stat_t sb; if ((fd = HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, H5_POSIX_CREATE_MODE_RW)) < 0) return 0; if (HDlseek(fd, (off_t)(1024*1024), SEEK_SET)!=1024*1024) return 0; @@ -86,16 +84,16 @@ is_sparse(void) #endif } - + /*------------------------------------------------------------------------- - * Function: print_array + * Function: print_array * - * Purpose: Prints the values in an array + * Purpose: Prints the values in an array * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * Friday, October 10, 1997 + * Programmer: Robb Matzke + * Friday, October 10, 1997 * * Modifications: * @@ -104,41 +102,41 @@ is_sparse(void) static void print_array(uint8_t *array, size_t nx, size_t ny, size_t nz) { - size_t i, j, k; + size_t i, j, k; for (i = 0; i < nx; i++) { - if (nz > 1) { - fprintf(stderr,"i=%lu:\n", (unsigned long)i); - } else { - fprintf(stderr,"%03lu:", (unsigned long)i); - } - - for (j = 0; j < ny; j++) { - if (nz > 1) - fprintf(stderr,"%03lu:", (unsigned long)j); - for (k = 0; k < nz; k++) { - fprintf(stderr," %3d", *array++); - } - if (nz > 1) - fprintf(stderr,"\n"); - } - fprintf(stderr,"\n"); + if (nz > 1) { + fprintf(stderr,"i=%lu:\n", (unsigned long)i); + } else { + fprintf(stderr,"%03lu:", (unsigned long)i); + } + + for (j = 0; j < ny; j++) { + if (nz > 1) + fprintf(stderr,"%03lu:", (unsigned long)j); + for (k = 0; k < nz; k++) { + fprintf(stderr," %3d", *array++); + } + if (nz > 1) + fprintf(stderr,"\n"); + } + fprintf(stderr,"\n"); } } - + /*------------------------------------------------------------------------- - * Function: new_object + * Function: new_object * - * Purpose: Creates a new object that refers to a indexed storage of raw - * data. No raw data is stored. + * Purpose: Creates a new object that refers to a indexed storage of raw + * data. No raw data is stored. * - * Return: Success: ID of dataset + * Return: Success: ID of dataset * - * Failure: -1 + * Failure: -1 * - * Programmer: Robb Matzke - * Wednesday, October 15, 1997 + * Programmer: Robb Matzke + * Wednesday, October 15, 1997 * * Modifications: * Converted to use datasets instead of directly messing with @@ -182,19 +180,19 @@ error: return -1; } - + /*------------------------------------------------------------------------- - * Function: test_create + * Function: test_create * - * Purpose: Creates a named object that refers to indexed storage of raw - * data. No raw data is stored. + * Purpose: Creates a named object that refers to indexed storage of raw + * data. No raw data is stored. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Wednesday, October 15, 1997 + * Programmer: Robb Matzke + * Wednesday, October 15, 1997 * * Modifications: * @@ -217,9 +215,9 @@ test_create(hid_t f, const char *prefix) dims[u] = my_chunk_dims[u] = 2; /* Create chunked dataset of this dimensionality */ - HDsnprintf(name, sizeof name, "%s_%02u", prefix, u); - if ((dataset=new_object(f, name, (int)u, dims, my_chunk_dims)) < 0) - return FAIL; + HDsnprintf(name, sizeof name, "%s_%02u", prefix, u); + if ((dataset=new_object(f, name, (int)u, dims, my_chunk_dims)) < 0) + return FAIL; /* Close dataset created */ if(H5Dclose(dataset) < 0) @@ -230,20 +228,20 @@ test_create(hid_t f, const char *prefix) return SUCCEED; } - + /*------------------------------------------------------------------------- - * Function: test_extend + * Function: test_extend * - * Purpose: Creates an empty object and then writes to it in such a way - * as to always extend the object's domain without creating - * holes and without causing the object to become concave. + * Purpose: Creates an empty object and then writes to it in such a way + * as to always extend the object's domain without creating + * holes and without causing the object to become concave. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Wednesday, October 15, 1997 + * Programmer: Robb Matzke + * Wednesday, October 15, 1997 * * Modifications: * @@ -251,35 +249,35 @@ test_create(hid_t f, const char *prefix) */ static herr_t test_extend(hid_t f, const char *prefix, - size_t nx, size_t ny, size_t nz) + size_t nx, size_t ny, size_t nz) { hid_t dataset; /* Dataset ID */ hid_t fspace; /* Dataset's file dataspace */ hid_t mspace; /* Dataset's memory dataspace */ - size_t i, j, k, ctr; - int ndims; - uint8_t *buf = NULL, *check = NULL, *whole = NULL; - char dims[64], s[256], name[256]; - hsize_t offset[3]; - hsize_t max_corner[3]; - hsize_t size[3]; - hsize_t whole_size[3]; - hsize_t nelmts; + size_t i, j, k, ctr; + int ndims; + uint8_t *buf = NULL, *check = NULL, *whole = NULL; + char dims[64], s[256], name[256]; + hsize_t offset[3]; + hsize_t max_corner[3]; + hsize_t size[3]; + hsize_t whole_size[3]; + hsize_t nelmts; if (!nz) { - if (!ny) { - ndims = 1; - ny = nz = 1; - sprintf(dims, "%lu", (unsigned long) nx); - } else { - ndims = 2; - nz = 1; - sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny); - } + if (!ny) { + ndims = 1; + ny = nz = 1; + sprintf(dims, "%lu", (unsigned long) nx); } else { - ndims = 3; - sprintf(dims, "%lux%lux%lu", - (unsigned long) nx, (unsigned long) ny, (unsigned long) nz); + ndims = 2; + nz = 1; + sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny); + } + } else { + ndims = 3; + sprintf(dims, "%lux%lux%lu", + (unsigned long) nx, (unsigned long) ny, (unsigned long) nz); } sprintf(s, "istore extend: %s", dims); @@ -298,57 +296,57 @@ test_extend(hid_t f, const char *prefix, /* Build the new empty object */ sprintf(name, "%s_%s", prefix, dims); if ((dataset=new_object(f, name, ndims, whole_size, whole_size)) < 0) { - fprintf(stderr," Cannot create %u-d object `%s'\n", ndims, name); - goto error; + fprintf(stderr," Cannot create %u-d object `%s'\n", ndims, name); + goto error; } /* Get dataset's dataspace */ if((fspace=H5Dget_space(dataset)) < 0) TEST_ERROR; for (ctr = 0; - H5VM_vector_lt_u((unsigned)ndims, max_corner, whole_size); - ctr++) { - - /* Size and location */ - if (0 == ctr) { - offset[0] = offset[1] = offset[2] = 0; - size[0] = size[1] = size[2] = 1; - nelmts = 1; - } else { - for (i=0, nelmts=1; i<(size_t)ndims; i++) { - if (ctr % (size_t)ndims == i) { - offset[i] = max_corner[i]; - size[i] = MIN(1, whole_size[i] - offset[i]); - } else { - offset[i] = 0; - size[i] = max_corner[i]; - } - nelmts *= size[i]; - } - } + H5VM_vector_lt_u((unsigned)ndims, max_corner, whole_size); + ctr++) { + + /* Size and location */ + if (0 == ctr) { + offset[0] = offset[1] = offset[2] = 0; + size[0] = size[1] = size[2] = 1; + nelmts = 1; + } else { + for (i=0, nelmts=1; i<(size_t)ndims; i++) { + if (ctr % (size_t)ndims == i) { + offset[i] = max_corner[i]; + size[i] = MIN(1, whole_size[i] - offset[i]); + } else { + offset[i] = 0; + size[i] = max_corner[i]; + } + nelmts *= size[i]; + } + } #if 0 - if (0 == ctr) - fprintf(stderr,"\n"); - fprintf(stderr," Insert: ctr=%lu, corner=(%ld", (unsigned long)ctr, (long)offset[0]); - if (ndims > 1) - fprintf(stderr,",%ld", (long)offset[1]); - if (ndims > 2) - fprintf(stderr,",%ld", (long)offset[2]); - fprintf(stderr,"), size=(%lu", (unsigned long)size[0]); - if (ndims > 1) - fprintf(stderr,",%lu", (unsigned long)size[1]); - if (ndims > 2) - fprintf(stderr,",%lu", (unsigned long)size[2]); - fprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s"); - if (0 == nelmts) - fprintf(stderr," *SKIPPED*"); - fprintf(stderr,"\n"); + if (0 == ctr) + fprintf(stderr,"\n"); + fprintf(stderr," Insert: ctr=%lu, corner=(%ld", (unsigned long)ctr, (long)offset[0]); + if (ndims > 1) + fprintf(stderr,",%ld", (long)offset[1]); + if (ndims > 2) + fprintf(stderr,",%ld", (long)offset[2]); + fprintf(stderr,"), size=(%lu", (unsigned long)size[0]); + if (ndims > 1) + fprintf(stderr,",%lu", (unsigned long)size[1]); + if (ndims > 2) + fprintf(stderr,",%lu", (unsigned long)size[2]); + fprintf(stderr,"), %lu element%s", (unsigned long)nelmts, 1 == nelmts ? "" : "s"); + if (0 == nelmts) + fprintf(stderr," *SKIPPED*"); + fprintf(stderr,"\n"); #endif - /* Fill the source array */ - if (0 == nelmts) continue; - HDmemset(buf, (signed)(128+ctr), (size_t)nelmts); + /* Fill the source array */ + if (0 == nelmts) continue; + HDmemset(buf, (signed)(128+ctr), (size_t)nelmts); /* Create dataspace for selection in memory */ if((mspace=H5Screate_simple(1,&nelmts,NULL)) < 0) TEST_ERROR; @@ -356,72 +354,72 @@ test_extend(hid_t f, const char *prefix, /* Select region in file dataspace */ if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL) < 0) TEST_ERROR; - /* Write to disk */ - if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) { - H5_FAILED(); - fprintf(stderr," Write failed: ctr=%lu\n", (unsigned long)ctr); - goto error; - } - - /* Read from disk */ - HDmemset(check, 0xff, (size_t)nelmts); - if (H5Dread(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, check) < 0) { - H5_FAILED(); - fprintf(stderr," Read failed: ctr=%lu\n", (unsigned long)ctr); - goto error; - } - if (HDmemcmp(buf, check, (size_t)nelmts)) { - H5_FAILED(); - fprintf(stderr," Read check failed: ctr=%lu\n", (unsigned long)ctr); - fprintf(stderr," Wrote:\n"); - print_array(buf, (size_t)size[0], (size_t)size[1], - (size_t)size[2]); - fprintf(stderr," Read:\n"); - print_array(check, (size_t)size[0], (size_t)size[1], - (size_t)size[2]); - goto error; - } + /* Write to disk */ + if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) { + H5_FAILED(); + fprintf(stderr," Write failed: ctr=%lu\n", (unsigned long)ctr); + goto error; + } + + /* Read from disk */ + HDmemset(check, 0xff, (size_t)nelmts); + if (H5Dread(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, check) < 0) { + H5_FAILED(); + fprintf(stderr," Read failed: ctr=%lu\n", (unsigned long)ctr); + goto error; + } + if (HDmemcmp(buf, check, (size_t)nelmts)) { + H5_FAILED(); + fprintf(stderr," Read check failed: ctr=%lu\n", (unsigned long)ctr); + fprintf(stderr," Wrote:\n"); + print_array(buf, (size_t)size[0], (size_t)size[1], + (size_t)size[2]); + fprintf(stderr," Read:\n"); + print_array(check, (size_t)size[0], (size_t)size[1], + (size_t)size[2]); + goto error; + } /* Close memory dataspace */ if(H5Sclose(mspace) < 0) TEST_ERROR; - /* Write to `whole' buffer for later checking */ - H5VM_hyper_copy((unsigned)ndims, size, - whole_size, offset, whole, /*dst*/ - size, H5VM_ZERO, buf); /*src*/ + /* Write to `whole' buffer for later checking */ + H5VM_hyper_copy((unsigned)ndims, size, + whole_size, offset, whole, /*dst*/ + size, H5VM_ZERO, buf); /*src*/ - /* Update max corner */ - for (i=0; i<(size_t)ndims; i++) - max_corner[i] = MAX(max_corner[i], offset[i]+size[i]); + /* Update max corner */ + for (i=0; i<(size_t)ndims; i++) + max_corner[i] = MAX(max_corner[i], offset[i]+size[i]); } /* Now read the entire array back out and check it */ HDmemset(buf, 0xff, nx * ny * nz); if (H5Dread(dataset, TEST_DATATYPE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) { - H5_FAILED(); - fprintf(stderr," Read failed for whole array.\n"); - goto error; + H5_FAILED(); + fprintf(stderr," Read failed for whole array.\n"); + goto error; } for (i=0; i<nx; i++) { - for (j=0; j<ny; j++) { - for (k=0; k<nz; k++) { - if (whole[i*ny*nz + j*nz + k] != buf[i*ny*nz + j*nz + k]) { - H5_FAILED(); - fprintf(stderr," Check failed at i=%lu", (unsigned long)i); - if (ndims > 1) { - fprintf(stderr,", j=%lu", (unsigned long)j); - } - if (ndims > 2) { - fprintf(stderr,", k=%lu", (unsigned long)k); - } - fprintf(stderr,"\n Check array is:\n"); - print_array(whole, nx, ny, nz); - fprintf(stderr," Value read is:\n"); - print_array(buf, nx, ny, nz); - goto error; - } - } - } + for (j=0; j<ny; j++) { + for (k=0; k<nz; k++) { + if (whole[i*ny*nz + j*nz + k] != buf[i*ny*nz + j*nz + k]) { + H5_FAILED(); + fprintf(stderr," Check failed at i=%lu", (unsigned long)i); + if (ndims > 1) { + fprintf(stderr,", j=%lu", (unsigned long)j); + } + if (ndims > 2) { + fprintf(stderr,", k=%lu", (unsigned long)k); + } + fprintf(stderr,"\n Check array is:\n"); + print_array(whole, nx, ny, nz); + fprintf(stderr," Value read is:\n"); + print_array(buf, nx, ny, nz); + goto error; + } + } + } } /* Close dataset's dataspace */ @@ -445,19 +443,19 @@ error: return FAIL; } - + /*------------------------------------------------------------------------- - * Function: test_sparse + * Function: test_sparse * - * Purpose: Creates a sparse matrix consisting of NBLOCKS randomly placed - * blocks each of size NX,NY,NZ. + * Purpose: Creates a sparse matrix consisting of NBLOCKS randomly placed + * blocks each of size NX,NY,NZ. * - * Return: Success: SUCCEED + * Return: Success: SUCCEED * - * Failure: FAIL + * Failure: FAIL * - * Programmer: Robb Matzke - * Wednesday, October 22, 1997 + * Programmer: Robb Matzke + * Wednesday, October 22, 1997 * * Modifications: * @@ -465,34 +463,34 @@ error: */ static herr_t test_sparse(hid_t f, const char *prefix, size_t nblocks, - size_t nx, size_t ny, size_t nz, int skip_test) + size_t nx, size_t ny, size_t nz, int skip_test) { hid_t dataset; /* Dataset ID */ hid_t fspace; /* Dataset's file dataspace */ hid_t mspace; /* Dataset's memory dataspace */ - int ndims; - hsize_t ctr; - char dims[64], s[256], name[256]; - hsize_t offset[3]; - hsize_t size[3], total = 0; - uint8_t *buf = NULL; - hsize_t whole_size[3]; /* Size of dataset's dataspace */ + int ndims; + hsize_t ctr; + char dims[64], s[256], name[256]; + hsize_t offset[3]; + hsize_t size[3], total = 0; + uint8_t *buf = NULL; + hsize_t whole_size[3]; /* Size of dataset's dataspace */ size_t u; /* Local index variable */ if (!nz) { - if (!ny) { - ndims = 1; - ny = nz = 1; - sprintf(dims, "%lu", (unsigned long) nx); - } else { - ndims = 2; - nz = 1; - sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny); - } + if (!ny) { + ndims = 1; + ny = nz = 1; + sprintf(dims, "%lu", (unsigned long) nx); } else { - ndims = 3; - sprintf(dims, "%lux%lux%lu", - (unsigned long) nx, (unsigned long) ny, (unsigned long) nz); + ndims = 2; + nz = 1; + sprintf(dims, "%lux%lu", (unsigned long) nx, (unsigned long) ny); + } + } else { + ndims = 3; + sprintf(dims, "%lux%lux%lu", + (unsigned long) nx, (unsigned long) ny, (unsigned long) nz); } sprintf(s, "istore sparse: %s", dims); @@ -516,8 +514,8 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, /* Build the new empty object */ sprintf(name, "%s_%s", prefix, dims); if ((dataset=new_object(f, name, ndims, whole_size, chunk_dims)) < 0) { - printf(" Cannot create %u-d object `%s'\n", ndims, name); - goto error; + printf(" Cannot create %u-d object `%s'\n", ndims, name); + goto error; } /* Get dataset's dataspace */ @@ -534,29 +532,29 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, /* Select region in file dataspace */ if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL) < 0) TEST_ERROR; - /* write to disk */ - if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) { - H5_FAILED(); - printf(" Write failed: ctr=%lu\n", (unsigned long)ctr); - printf(" offset=(%lu", (unsigned long) (offset[0])); - if (ndims > 1) - printf(",%lu", (unsigned long) (offset[1])); - if (ndims > 2) - printf(",%lu", (unsigned long) (offset[2])); - printf("), size=(%lu", (unsigned long) (size[0])); - if (ndims > 1) - printf(",%lu", (unsigned long) (size[1])); - if (ndims > 2) - printf(",%lu", (unsigned long) (size[2])); - printf(")\n"); - goto error; - } - total += nx * ny * nz; + /* write to disk */ + if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) { + H5_FAILED(); + printf(" Write failed: ctr=%lu\n", (unsigned long)ctr); + printf(" offset=(%lu", (unsigned long) (offset[0])); + if (ndims > 1) + printf(",%lu", (unsigned long) (offset[1])); + if (ndims > 2) + printf(",%lu", (unsigned long) (offset[2])); + printf("), size=(%lu", (unsigned long) (size[0])); + if (ndims > 1) + printf(",%lu", (unsigned long) (size[1])); + if (ndims > 2) + printf(",%lu", (unsigned long) (size[2])); + printf(")\n"); + goto error; + } + total += nx * ny * nz; #if 0 - HDfprintf(stderr,"ctr: ctr=%Zu, total=%Zu\n", ctr, total); + HDfprintf(stderr,"ctr: ctr=%Zu, total=%Zu\n", ctr, total); #endif - /* We don't test reading yet.... */ + /* We don't test reading yet.... */ } /* Close memory dataspace */ @@ -577,18 +575,18 @@ error: return FAIL; } - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Tests indexed storage stuff. + * Purpose: Tests indexed storage stuff. * - * Return: Success: exit(EXIT_SUCCESS) + * Return: Success: exit(EXIT_SUCCESS) * - * Failure: exit(EXIT_FAILURE) + * Failure: exit(EXIT_FAILURE) * - * Programmer: Robb Matzke - * Wednesday, October 15, 1997 + * Programmer: Robb Matzke + * Wednesday, October 15, 1997 * * Modifications: * @@ -597,12 +595,12 @@ error: int main(int argc, char *argv[]) { - hid_t fapl=-1, file=-1, fcpl=-1; - herr_t status; - int nerrors = 0; - unsigned size_of_test; + hid_t fapl=-1, file=-1, fcpl=-1; + herr_t status; + int nerrors = 0; + unsigned size_of_test; unsigned u; /* Local index variable */ - char filename[1024]; + char filename[1024]; int skip_test = 0; int has_sparse_support = 0; @@ -610,7 +608,7 @@ main(int argc, char *argv[]) if (1 == argc) { size_of_test = TEST_SMALL | TEST_MEDIUM | TEST_LARGE; } else { - int i; + int i; for (i = 1, size_of_test = 0; i < argc; i++) { if (!strcmp(argv[i], "small")) { size_of_test |= TEST_SMALL; diff --git a/test/objcopy.c b/test/objcopy.c index c4bcbf3..5d9d426 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -12,13 +12,12 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Peter X. Cao - * May 01, 2005 + * Programmer: Peter X. Cao + * May 01, 2005 * - * Purpose: Test H5Ocopy(). + * Purpose: Test H5Ocopy(). */ -#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" @@ -34,33 +33,33 @@ * This file needs to access private information from the H5S package. * This file also needs to access the dataspace testing code. */ -#define H5S_FRIEND /*suppress error about including H5Spkg */ +#define H5S_FRIEND /*suppress error about including H5Spkg */ #define H5S_TESTING -#include "H5Spkg.h" /* Dataspaces */ +#include "H5Spkg.h" /* Dataspaces */ /* * This file needs to access private information from the H5P package. * This file also needs to access the property list testing code. */ -#define H5P_FRIEND /*suppress error about including H5Ppkg */ +#define H5P_FRIEND /*suppress error about including H5Ppkg */ #define H5P_TESTING -#include "H5Ppkg.h" /* Property Lists */ +#include "H5Ppkg.h" /* Property Lists */ /* * This file needs to access private information from the H5D package. * This file also needs to access the dataset testing code. */ -#define H5D_FRIEND /*suppress error about including H5Dpkg */ +#define H5D_FRIEND /*suppress error about including H5Dpkg */ #define H5D_TESTING -#include "H5Dpkg.h" /* Datasets */ +#include "H5Dpkg.h" /* Datasets */ /* * This file needs to access private information from the H5O package. * This file also needs to access the dataspace testing code. */ -#define H5O_FRIEND /*suppress error about including H5Opkg */ +#define H5O_FRIEND /*suppress error about including H5Opkg */ #define H5O_TESTING -#include "H5Opkg.h" /* Object header */ +#include "H5Opkg.h" /* Object header */ const char *FILENAME[] = { @@ -83,77 +82,77 @@ const char *FILENAME[] = { #define CONFIG_DENSE 16 #define MAX_CONFIGURATION 31 -#define FILE_EXT "objcopy_ext.dat" +#define FILE_EXT "objcopy_ext.dat" /* The fill_old.h5 is generated from gen_old_fill.c in HDF5 'test' directory * for version 1.4(after 1.4.3). To get this data file, simply compile * gen_old_fill.c with HDF5 library (before v1.5) and run it. */ #define FILE_OLD_LAYOUT "fill_old.h5" -#define NAME_DATATYPE_SIMPLE "H5T_NATIVE_INT" -#define NAME_DATATYPE_SIMPLE2 "H5T_NATIVE_INT-2" -#define NAME_DATATYPE_VL "vlen of int" -#define NAME_DATATYPE_VL_VL "vlen of vlen of int" -#define NAME_DATASET_SIMPLE "dataset_simple" +#define NAME_DATATYPE_SIMPLE "H5T_NATIVE_INT" +#define NAME_DATATYPE_SIMPLE2 "H5T_NATIVE_INT-2" +#define NAME_DATATYPE_VL "vlen of int" +#define NAME_DATATYPE_VL_VL "vlen of vlen of int" +#define NAME_DATASET_SIMPLE "dataset_simple" #define NAME_DATASET_SIMPLE2 "dataset_simple_copy" #define NAME_DATASET_SIMPLE3 "dataset_simple_another_copy" -#define NAME_DATASET_COMPOUND "dataset_compound" -#define NAME_DATASET_CHUNKED "dataset_chunked" -#define NAME_DATASET_CHUNKED_SINGLE "dataset_chunked_single" -#define NAME_DATASET_CHUNKED2 "dataset_chunked2" -#define NAME_DATASET_CHUNKED2_SINGLE "dataset_chunked2_single" -#define NAME_DATASET_CHUNKED3 "dataset_chunked3" -#define NAME_DATASET_CHUNKED3_SINGLE "dataset_chunked3_single" -#define NAME_DATASET_CHUNKED4 "dataset_chunked4" -#define NAME_DATASET_CHUNKED4_SINGLE "dataset_chunked4_single" -#define NAME_DATASET_COMPACT "dataset_compact" -#define NAME_DATASET_EXTERNAL "dataset_ext" -#define NAME_DATASET_NAMED_DTYPE "dataset_named_dtype" -#define NAME_DATASET_NAMED_DTYPE2 "dataset_named_dtype2" -#define NAME_DATASET_MULTI_OHDR "dataset_multi_ohdr" -#define NAME_DATASET_MULTI_OHDR2 "dataset_multi_ohdr2" -#define NAME_DATASET_VL "dataset_vl" -#define NAME_DATASET_VL2 "dataset_vl2" -#define NAME_DATASET_VL_VL "dataset_vl_vl" -#define NAME_DATASET_VL_VL2 "dataset_vl_vl2" -#define NAME_DATASET_CMPD_VL "dataset_cmpd_vl" -#define NAME_DATASET_SUB_SUB "/g0/g00/g000/dataset_simple" -#define NAME_GROUP_UNCOPIED "/uncopied" -#define NAME_GROUP_EMPTY "/empty" -#define NAME_GROUP_TOP "/g0" +#define NAME_DATASET_COMPOUND "dataset_compound" +#define NAME_DATASET_CHUNKED "dataset_chunked" +#define NAME_DATASET_CHUNKED_SINGLE "dataset_chunked_single" +#define NAME_DATASET_CHUNKED2 "dataset_chunked2" +#define NAME_DATASET_CHUNKED2_SINGLE "dataset_chunked2_single" +#define NAME_DATASET_CHUNKED3 "dataset_chunked3" +#define NAME_DATASET_CHUNKED3_SINGLE "dataset_chunked3_single" +#define NAME_DATASET_CHUNKED4 "dataset_chunked4" +#define NAME_DATASET_CHUNKED4_SINGLE "dataset_chunked4_single" +#define NAME_DATASET_COMPACT "dataset_compact" +#define NAME_DATASET_EXTERNAL "dataset_ext" +#define NAME_DATASET_NAMED_DTYPE "dataset_named_dtype" +#define NAME_DATASET_NAMED_DTYPE2 "dataset_named_dtype2" +#define NAME_DATASET_MULTI_OHDR "dataset_multi_ohdr" +#define NAME_DATASET_MULTI_OHDR2 "dataset_multi_ohdr2" +#define NAME_DATASET_VL "dataset_vl" +#define NAME_DATASET_VL2 "dataset_vl2" +#define NAME_DATASET_VL_VL "dataset_vl_vl" +#define NAME_DATASET_VL_VL2 "dataset_vl_vl2" +#define NAME_DATASET_CMPD_VL "dataset_cmpd_vl" +#define NAME_DATASET_SUB_SUB "/g0/g00/g000/dataset_simple" +#define NAME_GROUP_UNCOPIED "/uncopied" +#define NAME_GROUP_EMPTY "/empty" +#define NAME_GROUP_TOP "/g0" #define NAME_GROUP_TOP2 "/g1" #define NAME_GROUP_TOP3 "/g2" #define NAME_GROUP_TOP4 "/g3" -#define NAME_GROUP_SUB "/g0/g00" -#define NAME_GROUP_SUB_2 "/g0/g01" -#define NAME_GROUP_SUB_SUB "/g0/g00/g000" -#define NAME_GROUP_SUB_SUB2 "g000" -#define NAME_GROUP_DATASET "/g0/dataset_simple" -#define NAME_GROUP_LINK "/g_links" -#define NAME_GROUP_LINK2 "/g_links2" -#define NAME_GROUP_LOOP "g_loop" -#define NAME_GROUP_LOOP2 "g_loop2" -#define NAME_GROUP_LOOP3 "g_loop3" -#define NAME_GROUP_REF "ref_grp" -#define NAME_LINK_DATASET "/g_links/dataset_simple" -#define NAME_LINK_HARD "/g_links/hard_link_to_dataset_simple" -#define NAME_LINK_SOFT "/g_links/soft_link_to_dataset_simple" -#define NAME_LINK_SOFT2 "/g_links2/soft_link_to_dataset_simple" -#define NAME_LINK_EXTERN "/g_links/external_link_to_dataset_simple" +#define NAME_GROUP_SUB "/g0/g00" +#define NAME_GROUP_SUB_2 "/g0/g01" +#define NAME_GROUP_SUB_SUB "/g0/g00/g000" +#define NAME_GROUP_SUB_SUB2 "g000" +#define NAME_GROUP_DATASET "/g0/dataset_simple" +#define NAME_GROUP_LINK "/g_links" +#define NAME_GROUP_LINK2 "/g_links2" +#define NAME_GROUP_LOOP "g_loop" +#define NAME_GROUP_LOOP2 "g_loop2" +#define NAME_GROUP_LOOP3 "g_loop3" +#define NAME_GROUP_REF "ref_grp" +#define NAME_LINK_DATASET "/g_links/dataset_simple" +#define NAME_LINK_HARD "/g_links/hard_link_to_dataset_simple" +#define NAME_LINK_SOFT "/g_links/soft_link_to_dataset_simple" +#define NAME_LINK_SOFT2 "/g_links2/soft_link_to_dataset_simple" +#define NAME_LINK_EXTERN "/g_links/external_link_to_dataset_simple" #define NAME_LINK_EXTERN2 "/g_links2/external_link_to_dataset_simple" -#define NAME_LINK_SOFT_DANGLE "/g_links/soft_link_to_nowhere" -#define NAME_LINK_SOFT_DANGLE2 "/g_links2/soft_link_to_nowhere" +#define NAME_LINK_SOFT_DANGLE "/g_links/soft_link_to_nowhere" +#define NAME_LINK_SOFT_DANGLE2 "/g_links2/soft_link_to_nowhere" #define NAME_LINK_EXTERN_DANGLE "/g_links/external_link_to_nowhere" #define NAME_LINK_EXTERN_DANGLE2 "/g_links2/external_link_to_nowhere" -#define NAME_OLD_FORMAT "/dset1" +#define NAME_OLD_FORMAT "/dset1" #define NAME_DSET_NULL "DSET_NULL" #define NAME_BUF_SIZE 1024 #define ATTR_NAME_LEN 80 #define DIM_SIZE_1 12 #define DIM_SIZE_2 6 -#define MAX_DIM_SIZE_1 100 -#define MAX_DIM_SIZE_2 80 +#define MAX_DIM_SIZE_1 100 +#define MAX_DIM_SIZE_2 80 #define CHUNK_SIZE_1 5 /* Not an even fraction of dimension sizes, so we test copying partial chunks */ #define CHUNK_SIZE_2 5 #define NUM_SUB_GROUPS 20 @@ -180,7 +179,7 @@ static int compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf); static int compare_groups(hid_t gid, hid_t gid2, hid_t pid, int depth, unsigned copy_flags); -static int +static int compare_idx_type(hid_t fapl, hid_t did, H5D_chunk_index_t new_type, H5D_chunk_index_t old_type); static int @@ -190,7 +189,7 @@ attach_attribute_compound_vlstr(hid_t loc_id); static int compare_attribute_compound_vlstr(hid_t loc, hid_t loc2); - + /*------------------------------------------------------------------------- * Function: addr_insert * @@ -224,7 +223,7 @@ addr_insert(H5O_info_t *oi) idtab_g.obj[n] = oi->addr; } /* end addr_insert() */ - + /*------------------------------------------------------------------------- * Function: addr_lookup * @@ -253,7 +252,7 @@ addr_lookup(H5O_info_t *oi) return FALSE; } /* end addr_lookup() */ - + /*------------------------------------------------------------------------- * Function: addr_reset * @@ -275,7 +274,7 @@ addr_reset(void) idtab_g.nalloc = idtab_g.nobjs = 0; } /* end addr_reset() */ - + /*------------------------------------------------------------------------- * Function: attach_ref_attr * @@ -336,7 +335,7 @@ error: return(-1); } - + /*------------------------------------------------------------------------- * Function: attach_reg_ref_attr * @@ -413,7 +412,7 @@ error: return(-1); } - + /*------------------------------------------------------------------------- * Function: create_reg_ref_dataset * @@ -508,7 +507,7 @@ error: return(-1); } - + /*------------------------------------------------------------------------- * Function: attach_attribute_vl * @@ -570,13 +569,13 @@ done: } /* end of attach_attribute_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_attach_attributes * * Purpose: Attach NUM_ATTRIBUTES attributes to the object to be copied * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Peter Cao * Friday, September 30, 2005 @@ -644,13 +643,13 @@ done: return ret_value; } - + /*------------------------------------------------------------------------- * Function: test_copy_attach_paired_attributes * * Purpose: Attach NUM_ATTRIBUTES attributes to a pair of objects to be copied * - * Return: Non-negative on success/Negative on failure + * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol * Tuesday, November 1, 2005 @@ -713,7 +712,7 @@ done: return -1; } /* end test_copy_attach_paired_attributes() */ - + /*------------------------------------------------------------------------- * Function: compare_attribute * @@ -844,18 +843,18 @@ error: return FALSE; } /* end compare_attribute() */ - + /*------------------------------------------------------------------------- * Function: compare_std_attributes * * Purpose: Compare "standard" attributes on two objects to check that they are equal * - * Return: TRUE if objects have same attributes/FALSE if they are different + * Return: TRUE if objects have same attributes/FALSE if they are different * * Programmer: Quincey Koziol * Monday, October 31, 2005 * - * Note: This isn't very general, the attributes are assumed to be + * Note: This isn't very general, the attributes are assumed to be * those written in test_copy_attach_attributes(). * * Modifier: Peter Cao @@ -916,19 +915,19 @@ compare_std_attributes(hid_t oid, hid_t oid2, hid_t pid) error: H5E_BEGIN_TRY { - H5Aclose(aid2); - H5Aclose(aid); + H5Aclose(aid2); + H5Aclose(aid); } H5E_END_TRY; return FALSE; } /* end compare_std_attributes() */ - + /*------------------------------------------------------------------------- * Function: compare_data * * Purpose: Compare two buffers of data to check that they are equal * - * Return: TRUE if buffer are equal/FALSE if they are different + * Return: TRUE if buffer are equal/FALSE if they are different * * Programmer: Quincey Koziol * Monday, November 21, 2005 @@ -1189,13 +1188,13 @@ error: return FALSE; } /* end compare_data() */ - + /*------------------------------------------------------------------------- * Function: compare_datasets * * Purpose: Compare two datasets to check that they are equal * - * Return: TRUE if datasets are equal/FALSE if they are different + * Return: TRUE if datasets are equal/FALSE if they are different * * Programmer: Quincey Koziol * Tuesday, October 25, 2005 @@ -1352,23 +1351,23 @@ error: HDfree(rbuf); if(rbuf2) HDfree(rbuf2); - H5Pclose(dcpl2); - H5Pclose(dcpl); - H5Sclose(sid2); - H5Sclose(sid); - H5Tclose(tid2); - H5Tclose(tid); + H5Pclose(dcpl2); + H5Pclose(dcpl); + H5Sclose(sid2); + H5Sclose(sid); + H5Tclose(tid2); + H5Tclose(tid); } H5E_END_TRY; return FALSE; } /* end compare_datasets() */ - + /*------------------------------------------------------------------------- * Function: compare_groups * * Purpose: Compare two groups to check that they are "equal" * - * Return: TRUE if group are equal/FALSE if they are different + * Return: TRUE if group are equal/FALSE if they are different * * Programmer: Quincey Koziol * Monday, October 31, 2005 @@ -1518,48 +1517,48 @@ error: return FALSE; } /* end compare_groups() */ - + /*------------------------------------------------------------------------- * Function: compare_idx_type * * Purpose: If using new format, the index array type should be NEW_TYPE - * If not, the index array type should be OLD_TYPE + * If not, the index array type should be OLD_TYPE * - * Return: TRUE if the index type retrieved for the dataset DID is - * as expected - * FALSE if not + * Return: TRUE if the index type retrieved for the dataset DID is + * as expected + * FALSE if not * * Programmer: Vailin Choi; August 2009 * *------------------------------------------------------------------------- */ -static int +static int compare_idx_type(hid_t fapl, hid_t did, H5D_chunk_index_t new_type, H5D_chunk_index_t old_type) { H5D_chunk_index_t idx_type; /* Dataset chunk index type */ H5F_libver_t low; /* File format low bound */ /* Get the chunk index type */ - if(H5D__layout_idx_type_test(did, &idx_type) < 0) - FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(did, &idx_type) < 0) + FAIL_STACK_ERROR /* Check if we are using the latest version of the format */ - if(H5Pget_libver_bounds(fapl, &low, NULL) < 0) - FAIL_STACK_ERROR + if(H5Pget_libver_bounds(fapl, &low, NULL) < 0) + FAIL_STACK_ERROR /* Verify index type */ if(low == H5F_LIBVER_LATEST) { - if(idx_type != new_type) - TEST_ERROR - } else if(idx_type != old_type) - TEST_ERROR + if(idx_type != new_type) + TEST_ERROR + } else if(idx_type != old_type) + TEST_ERROR return TRUE; error: return FALSE; } /* compare_idx_type() */ - + /*------------------------------------------------------------------------- * Function: test_copy_named_datatype * @@ -1580,8 +1579,8 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - char src_filename[NAME_BUF_SIZE]; - char dst_filename[NAME_BUF_SIZE]; + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; TESTING("H5Ocopy(): named datatype"); @@ -1646,15 +1645,15 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d error: H5E_BEGIN_TRY { - H5Tclose(tid2); - H5Tclose(tid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid2); + H5Tclose(tid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_named_datatype */ - + /*------------------------------------------------------------------------- * Function: test_copy_named_datatype_vl * @@ -1673,8 +1672,8 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_ { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - char src_filename[NAME_BUF_SIZE]; - char dst_filename[NAME_BUF_SIZE]; + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; TESTING("H5Ocopy(): named vlen datatype"); @@ -1739,15 +1738,15 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_ error: H5E_BEGIN_TRY { - H5Tclose(tid2); - H5Tclose(tid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid2); + H5Tclose(tid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_named_datatype_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_named_datatype_vl_vl * @@ -1766,8 +1765,8 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - char src_filename[NAME_BUF_SIZE]; - char dst_filename[NAME_BUF_SIZE]; + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; TESTING("H5Ocopy(): named nested vlen datatype"); @@ -1838,15 +1837,15 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h error: H5E_BEGIN_TRY { - H5Tclose(tid2); - H5Tclose(tid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid2); + H5Tclose(tid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_named_datatype_vl_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_named_datatype_attr_self * @@ -1989,7 +1988,7 @@ error: return 1; } /* end test_copy_named_datatype_attr_self */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_simple * @@ -2098,16 +2097,16 @@ test_copy_dataset_simple(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_simple */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_versionbounds * @@ -2274,18 +2273,18 @@ test_copy_dataset_versionbounds(hid_t fcpl_src, hid_t fapl_src) error: H5E_BEGIN_TRY { - H5Dclose(did_dst); - H5Dclose(did_src); - H5Sclose(sid); - H5Pclose(fapl_dst); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did_dst); + H5Dclose(did_src); + H5Sclose(sid); + H5Pclose(fapl_dst); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_versionbounds */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_simple_samefile * @@ -2383,22 +2382,22 @@ test_copy_dataset_simple_samefile(hid_t fcpl, hid_t fapl) error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid); } H5E_END_TRY; return 1; } /* end test_copy_dataset_simple_samefile */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_simple_empty * * Purpose: Create a simple dataset in SRC file and copy it to DST file * (Note: dataset has no data) * - * Note: The parameter "test_open" is added to test for H5Ocopy when + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -2501,16 +2500,16 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_simple_empty */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compound * @@ -2632,17 +2631,17 @@ test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compound */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked * @@ -2724,10 +2723,10 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * Create 1-D dataset: chunked, non-filterd, with data - * dims=max dims=chunk dims - * H5D_ALLOC_TIME_INC (default) + * dims=max dims=chunk dims + * H5D_ALLOC_TIME_INC (default) */ /* create 1-D dataspace */ if((sid = H5Screate_simple(1, dim1d, dim1d)) < 0) TEST_ERROR @@ -2799,9 +2798,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * Create 2-D dataset: chunked, non-filterd, with data, dims=chunk dims, - * H5D_ALLOC_TIME_INC (default) + * H5D_ALLOC_TIME_INC (default) */ /* create 2-D dataspace */ @@ -2823,9 +2822,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * Create 2-D dataset: chunked, non-filterd, with data, dims=chunk dims, - * H5D_ALLOC_TIME_EARLY + * H5D_ALLOC_TIME_EARLY */ if(H5Pset_alloc_time(pid, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR @@ -2847,9 +2846,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* close chunk plist */ if(H5Pclose(pid) < 0) TEST_ERROR - /* + /* * Create 2-D dataset: chunked, non-filterd, with data, dims=max dims=chunk dims, - * H5D_ALLOC_TIME_LATE + * H5D_ALLOC_TIME_LATE */ /* create 2-D dataspace */ if((sid = H5Screate_simple(2, dim2d, dim2d)) < 0) TEST_ERROR @@ -2908,7 +2907,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf1d) != TRUE) TEST_ERROR @@ -2928,7 +2927,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf1d) != TRUE) TEST_ERROR @@ -2947,7 +2946,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR @@ -2967,7 +2966,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR @@ -2986,7 +2985,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR @@ -3005,7 +3004,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR @@ -3024,7 +3023,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, buf2d) != TRUE) TEST_ERROR @@ -3046,17 +3045,17 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_empty * @@ -3124,9 +3123,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 1-D dataset: chunked, empty, non-filtered, - * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default) + * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default) */ /* Set 1-D dataspace dimensions */ @@ -3194,9 +3193,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 2-D dataset: chunked, empty, non-filtered, - * dims=chunk dims, H5D_ALLOC_TIME_INC (default) + * dims=chunk dims, H5D_ALLOC_TIME_INC (default) */ /* Set 2-D dataspace dimensions */ @@ -3219,9 +3218,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 2-D dataset: chunked, empty, non-filtered, dims=chunk dims - * H5D_ALLOC_TIME_EARLY + * H5D_ALLOC_TIME_EARLY */ /* Set allocation time to early */ if(H5Pset_alloc_time(pid, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR @@ -3241,9 +3240,9 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* - * create 2-D dataset: chunked, empty, non-filtered, - * dims=max dims=chunk dims, H5D_ALLOC_TIME_LATE + /* + * create 2-D dataset: chunked, empty, non-filtered, + * dims=max dims=chunk dims, H5D_ALLOC_TIME_LATE */ /* Set 2-D dataspace dimensions */ @@ -3305,7 +3304,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3324,7 +3323,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3343,7 +3342,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3362,7 +3361,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3382,7 +3381,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3402,7 +3401,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3421,7 +3420,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3443,17 +3442,17 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_empty */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_sparse * @@ -3677,7 +3676,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_EARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3697,7 +3696,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_BT2, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3717,7 +3716,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3737,7 +3736,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Check if the array index type is correct */ if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_NONE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -3760,17 +3759,17 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_sparse */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compressed * @@ -3867,9 +3866,9 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 2-D dataset: chunked, filtered, with data - * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default) + * dims=max dims=chunk dims, H5D_ALLOC_TIME_INC(default) */ /* create dataspace */ if((sid = H5Screate_simple(2, dim2d, dim2d)) < 0) TEST_ERROR @@ -3891,9 +3890,9 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 2-D dataset: chunked, filtered, with data - * dims=chunk dims, H5D_ALLOC_TIME_EARLY + * dims=chunk dims, H5D_ALLOC_TIME_EARLY */ /* create dataspace */ if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR @@ -3919,9 +3918,9 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid /* close the dataset */ if(H5Dclose(did) < 0) TEST_ERROR - /* + /* * create 2-D dataset: chunked, filtered, with data - * dims=chunk dims, H5D_ALLOC_TIME_LATE + * dims=chunk dims, H5D_ALLOC_TIME_LATE */ /* create dataspace */ if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR @@ -3986,7 +3985,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED, H5P_DEFAULT)) < 0) TEST_ERROR if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -4005,7 +4004,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2, H5P_DEFAULT)) < 0) TEST_ERROR if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_FARRAY, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -4023,7 +4022,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED2_SINGLE, H5P_DEFAULT)) < 0) TEST_ERROR if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -4041,7 +4040,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED3_SINGLE, H5P_DEFAULT)) < 0) TEST_ERROR if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -4059,7 +4058,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid if((did2 = H5Dopen2(fid_dst, NAME_DATASET_CHUNKED4_SINGLE, H5P_DEFAULT)) < 0) TEST_ERROR if(compare_idx_type(src_fapl, did2, H5D_CHUNK_IDX_SINGLE, H5D_CHUNK_IDX_BTREE) != TRUE) - TEST_ERROR + TEST_ERROR /* Check if the datasets are equal */ if(compare_datasets(did, did2, H5P_DEFAULT, NULL) != TRUE) TEST_ERROR @@ -4083,24 +4082,24 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid #ifdef H5_HAVE_FILTER_DEFLATE error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; #endif /* H5_HAVE_FILTER_DEFLATE */ } /* end test_copy_dataset_compressed */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_no_edge_filt * * Purpose: Create a compressed, chunked dataset in SRC file and copy it to DST file * - * Note: The parameter "test_open" is added to test for H5Ocopy when + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -4251,13 +4250,13 @@ error: #endif /* H5_HAVE_FILTER_DEFLATE */ } /* end test_copy_dataset_no_edge_filt */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compact * * Purpose: Create a compact dataset in SRC file and copy it to DST file * - * Note: The parameter "test_open" is added to test for H5Ocopy when + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -4377,17 +4376,17 @@ test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compact */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_external * @@ -4504,17 +4503,17 @@ test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_external */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_named_dtype * @@ -4625,17 +4624,17 @@ test_copy_dataset_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hi error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_named_dtype */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_named_dtype_hier * @@ -4762,18 +4761,18 @@ test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap error: H5E_BEGIN_TRY { - H5Dclose(did); - H5Tclose(tid); - H5Sclose(sid); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did); + H5Tclose(tid); + H5Sclose(sid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_named_dtype_hier */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_named_dtype_hier_outside * @@ -4901,18 +4900,18 @@ test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t error: H5E_BEGIN_TRY { - H5Dclose(did); - H5Tclose(tid); - H5Sclose(sid); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did); + H5Tclose(tid); + H5Sclose(sid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_named_dtype_hier_outside */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_multi_ohdr_chunks * @@ -5023,7 +5022,7 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fa /* close the second dataset */ if(H5Dclose(did2) < 0) TEST_ERROR - } else + } else /* open the group for copy */ if((gid = H5Gopen2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -5050,18 +5049,18 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fa error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_multi_ohdr_chunks */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_attr_named_dtype * @@ -5191,19 +5190,19 @@ test_copy_dataset_attr_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Tclose(tid); - H5Sclose(sid); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Tclose(tid); + H5Sclose(sid); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_attr_named_dtype */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_contig_vl * @@ -5327,19 +5326,19 @@ test_copy_dataset_contig_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_ error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_contig_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_vl * @@ -5510,20 +5509,20 @@ test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Pclose(pid); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Pclose(pid); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compact_vl * @@ -5655,19 +5654,19 @@ test_copy_dataset_compact_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compact_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_attribute_vl * @@ -5773,11 +5772,11 @@ error: H5E_BEGIN_TRY { H5Aclose(aid2); H5Aclose(aid); - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_simple_empty */ @@ -5796,18 +5795,18 @@ error: static int attach_attribute_compound_vlstr(hid_t loc_id) { - hid_t aid = -1; /* Attribute ID */ - hid_t sid = -1; /* Dataspace ID */ - hid_t tid = -1; /* Datatype ID */ - hid_t vl_str_tid = -1; /* Variable length string datatype ID */ - hid_t cmpd_tid = -1; /* Compound datatype ID */ - hsize_t dim1 = 1; /* Dimension size */ - typedef struct { /* Compound structure for the attribute */ + hid_t aid = -1; /* Attribute ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t tid = -1; /* Datatype ID */ + hid_t vl_str_tid = -1; /* Variable length string datatype ID */ + hid_t cmpd_tid = -1; /* Compound datatype ID */ + hsize_t dim1 = 1; /* Dimension size */ + typedef struct { /* Compound structure for the attribute */ int i; char *v; } s1; s1 buf; /* Buffer */ - int ret_value = -1; /* Return value */ + int ret_value = -1; /* Return value */ /* Create dataspace */ if((sid = H5Screate_simple(1, &dim1, NULL)) < 0 ) @@ -5861,7 +5860,7 @@ done: * Function: compare_attribute_compound_vlstr * * Purpose: Compare data of the attributes attached to the two objects. - * The attribute is a compound datatype with a variable length string. + * The attribute is a compound datatype with a variable length string. * * Return: Non-negative on success/Negative on failure * @@ -5872,46 +5871,46 @@ done: static int compare_attribute_compound_vlstr(hid_t loc, hid_t loc2) { - hid_t aid = -1, aid2 = -1; /* Attribute IDs */ - hid_t tid = -1, tid2 = -1; /* Datatype IDs */ - typedef struct { /* Compound structure for the attribute */ - int i; - char *v; + hid_t aid = -1, aid2 = -1; /* Attribute IDs */ + hid_t tid = -1, tid2 = -1; /* Datatype IDs */ + typedef struct { /* Compound structure for the attribute */ + int i; + char *v; } s1; - s1 rbuf; /* Buffer for data read */ - s1 rbuf2; /* Buffer for data read */ - + s1 rbuf; /* Buffer for data read */ + s1 rbuf2; /* Buffer for data read */ + /* Open the attributes attached to the objects */ if((aid = H5Aopen_by_idx(loc, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if((aid2 = H5Aopen_by_idx(loc2, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t)0, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Get the attributes' datatypes */ - if((tid = H5Aget_type(aid)) < 0) - FAIL_STACK_ERROR + if((tid = H5Aget_type(aid)) < 0) + FAIL_STACK_ERROR if((tid2 = H5Aget_type(aid2)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Read the attributes */ if(H5Aread(aid, tid, &rbuf) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Aread(aid2, tid2, &rbuf2) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Compare the attributes' data */ if(rbuf.i != rbuf2.i) - FAIL_STACK_ERROR - if(HDstrlen(rbuf.v) != HDstrlen(rbuf2.v)) - FAIL_STACK_ERROR - if(HDmemcmp(rbuf.v, rbuf2.v, HDstrlen(rbuf.v))) - FAIL_STACK_ERROR + FAIL_STACK_ERROR + if(HDstrlen(rbuf.v) != HDstrlen(rbuf2.v)) + FAIL_STACK_ERROR + if(HDmemcmp(rbuf.v, rbuf2.v, HDstrlen(rbuf.v))) + FAIL_STACK_ERROR /* Close the attributes */ if(H5Aclose(aid) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Aclose(aid2) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR return TRUE; error: @@ -5929,15 +5928,15 @@ error: * Function: test_copy_attribute_compound_vlstr * * Purpose: Create a simple dataset and a group in SRC file. - * Both has an attribute with a compound datatype consisting + * Both has an attribute with a compound datatype consisting * of a variable length string * Copy the dataset and the group to DST file - * This is for HDFFV-7991 + * This is for HDFFV-7991 * * Return: Success: 0 * Failure: number of errors * - * Programmer: + * Programmer: * *------------------------------------------------------------------------- */ @@ -5948,10 +5947,10 @@ test_copy_attribute_compound_vlstr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap hid_t sid = -1; /* Dataspace ID */ hid_t did = -1, did2 = -1; /* Dataset IDs */ hid_t aid = -1, aid2 = -1; /* Attribute IDs */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ hsize_t dim2d[2]; /* Dataset dimensions */ - char src_filename[NAME_BUF_SIZE]; /* Source file name */ - char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ + char src_filename[NAME_BUF_SIZE]; /* Source file name */ + char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ TESTING("H5Ocopy(): attribute with compound datatype consisting of variable length string"); @@ -5964,7 +5963,7 @@ test_copy_attribute_compound_vlstr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap /* create source file */ if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* set dataspace dimensions */ dim2d[0] = DIM_SIZE_1; @@ -5972,103 +5971,103 @@ test_copy_attribute_compound_vlstr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap /* create 2D dataspace */ if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* create 2D int dataset at SRC file */ if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close dataspace */ if(H5Sclose(sid) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* attach an attribute to the dataset */ if(attach_attribute_compound_vlstr(did) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the dataset */ if(H5Dclose(did) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* create a group */ if((gid = H5Gcreate2(fid_src, NAME_GROUP_EMPTY, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* attach attribute to the group */ if(attach_attribute_compound_vlstr(gid) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the group */ if(H5Gclose(gid) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the SRC file */ if(H5Fclose(fid_src) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* open the source file with read-only */ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* create destination file */ if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* copy the dataset from SRC to DST */ if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT, H5P_DEFAULT) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* open the src dataset */ if((did = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* open the destination dataset */ if((did2 = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* compare the data of the attributes attached to the two datasets */ if(compare_attribute_compound_vlstr(did, did2) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the datasets */ if(H5Dclose(did2) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Dclose(did) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Copy the group */ if(H5Ocopy(fid_src, NAME_GROUP_EMPTY, fid_dst, NAME_GROUP_EMPTY, H5P_DEFAULT, H5P_DEFAULT) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Open the src group */ if((gid = H5Gopen2(fid_src, NAME_GROUP_EMPTY, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Open the destination group */ if((gid2 = H5Gopen2(fid_dst, NAME_GROUP_EMPTY, H5P_DEFAULT)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* compare the data of the attributes attached to the two groups */ if(compare_attribute_compound_vlstr(gid, gid2) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the groups */ - if(H5Gclose(gid) < 0) - FAIL_STACK_ERROR - if(H5Gclose(gid2) < 0) - FAIL_STACK_ERROR + if(H5Gclose(gid) < 0) + FAIL_STACK_ERROR + if(H5Gclose(gid2) < 0) + FAIL_STACK_ERROR /* close the SRC file */ if(H5Fclose(fid_src) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* close the DST file */ if(H5Fclose(fid_dst) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR PASSED(); return 0; @@ -6077,18 +6076,18 @@ error: H5E_BEGIN_TRY { H5Aclose(aid2); H5Aclose(aid); - H5Dclose(did2); - H5Dclose(did); - H5Gclose(gid); - H5Gclose(gid2); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Gclose(gid); + H5Gclose(gid2); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_attribute_compound_vlstr() */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compressed_vl * @@ -6232,21 +6231,21 @@ test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, #ifdef H5_HAVE_FILTER_DEFLATE error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); + H5Pclose(pid); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; #endif /* H5_HAVE_FILTER_DEFLATE */ } /* end test_copy_dataset_compressed_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_group_empty * @@ -6333,15 +6332,15 @@ test_copy_group_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_ error: H5E_BEGIN_TRY { - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_group_empty */ - + /*------------------------------------------------------------------------- * Function: test_copy_root_group * @@ -6474,7 +6473,7 @@ error: return 1; } /* end test_copy_root_group */ - + /*------------------------------------------------------------------------- * Function: test_copy_group * @@ -6597,18 +6596,18 @@ test_copy_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) error: H5E_BEGIN_TRY { - H5Sclose(sid); - H5Dclose(did); - H5Gclose(gid_sub); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Sclose(sid); + H5Dclose(did); + H5Gclose(gid_sub); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_group */ - + /*------------------------------------------------------------------------- * Function: test_copy_group_deep * @@ -6739,18 +6738,18 @@ test_copy_group_deep(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f error: H5E_BEGIN_TRY { - H5Sclose(sid); - H5Dclose(did); - H5Gclose(gid_sub); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Sclose(sid); + H5Dclose(did); + H5Gclose(gid_sub); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_group_deep */ - + /*------------------------------------------------------------------------- * Function: test_copy_group_loop * @@ -6850,17 +6849,17 @@ test_copy_group_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_f error: H5E_BEGIN_TRY { - H5Gclose(gid_sub2); - H5Gclose(gid_sub); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Gclose(gid_sub2); + H5Gclose(gid_sub); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_group_loop */ - + /*------------------------------------------------------------------------- * Function: test_copy_group_wide_loop * @@ -6979,17 +6978,17 @@ test_copy_group_wide_loop(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t error: H5E_BEGIN_TRY { - H5Gclose(gid_sub2); - H5Gclose(gid_sub); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Gclose(gid_sub2); + H5Gclose(gid_sub); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_group_wide_loop */ - + /*------------------------------------------------------------------------- * Function: test_copy_group_links * @@ -7237,20 +7236,20 @@ test_copy_group_links(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_ error: H5E_BEGIN_TRY { - H5Sclose(sid); - H5Dclose(did2); - H5Dclose(did); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_ext); - H5Fclose(fid_dst); - H5Fclose(fid_src); - H5Pclose(plid); + H5Sclose(sid); + H5Dclose(did2); + H5Dclose(did); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_ext); + H5Fclose(fid_dst); + H5Fclose(fid_src); + H5Pclose(plid); } H5E_END_TRY; return 1; } /* end test_copy_group_links */ - + /*------------------------------------------------------------------------- * Function: test_copy_soft_link * @@ -7376,17 +7375,17 @@ test_copy_soft_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fa error: H5E_BEGIN_TRY { - H5Sclose(sid); - H5Dclose(did2); - H5Dclose(did); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Sclose(sid); + H5Dclose(did2); + H5Dclose(did); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_soft_link */ - + /*------------------------------------------------------------------------- * Function: test_copy_ext_link * @@ -7510,17 +7509,17 @@ test_copy_ext_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fap error: H5E_BEGIN_TRY { - H5Sclose(sid); - H5Dclose(did2); - H5Dclose(did); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Sclose(sid); + H5Dclose(did2); + H5Dclose(did); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_ext_link */ - + /*------------------------------------------------------------------------- * Function: test_copy_exist * @@ -7620,15 +7619,15 @@ test_copy_exist(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) error: H5E_BEGIN_TRY { - H5Dclose(did); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_exist */ - + /*------------------------------------------------------------------------- * Function: test_copy_path * @@ -7754,17 +7753,17 @@ test_copy_path(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Sclose(sid); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Sclose(sid); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_path */ - + /*------------------------------------------------------------------------- * Function: test_copy_same_file_named_datatype * @@ -7826,21 +7825,21 @@ test_copy_same_file_named_datatype(hid_t fcpl_src, hid_t fapl) error: H5E_BEGIN_TRY { - H5Tclose(tid2); - H5Tclose(tid); - H5Fclose(fid); + H5Tclose(tid2); + H5Tclose(tid); + H5Fclose(fid); } H5E_END_TRY; return 1; } /* end test_copy_same_file_named_datatype */ - + /*------------------------------------------------------------------------- * Function: test_copy_old_layout * * Purpose: Copy dataset that uses the "old" layout version (pre version 3) * format. * - * Note: This test uses the "fill_old.h5" file for convenience, since it + * Note: This test uses the "fill_old.h5" file for convenience, since it * has a dataset with the old layout format. * * Return: Success: 0 @@ -7916,15 +7915,15 @@ test_copy_old_layout(hid_t fcpl_dst, hid_t fapl, hbool_t test_open) error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did2); + H5Dclose(did); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_old_layout */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compact_named_vl * @@ -8065,21 +8064,21 @@ test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap error: H5E_BEGIN_TRY { - H5Pclose(pid); - H5Dclose(did2); - H5Dclose(did); + H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid_copy); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid_copy); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compact_named_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_contig_named_vl * @@ -8212,27 +8211,27 @@ test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid_copy); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid_copy); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_contig_named_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_named_vl * * Purpose: Create a dataset that uses a named variable length datatype * in SRC file and copy it to DST file * - * Note: The parameter "test_open" is added to test for H5Ocopy when + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -8379,21 +8378,21 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap error: H5E_BEGIN_TRY { - H5Pclose(pid); - H5Dclose(did2); - H5Dclose(did); + H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid_copy); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid_copy); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_named_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compressed_named_vl * @@ -8536,21 +8535,21 @@ test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_ error: H5E_BEGIN_TRY { - H5Pclose(pid); - H5Dclose(did2); - H5Dclose(did); + H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid_copy, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid_copy); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid_copy); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compressed_named_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compact_vl_vl * @@ -8699,28 +8698,28 @@ test_copy_dataset_compact_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Pclose(pid); - H5Tclose(tid); - H5Tclose(tid2); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Pclose(pid); + H5Tclose(tid); + H5Tclose(tid2); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compact_vl_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_contig_vl_vl * * Purpose: Create a compact dataset w/nested VLEN datatype * in SRC file and copy it to DST file * - * Note: The parameter "test_open" is added to test for H5Ocopy when + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -8872,21 +8871,21 @@ test_copy_dataset_contig_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, h error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Pclose(pid); - H5Tclose(tid); - H5Tclose(tid2); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Pclose(pid); + H5Tclose(tid); + H5Tclose(tid2); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_contig_vl_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_vl_vl * @@ -8905,7 +8904,7 @@ static int test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ - hid_t tid = -1, tid2=-1; /* Datatype ID */ + hid_t tid = -1, tid2=-1; /* Datatype ID */ hid_t sid = -1; /* Dataspace ID */ hid_t pid = -1; /* Dataset creation property list ID */ hid_t did = -1, did2 = -1; /* Dataset IDs */ @@ -9073,28 +9072,28 @@ test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, error: H5E_BEGIN_TRY { - H5Pclose(pid); - H5Dclose(did2); - H5Dclose(did); + H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid2); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid2); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_vl_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compressed_vl_vl * * Purpose: Create a dataset that uses a named variable length datatype * in SRC file and copy it to DST file * - * Note: The parameter "test_open" is added to test for H5Ocopy when + * Note: The parameter "test_open" is added to test for H5Ocopy when * the dataset is open in the file (HDFFV-7853). * * Return: Success: 0 @@ -9196,7 +9195,7 @@ test_copy_dataset_compressed_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap /* open the source file with read-only */ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR } - + /* create destination file */ if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR @@ -9249,16 +9248,16 @@ test_copy_dataset_compressed_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fap error: H5E_BEGIN_TRY { - H5Pclose(pid); - H5Dclose(did2); - H5Dclose(did); + H5Pclose(pid); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid2, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Tclose(tid); - H5Tclose(tid2); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(dxpl_id); + H5Tclose(tid); + H5Tclose(tid2); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compressed_vl_vl */ @@ -9272,7 +9271,7 @@ typedef struct cmpd_vl_t { double c; } cmpd_vl_t; - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_contig_cmpd_vl * @@ -9405,20 +9404,20 @@ test_copy_dataset_contig_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); H5Pclose(dxpl_id); H5Tclose(tid2); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_contig_cmpd_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_chunked_cmpd_vl * @@ -9558,21 +9557,21 @@ test_copy_dataset_chunked_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); H5Pclose(dxpl_id); H5Pclose(pid); H5Tclose(tid2); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_chunked_cmpd_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_compact_cmpd_vl * @@ -9711,21 +9710,21 @@ test_copy_dataset_compact_cmpd_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl error: H5E_BEGIN_TRY { - H5Dclose(did2); - H5Dclose(did); + H5Dclose(did2); + H5Dclose(did); H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf); - H5Pclose(dxpl_id); - H5Pclose(pid); + H5Pclose(dxpl_id); + H5Pclose(pid); H5Tclose(tid2); - H5Tclose(tid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_compact_cmpd_vl */ - + /*------------------------------------------------------------------------- * Function: test_copy_null_ref * @@ -9887,7 +9886,7 @@ error: return 1; } /* end test_copy_null_ref */ - + /*------------------------------------------------------------------------- * Function: test_copy_null_ref_open * @@ -10070,7 +10069,7 @@ error: return 1; } /* end test_copy_null_ref_open */ - + /*------------------------------------------------------------------------- * Function: test_copy_attr_crt_order * @@ -10192,7 +10191,7 @@ error: return 1; } /* end test_copy_attr_crt_order */ - + /*------------------------------------------------------------------------- * Function: test_copy_committed_datatype_merge * @@ -10429,7 +10428,7 @@ error: return 1; } /* end test_copy_committed_datatype_merge */ - + /*------------------------------------------------------------------------- * Function: test_copy_committed_datatype_merge_same_file * @@ -10701,7 +10700,7 @@ error: } /* end test_copy_committed_datatype_merge_same_file */ - + /*------------------------------------------------------------------------- * Function: test_copy_committed_dt_merge_sugg * @@ -10930,7 +10929,7 @@ error: return 1; } /* end test_copy_committed_dt_merge_sugg */ - + /*------------------------------------------------------------------------- * Function: test_copy_committed_dt_merge_attr * @@ -11123,27 +11122,27 @@ error: #define ROOT_NDT_INT "root_ndt_int" #define GROUP_NDT_SHORT "group_ndt_short" -#define SRC_GRP "src_grp" -#define DST_GRP "dst_grp" -#define DST_GRP2 "dst_grp2" +#define SRC_GRP "src_grp" +#define DST_GRP "dst_grp" +#define DST_GRP2 "dst_grp2" -#define SRC_NDT_SHORT "src_ndt_short" -#define SRC_NDT_INT "src_ndt_int" -#define SRC_NDT_INT2 "src_ndt_int2" -#define SRC_NDT_FLOAT "src_ndt_float" -#define SRC_NDT_DOUBLE "src_ndt_double" +#define SRC_NDT_SHORT "src_ndt_short" +#define SRC_NDT_INT "src_ndt_int" +#define SRC_NDT_INT2 "src_ndt_int2" +#define SRC_NDT_FLOAT "src_ndt_float" +#define SRC_NDT_DOUBLE "src_ndt_double" -#define DST_NDT_SHORT "dst_ndt_short" -#define DST_NDT_INT "dst_ndt_int" -#define DST_NDT_FLOAT "dst_ndt_float" -#define DST_NDT_DOUBLE "dst_ndt_double" +#define DST_NDT_SHORT "dst_ndt_short" +#define DST_NDT_INT "dst_ndt_int" +#define DST_NDT_FLOAT "dst_ndt_float" +#define DST_NDT_DOUBLE "dst_ndt_double" -#define SRC_NDT_DSET "src_ndt_dset" -#define SRC_NDT_DSET2 "src_ndt_dset2" -#define SRC_NDT_DSET3 "src_ndt_dset3" +#define SRC_NDT_DSET "src_ndt_dset" +#define SRC_NDT_DSET2 "src_ndt_dset2" +#define SRC_NDT_DSET3 "src_ndt_dset3" -#define SRC_DSET "src_dset" -#define SRC_DSET1 "src_dset1" +#define SRC_DSET "src_dset" +#define SRC_DSET1 "src_dset1" #define SRC_ATTR "src_attr" @@ -11152,21 +11151,21 @@ error: #define DST_ATTR "dst_attr" #define DST_ATTR2 "dst_attr2" - + /*------------------------------------------------------------------------- * Function: test_copy_cdt_hier_merge * * Purpose: Tests the "merge committed datatypes" feature of H5Ocopy: - * SRC file: - * Create committed datatypes at / and /g0 - * Create datasets with native type and committed datatypes at /g0 - * DST file: - * Create attributes with anonymous committed datatypes at /uncopied + * SRC file: + * Create committed datatypes at / and /g0 + * Create datasets with native type and committed datatypes at /g0 + * DST file: + * Create attributes with anonymous committed datatypes at /uncopied * - * Copy / at SRC to DST - * Copy /g0 at SRC to DST - * Copy the datasets in /g0 at SRC to DST /uncopied - * Verify that committed datatypes are copied and merged correctly + * Copy / at SRC to DST + * Copy /g0 at SRC to DST + * Copy the datasets in /g0 at SRC to DST /uncopied + * Verify that committed datatypes are copied and merged correctly * * Return: Success: 0 * Failure: number of errors @@ -11182,19 +11181,19 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d hid_t tid = -1; /* Datatype ID */ hid_t sid = -1; /* Dataspace ID */ hid_t did = -1; /* Dataset ID */ - hid_t gid = -1; /* Group IDs */ - hid_t f_tid = -1; /* Datatype ID for root group */ - hid_t g_tid = -1; /* Datatype ID for group */ - hid_t anon_tid = -1; /* Anonymous datatype */ - hid_t aid = -1; /* Attribute ID */ + hid_t gid = -1; /* Group IDs */ + hid_t f_tid = -1; /* Datatype ID for root group */ + hid_t g_tid = -1; /* Datatype ID for group */ + hid_t anon_tid = -1; /* Anonymous datatype */ + hid_t aid = -1; /* Attribute ID */ hid_t ocpypl_id = -1; /* Object copy plist ID */ - int i; /* Local index variable */ - hsize_t dim1d[1]; /* dimension sizes */ - int buf[DIM_SIZE_1]; /* Buffer for data */ - haddr_t exp_addr_int, exp_addr_short; /* Expected object addresses */ + int i; /* Local index variable */ + hsize_t dim1d[1]; /* dimension sizes */ + int buf[DIM_SIZE_1]; /* Buffer for data */ + haddr_t exp_addr_int, exp_addr_short; /* Expected object addresses */ H5O_info_t oinfo; /* Object info */ - char src_filename[NAME_BUF_SIZE]; /* Source file name */ - char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ + char src_filename[NAME_BUF_SIZE]; /* Source file name */ + char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ if(reopen) TESTING("H5Ocopy(): hier. of committed datatypes and merging with reopen") @@ -11212,8 +11211,8 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d /* Reset file address checking info */ addr_reset(); - /* - * Populate source file + /* + * Populate source file */ if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR @@ -11271,8 +11270,8 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d /* close the SRC file */ if(H5Fclose(fid_src) < 0) TEST_ERROR - /* - * Populate destination file + /* + * Populate destination file */ if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR @@ -11285,7 +11284,7 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d /* create attribute of anon ndt (short) in /uncopied */ if((aid = H5Acreate2(gid, DST_ATTR_ANON_SHORT, anon_tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR + TEST_ERROR /* close the attribute */ if(H5Aclose(aid) < 0) TEST_ERROR @@ -11299,7 +11298,7 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d /* create attribute of anon ndt (int) in /uncopied */ if((aid = H5Acreate2(gid, DST_ATTR_ANON_INT, anon_tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR + TEST_ERROR /* close the attribute */ if(H5Aclose(aid) < 0) TEST_ERROR @@ -11460,17 +11459,17 @@ test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t d error: H5E_BEGIN_TRY { - H5Tclose(tid); - H5Tclose(f_tid); - H5Tclose(g_tid); - H5Tclose(anon_tid); - H5Pclose(ocpypl_id); - H5Aclose(aid); - H5Dclose(did); - H5Sclose(sid); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Tclose(tid); + H5Tclose(f_tid); + H5Tclose(g_tid); + H5Tclose(anon_tid); + H5Pclose(ocpypl_id); + H5Aclose(aid); + H5Dclose(did); + H5Sclose(sid); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_cdt_hier_merge */ @@ -11480,22 +11479,22 @@ error: * Function: test_copy_cdt_merge_cdt * * Purpose: Tests the "merge committed datatypes" feature of H5Ocopy: - * SRC file: - * Create committed datatype (short) - * Create committed datatype (float) - * Create committed datatype (int), with attribute of ndt int - * Create committed datatype (double), with attribute of anon ndt short - * DST file: - * Create committed datatype (int) - * Create committed datatype (float), with attribute of native int - * Create committed datatype (double), with attribute of anon ndt short - * - * Copy / at SRC to DST - * Verify that committed datatypes are copied and merged correctly - * - * NOTE: - * Comparison of attributes are not implemented yet. - * Further tests will be added in the future. + * SRC file: + * Create committed datatype (short) + * Create committed datatype (float) + * Create committed datatype (int), with attribute of ndt int + * Create committed datatype (double), with attribute of anon ndt short + * DST file: + * Create committed datatype (int) + * Create committed datatype (float), with attribute of native int + * Create committed datatype (double), with attribute of anon ndt short + * + * Copy / at SRC to DST + * Verify that committed datatypes are copied and merged correctly + * + * NOTE: + * Comparison of attributes are not implemented yet. + * Further tests will be added in the future. * * Return: Success: 0 * Failure: number of errors @@ -11510,15 +11509,15 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */ hid_t tid3 = -1, tid4 = -1; /* Datatype IDs */ - hid_t tid5 = -1, tid = -1; /* Datatype IDs */ + hid_t tid5 = -1, tid = -1; /* Datatype IDs */ hid_t sid = -1; /* Dataspace ID */ - hid_t aid = -1; /* Attribute ID */ + hid_t aid = -1; /* Attribute ID */ hid_t ocpypl_id = -1; /* Object copy plist ID */ - hsize_t dim1d[1]; /* dimension sizes */ + hsize_t dim1d[1]; /* dimension sizes */ H5O_info_t oinfo; /* Object info */ - haddr_t exp_addr; /* Expected object addresses */ - char src_filename[NAME_BUF_SIZE]; /* Source file name */ - char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ + haddr_t exp_addr; /* Expected object addresses */ + char src_filename[NAME_BUF_SIZE]; /* Source file name */ + char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ if(reopen) TESTING("H5Ocopy(): merging various committed datatypes with reopen") @@ -11532,8 +11531,8 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds /* Reset file address checking info */ addr_reset(); - /* - * Populate source file + /* + * Populate source file */ if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR @@ -11583,8 +11582,8 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds /* close the SRC file */ if(H5Fclose(fid_src) < 0) TEST_ERROR - /* - * Populate destination file + /* + * Populate destination file */ if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR @@ -11639,8 +11638,8 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds /* copy everything in SRC to DST */ if(H5Ocopy(fid_src, "/", fid_dst, SRC_ROOT_GROUP, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR - /* - * Verification + /* + * Verification */ /* get address of committed datatype: /src_root/src_ndt_double */ if((tid = H5Topen2(fid_dst, "/" SRC_ROOT_GROUP "/" SRC_NDT_DOUBLE, H5P_DEFAULT)) < 0) TEST_ERROR @@ -11704,29 +11703,29 @@ test_copy_cdt_merge_cdt(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t ds error: H5E_BEGIN_TRY { - H5Pclose(ocpypl_id); - H5Tclose(tid); - H5Tclose(tid1); - H5Tclose(tid2); - H5Tclose(tid3); - H5Tclose(tid4); - H5Tclose(tid5); - H5Aclose(aid); - H5Sclose(sid); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Pclose(ocpypl_id); + H5Tclose(tid); + H5Tclose(tid1); + H5Tclose(tid2); + H5Tclose(tid3); + H5Tclose(tid4); + H5Tclose(tid5); + H5Aclose(aid); + H5Sclose(sid); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_cdt_merge_cdt */ - + /*------------------------------------------------------------------------- * Function: test_copy_cdt_merge_suggs * * Purpose: Tests the suggested searching paths feature (H5Padd_merge_committed_dtype_path) - * is correctly applied in merging the committed datatypes. - * + * is correctly applied in merging the committed datatypes. + * * Return: Success: 0 * Failure: number of errors * @@ -11795,7 +11794,7 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Fclose(fid_dst) < 0) TEST_ERROR /* - * Test 1 + * Test 1 */ /* open the source file with read-only */ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR @@ -11831,8 +11830,8 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 2 + /* + * Test 2 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -11864,14 +11863,14 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 3 + /* + * Test 3 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR /* remove "/uncopied/src_ndt_int" from DST file */ - if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_INT, H5P_DEFAULT) < 0) TEST_ERROR /* copy "/src_ndt_int" from SRC file to "/uncopied/src_ndt_int" at DST file */ /* use default ocpypl_id -- without merging and suggestion */ @@ -11880,7 +11879,7 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* copy "/src_ndt_int" from SRC file to "/src_ndt_int2" at DST file */ /* copy with merging and search suggestion: "/uncopied/src_ndt_int" */ if(H5Ocopy(fid_src, SRC_NDT_INT, fid_dst, SRC_NDT_INT2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR - + if(reopen) { /* Reopen file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR @@ -11902,8 +11901,8 @@ test_copy_cdt_merge_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 4 + /* + * Test 4 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -11955,13 +11954,13 @@ error: return 1; } /* end test_copy_cdt_merge_suggs */ - + /*------------------------------------------------------------------------- * Function: test_copy_cdt_merge_dset_suggs * * Purpose: Tests the suggested searching paths feature (H5Padd_merge_committed_dtype_path) - * is correctly applied in merging the committed datatypes of datasets. - * + * is correctly applied in merging the committed datatypes of datasets. + * * Return: Success: 0 * Failure: number of errors * @@ -12056,7 +12055,7 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Sclose(sid) < 0) TEST_ERROR /* - * Test 1 + * Test 1 */ /* open the source file with read-only */ if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR @@ -12094,8 +12093,8 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 2 + /* + * Test 2 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12131,14 +12130,14 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 3 + /* + * Test 3 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR /* remove "/uncopied/src_ndt_dset" */ - if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Ldelete(fid_dst, NAME_GROUP_UNCOPIED "/" SRC_NDT_DSET, H5P_DEFAULT) < 0) TEST_ERROR /* copy "src_ndt_dset" from SRC file to "/uncopied/src_ndt_dset" at DST file */ /* use default ocpypl_id -- without merging and suggestion */ @@ -12147,7 +12146,7 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* copy "src_ndt_dset" from SRC file to "/src_ndt_dset2" at DST file */ /* use merging and suggested searching path: "/uncopied/src_ndt_dset" */ if(H5Ocopy(fid_src, SRC_NDT_DSET, fid_dst, SRC_NDT_DSET2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR - + if(reopen) { /* Reopen file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR @@ -12173,8 +12172,8 @@ test_copy_cdt_merge_dset_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* - * Test 4 + /* + * Test 4 */ /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12232,12 +12231,12 @@ error: return 1; } /* end test_copy_cdt_merge_dset_suggs */ - + /*------------------------------------------------------------------------- * Function: test_copy_cdt_merge_all_suggs * * Purpose: Tests the merging committed datatype + search suggestion feature. - * + * * Return: Success: 0 * Failure: number of errors * @@ -12256,8 +12255,8 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t aid = -1; /* Attribute ID */ hid_t did = -1; /* Dataset ID */ hid_t exp_did = -1; /* Dataset ID */ - hid_t tid_short = -1; /* Datatype ID */ - hid_t exp_tid = -1; /* Expected datatype ID */ + hid_t tid_short = -1; /* Datatype ID */ + hid_t exp_tid = -1; /* Expected datatype ID */ hid_t ocpypl_id = -1; /* Object copy plist ID */ hsize_t dim1d[1]; /* Dataset dimensions */ char src_filename[NAME_BUF_SIZE]; @@ -12313,7 +12312,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* create third dataset in group */ if((did = H5Dcreate2(gid, SRC_DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR - + /* get datatype */ if((tid_short = H5Topen2(fid_src, "/" SRC_GRP "/" SRC_NDT_SHORT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -12442,7 +12441,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 1 */ /* open the source file with read-only */ @@ -12483,7 +12482,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 2 */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12520,7 +12519,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 3 */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12555,7 +12554,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 4 */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12608,7 +12607,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 5 */ /* open destination file */ @@ -12646,7 +12645,7 @@ test_copy_cdt_merge_all_suggs(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* close the DST file */ if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Test 6 */ /* open destination file */ @@ -12707,7 +12706,7 @@ error: return 1; } /* end test_copy_cdt_merge_all_suggs */ - + /*------------------------------------------------------------------------- * Function: test_copy_set_mcdt_search_cb * @@ -12892,7 +12891,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Continue the global search */ if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cb, &cb_udata) < 0) - TEST_ERROR + TEST_ERROR /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -12927,7 +12926,7 @@ test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Fclose(fid_dst) < 0) TEST_ERROR - /* + /* * Stop the search, default action is to create an anonymous committed datatype */ cb_udata.search_action = H5O_MCDT_SEARCH_STOP; @@ -13063,7 +13062,7 @@ error: return 1; } /* end test_copy_set_mcdt_search_cb */ - + /*------------------------------------------------------------------------- * Function: test_copy_set_get_mcdt_cb * @@ -13109,10 +13108,10 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, int buf[DIM_SIZE_1]; /* Buffer for writing data */ char src_filename[NAME_BUF_SIZE]; char dst_filename[NAME_BUF_SIZE]; - H5O_mcdt_search_cb_t mcdt_cb = NULL; /* The callback function */ - H5O_mcdt_search_ret_t mcdt_udataA; /* User data for callback */ - H5O_mcdt_search_ret_t mcdt_udataB; /* User data for callback */ - H5O_mcdt_search_ret_t *mcdt_udata_p = NULL; /* Pointer to user data for callback */ + H5O_mcdt_search_cb_t mcdt_cb = NULL; /* The callback function */ + H5O_mcdt_search_ret_t mcdt_udataA; /* User data for callback */ + H5O_mcdt_search_ret_t mcdt_udataB; /* User data for callback */ + H5O_mcdt_search_ret_t *mcdt_udata_p = NULL; /* Pointer to user data for callback */ if(reopen) TESTING("H5Ocopy(): H5Pset/get_mcdt_search_cb and reopen") @@ -13242,7 +13241,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* Continue the global search */ if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbA, &mcdt_udataA) < 0) - TEST_ERROR + TEST_ERROR /* open the destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -13275,7 +13274,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, mcdt_udataB = H5O_MCDT_SEARCH_STOP; if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbA, &mcdt_udataB) < 0) - TEST_ERROR + TEST_ERROR /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -13305,7 +13304,7 @@ test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, if(H5Pfree_merge_committed_dtype_paths(ocpypl_id) < 0) TEST_ERROR if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbB, &mcdt_udataB) < 0) - TEST_ERROR + TEST_ERROR /* open destination file */ if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR @@ -13358,7 +13357,7 @@ error: return 1; } /* end test_copy_set_get_mcdt_search_cb */ - + /*------------------------------------------------------------------------- * Function: test_copy_iterate * @@ -13456,7 +13455,7 @@ error: return 1; } /* end test_copy_iterate */ - + /*------------------------------------------------------------------------- * Function: test_copy_option * @@ -13481,7 +13480,7 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, hid_t did = -1; /* Dataset ID */ hid_t gid=-1, gid2=-1, gid_ref=-1; /* Group IDs */ hid_t gid_sub=-1, gid_sub_sub=-1; /* Sub-group ID */ - hid_t pid=-1, lcpl_id=-1; /* Property IDs */ + hid_t pid=-1, lcpl_id=-1; /* Property IDs */ unsigned cpy_flags; /* Object copy flags */ int depth = -1; /* Copy depth */ hsize_t dim2d[2]; @@ -13734,51 +13733,51 @@ error: H5E_BEGIN_TRY { H5Pclose(lcpl_id); H5Pclose(pid); - H5Sclose(sid); - H5Dclose(did); - H5Gclose(gid_ref); - H5Gclose(gid_sub); - H5Gclose(gid2); - H5Gclose(gid); - H5Fclose(fid_dst); - H5Fclose(fid_src); - H5Fclose(fid_ext); + H5Sclose(sid); + H5Dclose(did); + H5Gclose(gid_ref); + H5Gclose(gid_sub); + H5Gclose(gid2); + H5Gclose(gid); + H5Fclose(fid_dst); + H5Fclose(fid_src); + H5Fclose(fid_ext); } H5E_END_TRY; return 1; } /* end test_copy_option */ - + /*------------------------------------------------------------------------- * Function: test_copy_dataset_open * * Purpose: To ensure that H5Ocopy() copies data of opened dataset correctly. - * This is for bug fix HDFFV-7853. - * - * Test Case 1: - * Create a dataset with attributes in SRC file - * Copy the opened dataset to another location in the same file - * Copy the opened dataset to DST file - * Close the dataset - * - * Test Case 2: - * Reopen the dataset, write new data to the dataset - * Copy the opened dataset to another location in the same file - * Copy the opened dataset to to DST file - * Close the dataset - * - * Test Case 3: - * Create a committed datatype - * Create a dataset with the committed datatype in SRC file - * Open the committed datatype - * Copy the opened dataset (with the opened committed datatype) to another location in the same file - * Copy the opened dataset (with the opened committed datatype) to DST file - * Close the dataset and the committed datatype - * - * Test Case 4: - * Create a group with attributes, create a dataset in the group - * Copy the opened group (together with the opened dataset) to another location in the same file - * Copy the opened group (together with the opened dataset) to DST file - * Close the group and the dataset + * This is for bug fix HDFFV-7853. + * + * Test Case 1: + * Create a dataset with attributes in SRC file + * Copy the opened dataset to another location in the same file + * Copy the opened dataset to DST file + * Close the dataset + * + * Test Case 2: + * Reopen the dataset, write new data to the dataset + * Copy the opened dataset to another location in the same file + * Copy the opened dataset to to DST file + * Close the dataset + * + * Test Case 3: + * Create a committed datatype + * Create a dataset with the committed datatype in SRC file + * Open the committed datatype + * Copy the opened dataset (with the opened committed datatype) to another location in the same file + * Copy the opened dataset (with the opened committed datatype) to DST file + * Close the dataset and the committed datatype + * + * Test Case 4: + * Create a group with attributes, create a dataset in the group + * Copy the opened group (together with the opened dataset) to another location in the same file + * Copy the opened group (together with the opened dataset) to DST file + * Close the group and the dataset * * Return: Success: 0 * Failure: number of errors @@ -13856,16 +13855,16 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* write data to the dataset */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR - + /* attach attributes to the dataset */ if(test_copy_attach_attributes(did, H5T_NATIVE_INT) < 0) TEST_ERROR if(test_copy_attach_attributes(did2, H5T_NATIVE_INT) < 0) TEST_ERROR - /* - * Test case 1 + /* + * Test case 1 */ - /* + /* * Copy within the same file */ /* copy the opened dataset to another location in SRC file */ @@ -13884,7 +13883,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst if(H5Dclose(did3) < 0) TEST_ERROR if(H5Dclose(did4) < 0) TEST_ERROR - /* + /* * Copy to another file */ /* copy the opened dataset from SRC to DST */ @@ -13907,8 +13906,8 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst if(H5Dclose(did) < 0) TEST_ERROR if(H5Dclose(did2) < 0) TEST_ERROR - /* - * Test case 2 + /* + * Test case 2 */ /* reopen the dataset in SRC file */ if((did = H5Dopen2(fid_src, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR @@ -13918,7 +13917,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, newbuf) < 0) TEST_ERROR if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, newbuf) < 0) TEST_ERROR - /* + /* * Copy within the same file */ /* copy the opened dataset to another location in SRC file */ @@ -13936,7 +13935,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* close the copied dataset in SRC file */ if(H5Dclose(did3) < 0) TEST_ERROR if(H5Dclose(did4) < 0) TEST_ERROR - /* + /* * Copy to another file */ /* copy the opened dataset from SRC to DST */ @@ -13959,8 +13958,8 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst if(H5Dclose(did) < 0) TEST_ERROR if(H5Dclose(did2) < 0) TEST_ERROR - /* - * Test case 3 + /* + * Test case 3 */ /* make a copy of the datatype */ @@ -13981,7 +13980,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* write data to the dataset */ if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR - /* + /* * Copy within the same file */ /* copy the opened dataset (with the opened committed datatype) to another location in SRC file */ @@ -13996,7 +13995,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* close the copied dataset in SRC file */ if(H5Dclose(did2) < 0) TEST_ERROR - /* + /* * Copy to another file */ /* copy the opened dataset (with the opened committed datatype) from SRC to DST */ @@ -14017,8 +14016,8 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* close the committed datatype at SRC file */ if(H5Tclose(tid) < 0) TEST_ERROR - /* - * Test case 4 + /* + * Test case 4 */ /* create a group in SRC file */ if((gid = H5Gcreate2(fid_src, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -14031,7 +14030,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* write data to the dataset */ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR - /* + /* * Copy within the same file */ /* copy the opened group (together with opened dataset) to another location in SRC file */ @@ -14046,7 +14045,7 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst /* close the DST dataset */ if(H5Gclose(gid2) < 0) TEST_ERROR - /* + /* * Copy to another file */ /* copy the opened group (together with opened dataset) to DST file */ @@ -14081,20 +14080,20 @@ test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst error: H5E_BEGIN_TRY { - H5Dclose(did); - H5Dclose(did2); - H5Sclose(sid); - H5Gclose(gid); - H5Gclose(gid2); - H5Fclose(fid_dst); - H5Fclose(fid_src); + H5Dclose(did); + H5Dclose(did2); + H5Sclose(sid); + H5Gclose(gid); + H5Gclose(gid2); + H5Fclose(fid_dst); + H5Fclose(fid_src); } H5E_END_TRY; return 1; } /* end test_copy_dataset_open */ - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * * Purpose: Test H5Ocopy() * @@ -14115,11 +14114,11 @@ int main(void) { int nerrors = 0; - hid_t fapl, fapl2; + hid_t fapl, fapl2; hid_t fcpl_shared, ocpl; unsigned max_compact, min_dense; int configuration; /* Configuration of tests. */ - int ExpressMode; + int ExpressMode; hbool_t same_file; /* Whether to run tests that only use one file */ /* Setup */ @@ -14197,7 +14196,7 @@ main(void) } } /* end if */ else { - puts("Testing with oldest file format for source file:"); + puts("Testing with oldest file format for source file:"); src_fapl = fapl; num_attributes_g = 4; } /* end else */ diff --git a/test/swmr.c b/test/swmr.c index 3b1bd09..0b352e2 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -24,7 +24,6 @@ * *************************************************************/ -#include "hdf5.h" #include "h5test.h" #include "H5Iprivate.h" diff --git a/test/tarray.c b/test/tarray.c index b2e0ee7..99f7bf8 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: tarray +* Test program: tarray * * Test the Array Datatype functionality * @@ -22,13 +22,11 @@ #include "testhdf5.h" #include "H5srcdir.h" -#include "hdf5.h" - #define FILENAME "tarray1.h5" #define TESTFILE "tarrold.h5" /* 1-D array datatype */ -#define ARRAY1_RANK 1 +#define ARRAY1_RANK 1 #define ARRAY1_DIM1 4 /* 3-D array datatype */ @@ -67,7 +65,7 @@ typedef struct void *test_array_alloc_custom(size_t size, void *info); void test_array_free_custom(void *mem, void *info); - + /*------------------------------------------------------------------------- * Function: test_array_atomic_1d * @@ -191,7 +189,7 @@ test_array_atomic_1d(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_array_atomic_1d() */ - + /*------------------------------------------------------------------------- * Function: test_array_funcs * @@ -254,7 +252,7 @@ test_array_funcs(void) CHECK(ret, FAIL, "H5Tclose"); } /* end test_array_funcs() */ - + /*------------------------------------------------------------------------- * Function: test_array_atomic_3d * @@ -383,7 +381,7 @@ test_array_atomic_3d(void) } /* end test_array_atomic_3d() */ - + /*------------------------------------------------------------------------- * Function: test_array_array_atomic * @@ -542,7 +540,7 @@ test_array_array_atomic(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_array_array_atomic() */ - + /*------------------------------------------------------------------------- * Function: test_array_compound_atomic * @@ -749,7 +747,7 @@ test_array_compound_atomic(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_array_compound_atomic() */ - + /*------------------------------------------------------------------------- * Function: test_array_compound_array * @@ -1008,7 +1006,7 @@ test_array_compound_array(void) ** allocated. ** ****************************************************************/ - + /*------------------------------------------------------------------------- * Function: test_array_alloc_custom * @@ -1047,7 +1045,7 @@ test_array_alloc_custom(size_t size, void *info) return ret_value; } /* end test_array_alloc_custom() */ - + /*------------------------------------------------------------------------- * Function: test_array_free_custom * @@ -1083,7 +1081,7 @@ test_array_free_custom(void *_mem, void *info) return; } /* end test_array_free_custom() */ - + /*------------------------------------------------------------------------- * Function: test_array_vlen_atomic * @@ -1298,7 +1296,7 @@ test_array_vlen_atomic(void) } /* end test_array_vlen_atomic() */ - + /*------------------------------------------------------------------------- * Function: test_array_vlen_array * @@ -1553,7 +1551,7 @@ test_array_vlen_array(void) } /* end test_array_vlen_array() */ - + /*------------------------------------------------------------------------- * Function: test_array_bkg * @@ -1582,9 +1580,9 @@ test_array_bkg(void) unsigned ndims[3] = {1,1,1}; typedef struct { - int a[ALEN]; - float b[ALEN]; - double c[ALEN]; + int a[ALEN]; + float b[ALEN]; + double c[ALEN]; } CmpField; CmpField cf[LENGTH]; @@ -1857,7 +1855,7 @@ test_array_bkg(void) HDfree(dtsinfo); } /* end test_array_bkg() */ - + /*------------------------------------------------------------------------- * Function: test_compat * @@ -2152,7 +2150,7 @@ test_compat(void) } /* end test_compat() */ - + /*------------------------------------------------------------------------- * Function: test_array * @@ -2185,7 +2183,7 @@ test_array(void) } /* end test_array() */ - + /*------------------------------------------------------------------------- * Function: cleanup_array * diff --git a/test/tattr.c b/test/tattr.c index 2d333e9..525898d 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -20,8 +20,6 @@ *************************************************************/ #include "testhdf5.h" -#include "h5test.h" -#include "hdf5.h" /* * This file needs to access private information from the H5O package. @@ -153,7 +151,7 @@ static herr_t attr_op1(hid_t loc_id, const char *name, const H5A_info_t *ainfo, void *op_data); - + /**************************************************************** ** ** test_attr_basic_write(): Test basic H5A (attribute) code. @@ -393,7 +391,7 @@ test_attr_basic_write(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_basic_write() */ - + /**************************************************************** ** ** test_attr_basic_read(): Test basic H5A (attribute) code. @@ -484,7 +482,7 @@ test_attr_basic_read(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_basic_read() */ - + /**************************************************************** ** ** test_attr_flush(): Test H5A (attribute) code for performing @@ -551,7 +549,7 @@ test_attr_flush(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_flush() */ - + /**************************************************************** ** ** test_attr_plist(): Test Attribute Creation Property Lists @@ -664,7 +662,7 @@ test_attr_plist(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_plist() */ - + /**************************************************************** ** ** test_attr_compound_write(): Test H5A (attribute) code. @@ -753,7 +751,7 @@ test_attr_compound_write(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_compound_write() */ - + /**************************************************************** ** ** test_attr_compound_read(): Test basic H5A (attribute) code. @@ -903,7 +901,7 @@ test_attr_compound_read(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_compound_read() */ - + /**************************************************************** ** ** test_attr_scalar_write(): Test scalar H5A (attribute) writing code. @@ -969,7 +967,7 @@ test_attr_scalar_write(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_scalar_write() */ - + /**************************************************************** ** ** test_attr_scalar_read(): Test scalar H5A (attribute) reading code. @@ -1040,7 +1038,7 @@ test_attr_scalar_read(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_scalar_read() */ - + /**************************************************************** ** ** test_attr_mult_write(): Test basic H5A (attribute) code. @@ -1161,7 +1159,7 @@ test_attr_mult_write(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_mult_write() */ - + /**************************************************************** ** ** test_attr_mult_read(): Test basic H5A (attribute) code. @@ -1383,7 +1381,7 @@ test_attr_mult_read(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_mult_read() */ - + /**************************************************************** ** ** attr_op1(): Attribute operator @@ -1423,7 +1421,7 @@ attr_op1(hid_t H5_ATTR_UNUSED loc_id, const char *name, const H5A_info_t H5_ATTR return(ret); } /* end attr_op1() */ - + /**************************************************************** ** ** test_attr_iterate(): Test H5A (attribute) iterator code. @@ -1495,7 +1493,7 @@ test_attr_iterate(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_iterate() */ - + /**************************************************************** ** ** test_attr_delete(): Test H5A (attribute) code for deleting objects. @@ -1615,7 +1613,7 @@ test_attr_delete(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_delete() */ - + /**************************************************************** ** ** test_attr_dtype_shared(): Test H5A (attribute) code for using @@ -1792,7 +1790,7 @@ test_attr_dtype_shared(hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dtype_shared() */ - + /**************************************************************** ** ** test_attr_duplicate_ids(): Test operations with more than @@ -2037,7 +2035,7 @@ test_attr_duplicate_ids(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_duplicate_ids() */ - + /**************************************************************** ** ** test_attr_dense_verify(): Test basic H5A (attribute) code. @@ -2107,7 +2105,7 @@ test_attr_dense_verify(hid_t loc_id, unsigned max_attr) return(-1); } /* test_attr_dense_verify() */ - + /**************************************************************** ** ** test_attr_dense_create(): Test basic H5A (attribute) code. @@ -2238,7 +2236,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_create() */ - + /**************************************************************** ** ** test_attr_dense_open(): Test basic H5A (attribute) code. @@ -2377,7 +2375,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_open() */ - + /**************************************************************** ** ** test_attr_dense_delete(): Test basic H5A (attribute) code. @@ -2555,7 +2553,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_delete() */ - + /**************************************************************** ** ** test_attr_dense_rename(): Test basic H5A (attribute) code. @@ -2714,7 +2712,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_rename() */ - + /**************************************************************** ** ** test_attr_dense_unlink(): Test basic H5A (attribute) code. @@ -2844,7 +2842,7 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_unlink() */ - + /**************************************************************** ** ** test_attr_dense_limits(): Test basic H5A (attribute) code. @@ -3009,7 +3007,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_dense_limits() */ - + /**************************************************************** ** ** test_attr_dense_dup_ids(): Test operations with multiple ID @@ -3532,7 +3530,7 @@ test_attr_dense_dup_ids(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_dense_dup_ids() */ - + /**************************************************************** ** ** test_attr_big(): Test basic H5A (attribute) code. @@ -3802,7 +3800,7 @@ test_attr_big(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_big() */ - + /**************************************************************** ** ** test_attr_null_space(): Test basic H5A (attribute) code. @@ -4020,7 +4018,7 @@ test_attr_null_space(hid_t fcpl, hid_t fapl) VERIFY(filesize, empty_filesize, "h5_get_file_size"); } /* test_attr_null_space() */ - + /**************************************************************** ** ** test_attr_deprec(): Test basic H5A (attribute) code. @@ -4129,7 +4127,7 @@ test_attr_deprec(hid_t fcpl, hid_t fapl) #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* test_attr_deprec() */ - + /**************************************************************** ** ** test_attr_many(): Test basic H5A (attribute) code. @@ -4258,7 +4256,7 @@ test_attr_many(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_many() */ - + /**************************************************************** ** ** test_attr_corder_create_empty(): Test basic H5A (attribute) code. @@ -4374,7 +4372,7 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_corder_create_basic() */ - + /**************************************************************** ** ** test_attr_corder_create_compact(): Test basic H5A (attribute) code. @@ -4572,7 +4570,7 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_corder_create_compact() */ - + /**************************************************************** ** ** test_attr_corder_create_dense(): Test basic H5A (attribute) code. @@ -4799,7 +4797,7 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); } /* test_attr_corder_create_dense() */ - + /**************************************************************** ** ** test_attr_corder_create_reopen(): Test basic H5A (attribute) code. @@ -4907,7 +4905,7 @@ test_attr_corder_create_reopen(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_corder_create_reopen() */ - + /**************************************************************** ** ** test_attr_corder_transition(): Test basic H5A (attribute) code. @@ -5313,7 +5311,7 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_corder_transition() */ - + /**************************************************************** ** ** test_attr_corder_delete(): Test basic H5A (attribute) code. @@ -5514,7 +5512,7 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_corder_delete() */ - + /*------------------------------------------------------------------------- * Function: attr_info_by_idx_check * @@ -5661,7 +5659,7 @@ attr_info_by_idx_check(hid_t obj_id, const char *attrname, hsize_t n, return(-1); } /* end attr_info_by_idx_check() */ - + /**************************************************************** ** ** test_attr_info_by_idx(): Test basic H5A (attribute) code. @@ -5871,7 +5869,7 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_info_by_idx() */ - + /**************************************************************** ** ** test_attr_delete_by_idx(): Test basic H5A (attribute) code. @@ -6403,7 +6401,7 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_delete_by_idx() */ - + /**************************************************************** ** ** attr_iterate2_cb(): Revised attribute operator @@ -6477,7 +6475,7 @@ HDfprintf(stderr, "op_data->curr = %Hd\n", op_data->curr); } /* end attr_iterate2_cb() */ #ifndef H5_NO_DEPRECATED_SYMBOLS - + /**************************************************************** ** ** attr_iterate1_cb(): Attribute operator @@ -6490,7 +6488,7 @@ attr_iterate1_cb(hid_t loc_id, const char *attr_name, void *_op_data) } /* end attr_iterate1_cb() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ - + /*------------------------------------------------------------------------- * Function: attr_iterate2_fail_cb * @@ -6512,7 +6510,7 @@ attr_iterate2_fail_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED * return(H5_ITER_ERROR); } /* end attr_iterate2_fail_cb() */ - + /*------------------------------------------------------------------------- * Function: attr_iterate_check * @@ -6812,7 +6810,7 @@ attr_iterate_check(hid_t fid, const char *dsetname, hid_t obj_id, return(-1); } /* end attr_iterate_check() */ - + /**************************************************************** ** ** test_attr_iterate2(): Test basic H5A (attribute) code. @@ -7116,7 +7114,7 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl) HDfree(visited); } /* test_attr_iterate2() */ - + /*------------------------------------------------------------------------- * Function: attr_open_by_idx_check * @@ -7176,7 +7174,7 @@ attr_open_by_idx_check(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, return(-1); } /* end attr_open_by_idx_check() */ - + /**************************************************************** ** ** test_attr_open_by_idx(): Test basic H5A (attribute) code. @@ -7438,7 +7436,7 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_open_by_idx() */ - + /*------------------------------------------------------------------------- * Function: attr_open_check * @@ -7524,7 +7522,7 @@ attr_open_check(hid_t fid, const char *dsetname, hid_t obj_id, return(-1); } /* end attr_open_check() */ - + /**************************************************************** ** ** test_attr_open_by_name(): Test basic H5A (attribute) code. @@ -7779,7 +7777,7 @@ test_attr_open_by_name(hbool_t new_format, hid_t fcpl, hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); } /* test_attr_open_by_name() */ - + /**************************************************************** ** ** test_attr_create_by_name(): Test basic H5A (attribute) code. @@ -10866,7 +10864,7 @@ test_attr(void) CHECK(ret, FAIL, "H5Pclose"); } /* test_attr() */ - + /*------------------------------------------------------------------------- * Function: cleanup_attr * diff --git a/test/tconfig.c b/test/tconfig.c index a9f3378..b652ca4 100644 --- a/test/tconfig.c +++ b/test/tconfig.c @@ -19,7 +19,6 @@ * *************************************************************/ -#include "hdf5.h" #include "testhdf5.h" /* macros definitions */ @@ -40,22 +39,22 @@ /* Needs this extra step so that we can print the macro name. */ #define vrfy_macrosize(type, macro, macroname) \ if (sizeof(type) != macro) \ - TestErrPrintf("Error: sizeof(%s) is %zu but %s is %d\n", \ - #type, sizeof(type), macroname, (int)macro); + TestErrPrintf("Error: sizeof(%s) is %zu but %s is %d\n", \ + #type, sizeof(type), macroname, (int)macro); /* local routine prototypes */ void test_config_ctypes(void); void test_exit_definitions(void); - + /*------------------------------------------------------------------------- - * Function: test_configure + * Function: test_configure * - * Purpose: Main configure definitions testing routine + * Purpose: Main configure definitions testing routine * - * Return: none (error is fed back via global variable num_errs) + * Return: none (error is fed back via global variable num_errs) * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * September 25, 2001 * *------------------------------------------------------------------------- @@ -69,15 +68,15 @@ test_configure(void) test_exit_definitions(); } - + /*------------------------------------------------------------------------- - * Function: cleanup_configure + * Function: cleanup_configure * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * September 25, 2001 * * Modifications: @@ -90,20 +89,20 @@ cleanup_configure(void) /* no file to clean */ } - + /*------------------------------------------------------------------------- - * Function: test_config_ctypes + * Function: test_config_ctypes * - * Purpose: test C language data type sizes + * Purpose: test C language data type sizes * - * Return: none (error is fed back via global variable num_errs) + * Return: none (error is fed back via global variable num_errs) * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * September 25, 2001 * * Modifications: - * Albert Cheng, 2004/10/14 - * Verified both signed and unsigned int types. + * Albert Cheng, 2004/10/14 + * Verified both signed and unsigned int types. * *------------------------------------------------------------------------- */ @@ -201,15 +200,15 @@ test_config_ctypes(void) } - + /*------------------------------------------------------------------------- - * Function: test_exit_definitions + * Function: test_exit_definitions * - * Purpose: test the exit macros values + * Purpose: test the exit macros values * - * Return: none (error is fed back via global variable num_errs) + * Return: none (error is fed back via global variable num_errs) * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * October 12, 2009 * * Modifications: @@ -222,9 +221,9 @@ test_exit_definitions(void) /* Verify the EXIT_SUCCESS and EXIT_FAILURE are 0 and 1 respectively. */ /* This should be true for POSIX compliant systems. */ if (EXIT_SUCCESS != 0) \ - TestErrPrintf("Error: EXIT_SUCCESS is %d, should be %d\n", \ - EXIT_SUCCESS, 0); + TestErrPrintf("Error: EXIT_SUCCESS is %d, should be %d\n", \ + EXIT_SUCCESS, 0); if (EXIT_FAILURE != 1) \ - TestErrPrintf("Error: EXIT_FAILURE is %d, should be %d\n", \ - EXIT_FAILURE, 1); + TestErrPrintf("Error: EXIT_FAILURE is %d, should be %d\n", \ + EXIT_FAILURE, 1); } diff --git a/test/testhdf5.h b/test/testhdf5.h index 127c687..1f3f6a0 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -18,13 +18,6 @@ #ifndef TESTHDF5_H #define TESTHDF5_H -/* - * Include required headers. This file tests internal library functions, - * so we include the private headers here. - */ -#include "H5private.h" -#include "H5Eprivate.h" - /* Include generic testing header also */ #include "h5test.h" @@ -204,12 +197,12 @@ void test_vlstrings(void); void test_iterate(void); void test_array(void); void test_genprop(void); -void test_configure(void); -void test_misc(void); -void test_ids(void); -void test_skiplist(void); -void test_sohm(void); -void test_unicode(void); +void test_configure(void); +void test_misc(void); +void test_ids(void); +void test_skiplist(void); +void test_sohm(void); +void test_unicode(void); /* Prototypes for the cleanup routines */ void cleanup_metadata(void); @@ -227,10 +220,10 @@ void cleanup_vlstrings(void); void cleanup_iterate(void); void cleanup_array(void); void cleanup_genprop(void); -void cleanup_configure(void); -void cleanup_sohm(void); -void cleanup_misc(void); -void cleanup_unicode(void); +void cleanup_configure(void); +void cleanup_sohm(void); +void cleanup_misc(void); +void cleanup_unicode(void); #ifdef __cplusplus } diff --git a/test/tfile.c b/test/tfile.c index f1a4a1d..1678fb6 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -13,13 +13,12 @@ /*********************************************************** * -* Test program: tfile +* Test program: tfile * * Test the low-level file I/O features. * *************************************************************/ -#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" @@ -31,9 +30,9 @@ * This file needs to access private information from the H5F package. * This file also needs to access the file testing code. */ -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING -#include "H5Fpkg.h" /* File access */ +#include "H5Fpkg.h" /* File access */ #define H5D_FRIEND /*suppress error about including H5Dpkg */ #include "H5Dpkg.h" /* Dataset access */ @@ -59,46 +58,46 @@ #define BAD_USERBLOCK_SIZE7 (hsize_t)6144 #define F1_USERBLOCK_SIZE (hsize_t)0 -#define F1_OFFSET_SIZE sizeof(haddr_t) -#define F1_LENGTH_SIZE sizeof(hsize_t) -#define F1_SYM_LEAF_K 4 -#define F1_SYM_INTERN_K 16 -#define FILE1 "tfile1.h5" -#define SFILE1 "sys_file1" +#define F1_OFFSET_SIZE sizeof(haddr_t) +#define F1_LENGTH_SIZE sizeof(hsize_t) +#define F1_SYM_LEAF_K 4 +#define F1_SYM_INTERN_K 16 +#define FILE1 "tfile1.h5" +#define SFILE1 "sys_file1" #define REOPEN_FILE "tfile_reopen.h5" #define REOPEN_DSET "dset" #define F2_USERBLOCK_SIZE (hsize_t)512 -#define F2_OFFSET_SIZE 8 -#define F2_LENGTH_SIZE 8 -#define F2_SYM_LEAF_K 8 -#define F2_SYM_INTERN_K 32 +#define F2_OFFSET_SIZE 8 +#define F2_LENGTH_SIZE 8 +#define F2_SYM_LEAF_K 8 +#define F2_SYM_INTERN_K 32 #define F2_RANK 2 #define F2_DIM0 4 #define F2_DIM1 6 #define F2_DSET "dset" -#define FILE2 "tfile2.h5" +#define FILE2 "tfile2.h5" #define F3_USERBLOCK_SIZE (hsize_t)0 -#define F3_OFFSET_SIZE F2_OFFSET_SIZE -#define F3_LENGTH_SIZE F2_LENGTH_SIZE -#define F3_SYM_LEAF_K F2_SYM_LEAF_K -#define F3_SYM_INTERN_K F2_SYM_INTERN_K -#define FILE3 "tfile3.h5" +#define F3_OFFSET_SIZE F2_OFFSET_SIZE +#define F3_LENGTH_SIZE F2_LENGTH_SIZE +#define F3_SYM_LEAF_K F2_SYM_LEAF_K +#define F3_SYM_INTERN_K F2_SYM_INTERN_K +#define FILE3 "tfile3.h5" #define GRP_NAME "/group" #define DSET_NAME "dataset" #define ATTR_NAME "attr" #define TYPE_NAME "type" -#define FILE4 "tfile4.h5" +#define FILE4 "tfile4.h5" #define OBJ_ID_COUNT_0 0 #define OBJ_ID_COUNT_1 1 #define OBJ_ID_COUNT_2 2 #define OBJ_ID_COUNT_3 3 #define OBJ_ID_COUNT_4 4 -#define OBJ_ID_COUNT_6 6 +#define OBJ_ID_COUNT_6 6 #define OBJ_ID_COUNT_8 8 #define GROUP1 "Group1" @@ -128,22 +127,22 @@ #define FSP_SIZE1G 1024*1024*1024 /* File space page size */ /* Declaration for test_libver_macros2() */ -#define FILE6 "tfile6.h5" /* Test file */ +#define FILE6 "tfile6.h5" /* Test file */ /* Declaration for test_get_obj_ids() */ -#define FILE7 "tfile7.h5" /* Test file */ -#define NGROUPS 2 -#define NDSETS 4 +#define FILE7 "tfile7.h5" /* Test file */ +#define NGROUPS 2 +#define NDSETS 4 /* Files created under 1.6 branch and 1.8 branch--used in test_filespace_compatible() */ -const char *OLD_FILENAME[] = { - "filespace_1_6.h5", /* 1.6 HDF5 file */ - "filespace_1_8.h5" /* 1.8 HDF5 file */ +const char *OLD_FILENAME[] = { + "filespace_1_6.h5", /* 1.6 HDF5 file */ + "filespace_1_8.h5" /* 1.8 HDF5 file */ }; /* Files created in 1.10.0 release --used in test_filespace_1.10.0_compatible() */ /* These files are copied from release 1.10.0 tools/h5format_convert/testfiles */ -const char *OLD_1_10_0_FILENAME[] = { +const char *OLD_1_10_0_FILENAME[] = { "h5fc_ext1_i.h5", /* 0 */ "h5fc_ext1_f.h5", /* 1 */ "h5fc_ext2_if.h5", /* 2 */ @@ -179,13 +178,13 @@ static void test_libver_bounds_datatype(hid_t fapl); static void test_libver_bounds_datatype_check(hid_t fapl, hid_t tid); static void test_libver_bounds_attributes(hid_t fapl); -#define FILE8 "tfile8.h5" /* Test file */ +#define FILE8 "tfile8.h5" /* Test file */ -#define DSET_NULL "DSET_NULL" -#define DSET "DSET" -#define DSETA "DSETA" -#define DSETB "DSETB" -#define DSETC "DSETC" +#define DSET_NULL "DSET_NULL" +#define DSET "DSET" +#define DSETA "DSETA" +#define DSETB "DSETB" +#define DSETC "DSETC" static void create_objects(hid_t, hid_t, hid_t *, hid_t *, hid_t *, hid_t *); @@ -207,14 +206,14 @@ static void test_rw_noupdate(void); static void test_file_create(void) { - hid_t fid1, fid2, fid3; /* HDF5 File IDs */ - hid_t tmpl1, tmpl2; /*file creation templates */ - hsize_t ublock; /*sizeof userblock */ - size_t parm; /*file-creation parameters */ - size_t parm2; /*file-creation parameters */ - unsigned iparm; - unsigned iparm2; - herr_t ret; /*generic return value */ + hid_t fid1, fid2, fid3; /* HDF5 File IDs */ + hid_t tmpl1, tmpl2; /*file creation templates */ + hsize_t ublock; /*sizeof userblock */ + size_t parm; /*file-creation parameters */ + size_t parm2; /*file-creation parameters */ + unsigned iparm; + unsigned iparm2; + herr_t ret; /*generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Low-Level File Creation I/O\n")); @@ -466,7 +465,7 @@ test_file_create(void) /* Close third file */ ret = H5Fclose(fid3); CHECK(ret, FAIL, "H5Fclose"); -} /* test_file_create() */ +} /* test_file_create() */ /**************************************************************** ** @@ -476,17 +475,17 @@ test_file_create(void) static void test_file_open(void) { - hid_t fid1, fid2; /*HDF5 File IDs */ + hid_t fid1, fid2; /*HDF5 File IDs */ hid_t did; /*dataset ID */ hid_t fapl_id; /*file access property list ID */ - hid_t tmpl1; /*file creation templates */ - hsize_t ublock; /*sizeof user block */ - size_t parm; /*file-creation parameters */ - size_t parm2; /*file-creation parameters */ - unsigned iparm; - unsigned iparm2; - unsigned intent; - herr_t ret; /*generic return value */ + hid_t tmpl1; /*file creation templates */ + hsize_t ublock; /*sizeof user block */ + size_t parm; /*file-creation parameters */ + size_t parm2; /*file-creation parameters */ + unsigned iparm; + unsigned iparm2; + unsigned intent; + herr_t ret; /*generic return value */ /* * Test single file open @@ -650,7 +649,7 @@ test_file_close(void) { hid_t fid1, fid2; hid_t fapl_id, access_id; - hid_t dataset_id, group_id1, group_id2, group_id3; + hid_t dataset_id, group_id1, group_id2, group_id3; H5F_close_degree_t fc_degree; herr_t ret; @@ -840,7 +839,7 @@ test_file_close(void) /* Create more new files and test object count and ID list functions */ test_obj_count_and_id(fid1, fid2, dataset_id, group_id1, - group_id2, group_id3); + group_id2, group_id3); /* Close first open */ ret = H5Fclose(fid1); @@ -896,22 +895,22 @@ test_file_close(void) CHECK(ret, FAIL, "H5Pget_fclose_degree"); switch(fc_degree) { - case H5F_CLOSE_STRONG: - /* Close first open */ - ret = H5Fclose(fid1); - CHECK(ret, FAIL, "H5Fclose"); - /* Close second open */ - ret = H5Fclose(fid2); - CHECK(ret, FAIL, "H5Fclose"); - break; - case H5F_CLOSE_SEMI: + case H5F_CLOSE_STRONG: /* Close first open */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); - ret = H5Dclose(dataset_id); + /* Close second open */ + ret = H5Fclose(fid2); + CHECK(ret, FAIL, "H5Fclose"); + break; + case H5F_CLOSE_SEMI: + /* Close first open */ + ret = H5Fclose(fid1); + CHECK(ret, FAIL, "H5Fclose"); + ret = H5Dclose(dataset_id); CHECK(ret, FAIL, "H5Dclose"); ret = H5Gclose(group_id1); - CHECK(ret, FAIL, "H5Gclose"); + CHECK(ret, FAIL, "H5Gclose"); ret = H5Gclose(group_id2); CHECK(ret, FAIL, "H5Gclose"); ret = H5Gclose(group_id3); @@ -919,8 +918,8 @@ test_file_close(void) /* Close second open */ ret = H5Fclose(fid2); CHECK(ret, FAIL, "H5Fclose"); - break; - case H5F_CLOSE_WEAK: + break; + case H5F_CLOSE_WEAK: /* Close first open */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -935,7 +934,7 @@ test_file_close(void) CHECK(ret, FAIL, "H5Gclose"); ret = H5Gclose(group_id3); CHECK(ret, FAIL, "H5Gclose"); - break; + break; case H5F_CLOSE_DEFAULT: default: CHECK(fc_degree, H5F_CLOSE_DEFAULT, "H5Pget_fclose_degree"); @@ -957,10 +956,10 @@ test_file_close(void) ****************************************************************/ static void create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1, - hid_t *ret_gid2, hid_t *ret_gid3) + hid_t *ret_gid2, hid_t *ret_gid3) { - ssize_t oid_count; - herr_t ret; + ssize_t oid_count; + herr_t ret; /* Check reference counts of file IDs and opened object IDs. * The verification is hard-coded. If in any case, this testing @@ -1062,7 +1061,7 @@ create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1, /**************************************************************** ** ** test_get_obj_ids(): Test the bug and the fix for Jira 8528. -** H5Fget_obj_ids overfilled the list of +** H5Fget_obj_ids overfilled the list of ** object IDs by one. This is an enhancement ** for test_obj_count_and_id(). ** @@ -1109,14 +1108,14 @@ test_get_obj_ids(void) oid_list = (hid_t *)HDcalloc((size_t)oid_list_size, sizeof(hid_t)); CHECK_PTR(oid_list, "HDcalloc"); - /* Call the public function H5F_get_obj_ids to use H5F_get_objects. User reported having problem here. - * that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in + /* Call the public function H5F_get_obj_ids to use H5F_get_objects. User reported having problem here. + * that the returned size (ret_count) from H5Fget_obj_ids is one greater than the size passed in * (oid_list_size) */ ret_count = H5Fget_obj_ids(fid, H5F_OBJ_ALL, (size_t)oid_list_size, oid_list); CHECK(ret_count, FAIL, "H5Fget_obj_ids"); VERIFY(ret_count, oid_list_size, "H5Fget_obj_count"); - /* Close all object IDs on the list except the file ID. The first ID is supposed to be file ID according + /* Close all object IDs on the list except the file ID. The first ID is supposed to be file ID according * to the library design */ for(i = 0; i< ret_count; i++) { if(fid != oid_list[i]) { @@ -1131,7 +1130,7 @@ test_get_obj_ids(void) CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, NGROUPS + 2, "H5Fget_obj_count"); - /* Get the IDs of the left opend objects */ + /* Get the IDs of the left opend objects */ ret_count = H5Fget_obj_ids(fid, H5F_OBJ_ALL, (size_t)oid_list_size, oid_list); CHECK(ret_count, FAIL, "H5Fget_obj_ids"); VERIFY(ret_count, oid_list_size, "H5Fget_obj_count"); @@ -1143,14 +1142,14 @@ test_get_obj_ids(void) CHECK(ret, FAIL, "H5Oclose"); } } - + H5Sclose(filespace); H5Fclose(fid); HDfree(oid_list); - /* Reopen the file to check whether H5Fget_obj_count and H5Fget_obj_ids still works - * when the file is closed first */ + /* Reopen the file to check whether H5Fget_obj_count and H5Fget_obj_ids still works + * when the file is closed first */ fid = H5Fopen(FILE7, H5F_ACC_RDONLY, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); @@ -1193,7 +1192,7 @@ static void test_get_file_id(void) { hid_t fid, fid2, fid3; - hid_t datatype_id, dataset_id, dataspace_id, group_id, attr_id; + hid_t datatype_id, dataset_id, dataspace_id, group_id, attr_id; hid_t plist; hsize_t dims[F2_RANK]; unsigned intent; @@ -1351,7 +1350,7 @@ check_file_id(hid_t fid, hid_t object_id) ****************************************************************/ static void test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, - hid_t gid2, hid_t gid3) + hid_t gid2, hid_t gid3) { hid_t fid3, fid4; ssize_t oid_count, ret_count; @@ -1392,7 +1391,7 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, oid_count = H5Fget_obj_count((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL); CHECK(oid_count, FAIL, "H5Fget_obj_count"); VERIFY(oid_count, OBJ_ID_COUNT_8, "H5Fget_obj_count"); - + if(oid_count > 0) { hid_t *oid_list; @@ -1400,8 +1399,8 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1, if(oid_list != NULL) { int i; - ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); - CHECK(ret_count, FAIL, "H5Fget_obj_ids"); + ret_count = H5Fget_obj_ids((hid_t)H5F_OBJ_ALL, H5F_OBJ_ALL, (size_t)oid_count, oid_list); + CHECK(ret_count, FAIL, "H5Fget_obj_ids"); for(i = 0; i < oid_count; i++) { H5I_type_t id_type; @@ -1515,11 +1514,11 @@ test_file_perm(void) /**************************************************************** ** ** test_file_perm2(): low-level file test routine. -** This test verifies that no object can be created in a +** This test verifies that no object can be created in a ** file that is opened for read-only. ** *****************************************************************/ -static void +static void test_file_perm2(void) { hid_t file; /* File opened with read-write permission */ @@ -1529,7 +1528,7 @@ test_file_perm2(void) hid_t dset; /* Dataset ID */ hid_t type; /* Datatype ID */ hid_t attr; /* Attribute ID */ - herr_t ret; + herr_t ret; /* Output message about test being performed */ MESSAGE(5, ("Testing Low-Level File Permissions again\n")); @@ -2121,35 +2120,35 @@ test_file_double_dataset_open(void) /**************************************************************** ** ** test_file_double_file_dataset_open(): -** This test checks multi-opens of files & datasets: -** It simulates the multi-thread test program from DLS -** which exposes the file pointer segmentation fault failure. -** NOTE: The order on when the files and datasets are open/close -** is important. +** This test checks multi-opens of files & datasets: +** It simulates the multi-thread test program from DLS +** which exposes the file pointer segmentation fault failure. +** NOTE: The order on when the files and datasets are open/close +** is important. ** *****************************************************************/ static void test_file_double_file_dataset_open(hbool_t new_format) { - hid_t fapl = -1; /* File access property list */ - hid_t dcpl = -1; /* Dataset creation property list */ - hid_t fid1 = -1, fid2 = -1; /* File IDs */ - hid_t did1 = -1, did2 = -1; /* Dataset IDs */ - hid_t sid1 = -1, sid2 = -1; /* Dataspace IDs */ - hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */ - hsize_t dims[1] = {5}, dims2[2] = {1, 4}; /* Dimension sizes */ - hsize_t e_ext_dims[1] = {7}; /* Expanded dimension sizes */ - hsize_t s_ext_dims[1] = {3}; /* Shrunk dimension sizes */ - hsize_t max_dims0[1] = {8}; /* Maximum dimension sizes */ - hsize_t max_dims1[1] = {H5S_UNLIMITED}; /* Maximum dimesion sizes for extensible array index */ - 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 */ + hid_t fapl = -1; /* File access property list */ + hid_t dcpl = -1; /* Dataset creation property list */ + hid_t fid1 = -1, fid2 = -1; /* File IDs */ + hid_t did1 = -1, did2 = -1; /* Dataset IDs */ + hid_t sid1 = -1, sid2 = -1; /* Dataspace IDs */ + hid_t tid1 = -1, tid2 = -1; /* Datatype IDs */ + hsize_t dims[1] = {5}, dims2[2] = {1, 4}; /* Dimension sizes */ + hsize_t e_ext_dims[1] = {7}; /* Expanded dimension sizes */ + hsize_t s_ext_dims[1] = {3}; /* Shrunk dimension sizes */ + hsize_t max_dims0[1] = {8}; /* Maximum dimension sizes */ + hsize_t max_dims1[1] = {H5S_UNLIMITED}; /* Maximum dimesion sizes for extensible array index */ + 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 */ - 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 */ - int wbuf[4] = {1, 2, 3, 4}; /* Input data */ - herr_t ret; /* Generic return value */ + 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 */ + int wbuf[4] = {1, 2, 3, 4}; /* Input data */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing double file and dataset open/close\n")); @@ -2252,8 +2251,8 @@ test_file_double_file_dataset_open(hbool_t new_format) ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); - /* - * Scenario 1 + /* + * Scenario 1 */ /* First file open */ @@ -2308,8 +2307,8 @@ test_file_double_file_dataset_open(hbool_t new_format) ret = H5Tclose(tid2); CHECK(ret, FAIL, "H5Tclose"); - /* - * Scenario 2 + /* + * Scenario 2 */ /* First file open */ @@ -2373,7 +2372,7 @@ test_file_double_file_dataset_open(hbool_t new_format) ret = H5Tclose(tid2); CHECK(ret, FAIL, "H5Tclose"); - /* + /* * Scenario 3 */ @@ -2417,10 +2416,10 @@ test_file_double_file_dataset_open(hbool_t new_format) ret = H5Fclose(fid2); CHECK(ret, FAIL, "H5Fclose"); - /* + /* * Scenario 4 * --trigger H5AC_protect: Assertion `f->shared' failed - * from second call to H5Dset_extent->...H5D__earray_idx_remove->H5EA_get...H5EA__iblock_protect...H5AC_protect + * 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); @@ -2729,9 +2728,9 @@ cal_chksum(const char *file, uint32_t *chksum) ** This test checks to ensure that opening and closing a file ** with read/write permissions does not write anything to the ** file if the file does not change. -** Due to the implementation of file locking (status_flags in -** the superblock is used), this test is changed to use checksum -** instead of timestamp to verify the file is not changed. +** Due to the implementation of file locking (status_flags in +** the superblock is used), this test is changed to use checksum +** instead of timestamp to verify the file is not changed. ** ** Programmer: Vailin Choi; July 2013 ** @@ -2740,8 +2739,8 @@ static void test_rw_noupdate(void) { herr_t ret; /* Generic return value */ - hid_t fid; /* File ID */ - uint32_t chksum1, chksum2; /* Checksum value */ + hid_t fid; /* File ID */ + uint32_t chksum1, chksum2; /* Checksum value */ /* Output message about test being performed */ MESSAGE(5, ("Testing to verify that nothing is written if nothing is changed.\n")); @@ -3130,8 +3129,8 @@ test_userblock_alignment(void) ** test_userblock_alignment_paged(): low-level file test routine. ** This test checks to ensure that files with both a userblock and ** alignment interact properly: -** -- alignment via H5Pset_alignment -** -- alignment via paged aggregation +** -- alignment via H5Pset_alignment +** -- alignment via paged aggregation ** ** Programmer: Vailin Choi; March 2013 ** @@ -3147,14 +3146,14 @@ test_userblock_alignment_paged(void) /* Output message about test being performed */ MESSAGE(5, ("Testing interaction between userblock and alignment (via paged aggregation and H5Pset_alignment)\n")); - /* + /* * Case 1: * Userblock size = 0 * Alignment in use = 4096 * Strategy = H5F_FILE_SPACE_PAGE; fsp_size = alignment = 4096 * Outcome: - * Should succeed: - * userblock is 0 and alignment != 0 + * Should succeed: + * userblock is 0 and alignment != 0 */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3185,14 +3184,14 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 2a: * Userblock size = 1024 * Alignment in use = 512 - * Strategy = H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512 + * Strategy = H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512 * H5Pset_alignment() is 3 * Outcome: - * Should succeed: + * Should succeed: * userblock (1024) is integral mult. of alignment (512) */ /* Create file creation property list with user block */ @@ -3221,16 +3220,16 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 2b: * Userblock size = 1024 * Alignment in use = 3 - * Strategy = H5F_FILE_SPACE_AGGR; fsp_size = 512 - * (via default file creation property) + * Strategy = H5F_FILE_SPACE_AGGR; fsp_size = 512 + * (via default file creation property) * H5Pset_alignment() is 3 * Outcome: - * Should fail at file creation: - * userblock (1024) is non-integral mult. of alignment (3) + * Should fail at file creation: + * userblock (1024) is non-integral mult. of alignment (3) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3257,15 +3256,15 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 3a: * Userblock size = 512 * Alignment in use = 512 - * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512 + * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512 * H5Pset_alignment() is 3 * Outcome: - * Should succeed: - * userblock (512) is equal to alignment (512) + * Should succeed: + * userblock (512) is equal to alignment (512) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3295,15 +3294,15 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 3b: * Userblock size = 512 * Alignment in use = 3 - * Strategy is H5F_FILE_SPACE_NONE; fsp_size = 512 + * Strategy is H5F_FILE_SPACE_NONE; fsp_size = 512 * H5Pset_alignment() is 3 * Outcome: - * Should fail at file creation: - * userblock (512) is non-integral mult. of alignment (3) + * Should fail at file creation: + * userblock (512) is non-integral mult. of alignment (3) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3333,15 +3332,15 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 4a: * Userblock size = 1024 * Alignment in use = 1023 * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 1023 * H5Pset_alignment() is 16 * Outcome: - * Should fail at file creation: - * userblock (1024) is non-integral multiple of alignment (1023) + * Should fail at file creation: + * userblock (1024) is non-integral multiple of alignment (1023) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3371,15 +3370,15 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 4b: * Userblock size = 1024 * Alignment in use = 16 * Strategy is H5F_FILE_SPACE_FSM_AGGR; fsp_size = 1023 * H5Pset_alignment() is 16 * Outcome: - * Should succeed: - * userblock (512) is integral multiple of alignment (16) + * Should succeed: + * userblock (512) is integral multiple of alignment (16) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3409,15 +3408,15 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 5a: * Userblock size = 512 * Alignment in use = 1024 * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 1024 * H5Pset_alignment() is 16 * Outcome: - * Should fail at file creation: - * userblock (512) is less than alignment (1024) + * Should fail at file creation: + * userblock (512) is less than alignment (1024) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3447,7 +3446,7 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 5b: * Userblock size = 512 * Alignment in use = 16 @@ -3455,7 +3454,7 @@ test_userblock_alignment_paged(void) * H5Pset_alignment() is 16 * Outcome: * Should succed: - * userblock (512) is integral multiple of alignment (16) + * userblock (512) is integral multiple of alignment (16) */ /* Create file creation property list with user block */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3485,16 +3484,16 @@ test_userblock_alignment_paged(void) ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case 6: * Userblock size = 512 * Alignment in use = 512 * Strategy is H5F_FILE_SPACE_PAGE; fsp_size = alignment = 512 * H5Pset_alignment() is 3 - * Reopen the file; H5Pset_alignment() is 1024 + * Reopen the file; H5Pset_alignment() is 1024 * Outcome: * Should succed: - * Userblock (512) is the same as alignment (512); + * Userblock (512) is the same as alignment (512); * The H5Pset_alignment() calls have no effect */ /* Create file creation property list with user block */ @@ -3538,19 +3537,19 @@ test_userblock_alignment_paged(void) /**************************************************************** ** ** test_filespace_info(): -** Verify the following public routines retrieve and set file space -** information correctly: -** (1) H5Pget/set_file_space_strategy(): -** Retrieve and set file space strategy, persisting free-space, -** and free-space section threshold as specified -** (2) H5Pget/set_file_space_page_size(): -** Retrieve and set the page size for paged aggregation +** Verify the following public routines retrieve and set file space +** information correctly: +** (1) H5Pget/set_file_space_strategy(): +** Retrieve and set file space strategy, persisting free-space, +** and free-space section threshold as specified +** (2) H5Pget/set_file_space_page_size(): +** Retrieve and set the page size for paged aggregation ** ****************************************************************/ static void test_filespace_info(const char *env_h5_drvr) { - hid_t fid; /* File IDs */ + hid_t fid; /* File IDs */ hid_t fapl, new_fapl; /* File access property lists */ hid_t fcpl, fcpl1, fcpl2; /* File creation property lists */ H5F_fspace_strategy_t strategy; /* File space strategy */ @@ -3563,7 +3562,7 @@ test_filespace_info(const char *env_h5_drvr) hsize_t fsp_size; /* File space page size */ char filename[FILENAME_LEN]; /* Filename to use */ hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ - herr_t ret; /* Return value */ + herr_t ret; /* Return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing file creation public routines: H5Pget/set_file_space_strategy & H5Pget/set_file_space_page_size\n")); @@ -3581,14 +3580,14 @@ test_filespace_info(const char *env_h5_drvr) ret = H5Pset_libver_bounds(new_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); CHECK(ret, FAIL, "H5Pset_libver_bounds"); - /* + /* * Case (1) * Check file space information from a default file creation property list. * Values expected: - * strategy--H5F_FILE_SPACE_AGGR - * persist--FALSE - * threshold--1 - * file space page size--4096 + * strategy--H5F_FILE_SPACE_AGGR + * persist--FALSE + * threshold--1 + * file space page size--4096 */ /* Create file creation property list template */ fcpl = H5Pcreate(H5P_FILE_CREATE); @@ -3611,7 +3610,7 @@ test_filespace_info(const char *env_h5_drvr) /* Close property list */ H5Pclose(fcpl); - /* + /* * Case (2) * File space page size has a minimum size of 512. * Setting value less than 512 will return an error; @@ -3660,14 +3659,14 @@ test_filespace_info(const char *env_h5_drvr) /* Close property list */ H5Pclose(fcpl); - /* + /* * Case (3) * Check file space information when creating a file with default properties. * Values expected: - * strategy--H5F_FILE_SPACE_AGGR - * persist--FALSE - * threshold--1 - * file space page size--4096 + * strategy--H5F_FILE_SPACE_AGGR + * persist--FALSE + * threshold--1 + * file space page size--4096 */ /* Create a file with default file creation and access property lists */ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -3697,15 +3696,15 @@ test_filespace_info(const char *env_h5_drvr) ret = H5Pclose(fcpl1); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case (4) * Check file space information when creating a file with the * latest library format and default properties. * Values expected: - * strategy--H5F_FILE_SPACE_AGGR - * persist--FALSE - * threshold--1 - * file space page size--4096 + * strategy--H5F_FILE_SPACE_AGGR + * persist--FALSE + * threshold--1 + * file space page size--4096 */ /* Create a file with the latest library format */ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, new_fapl); @@ -3735,21 +3734,21 @@ test_filespace_info(const char *env_h5_drvr) ret = H5Pclose(fcpl1); CHECK(ret, FAIL, "H5Pclose"); - /* + /* * Case (5) * Check file space information with the following combinations: - * Create file with -- - * New or old format - * Persist or not persist free-space - * Different sizes for free-space section threshold (0 to 10) - * The four file space strategies: - * H5F_FSPACE_STRATEGY_FSM_AGGR, H5F_FSPACE_STRATEGY_PAGE, + * Create file with -- + * New or old format + * Persist or not persist free-space + * Different sizes for free-space section threshold (0 to 10) + * The four file space strategies: + * H5F_FSPACE_STRATEGY_FSM_AGGR, H5F_FSPACE_STRATEGY_PAGE, * H5F_FSPACE_STRATEGY_AGGR, H5F_FSPACE_STRATEGY_NONE - * File space page size: set to 512 - * + * File space page size: set to 512 + * */ for(new_format = FALSE; new_format <= TRUE; new_format++) { - hid_t my_fapl; + hid_t my_fapl; /* Set the FAPL for the type of format */ if(new_format) { @@ -3783,7 +3782,7 @@ test_filespace_info(const char *env_h5_drvr) ret = H5Pset_file_space_page_size(fcpl, FSP_SIZE512); CHECK(ret, FAIL, "H5Pset_file_space_strategy"); - + /* Retrieve file space information */ ret = H5Pget_file_space_strategy(fcpl, &strategy, &persist, &threshold); CHECK(ret, FAIL, "H5Pget_file_space_strategy"); @@ -3942,13 +3941,13 @@ error: ** returned by the public routine H5Fget_freespace(). ** ** Modifications: -** Vailin Choi; July 2012 -** Remove datasets in reverse order so that all file spaces are shrunk. -** (A change due to H5FD_FLMAP_DICHOTOMY.) +** Vailin Choi; July 2012 +** Remove datasets in reverse order so that all file spaces are shrunk. +** (A change due to H5FD_FLMAP_DICHOTOMY.) ** -** Vailin Choi; Dec 2012 -** Add changes due to paged aggregation via new format: -** the amount of freespace is different. +** Vailin Choi; Dec 2012 +** Add changes due to paged aggregation via new format: +** the amount of freespace is different. ** *****************************************************************/ static void @@ -4088,9 +4087,9 @@ test_file_freespace(const char *env_h5_drvr) /* Check that there is the right amount of free space in the file */ free_space = H5Fget_freespace(file); CHECK(free_space, FAIL, "H5Fget_freespace"); - if(new_format) + if(new_format) VERIFY(free_space, expected_fs_del, "H5Fget_freespace"); - else + else VERIFY(free_space, expected_fs_del, "H5Fget_freespace"); /* Close file */ @@ -4114,7 +4113,7 @@ test_file_freespace(const char *env_h5_drvr) ** ** test_sects_freespace(): ** This routine checks free-space section information for the -** file as returned by the public routine H5Fget_free_sections(). +** file as returned by the public routine H5Fget_free_sections(). ** *****************************************************************/ static void @@ -4136,9 +4135,9 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) H5F_sect_info_t all_sect_info[15]; /* Array to hold free-space information for all types of data */ H5F_sect_info_t meta_sect_info[15]; /* Array to hold free-space information for metadata */ H5F_sect_info_t raw_sect_info[15]; /* Array to hold free-space information for raw data */ - hsize_t total = 0; /* sum of the free-space section sizes */ + hsize_t total = 0; /* sum of the free-space section sizes */ hsize_t tmp_tot = 0; /* Sum of the free-space section sizes */ - hsize_t last_size; /* Size of last free-space section */ + hsize_t last_size; /* Size of last free-space section */ hsize_t dims[1]; /* Dimension sizes */ unsigned u; /* Local index variable */ H5FD_mem_t type; @@ -4177,7 +4176,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) } else { ret = H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1); CHECK(ret, FAIL, "H5Pget_file_space_strategy"); - } + } /* Create the file */ file = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); @@ -4301,7 +4300,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) HDmemset(meta_sect_info, 0, sizeof(meta_sect_info)); if(multi_vfd) { - hssize_t ntmp; + hssize_t ntmp; for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) { if(type == H5FD_MEM_DRAW || type == H5FD_MEM_GHEAP) @@ -4353,7 +4352,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) CHECK(fcpl, FAIL, "H5Pclose"); h5_clean_files(FILESPACE_NAME, fapl); - } + } } /* end test_sects_freespace() */ @@ -4361,29 +4360,29 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) /**************************************************************** ** ** test_filespace_compatible(): -** Verify that the trunk with the latest file space management -** can open, read and modify 1.6 HDF5 file and 1.8 HDF5 file. -** Also verify the correct file space handling information -** and the amount of free space. +** Verify that the trunk with the latest file space management +** can open, read and modify 1.6 HDF5 file and 1.8 HDF5 file. +** Also verify the correct file space handling information +** and the amount of free space. ** ****************************************************************/ static void test_filespace_compatible(void) { int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */ - hid_t fid = -1; /* File id */ - hid_t did = -1; /* Dataset id */ - hid_t fcpl; /* File creation property list template */ - int check[100]; /* Temporary buffer for verifying dataset data */ - int rdbuf[100]; /* Temporary buffer for reading in dataset data */ - uint8_t buf[READ_OLD_BUFSIZE]; /* temporary buffer for reading */ - ssize_t nread; /* Number of bytes read in */ - unsigned i, j; /* Local index variable */ - hssize_t free_space; /* Amount of free-space in the file */ - hbool_t persist; /* Persist free-space or not */ - hsize_t threshold; /* Free-space section threshold */ - H5F_fspace_strategy_t strategy; /* File space handling strategy */ - herr_t ret; /* Return value */ + hid_t fid = -1; /* File id */ + hid_t did = -1; /* Dataset id */ + hid_t fcpl; /* File creation property list template */ + int check[100]; /* Temporary buffer for verifying dataset data */ + int rdbuf[100]; /* Temporary buffer for reading in dataset data */ + uint8_t buf[READ_OLD_BUFSIZE]; /* temporary buffer for reading */ + ssize_t nread; /* Number of bytes read in */ + unsigned i, j; /* Local index variable */ + hssize_t free_space; /* Amount of free-space in the file */ + hbool_t persist; /* Persist free-space or not */ + hsize_t threshold; /* Free-space section threshold */ + H5F_fspace_strategy_t strategy; /* File space handling strategy */ + herr_t ret; /* Return value */ /* Output message about test being performed */ MESSAGE(5, ("File space compatibility testing for 1.6 and 1.8 files\n")); @@ -4392,31 +4391,31 @@ test_filespace_compatible(void) const char *filename = H5_get_srcdir_filename(OLD_FILENAME[j]); /* Corrected test file name */ /* Open and copy the test file into a temporary file */ - fd_old = HDopen(filename, O_RDONLY); - CHECK(fd_old, FAIL, "HDopen"); - fd_new = HDopen(FILE5, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW); - CHECK(fd_new, FAIL, "HDopen"); + fd_old = HDopen(filename, O_RDONLY); + CHECK(fd_old, FAIL, "HDopen"); + fd_new = HDopen(FILE5, O_RDWR|O_CREAT|O_TRUNC, H5_POSIX_CREATE_MODE_RW); + CHECK(fd_new, FAIL, "HDopen"); - /* Copy data */ + /* Copy data */ while((nread = HDread(fd_old, buf, (size_t)READ_OLD_BUFSIZE)) > 0) { ssize_t write_err = HDwrite(fd_new, buf, (size_t)nread); CHECK(write_err, -1, "HDwrite"); } /* end while */ - /* Close the files */ - ret = HDclose(fd_old); - CHECK(ret, FAIL, "HDclose"); - ret = HDclose(fd_new); - CHECK(ret, FAIL, "HDclose"); + /* Close the files */ + ret = HDclose(fd_old); + CHECK(ret, FAIL, "HDclose"); + ret = HDclose(fd_new); + CHECK(ret, FAIL, "HDclose"); /* Open the temporary test file */ - fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT); - CHECK(fid, FAIL, "H5Fopen"); + fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); - /* There should not be any free space in the file */ - free_space = H5Fget_freespace(fid); - CHECK(free_space, FAIL, "H5Fget_freespace"); - VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); + /* There should not be any free space in the file */ + free_space = H5Fget_freespace(fid); + CHECK(free_space, FAIL, "H5Fget_freespace"); + VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); /* Get the file's file creation property list */ fcpl = H5Fget_create_plist(fid); @@ -4433,27 +4432,27 @@ test_filespace_compatible(void) VERIFY(persist, FALSE, "H5Pget_file_space_strategy"); VERIFY(threshold, 1, "H5Pget_file_space_strategy"); - /* Generate raw data */ - for(i = 0; i < 100; i++) - check[i] = (int)i; + /* Generate raw data */ + for(i = 0; i < 100; i++) + check[i] = (int)i; - /* Open and read the dataset */ - did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT); - CHECK(did, FAIL, "H5Dopen"); - ret = H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdbuf); - CHECK(ret, FAIL, "H5Dread"); + /* Open and read the dataset */ + did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dopen"); + ret = H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdbuf); + CHECK(ret, FAIL, "H5Dread"); - /* Verify the data read is correct */ - for(i = 0; i < 100; i++) - VERIFY(rdbuf[i], check[i], "test_compatible"); + /* Verify the data read is correct */ + for(i = 0; i < 100; i++) + VERIFY(rdbuf[i], check[i], "test_compatible"); - /* Close the dataset */ - ret = H5Dclose(did); - CHECK(ret, FAIL, "H5Dclose"); + /* Close the dataset */ + ret = H5Dclose(did); + CHECK(ret, FAIL, "H5Dclose"); - /* Remove the dataset */ - ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Ldelete"); + /* Remove the dataset */ + ret = H5Ldelete(fid, DSETNAME, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Ldelete"); /* Close the plist */ ret = H5Pclose(fcpl); @@ -4463,30 +4462,30 @@ test_filespace_compatible(void) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Re-Open the file */ - fid = H5Fopen(FILE5, H5F_ACC_RDONLY, H5P_DEFAULT); - CHECK(fid, FAIL, "H5Fopen"); + /* Re-Open the file */ + fid = H5Fopen(FILE5, H5F_ACC_RDONLY, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); - /* The dataset should not be there */ - did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT); - VERIFY(did, FAIL, "H5Dopen"); + /* The dataset should not be there */ + did = H5Dopen2(fid, DSETNAME, H5P_DEFAULT); + VERIFY(did, FAIL, "H5Dopen"); - /* There should not be any free space in the file */ - free_space = H5Fget_freespace(fid); - CHECK(free_space, FAIL, "H5Fget_freespace"); - VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); + /* There should not be any free space in the file */ + free_space = H5Fget_freespace(fid); + CHECK(free_space, FAIL, "H5Fget_freespace"); + VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); - /* Close the file */ - ret = H5Fclose(fid); - CHECK(ret, FAIL, "H5Fclose"); + /* Close the file */ + ret = H5Fclose(fid); + CHECK(ret, FAIL, "H5Fclose"); } /* end for */ } /* test_filespace_compatible */ /**************************************************************** ** ** test_filespace_1.10.0_compatible(): -** Verify that the latest file space management can open, read and -** modify 1.10.0 HDF5 files : +** Verify that the latest file space management can open, read and +** modify 1.10.0 HDF5 files : ** h5fc_ext1_i.h5: H5F_FILE_SPACE_ALL, default threshold; has superblock extension but no fsinfo message ** h5fc_ext1_f.h5: H5F_FILE_SPACE_ALL_PERSIST, default threshold; has superblock extension with fsinfo message ** h5fc_ext2_if.h5: H5F_FILE_SPACE_ALL, non-default threshold; has superblock extension with fsinfo message @@ -4500,16 +4499,16 @@ static void test_filespace_1_10_0_compatible(void) { hid_t fid = -1; /* File id */ - hid_t did = -1; /* Dataset id */ + hid_t did = -1; /* Dataset id */ hid_t fcpl; /* File creation property list */ - hbool_t persist; /* Persist free-space or not */ - hsize_t threshold; /* Free-space section threshold */ + hbool_t persist; /* Persist free-space or not */ + hsize_t threshold; /* Free-space section threshold */ H5F_fspace_strategy_t strategy; /* File space handling strategy */ - int wbuf[24]; /* Buffer for dataset data */ - int rdbuf[24]; /* Buffer for dataset data */ + int wbuf[24]; /* Buffer for dataset data */ + int rdbuf[24]; /* Buffer for dataset data */ int status; /* Status from copying the existing file */ unsigned i, j; /* Local index variable */ - herr_t ret; /* Return value */ + herr_t ret; /* Return value */ /* Output message about test being performed */ MESSAGE(5, ("File space compatibility testing for 1.10.0 files\n")); @@ -4517,7 +4516,7 @@ test_filespace_1_10_0_compatible(void) for(j = 0; j < NELMTS(OLD_1_10_0_FILENAME); j++) { /* Make a copy of the test file */ status = h5_make_local_copy(OLD_1_10_0_FILENAME[j], FILE5); - CHECK(status, FAIL, "h5_make_local_copy"); + CHECK(status, FAIL, "h5_make_local_copy"); /* Open the temporary test file */ fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT); @@ -4551,7 +4550,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 1: VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy"); @@ -4572,7 +4571,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 2: VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy"); @@ -4593,7 +4592,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 3: VERIFY(strategy, H5F_FSPACE_STRATEGY_NONE, "H5Pget_file_space_strategy"); @@ -4614,7 +4613,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 4: VERIFY(strategy, H5F_FSPACE_STRATEGY_AGGR, "H5Pget_file_space_strategy"); @@ -4635,7 +4634,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 5: VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy"); VERIFY(persist, H5F_FREE_SPACE_PERSIST_DEF, "H5Pget_file_space_strategy"); @@ -4655,10 +4654,10 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; default: - break; + break; } /* Close the plist */ @@ -4689,7 +4688,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 1: /* Open and read the dataset */ @@ -4706,7 +4705,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 2: /* Open and read the dataset */ @@ -4723,7 +4722,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 3: /* Open and read the dataset */ @@ -4740,7 +4739,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 4: @@ -4758,7 +4757,7 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; case 5: @@ -4776,10 +4775,10 @@ test_filespace_1_10_0_compatible(void) /* Close the dataset */ ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); - break; + break; default: - break; + break; } /* Close the file */ @@ -4792,36 +4791,36 @@ test_filespace_1_10_0_compatible(void) /**************************************************************** ** ** test_filespace_round_compatible(): -** Verify that the trunk can open, read and modify these files-- -** 1) They are initially created (via gen_filespace.c) in the trunk -** with combinations of file space strategies, default/non-default -** threshold, and file spacing paging enabled/disbled. -** The library creates the file space info message with -** "mark if unknown" in these files. -** 2) They are copied to the 1.8 branch, and are opened/read/modified -** there via test_filespace_compatible() in test/tfile.c. -** The 1.8 library marks the file space info message as "unknown" -** in these files. -** 3) They are then copied back from the 1.8 branch to the trunk for -** compatibility testing via this routine. -** 4) Upon encountering the file space info message which is marked -** as "unknown", the library will use the default file space management -** from then on: non-persistent free-space managers, default threshold, -** and non-paging file space. +** Verify that the trunk can open, read and modify these files-- +** 1) They are initially created (via gen_filespace.c) in the trunk +** with combinations of file space strategies, default/non-default +** threshold, and file spacing paging enabled/disbled. +** The library creates the file space info message with +** "mark if unknown" in these files. +** 2) They are copied to the 1.8 branch, and are opened/read/modified +** there via test_filespace_compatible() in test/tfile.c. +** The 1.8 library marks the file space info message as "unknown" +** in these files. +** 3) They are then copied back from the 1.8 branch to the trunk for +** compatibility testing via this routine. +** 4) Upon encountering the file space info message which is marked +** as "unknown", the library will use the default file space management +** from then on: non-persistent free-space managers, default threshold, +** and non-paging file space. ** ****************************************************************/ static void test_filespace_round_compatible(void) { - hid_t fid = -1; /* File id */ - hid_t fcpl = -1; /* File creation property list ID */ - unsigned j; /* Local index variable */ - H5F_fspace_strategy_t strategy; /* File space strategy */ - hbool_t persist; /* Persist free-space or not */ - hsize_t threshold; /* Free-space section threshold */ - hssize_t free_space; /* Amount of free space in the file */ + hid_t fid = -1; /* File id */ + hid_t fcpl = -1; /* File creation property list ID */ + unsigned j; /* Local index variable */ + H5F_fspace_strategy_t strategy; /* File space strategy */ + hbool_t persist; /* Persist free-space or not */ + hsize_t threshold; /* Free-space section threshold */ + hssize_t free_space; /* Amount of free space in the file */ int status; /* Status from copying the existing file */ - herr_t ret; /* Return value */ + herr_t ret; /* Return value */ /* Output message about test being performed */ MESSAGE(5, ("File space compatibility testing for files from trunk to 1_8 to trunk\n")); @@ -4829,31 +4828,31 @@ test_filespace_round_compatible(void) for(j = 0; j < NELMTS(FSPACE_FILENAMES); j++) { /* Make a copy of the test file */ status = h5_make_local_copy(FSPACE_FILENAMES[j], FILE5); - CHECK(status, FAIL, "h5_make_local_copy"); - - /* Open the temporary test file */ - fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT); - CHECK(fid, FAIL, "H5Fopen"); - - /* Get the file's creation property list */ - fcpl = H5Fget_create_plist(fid); - CHECK(fcpl, FAIL, "H5Fget_create_plist"); - - ret = H5Pget_file_space_strategy(fcpl, &strategy, &persist, &threshold); - CHECK(ret, FAIL, "H5Pget_file_space_strategy"); - VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy"); - VERIFY(persist, FALSE, "H5Pget_file_space_strategy"); - VERIFY(threshold, 1, "H5Pget_file_space_strategy"); - - /* There should not be any free space in the file */ - free_space = H5Fget_freespace(fid); - CHECK(free_space, FAIL, "H5Fget_freespace"); - VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); - - /* Closing */ - ret = H5Fclose(fid); - ret = H5Pclose(fcpl); - CHECK(ret, FAIL, "H5Fclose"); + CHECK(status, FAIL, "h5_make_local_copy"); + + /* Open the temporary test file */ + fid = H5Fopen(FILE5, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fopen"); + + /* Get the file's creation property list */ + fcpl = H5Fget_create_plist(fid); + CHECK(fcpl, FAIL, "H5Fget_create_plist"); + + ret = H5Pget_file_space_strategy(fcpl, &strategy, &persist, &threshold); + CHECK(ret, FAIL, "H5Pget_file_space_strategy"); + VERIFY(strategy, H5F_FSPACE_STRATEGY_FSM_AGGR, "H5Pget_file_space_strategy"); + VERIFY(persist, FALSE, "H5Pget_file_space_strategy"); + VERIFY(threshold, 1, "H5Pget_file_space_strategy"); + + /* There should not be any free space in the file */ + free_space = H5Fget_freespace(fid); + CHECK(free_space, FAIL, "H5Fget_freespace"); + VERIFY(free_space, (hssize_t)0, "H5Fget_freespace"); + + /* Closing */ + ret = H5Fclose(fid); + ret = H5Pclose(fcpl); + CHECK(ret, FAIL, "H5Fclose"); } /* end for */ } /* test_filespace_round_compatible */ @@ -4953,14 +4952,14 @@ test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, CHECK(ret, FAIL, "H5Pclose"); } /* end test_libver_bounds_real() */ - + /*------------------------------------------------------------------------- * Function: test_libver_bounds_open * * Purpose: Tests opening latest file with various low/high bounds. * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * *------------------------------------------------------------------------- */ @@ -5065,22 +5064,22 @@ test_libver_bounds_open(void) CHECK(ret, FAIL, "H5Pget_libver_bounds"); VERIFY(new_low, H5F_LIBVER_LATEST, "Low bound should be upgraded to H5F_LIBVER_LATEST"); - ret = H5Pclose(new_fapl); + ret = H5Pclose(new_fapl); CHECK(ret, FAIL, "H5Pclose"); - ret = H5Fclose(file); + ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); } /* for low */ /* Close dataspace and property lists */ ret = H5Sclose(space); CHECK(ret, FAIL, "H5Sclose"); - ret = H5Pclose(dcpl); + ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - ret = H5Pclose(fapl); + ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); } /* end test_libver_bounds_open() */ - + /**************************************************************** ** ** test_libver_bounds(): @@ -5112,7 +5111,7 @@ test_libver_bounds(void) ** (4) (v18, v110) ** (5) (v110, v110) ** -** For each pair of setting in fapl, verify format versions with the following +** For each pair of setting in fapl, verify format versions with the following ** six tests: ** (1) test_libver_bounds_super(fapl): superblock versions ** (2) test_libver_bounds_obj(fapl): object header versions @@ -5139,7 +5138,7 @@ test_libver_bounds_low_high(void) /* Loop through all the combinations of low/high version bounds */ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { - + H5E_BEGIN_TRY { /* Set the low/high version bounds */ ret = H5Pset_libver_bounds(fapl, low, high); @@ -5179,15 +5178,15 @@ test_libver_bounds_low_high(void) ** ** test_libver_bounds_super(): ** Verify superblock version with the following two tests: -** (1) test_libver_bounds_super_create(): -** --when creating a file with the input fapl and the fcpl +** (1) test_libver_bounds_super_create(): +** --when creating a file with the input fapl and the fcpl ** that has the following feature enabled: ** (A) default fcpl ** (B) fcpl with v1-btee K value enabled ** (C) fcpl with shared messages enabled ** (D) fcpl with persistent free-space manager enabled ** -** (2) test_libver_bounds_super_open(): +** (2) test_libver_bounds_super_open(): ** --when opening a file which is created with the input fapl ** and the fcpl setting as #A to #D above. ** @@ -5205,7 +5204,7 @@ test_libver_bounds_super(hid_t fapl) fcpl = H5Pcreate(H5P_FILE_CREATE); CHECK(fcpl, FAIL, "H5Pcreate"); - /* Verify superblock version when creating a file with input fapl, + /* Verify superblock version when creating a file with input fapl, fcpl #A and with/without SWMR access */ test_libver_bounds_super_create(fapl, fcpl, TRUE); test_libver_bounds_super_create(fapl, fcpl, FALSE); @@ -5249,7 +5248,7 @@ test_libver_bounds_super(hid_t fapl) ret = H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_ATTR_FLAG, 2); CHECK(ret, FAIL, "H5Pset_shared_mesg_index"); - /* Verify superblock version when creating a file with input fapl, + /* Verify superblock version when creating a file with input fapl, fcpl #C and with/without SWMR access */ test_libver_bounds_super_create(fapl, fcpl, TRUE); test_libver_bounds_super_create(fapl, fcpl, FALSE); @@ -5329,11 +5328,11 @@ test_libver_bounds_super(hid_t fapl) static void test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr) { - hid_t fid = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file pointer */ + hid_t fid = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file pointer */ H5F_libver_t low, high; /* Low and high bounds */ - hbool_t ok; /* The result is ok or not */ - herr_t ret; /* The return value */ + hbool_t ok; /* The result is ok or not */ + herr_t ret; /* The return value */ /* Try to create the file */ H5E_BEGIN_TRY { @@ -5477,13 +5476,13 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr) static void test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) { - hid_t fid = -1; /* File ID */ - H5F_t *f = NULL; /* Internal file pointer */ + hid_t fid = -1; /* File ID */ + H5F_t *f = NULL; /* Internal file pointer */ hid_t new_fapl = -1; /* File access property list */ - unsigned super_vers; /* Superblock version */ + unsigned super_vers; /* Superblock version */ H5F_libver_t low, high; /* Low and high bounds */ - hbool_t ok; /* The result is ok or not */ - herr_t ret; /* Return value */ + hbool_t ok; /* The result is ok or not */ + herr_t ret; /* Return value */ /* Create the file with the input fcpl and fapl */ fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, fcpl, fapl); @@ -5594,7 +5593,7 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr) ** Close the file. ** ** (c) Reopen the same file in (b) with a new fapl. -** The new fapl is set to the 5 pairs of low/high +** The new fapl is set to the 5 pairs of low/high ** bounds in a "for" loop. For each setting in fapl: ** --Create a group in the file ** --Verify the group's object header version @@ -5670,7 +5669,7 @@ test_libver_bounds_obj(hid_t fapl) CHECK(new_fapl, FAIL, "H5Pcreate"); /* Loop through all the combinations of low/high bounds in new_fapl */ - /* Open the file with the fapl; create a group and verify the + /* Open the file with the fapl; create a group and verify the object header version, then delete the group and close the file.*/ for(low = H5F_LIBVER_EARLIEST; low < H5F_LIBVER_NBOUNDS; low++) { for(high = H5F_LIBVER_EARLIEST; high < H5F_LIBVER_NBOUNDS; high++) { @@ -5746,13 +5745,13 @@ test_libver_bounds_obj(hid_t fapl) ** Create the following two datasets: ** --A contiguous dataset ** --A chunked dataset with "no filter edge chunks" -** For both datasets, verify the versions for the layout, +** For both datasets, verify the versions for the layout, ** fill value and filter pipeline messages. ** Close the file. ** -** (b) Create a new fapl that is set to the 5 pairs of low/high -** bounds in a "for" loop. For each pair of setting in the -** new fapl: +** (b) Create a new fapl that is set to the 5 pairs of low/high +** bounds in a "for" loop. For each pair of setting in the +** new fapl: ** --Open the same file in (a) with the fapl ** --Create a chunked dataset with 2 unlimited ** dimensions @@ -5803,7 +5802,7 @@ test_libver_bounds_dataset(hid_t fapl) /* Verify version for layout and fill value messages */ if(low == H5F_LIBVER_EARLIEST) { /* For layout message: the earliest version the library will set is 3 */ - /* For fill value message: the earliest version the library will set is 2 */ + /* For fill value message: the earliest version the library will set is 2 */ VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "H5O_layout_ver_bounds"); VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "H5O_fill_ver_bounds"); } else { @@ -5823,7 +5822,7 @@ test_libver_bounds_dataset(hid_t fapl) CHECK(ret, FAIL, "H5Sclose"); /* Set up dataspace and dcpl for creating a chunked dataset - with "no filter edge chunks" enabled. + with "no filter edge chunks" enabled. This will result in a version 4 layout message */ sid = H5Screate_simple(2, fix_dims2, NULL); CHECK(sid, FAIL, "H5Screate_simple"); @@ -5866,12 +5865,12 @@ test_libver_bounds_dataset(hid_t fapl) ret = H5Pclose(dcpl); CHECK(ret, FAIL, "H5Pclose"); - /* Create a default file access property list which is used + /* Create a default file access property list which is used to open the file in the 'for' loop */ new_fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(new_fapl, FAIL, "H5Pcreate"); - /* Set up dataspace and dcpl for creating a chunked dataset with + /* Set up dataspace and dcpl for creating a chunked dataset with 2 unlimited dimensions in the 'for' loop */ sid = H5Screate_simple(2, dims2, max_dims2); CHECK(sid, FAIL, "H5Screate_simple"); @@ -5915,7 +5914,7 @@ test_libver_bounds_dataset(hid_t fapl) /* Also verify the chunk indexing type */ if(f->shared->low_bound == H5F_LIBVER_EARLIEST) { /* For layout message: the earliest version the library will set is 3 */ - /* For fill value message: the earliest version the library will set is 2 */ + /* For fill value message: the earliest version the library will set is 2 */ VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_DEFAULT, "H5O_layout_ver_bounds"); VERIFY(dset->shared->dcpl_cache.fill.version, H5O_FILL_VERSION_2, "H5O_fill_ver_bounds"); } else { @@ -5975,7 +5974,7 @@ test_libver_bounds_dataset(hid_t fapl) ** Close the file. ** ** (b) Create a new fapl that is set to the 5 pairs of low/high -** bounds in a "for" loop. For each pair of setting in the +** bounds in a "for" loop. For each pair of setting in the ** new fapl: ** --Open the same file in (a) with the fapl ** --Create a chunked dataset, a compact dataset and @@ -6228,7 +6227,7 @@ static void test_libver_bounds_datatype(hid_t fapl) { hid_t tid = -1, tid_enum = -1, tid_array = -1; /* Datatype IDs */ - hid_t tid_compound = -1, tid_vlen = -1; /* Datatype IDs */ + hid_t tid_compound = -1, tid_vlen = -1; /* Datatype IDs */ int enum_value; /* Value for enum datatype */ typedef struct s1 { /* Data structure for compound datatype */ char c; @@ -6296,12 +6295,12 @@ test_libver_bounds_datatype(hid_t fapl) ** test_libver_bounds_datatype_check(): ** Helper routine called by test_libver_bounds_datatype() ** to verify the datatype message version for the input tid: -** +** ** (a) Create a file with default fcpl and the input fapl. ** Create a contiguous dataset with the input tid. -** Verify the datatype message version. +** Verify the datatype message version. ** Create a committed datatype of string to be -** used later. +** used later. ** Close the file. ** ** (b) Create a new fapl that is set to the 5 pairs of low/high @@ -6319,13 +6318,13 @@ test_libver_bounds_datatype(hid_t fapl) static void test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) { - hid_t fid = -1; /* File ID */ + hid_t fid = -1; /* File ID */ hid_t new_fapl = -1; /* File acess property list */ hid_t dcpl = -1; /* Dataset creation property list */ hid_t dtid = -1; /* Datatype ID for the dataset */ hid_t str_tid = -1; /* String datatype ID */ - hid_t did = -1; /* Dataset ID */ - hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hid_t sid = -1; /* Dataspace ID */ hsize_t dims[1] = {1}; /* Dimension sizes */ hsize_t dims2[2] = {5, 4}; /* Dimension sizes */ hsize_t max_dims2[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Maximum dimension sizes */ @@ -6336,7 +6335,7 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) H5F_libver_t low, high; /* Low and high bounds */ herr_t ret; /* Return value */ - /* Retrieve the low/high version bounds from the input fapl */ + /* Retrieve the low/high version bounds from the input fapl */ ret = H5Pget_libver_bounds(fapl, &low, &high); CHECK(ret, FAIL, "H5Pget_libver_bounds"); @@ -6373,14 +6372,14 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) /* Verify the datatype message version */ /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY: - * --the library will set version according to low_bound - * --H5T_ARRAY: the earliest version the library will set is 2 + * --the library will set version according to low_bound + * --H5T_ARRAY: the earliest version the library will set is 2 * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE: - * --the library will only use basic version + * --the library will only use basic version */ - if(dtype->shared->type == H5T_COMPOUND || - dtype->shared->type == H5T_ENUM || + if(dtype->shared->type == H5T_COMPOUND || + dtype->shared->type == H5T_ENUM || dtype->shared->type == H5T_ARRAY) { if(dtype->shared->type == H5T_ARRAY && low == H5F_LIBVER_EARLIEST) VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds"); @@ -6469,15 +6468,15 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) /* Verify the dataset's datatype message version */ /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY: - * --the library will set version according to low_bound - * --H5T_ARRAY: the earliest version the library will set is 2 + * --the library will set version according to low_bound + * --H5T_ARRAY: the earliest version the library will set is 2 * H5T_INTEGER, H5T_FLOAT, H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_REFERENCE: - * --the library will only use basic version + * --the library will only use basic version */ - if(dtype->shared->type == H5T_COMPOUND || - dtype->shared->type == H5T_ENUM || + if(dtype->shared->type == H5T_COMPOUND || + dtype->shared->type == H5T_ENUM || dtype->shared->type == H5T_ARRAY) { - if(dtype->shared->type == H5T_ARRAY && + if(dtype->shared->type == H5T_ARRAY && f->shared->low_bound == H5F_LIBVER_EARLIEST) VERIFY(dtype->shared->version, H5O_DTYPE_VERSION_2, "H5O_dtype_ver_bounds"); else @@ -6525,7 +6524,7 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) ** Verify the attribute message versions: ** ** (a) Create a file with default fcpl and the input fapl. -** Create a group and attach the following three attributes +** Create a group and attach the following three attributes ** to the group: ** (1) Attribute with a committed datatype ** (2) Attribute with integer type @@ -6535,7 +6534,7 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) ** ** (b) Create a fcpl that has shared datatype message enabled. ** Create a file with the fcpl and the input fapl. -** Create a group and attach an attribute with shared +** Create a group and attach an attribute with shared ** integer type to the group. ** Verify the attribute message version. ** Close the file @@ -6567,7 +6566,7 @@ test_libver_bounds_attributes(hid_t fapl) H5F_libver_t low, high; /* Low and high bounds */ herr_t ret; /* Return value */ - /* Retrieve the low/high bounds from the input fapl */ + /* Retrieve the low/high bounds from the input fapl */ ret = H5Pget_libver_bounds(fapl, &low, &high); CHECK(ret, FAIL, "H5Pget_libver_bounds"); @@ -6810,7 +6809,7 @@ test_libver_bounds_attributes(hid_t fapl) /**************************************************************** ** ** test_libver_macros(): -** Verify that H5_VERSION_GE and H5_VERSION_LE work correactly. +** Verify that H5_VERSION_GE and H5_VERSION_LE work correactly. ** ****************************************************************/ static void @@ -6859,7 +6858,7 @@ test_libver_macros(void) /**************************************************************** ** ** test_libver_macros2(): -** Verify that H5_VERSION_GE works correactly and show how +** Verify that H5_VERSION_GE works correactly and show how ** to use it. ** ****************************************************************/ @@ -6892,9 +6891,9 @@ test_libver_macros2(void) ret = H5Gclose(grp); CHECK(ret, FAIL, "H5Gclose"); - /* + /* * Delete the group using different function based on the library version. - * And verify the action. + * And verify the action. */ #if H5_VERSION_GE(1,8,0) ret = H5Ldelete(file, "Group", H5P_DEFAULT); @@ -6923,7 +6922,7 @@ test_libver_macros2(void) /**************************************************************** ** ** test_deprec(): -** Test deprecated functionality. +** Test deprecated functionality. ** ****************************************************************/ #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -6939,7 +6938,7 @@ test_deprec(void) unsigned freelist; /* Free list version # */ unsigned stab; /* Symbol table entry version # */ unsigned shhdr; /* Shared object header version # */ - H5F_info1_t finfo; /* global information about file */ + H5F_info1_t finfo; /* global information about file */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -7155,7 +7154,7 @@ test_deprec(void) void test_file(void) { - const char *env_h5_drvr; /* File Driver value from environment */ + const char *env_h5_drvr; /* File Driver value from environment */ /* Output message about test being performed */ MESSAGE(5, ("Testing Low-Level File I/O\n")); @@ -7211,15 +7210,15 @@ test_file(void) #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* test_file() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_file + * Function: cleanup_file * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * July 2, 1998 * * Modifications: diff --git a/test/tgenprop.c b/test/tgenprop.c index 0e6b5c9..5031846 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -13,21 +13,21 @@ /*********************************************************** * -* Test program: tgenprop +* Test program: tgenprop * * Test the Generic Property functionality * *************************************************************/ -#define H5P_FRIEND /*suppress error about including H5Ppkg */ +#define H5P_FRIEND /*suppress error about including H5Ppkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5P_TESTING #include "testhdf5.h" -#include "hdf5.h" + #include "H5Dprivate.h" /* For Dataset creation property list names */ -#include "H5Ppkg.h" /* Generic Properties */ +#include "H5Ppkg.h" /* Generic Properties */ #define FILENAME "tgenprop.h5" @@ -80,11 +80,11 @@ typedef struct count_data_t { static void test_genprop_basic_class(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t cid2; /* Generic Property class ID */ - hid_t cid3; /* Generic Property class ID */ + hid_t cid1; /* Generic Property class ID */ + hid_t cid2; /* Generic Property class ID */ + hid_t cid3; /* Generic Property class ID */ char *name; /* Name of class */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Class Creation Functionality\n")); @@ -169,10 +169,10 @@ test_genprop_basic_class(void) static void test_genprop_basic_class_prop(void) { - hid_t cid1; /* Generic Property class ID */ - size_t size; /* Size of property */ - size_t nprops; /* Number of properties in class */ - herr_t ret; /* Generic return value */ + hid_t cid1; /* Generic Property class ID */ + size_t size; /* Size of property */ + size_t nprops; /* Number of properties in class */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Class Properties Functionality\n")); @@ -311,8 +311,8 @@ test_genprop_iter1(hid_t H5_ATTR_UNUSED id, const char *name, static void test_genprop_class_iter(void) { - hid_t cid1; /* Generic Property class ID */ - size_t nprops; /* Number of properties in class */ + hid_t cid1; /* Generic Property class ID */ + size_t nprops; /* Number of properties in class */ int idx; /* Index to start iteration at */ struct { /* Struct for iterations */ int iter_count; @@ -323,7 +323,7 @@ test_genprop_class_iter(void) PROP2_NAME, PROP3_NAME, PROP4_NAME}; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Class Property Iteration Functionality\n")); @@ -417,17 +417,17 @@ test_genprop_cls_cls_cb1(hid_t list_id, void *create_data) static void test_genprop_class_callback(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t cid2; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - hid_t lid2; /* Generic Property list ID */ - hid_t lid3; /* Generic Property list ID */ - size_t nprops; /* Number of properties in class */ + hid_t cid1; /* Generic Property class ID */ + hid_t cid2; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + hid_t lid2; /* Generic Property list ID */ + hid_t lid3; /* Generic Property list ID */ + size_t nprops; /* Number of properties in class */ struct { /* Struct for callbacks */ int count; hid_t id; } crt_cb_struct, cpy_cb_struct, cls_cb_struct; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Class Callback Functionality\n")); @@ -596,14 +596,14 @@ test_genprop_class_callback(void) static void test_genprop_basic_list(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t cid2; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - size_t nprops; /* Number of properties */ - size_t size; /* Size of property */ + hid_t cid1; /* Generic Property class ID */ + hid_t cid2; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + size_t nprops; /* Number of properties */ + size_t size; /* Size of property */ int prop1_value; /* Value for property #1 */ float prop2_value; /* Value for property #2 */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Creation Functionality\n")); @@ -678,8 +678,8 @@ test_genprop_basic_list(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); /* Close list */ @@ -702,14 +702,14 @@ test_genprop_basic_list(void) static void test_genprop_basic_list_prop(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - size_t nprops; /* Number of properties */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + size_t nprops; /* Number of properties */ int prop1_value; /* Value for property #1 */ float prop2_value; /* Value for property #2 */ char prop3_value[10];/* Property #3 value */ double prop4_value; /* Property #4 value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Property Functionality\n")); @@ -770,8 +770,8 @@ test_genprop_basic_list_prop(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); /* Check values of temporary properties (set with regular values) */ @@ -783,8 +783,8 @@ test_genprop_basic_list_prop(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Delete permanent property */ ret = H5Premove(lid1, PROP2_NAME); @@ -820,8 +820,8 @@ test_genprop_basic_list_prop(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Close list */ ret = H5Pclose(lid1); @@ -856,9 +856,9 @@ test_genprop_iter2(hid_t H5_ATTR_UNUSED id, const char *name, static void test_genprop_list_iter(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - size_t nprops; /* Number of properties */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + size_t nprops; /* Number of properties */ int idx; /* Index to start iteration at */ struct { /* Struct for iterations */ int iter_count; @@ -870,7 +870,7 @@ test_genprop_list_iter(void) PROP1_NAME, PROP2_NAME }; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Generic Property List Iteration Functionality\n")); @@ -1144,10 +1144,10 @@ test_genprop_prop_del_cb2(hid_t plist_id, const char *name, size_t size, void *v static void test_genprop_list_callback(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - hid_t lid2; /* 2nd Generic Property list ID */ - size_t nprops; /* Number of properties in class */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + hid_t lid2; /* 2nd Generic Property list ID */ + size_t nprops; /* Number of properties in class */ int prop1_value; /* Value for property #1 */ int prop1_new_value=20; /* Property #1 new value */ float prop2_value; /* Value for property #2 */ @@ -1158,7 +1158,7 @@ test_genprop_list_callback(void) int count; hid_t id; } cop_cb_struct; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Property Callback Functionality\n")); @@ -1225,8 +1225,8 @@ test_genprop_list_callback(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__); /* Check values of temporary properties (set with regular values) */ ret = H5Pget(lid1, PROP3_NAME,&prop3_value); @@ -1240,8 +1240,8 @@ test_genprop_list_callback(void) CHECK_I(ret, "H5Pget"); /* Verify the floating-poing value in this way to avoid compiler warning. */ if(!H5_DBL_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE)) - printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", - "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); + printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", + "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__); /* Verify get callback information for properties tracked */ VERIFY(prop1_cb_info.get_count, 1, "H5Pget"); @@ -1373,7 +1373,7 @@ test_genprop_list_addprop(void) hid_t sid; /* Dataspace ID */ hid_t pid; /* Property List ID */ int prop1_value; /* Value for property #1 */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create file */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1448,7 +1448,7 @@ test_genprop_class_addprop(void) hid_t cid; /* Property Class ID */ hid_t pid; /* Property List ID */ int prop1_value; /* Value for property #1 */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create file */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1570,7 +1570,7 @@ static void test_genprop_list_add_remove_prop(void) { hid_t pid; /* Property List ID */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create a dataset creation property list */ pid = H5Pcreate(H5P_DATASET_CREATE); @@ -1607,11 +1607,11 @@ test_genprop_list_add_remove_prop(void) static void test_genprop_equal(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property list ID */ - hid_t lid2; /* Generic Property list ID */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property list ID */ + hid_t lid2; /* Generic Property list ID */ int prop1_new_value = 20; /* Property #1 new value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Generic Property List Equal Functionality\n")); @@ -1756,11 +1756,11 @@ test_genprop_equal(void) static void test_genprop_path(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t cid2; /* Generic Property class ID */ - hid_t cid3; /* Generic Property class ID */ + hid_t cid1; /* Generic Property class ID */ + hid_t cid2; /* Generic Property class ID */ + hid_t cid3; /* Generic Property class ID */ char *path; /* Class path */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Generic Property List Class Path Functionality\n")); @@ -1828,10 +1828,10 @@ test_genprop_path(void) static void test_genprop_refcount(void) { - hid_t cid1; /* Generic Property class ID */ - hid_t lid1; /* Generic Property class ID */ + hid_t cid1; /* Generic Property class ID */ + hid_t lid1; /* Generic Property class ID */ char *name; /* Name of class */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Generic Property List Reference Count Functionality\n")); @@ -1901,10 +1901,10 @@ test_genprop_refcount(void) static void test_genprop_deprec_class(void) { - hid_t cid1; /* Generic Property class ID */ - size_t size; /* Size of property */ - size_t nprops; /* Number of properties in class */ - herr_t ret; /* Generic return value */ + hid_t cid1; /* Generic Property class ID */ + size_t size; /* Size of property */ + size_t nprops; /* Number of properties in class */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deprecated Generic Property List Functions\n")); @@ -2034,7 +2034,7 @@ test_genprop_deprec_list(void) hid_t sid; /* Dataspace ID */ hid_t pid; /* Property List ID */ int prop1_value; /* Value for property #1 */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Create file */ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2130,15 +2130,15 @@ test_genprop(void) } /* test_genprop() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_genprop + * Function: cleanup_genprop * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * June 8, 1999 * * Modifications: diff --git a/test/th5s.c b/test/th5s.c index 4154c5f..0b0a2e7 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -13,13 +13,12 @@ /*********************************************************** * -* Test program: th5s +* Test program: th5s * * Test the dataspace functionality * *************************************************************/ -#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" @@ -42,7 +41,6 @@ #define H5O_TESTING #include "H5Opkg.h" /* Object header */ -#include "H5private.h" #include "H5Bprivate.h" #include "H5Sprivate.h" #include "H5Pprivate.h" @@ -63,31 +61,31 @@ #define EXTFILE_NAME "ext_file" /* 3-D dataset with fixed dimensions */ -#define SPACE1_RANK 3 -#define SPACE1_DIM1 3 -#define SPACE1_DIM2 15 -#define SPACE1_DIM3 13 +#define SPACE1_RANK 3 +#define SPACE1_DIM1 3 +#define SPACE1_DIM2 15 +#define SPACE1_DIM3 13 /* 4-D dataset with one unlimited dimension */ -#define SPACE2_RANK 4 -#define SPACE2_DIM1 0 -#define SPACE2_DIM2 15 -#define SPACE2_DIM3 13 -#define SPACE2_DIM4 23 -#define SPACE2_MAX1 H5S_UNLIMITED -#define SPACE2_MAX2 15 -#define SPACE2_MAX3 13 -#define SPACE2_MAX4 23 +#define SPACE2_RANK 4 +#define SPACE2_DIM1 0 +#define SPACE2_DIM2 15 +#define SPACE2_DIM3 13 +#define SPACE2_DIM4 23 +#define SPACE2_MAX1 H5S_UNLIMITED +#define SPACE2_MAX2 15 +#define SPACE2_MAX3 13 +#define SPACE2_MAX4 23 /* Scalar dataset with simple datatype */ -#define SPACE3_RANK 0 +#define SPACE3_RANK 0 unsigned space3_data=65; /* Scalar dataset with compound datatype */ -#define SPACE4_FIELDNAME1 "c1" -#define SPACE4_FIELDNAME2 "u" -#define SPACE4_FIELDNAME3 "f" -#define SPACE4_FIELDNAME4 "c2" +#define SPACE4_FIELDNAME1 "c1" +#define SPACE4_FIELDNAME2 "u" +#define SPACE4_FIELDNAME3 "f" +#define SPACE4_FIELDNAME4 "c2" size_t space4_field1_off=0; size_t space4_field2_off=0; size_t space4_field3_off=0; @@ -107,21 +105,21 @@ struct space4_struct { static void test_h5s_basic(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t sid1, sid2; /* Dataspace ID */ - hid_t dset1; /* Dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t sid1, sid2; /* Dataspace ID */ + hid_t dset1; /* Dataset ID */ hid_t aid1; /* Attribute ID */ - int rank; /* Logical rank of dataspace */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3, - SPACE2_DIM4}; - hsize_t dims3[H5S_MAX_RANK+1]; - hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3, - SPACE2_MAX4}; - hsize_t tdims[4]; /* Dimension array to test with */ - hsize_t tmax[4]; - hssize_t n; /* Number of dataspace elements */ - herr_t ret; /* Generic return value */ + int rank; /* Logical rank of dataspace */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3, + SPACE2_DIM4}; + hsize_t dims3[H5S_MAX_RANK+1]; + hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3, + SPACE2_MAX4}; + hsize_t tdims[4]; /* Dimension array to test with */ + hsize_t tmax[4]; + hssize_t n; /* Number of dataspace elements */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dataspace Manipulation\n")); @@ -132,7 +130,7 @@ test_h5s_basic(void) n = H5Sget_simple_extent_npoints(sid1); CHECK(n, FAIL, "H5Sget_simple_extent_npoints"); VERIFY(n, SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3, - "H5Sget_simple_extent_npoints"); + "H5Sget_simple_extent_npoints"); rank = H5Sget_simple_extent_ndims(sid1); CHECK(rank, FAIL, "H5Sget_simple_extent_ndims"); @@ -141,7 +139,7 @@ test_h5s_basic(void) rank = H5Sget_simple_extent_dims(sid1, tdims, NULL); CHECK(rank, FAIL, "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); sid2 = H5Screate_simple(SPACE2_RANK, dims2, max2); CHECK(sid2, FAIL, "H5Screate_simple"); @@ -149,7 +147,7 @@ test_h5s_basic(void) n = H5Sget_simple_extent_npoints(sid2); CHECK(n, FAIL, "H5Sget_simple_extent_npoints"); VERIFY(n, SPACE2_DIM1 * SPACE2_DIM2 * SPACE2_DIM3 * SPACE2_DIM4, - "H5Sget_simple_extent_npoints"); + "H5Sget_simple_extent_npoints"); rank = H5Sget_simple_extent_ndims(sid2); CHECK(rank, FAIL, "H5Sget_simple_extent_ndims"); @@ -158,9 +156,9 @@ test_h5s_basic(void) rank = H5Sget_simple_extent_dims(sid2, tdims, tmax); CHECK(rank, FAIL, "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tmax, max2, SPACE2_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); /* Change max dims to be equal to the dimensions */ ret = H5Sset_extent_simple(sid1, SPACE1_RANK, dims1, NULL); @@ -168,9 +166,9 @@ test_h5s_basic(void) rank = H5Sget_simple_extent_dims(sid1, tdims, tmax); CHECK(rank, FAIL, "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tmax, dims1, SPACE1_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); @@ -183,7 +181,7 @@ test_h5s_basic(void) * dimensions. */ H5E_BEGIN_TRY { - sid1 = H5Screate_simple(H5S_MAX_RANK+1, dims3, NULL); + sid1 = H5Screate_simple(H5S_MAX_RANK+1, dims3, NULL); } H5E_END_TRY; VERIFY(sid1, FAIL, "H5Screate_simple"); @@ -306,7 +304,7 @@ test_h5s_basic(void) CHECK(ret, FAIL, "H5Sclose"); ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -} /* test_h5s_basic() */ +} /* test_h5s_basic() */ /**************************************************************** ** @@ -366,16 +364,16 @@ test_h5s_null(void) hsize_t start[1]={0}; hsize_t count[1]={0}; - ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL, count, NULL); + ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL, count, NULL); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Sselect_hyperslab"); /* Check to be sure we can't set a point selection on a null dataspace */ H5E_BEGIN_TRY { - hsize_t coord[1][1]; /* Coordinates for point selection */ + hsize_t coord[1][1]; /* Coordinates for point selection */ coord[0][0]=0; - ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord); + ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Sselect_elements"); @@ -536,18 +534,18 @@ test_h5s_null(void) static void test_h5s_zero_dim(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t sid1, attr_sid; /* Dataspace ID */ - hid_t sid_chunk; /* Dataspace ID for chunked dataset */ - hid_t dset1; /* Dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t sid1, attr_sid; /* Dataspace ID */ + hid_t sid_chunk; /* Dataspace ID for chunked dataset */ + hid_t dset1; /* Dataset ID */ hid_t plist_id; /* Dataset creation property list */ hid_t attr; /* Attribute ID */ - int rank; /* Logical rank of dataspace */ - hsize_t dims1[] = {0, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t max_dims[] = {SPACE1_DIM1+1, SPACE1_DIM2, SPACE1_DIM3}; - hsize_t extend_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + int rank; /* Logical rank of dataspace */ + hsize_t dims1[] = {0, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t max_dims[] = {SPACE1_DIM1+1, SPACE1_DIM2, SPACE1_DIM3}; + hsize_t extend_dims[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; hsize_t chunk_dims[] = {SPACE1_DIM1, SPACE1_DIM2/3, SPACE1_DIM3}; - hsize_t tdims[SPACE1_RANK]; /* Dimension array to test with */ + hsize_t tdims[SPACE1_RANK]; /* Dimension array to test with */ int wdata[SPACE1_DIM2][SPACE1_DIM3]; int rdata[SPACE1_DIM2][SPACE1_DIM3]; short wdata_short[SPACE1_DIM2][SPACE1_DIM3]; @@ -557,12 +555,12 @@ test_h5s_zero_dim(void) int val = 3; hsize_t start[] = {0, 0, 0}; hsize_t count[] = {3, 15, 13}; - hsize_t coord[1][3]; /* Coordinates for point selection */ + hsize_t coord[1][3]; /* Coordinates for point selection */ hssize_t nelem; /* Number of elements */ H5S_sel_type sel_type; /* Type of selection currently */ H5S_class_t stype; /* dataspace type */ H5D_alloc_time_t alloc_time; /* Space allocation time */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ unsigned int i, j, k; /* Output message about test being performed */ @@ -638,8 +636,8 @@ test_h5s_zero_dim(void) CHECK(sid_chunk, FAIL, "H5Screate_simple"); /*============================================ - * Make sure we can use 0-dimension to create - * contiguous, chunked, compact, and external + * Make sure we can use 0-dimension to create + * contiguous, chunked, compact, and external * datasets, and also attribute. *============================================ */ @@ -703,7 +701,7 @@ test_h5s_zero_dim(void) } } - /* Select a hyperslab beyond its current dimension sizes, then try to write + /* Select a hyperslab beyond its current dimension sizes, then try to write * the data. It should fail. */ ret = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL); CHECK(ret, FAIL, "H5Sselect_hyperslab"); @@ -717,7 +715,7 @@ test_h5s_zero_dim(void) ret = H5Sselect_none(sid1); CHECK(ret, FAIL, "H5Sselect_none"); - /* Select a point beyond the dimension size, then try to write the data. + /* Select a point beyond the dimension size, then try to write the data. * It should fail. */ coord[0][0]=2; coord[0][1]=5; coord[0][2]=3; ret = H5Sselect_elements(sid1, H5S_SELECT_SET, (size_t)1, (const hsize_t *)coord); @@ -769,8 +767,8 @@ test_h5s_zero_dim(void) } } - /* Now extend the dataset to SPACE1_DIM1*SPACE1_DIM2*SPACE1_DIM3 and make sure - * we can write data to it */ + /* Now extend the dataset to SPACE1_DIM1*SPACE1_DIM2*SPACE1_DIM3 and make sure + * we can write data to it */ extend_dims[0] = SPACE1_DIM1; ret = H5Dset_extent(dset1, extend_dims); CHECK(ret, FAIL, "H5Dset_extent"); @@ -970,10 +968,10 @@ test_h5s_zero_dim(void) CHECK(ret, FAIL, "H5Aclose"); /*=============================================================== - * Extend the dimension to make it a normal dataspace (3x15x13). - * Verify that data can be written to and read from the chunked - * dataset now. - *=============================================================== + * Extend the dimension to make it a normal dataspace (3x15x13). + * Verify that data can be written to and read from the chunked + * dataset now. + *=============================================================== */ dims1[0]=SPACE1_DIM1; ret = H5Sset_extent_simple(sid_chunk,SPACE1_RANK,dims1,max_dims); @@ -1174,14 +1172,14 @@ test_h5s_zero_dim(void) static void test_h5s_encode(void) { - hid_t sid1, sid2, sid3; /* Dataspace ID */ + hid_t sid1, sid2, sid3; /* Dataspace ID */ hid_t decoded_sid1, decoded_sid2, decoded_sid3; - int rank; /* Logical rank of dataspace */ - hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; + int rank; /* Logical rank of dataspace */ + hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; size_t sbuf_size=0, null_size=0, scalar_size=0; unsigned char *sbuf=NULL, *null_sbuf=NULL, *scalar_buf=NULL; - hsize_t tdims[4]; /* Dimension array to test with */ - hssize_t n; /* Number of dataspace elements */ + hsize_t tdims[4]; /* Dimension array to test with */ + hssize_t n; /* Number of dataspace elements */ hsize_t start[] = {0, 0, 0}; hsize_t stride[] = {2, 5, 3}; hsize_t count[] = {2, 2, 2}; @@ -1189,8 +1187,8 @@ test_h5s_encode(void) H5S_sel_type sel_type; H5S_class_t space_type; hssize_t nblocks; - hid_t ret_id; /* Generic hid_t return value */ - herr_t ret; /* Generic return value */ + hid_t ret_id; /* Generic hid_t return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Dataspace Encoding and Decoding\n")); @@ -1214,7 +1212,7 @@ test_h5s_encode(void) /* Try decoding bogus buffer */ H5E_BEGIN_TRY { - ret_id = H5Sdecode(sbuf); + ret_id = H5Sdecode(sbuf); } H5E_END_TRY; VERIFY(ret_id, FAIL, "H5Sdecode"); @@ -1229,7 +1227,7 @@ test_h5s_encode(void) n = H5Sget_simple_extent_npoints(decoded_sid1); CHECK(n, FAIL, "H5Sget_simple_extent_npoints"); VERIFY(n, SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3, - "H5Sget_simple_extent_npoints"); + "H5Sget_simple_extent_npoints"); rank = H5Sget_simple_extent_ndims(decoded_sid1); CHECK(rank, FAIL, "H5Sget_simple_extent_ndims"); @@ -1238,7 +1236,7 @@ test_h5s_encode(void) rank = H5Sget_simple_extent_dims(decoded_sid1, tdims, NULL); CHECK(rank, FAIL, "H5Sget_simple_extent_dims"); VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0, - "H5Sget_simple_extent_dims"); + "H5Sget_simple_extent_dims"); /* Verify hyperslabe selection */ sel_type = H5Sget_select_type(decoded_sid1); @@ -1328,7 +1326,7 @@ test_h5s_encode(void) HDfree(sbuf); HDfree(null_sbuf); HDfree(scalar_buf); -} /* test_h5s_encode() */ +} /* test_h5s_encode() */ /**************************************************************** ** @@ -1338,14 +1336,14 @@ test_h5s_encode(void) static void test_h5s_scalar_write(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - int rank; /* Logical rank of dataspace */ - hsize_t tdims[4]; /* Dimension array to test with */ - hssize_t n; /* Number of dataspace elements */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + int rank; /* Logical rank of dataspace */ + hsize_t tdims[4]; /* Dimension array to test with */ + hssize_t n; /* Number of dataspace elements */ H5S_class_t ext_type; /* Extent type */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Scalar Dataspace Manipulation during Writing\n")); @@ -1397,7 +1395,7 @@ test_h5s_scalar_write(void) /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -} /* test_h5s_scalar_write() */ +} /* test_h5s_scalar_write() */ /**************************************************************** ** @@ -1407,14 +1405,14 @@ test_h5s_scalar_write(void) static void test_h5s_scalar_read(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - int rank; /* Logical rank of dataspace */ - hsize_t tdims[4]; /* Dimension array to test with */ - hssize_t n; /* Number of dataspace elements */ - unsigned rdata; /* Scalar data read in */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + int rank; /* Logical rank of dataspace */ + hsize_t tdims[4]; /* Dimension array to test with */ + hssize_t n; /* Number of dataspace elements */ + unsigned rdata; /* Scalar data read in */ + herr_t ret; /* Generic return value */ H5S_class_t ext_type; /* Extent type */ /* Output message about test being performed */ @@ -1461,7 +1459,7 @@ test_h5s_scalar_read(void) /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -} /* test_h5s_scalar_read() */ +} /* test_h5s_scalar_read() */ /**************************************************************** ** @@ -1472,14 +1470,14 @@ test_h5s_scalar_read(void) static void test_h5s_compound_scalar_write(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t tid1; /* Attribute datatype ID */ - hid_t sid1; /* Dataspace ID */ - int rank; /* Logical rank of dataspace */ - hsize_t tdims[4]; /* Dimension array to test with */ - hssize_t n; /* Number of dataspace elements */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t tid1; /* Attribute datatype ID */ + hid_t sid1; /* Dataspace ID */ + int rank; /* Logical rank of dataspace */ + hsize_t tdims[4]; /* Dimension array to test with */ + hssize_t n; /* Number of dataspace elements */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Scalar Dataspace Manipulation for Writing Compound Datatypes\n")); @@ -1493,19 +1491,19 @@ test_h5s_compound_scalar_write(void) CHECK(tid1, FAIL, "H5Tcreate"); space4_field1_off=HOFFSET(struct space4_struct, c1); ret = H5Tinsert(tid1, SPACE4_FIELDNAME1, space4_field1_off, - H5T_NATIVE_SCHAR); + H5T_NATIVE_SCHAR); CHECK(ret, FAIL, "H5Tinsert"); space4_field2_off=HOFFSET(struct space4_struct, u); ret = H5Tinsert(tid1, SPACE4_FIELDNAME2, space4_field2_off, - H5T_NATIVE_UINT); + H5T_NATIVE_UINT); CHECK(ret, FAIL, "H5Tinsert"); space4_field3_off=HOFFSET(struct space4_struct, f); ret = H5Tinsert(tid1, SPACE4_FIELDNAME3, space4_field3_off, - H5T_NATIVE_FLOAT); + H5T_NATIVE_FLOAT); CHECK(ret, FAIL, "H5Tinsert"); space4_field4_off=HOFFSET(struct space4_struct, c2); ret = H5Tinsert(tid1, SPACE4_FIELDNAME4, space4_field4_off, - H5T_NATIVE_SCHAR); + H5T_NATIVE_SCHAR); CHECK(ret, FAIL, "H5Tinsert"); /* Create scalar dataspace */ @@ -1545,7 +1543,7 @@ test_h5s_compound_scalar_write(void) /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -} /* test_h5s_compound_scalar_write() */ +} /* test_h5s_compound_scalar_write() */ /**************************************************************** ** @@ -1556,15 +1554,15 @@ test_h5s_compound_scalar_write(void) static void test_h5s_compound_scalar_read(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t type; /* Datatype */ - int rank; /* Logical rank of dataspace */ - hsize_t tdims[4]; /* Dimension array to test with */ - hssize_t n; /* Number of dataspace elements */ - struct space4_struct rdata; /* Scalar data read in */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t type; /* Datatype */ + int rank; /* Logical rank of dataspace */ + hsize_t tdims[4]; /* Dimension array to test with */ + hssize_t n; /* Number of dataspace elements */ + struct space4_struct rdata; /* Scalar data read in */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Scalar Dataspace Manipulation for Reading Compound Datatypes\n")); @@ -1618,7 +1616,7 @@ test_h5s_compound_scalar_read(void) /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -} /* test_h5s_compound_scalar_read() */ +} /* test_h5s_compound_scalar_read() */ /* Data arrays for chunk test */ double chunk_data_dbl[50000][3]; @@ -2384,7 +2382,7 @@ test_h5s_bug1(void) CHECK(ret, FAIL, "H5Sclose"); } /* test_h5s_bug1() */ - + /*------------------------------------------------------------------------- * Function: test_versionbounds * @@ -2395,8 +2393,8 @@ test_h5s_bug1(void) * reopens it with higher bounds to show that the dataspace * version is upgraded appropriately. * - * Return: Success: 0 - * Failure: number of errors + * Return: Success: 0 + * Failure: number of errors * *------------------------------------------------------------------------- */ @@ -2501,13 +2499,13 @@ test_versionbounds(void) ret = H5Sclose(space); CHECK(ret, FAIL, "H5Sclose"); - ret = H5Pclose(fapl); + ret = H5Pclose(fapl); CHECK(ret, FAIL, "H5Pclose"); ret = H5Fclose(file); CHECK(ret, FAIL, "H5Fclose"); } /* end test_versionbounds() */ - + /**************************************************************** ** ** test_h5s(): Main H5S (dataspace) testing routine. @@ -2519,34 +2517,34 @@ test_h5s(void) /* Output message about test being performed */ MESSAGE(5, ("Testing Dataspaces\n")); - test_h5s_basic(); /* Test basic H5S code */ - test_h5s_null(); /* Test Null dataspace H5S code */ + test_h5s_basic(); /* Test basic H5S code */ + test_h5s_null(); /* Test Null dataspace H5S code */ test_h5s_zero_dim(); /* Test dataspace with zero dimension size */ test_h5s_encode(); /* Test encoding and decoding */ - test_h5s_scalar_write(); /* Test scalar H5S writing code */ - test_h5s_scalar_read(); /* Test scalar H5S reading code */ + test_h5s_scalar_write(); /* Test scalar H5S writing code */ + test_h5s_scalar_read(); /* Test scalar H5S reading code */ - test_h5s_compound_scalar_write(); /* Test compound datatype scalar H5S writing code */ - test_h5s_compound_scalar_read(); /* Test compound datatype scalar H5S reading code */ + test_h5s_compound_scalar_write(); /* Test compound datatype scalar H5S writing code */ + test_h5s_compound_scalar_read(); /* Test compound datatype scalar H5S reading code */ /* This test was added later to exercise a bug in chunked I/O */ - test_h5s_chunk(); /* Exercise bug fix for chunked I/O */ + test_h5s_chunk(); /* Exercise bug fix for chunked I/O */ - test_h5s_extent_equal(); /* Test extent comparison code */ + test_h5s_extent_equal(); /* Test extent comparison code */ test_h5s_extent_copy(); /* Test extent copy code */ test_h5s_bug1(); /* Test bug in offset initialization */ test_versionbounds(); /* Test version bounds with dataspace */ } /* test_h5s() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_h5s + * Function: cleanup_h5s * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * July 2, 1998 * * Modifications: @@ -14,10 +14,9 @@ /* Test user-created identifiers (hid_t's) and identifier types. */ #include "testhdf5.h" -#include "hdf5.h" /* Include H5Ipkg.h to calculate max number of groups */ -#define H5I_FRIEND /*suppress error about including H5Ipkg */ +#define H5I_FRIEND /*suppress error about including H5Ipkg */ #include "H5Ipkg.h" /* Test basic functionality of registering and deleting types and IDs */ @@ -238,97 +237,97 @@ out: } - /* A dummy search function for the next test */ + /* A dummy search function for the next test */ static int test_search_func(void H5_ATTR_UNUSED * ptr1, void H5_ATTR_UNUSED * ptr2) { return 0; } - /* Ensure that public functions cannot access "predefined" ID types */ + /* Ensure that public functions cannot access "predefined" ID types */ static int id_predefined_test(void ) { - void * testObj; - hid_t testID; - hid_t typeID = H5I_INVALID_HID; - void * testPtr; - herr_t testErr; + void * testObj; + hid_t testID; + hid_t typeID = H5I_INVALID_HID; + void * testPtr; + herr_t testErr; - testObj = HDmalloc(sizeof(int)); + testObj = HDmalloc(sizeof(int)); - /* Try to perform illegal functions on various predefined types */ - H5E_BEGIN_TRY - testID = H5Iregister(H5I_FILE, testObj); - H5E_END_TRY + /* Try to perform illegal functions on various predefined types */ + H5E_BEGIN_TRY + testID = H5Iregister(H5I_FILE, testObj); + H5E_END_TRY - VERIFY(testID, H5I_INVALID_HID, "H5Iregister"); - if(testID != H5I_INVALID_HID) - goto out; + VERIFY(testID, H5I_INVALID_HID, "H5Iregister"); + if(testID != H5I_INVALID_HID) + goto out; - H5E_BEGIN_TRY - testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj); - H5E_END_TRY + H5E_BEGIN_TRY + testPtr = H5Isearch(H5I_GENPROP_LST, (H5I_search_func_t) test_search_func, testObj); + H5E_END_TRY - CHECK_PTR_NULL(testPtr, "H5Isearch"); - if(testPtr != NULL) - goto out; + CHECK_PTR_NULL(testPtr, "H5Isearch"); + if(testPtr != NULL) + goto out; - H5E_BEGIN_TRY - testErr = H5Inmembers(H5I_ERROR_STACK, NULL); - H5E_END_TRY + H5E_BEGIN_TRY + testErr = H5Inmembers(H5I_ERROR_STACK, NULL); + H5E_END_TRY - VERIFY(testErr, -1, "H5Inmembers"); - if(testErr != -1) - goto out; + VERIFY(testErr, -1, "H5Inmembers"); + if(testErr != -1) + goto out; - H5E_BEGIN_TRY - testErr = H5Iclear_type(H5I_FILE, 0); - H5E_END_TRY + H5E_BEGIN_TRY + testErr = H5Iclear_type(H5I_FILE, 0); + H5E_END_TRY - VERIFY((testErr >= 0), 0, "H5Iclear_type"); - if(testErr >= 0) - goto out; + VERIFY((testErr >= 0), 0, "H5Iclear_type"); + if(testErr >= 0) + goto out; - H5E_BEGIN_TRY - testErr = H5Idestroy_type(H5I_DATASET); - H5E_END_TRY + H5E_BEGIN_TRY + testErr = H5Idestroy_type(H5I_DATASET); + H5E_END_TRY - VERIFY((testErr >= 0), 0, "H5Idestroy_type"); - if(testErr >= 0) - goto out; + VERIFY((testErr >= 0), 0, "H5Idestroy_type"); + if(testErr >= 0) + goto out; - /* Create a datatype ID and try to perform illegal functions on it */ - typeID = H5Tcreate(H5T_OPAQUE, (size_t)42); - CHECK(typeID, H5I_INVALID_HID, "H5Tcreate"); - if(typeID == H5I_INVALID_HID) - goto out; + /* Create a datatype ID and try to perform illegal functions on it */ + typeID = H5Tcreate(H5T_OPAQUE, (size_t)42); + CHECK(typeID, H5I_INVALID_HID, "H5Tcreate"); + if(typeID == H5I_INVALID_HID) + goto out; - H5E_BEGIN_TRY - testPtr = H5Iremove_verify(typeID, H5I_DATATYPE); - H5E_END_TRY + H5E_BEGIN_TRY + testPtr = H5Iremove_verify(typeID, H5I_DATATYPE); + H5E_END_TRY - CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); - if(testPtr != NULL) - goto out; + CHECK_PTR_NULL(testPtr, "H5Iremove_verify"); + if(testPtr != NULL) + goto out; - H5E_BEGIN_TRY - testPtr = H5Iobject_verify(typeID, H5I_DATATYPE); - H5E_END_TRY + H5E_BEGIN_TRY + testPtr = H5Iobject_verify(typeID, H5I_DATATYPE); + H5E_END_TRY - CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); - if(testPtr != NULL) - goto out; + CHECK_PTR_NULL(testPtr, "H5Iobject_verify"); + if(testPtr != NULL) + goto out; - H5Tclose(typeID); + H5Tclose(typeID); - /* testObj was never registered as an atom, so it will not be + /* testObj was never registered as an atom, so it will not be * automatically freed. */ - HDfree(testObj); - return 0; + HDfree(testObj); + return 0; out: - if(typeID != H5I_INVALID_HID) - H5Tclose(typeID); + if(typeID != H5I_INVALID_HID) + H5Tclose(typeID); if(testObj != NULL) - HDfree(testObj); + HDfree(testObj); - return -1; + return -1; } @@ -444,12 +443,12 @@ static int test_get_type(void) out: if(dtype != H5I_INVALID_HID) - H5Tclose(dtype); + H5Tclose(dtype); return -1; } - /* Test boundary cases with lots of types */ + /* Test boundary cases with lots of types */ /* Type IDs range from H5I_NTYPES to H5I_MAX_NUM_TYPES. The system will assign */ /* IDs in sequential order until H5I_MAX_NUM_TYPES IDs have been given out, at which */ @@ -459,78 +458,78 @@ out: /* to low values successfully, ensure that an error is thrown when all possible */ /* type IDs are taken, then ensure that deleting types frees up their IDs. */ /* Note that this test depends on the implementation of IDs, so may break */ -/* if the implementation changes. */ +/* if the implementation changes. */ /* Also note that if someone else registered a user-defined type and forgot to */ /* destroy it, this test will mysteriously fail (because it will expect there to */ /* be one more "free" type ID than there is). */ /* H5I_NTYPES is defined in h5public.h, H5I_MAX_NUM_TYPES is defined in h5pkg.h */ static int test_id_type_list(void) { - H5I_type_t startType; /* The first type ID we were assigned in this test */ - H5I_type_t currentType; - H5I_type_t testType; - int i; /* Just a counter variable */ - - startType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); - CHECK(startType, H5I_BADID, "H5Iregister_type"); - if(startType == H5I_BADID) - goto out; - - /* Sanity check */ - if(startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES) - { - /* Error condition, throw an error */ - CHECK(1, 1, "H5Iregister_type"); - goto out; - } - /* Create types up to H5I_MAX_NUM_TYPES */ - for(i = startType + 1; i < H5I_MAX_NUM_TYPES; i++) - { - currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); - CHECK(currentType, H5I_BADID, "H5Iregister_type"); - if(currentType == H5I_BADID) - goto out; - } - - /* Wrap around to low type ID numbers */ - for(i = H5I_NTYPES; i < startType; i++) - { - currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); - CHECK(currentType, H5I_BADID, "H5Iregister_type"); - if(currentType == H5I_BADID) - goto out; - } - - /* There should be no room at the inn for a new ID type*/ - H5E_BEGIN_TRY - testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); - H5E_END_TRY - - VERIFY(testType, H5I_BADID, "H5Iregister_type"); - if(testType != H5I_BADID) - goto out; - - /* Now delete a type and try to insert again */ - H5Idestroy_type(H5I_NTYPES); - testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); - - VERIFY(testType, H5I_NTYPES, "H5Iregister_type"); - if(testType != H5I_NTYPES) - goto out; - - /* Cleanup. Destroy all types. */ - for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++) - H5Idestroy_type((H5I_type_t) i); - - return 0; + H5I_type_t startType; /* The first type ID we were assigned in this test */ + H5I_type_t currentType; + H5I_type_t testType; + int i; /* Just a counter variable */ + + startType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + CHECK(startType, H5I_BADID, "H5Iregister_type"); + if(startType == H5I_BADID) + goto out; + + /* Sanity check */ + if(startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES) + { + /* Error condition, throw an error */ + CHECK(1, 1, "H5Iregister_type"); + goto out; + } + /* Create types up to H5I_MAX_NUM_TYPES */ + for(i = startType + 1; i < H5I_MAX_NUM_TYPES; i++) + { + currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + CHECK(currentType, H5I_BADID, "H5Iregister_type"); + if(currentType == H5I_BADID) + goto out; + } + + /* Wrap around to low type ID numbers */ + for(i = H5I_NTYPES; i < startType; i++) + { + currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + CHECK(currentType, H5I_BADID, "H5Iregister_type"); + if(currentType == H5I_BADID) + goto out; + } + + /* There should be no room at the inn for a new ID type*/ + H5E_BEGIN_TRY + testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + H5E_END_TRY + + VERIFY(testType, H5I_BADID, "H5Iregister_type"); + if(testType != H5I_BADID) + goto out; + + /* Now delete a type and try to insert again */ + H5Idestroy_type(H5I_NTYPES); + testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); + + VERIFY(testType, H5I_NTYPES, "H5Iregister_type"); + if(testType != H5I_NTYPES) + goto out; + + /* Cleanup. Destroy all types. */ + for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++) + H5Idestroy_type((H5I_type_t) i); + + return 0; out: /* Cleanup. For simplicity, just destroy all types and ignore errors. */ - H5E_BEGIN_TRY - for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++) - H5Idestroy_type((H5I_type_t) i); - H5E_END_TRY - return -1; + H5E_BEGIN_TRY + for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++) + H5Idestroy_type((H5I_type_t) i); + H5E_END_TRY + return -1; } /* Test removing ids in callback for H5Iclear_type */ @@ -733,11 +732,11 @@ void test_ids(void) /* Set the random # seed */ HDsrandom((unsigned)HDtime(NULL)); - if (basic_id_test() < 0) TestErrPrintf("Basic ID test failed\n"); - if (id_predefined_test() < 0) TestErrPrintf("Predefined ID type test failed\n"); - if (test_is_valid() < 0) TestErrPrintf("H5Iis_valid test failed\n"); - if (test_get_type() < 0) TestErrPrintf("H5Iget_type test failed\n"); - if (test_id_type_list() < 0) TestErrPrintf("ID type list test failed\n"); - if (test_remove_clear_type() < 0) TestErrPrintf("ID remove during H5Iclear_type test failed\n"); + if (basic_id_test() < 0) TestErrPrintf("Basic ID test failed\n"); + if (id_predefined_test() < 0) TestErrPrintf("Predefined ID type test failed\n"); + if (test_is_valid() < 0) TestErrPrintf("H5Iis_valid test failed\n"); + if (test_get_type() < 0) TestErrPrintf("H5Iget_type test failed\n"); + if (test_id_type_list() < 0) TestErrPrintf("ID type list test failed\n"); + if (test_remove_clear_type() < 0) TestErrPrintf("ID remove during H5Iclear_type test failed\n"); } diff --git a/test/titerate.c b/test/titerate.c index 231bd2e..82c26eb 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: titerate +* Test program: titerate * * Test the Group & Attribute functionality * @@ -21,8 +21,6 @@ #include "testhdf5.h" -#include "hdf5.h" - #define DATAFILE "titerate.h5" /* Number of datasets for group iteration test */ @@ -38,8 +36,8 @@ #define NAMELEN 80 /* 1-D dataset with fixed dimensions */ -#define SPACE1_RANK 1 -#define SPACE1_DIM1 4 +#define SPACE1_RANK 1 +#define SPACE1_DIM1 4 typedef enum { RET_ZERO, @@ -131,7 +129,7 @@ test_iter_group(hid_t fapl, hbool_t new_format) char dataset_name[NAMELEN]; /* dataset name */ iter_info info; /* Custom iteration information */ H5G_info_t ginfo; /* Buffer for querying object's info */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Group Iteration Functionality\n")); @@ -390,7 +388,7 @@ static void test_iter_attr(hid_t fapl, hbool_t new_format) char name[NAMELEN]; /* temporary name buffer */ char *anames[NATTR]; /* Names of the attributes created */ iter_info info; /* Custom iteration information */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Attribute Iteration Functionality\n")); @@ -545,7 +543,7 @@ liter_cb2(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_ { const iter_info *test_info = (const iter_info *)opdata; H5O_info_t oinfo; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ if(HDstrcmp(name, test_info->name)) { TestErrPrintf("name = '%s', test_info = '%s'\n", name, test_info->name); @@ -575,13 +573,13 @@ liter_cb2(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR_UNUSED *link_ static void test_iter_group_large(hid_t fapl) { - hid_t file; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t group; /* Group ID */ - hid_t sid; /* Dataspace ID */ - hid_t tid; /* Datatype ID */ - hsize_t dims[] = {SPACE1_DIM1}; - herr_t ret; /* Generic return value */ + hid_t file; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t group; /* Group ID */ + hid_t sid; /* Dataspace ID */ + hid_t tid; /* Datatype ID */ + hsize_t dims[] = {SPACE1_DIM1}; + herr_t ret; /* Generic return value */ char gname[20]; /* Temporary group name */ iter_info *names; /* Names of objects in the root group */ iter_info *curr_name; /* Pointer to the current name in the root group */ @@ -711,7 +709,7 @@ static void test_grp_memb_funcs(hid_t fapl) char dataset_name[NAMELEN]; /* dataset name */ ssize_t name_len; /* Length of object's name */ H5G_info_t ginfo; /* Buffer for querying object's info */ - herr_t ret = SUCCEED; /* Generic return value */ + herr_t ret = SUCCEED; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Group Member Information Functionality\n")); @@ -851,7 +849,7 @@ static void test_links(hid_t fapl) hid_t gid, gid1; H5G_info_t ginfo; /* Buffer for querying object's info */ hsize_t i; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Soft and Hard Link Iteration Functionality\n")); @@ -927,7 +925,7 @@ test_iterate(void) { hid_t fapl, fapl2; /* File access property lists */ unsigned new_format; /* Whether to use the new format or not */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Iteration Operations\n")); @@ -960,15 +958,15 @@ test_iterate(void) CHECK(ret, FAIL, "H5Pclose"); } /* test_iterate() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_iterate + * Function: cleanup_iterate * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * April 5, 2000 * * Modifications: diff --git a/test/tmisc.c b/test/tmisc.c index f0e595b..4a77b51 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -21,12 +21,11 @@ * *************************************************************/ -#define H5D_FRIEND /*suppress error about including H5Dpkg */ +#define H5D_FRIEND /*suppress error about including H5Dpkg */ /* Define this macro to indicate that the testing APIs should be available */ #define H5D_TESTING -#include "hdf5.h" #include "testhdf5.h" #include "H5srcdir.h" #include "H5Dpkg.h" /* Datasets */ @@ -1816,11 +1815,11 @@ test_misc11(void) unsigned sym_ik; /* Symbol table B-tree initial 'K' value */ unsigned istore_ik; /* Indexed storage B-tree initial 'K' value */ unsigned sym_lk; /* Symbol table B-tree leaf 'K' value */ - unsigned nindexes; /* Shared message number of indexes */ + unsigned nindexes; /* Shared message number of indexes */ H5F_info2_t finfo; /* global information about file */ H5F_fspace_strategy_t strategy; /* File space strategy */ - hsize_t threshold; /* Free-space section threshold */ - hbool_t persist; /* To persist free-space or not */ + hsize_t threshold; /* Free-space section threshold */ + hbool_t persist; /* To persist free-space or not */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -1859,7 +1858,7 @@ test_misc11(void) /* This should fail as (32770*2) will exceed ^16 - 2 bytes for storing btree entries */ H5E_BEGIN_TRY { - ret=H5Pset_sym_k(fcpl, 32770, 0); + ret=H5Pset_sym_k(fcpl, 32770, 0); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Pset_sym_k"); @@ -1868,7 +1867,7 @@ test_misc11(void) /* This should fail as (32770*2) will exceed ^16 - 2 bytes for storing btree entries */ H5E_BEGIN_TRY { - ret=H5Pset_istore_k(fcpl, 32770); + ret=H5Pset_istore_k(fcpl, 32770); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Pset_istore_k"); @@ -1980,19 +1979,19 @@ test_misc12(void) "las palabras del que murio en la cruz." }; char *rdata [MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE]; /* Information read in */ - hid_t fid1; - hid_t dataset; - hid_t sid1, space, memspace; - hid_t tid1, cparms; - hsize_t dims1[] = {MISC12_SPACE1_DIM1}; - hsize_t dimsn[] = {MISC12_APPEND_SIZE}; - hsize_t maxdims1[1] = {H5S_UNLIMITED}; - hsize_t chkdims1[1] = {MISC12_CHUNK_SIZE}; + hid_t fid1; + hid_t dataset; + hid_t sid1, space, memspace; + hid_t tid1, cparms; + hsize_t dims1[] = {MISC12_SPACE1_DIM1}; + hsize_t dimsn[] = {MISC12_APPEND_SIZE}; + hsize_t maxdims1[1] = {H5S_UNLIMITED}; + hsize_t chkdims1[1] = {MISC12_CHUNK_SIZE}; hsize_t newsize[1] = {MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE}; - hsize_t offset[1] = {MISC12_SPACE1_DIM1}; + hsize_t offset[1] = {MISC12_SPACE1_DIM1}; hsize_t count[1] = {MISC12_APPEND_SIZE}; int i; /* counting variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing VL-type in chunked dataset\n")); @@ -2746,10 +2745,10 @@ test_misc16(void) herr_t ret; /* Generic return value */ char wdata[MISC16_SPACE_DIM][MISC16_STR_SIZE]; char rdata[MISC16_SPACE_DIM][MISC16_STR_SIZE]; /* Information read in */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t tid; /* Datatype ID */ - hsize_t dims[] = {MISC16_SPACE_DIM}; + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t tid; /* Datatype ID */ + hsize_t dims[] = {MISC16_SPACE_DIM}; int i; /* Initialize the data */ @@ -2831,10 +2830,10 @@ test_misc17(void) herr_t ret; /* Generic return value */ char wdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2]; char rdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2]; /* Information read in */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t tid; /* Datatype ID */ - hsize_t dims[] = {MISC17_SPACE_DIM1, MISC17_SPACE_DIM2}; + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t tid; /* Datatype ID */ + hsize_t dims[] = {MISC17_SPACE_DIM1, MISC17_SPACE_DIM2}; int i; /* Initialize the data */ @@ -3798,13 +3797,13 @@ test_misc22(void) /* compute the correct PPB that should be set by SZIP */ if(offsets[k] == 0) - correct = prec[j]; + correct = prec[j]; else correct = H5Tget_size(idts[i]) * 8; if(correct > 24) { - if(correct <= 32) + if(correct <= 32) correct = 32; - else if(correct <= 64) + else if(correct <= 64) correct = 64; } /* end if */ @@ -4757,7 +4756,7 @@ test_misc25b(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_misc25b() */ - + /**************************************************************** ** ** test_misc25c(): Exercise another null object header message merge bug. @@ -4891,7 +4890,7 @@ test_misc25c(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_misc25c() */ - + /**************************************************************** ** ** test_misc26(): Regression test: ensure that copying filter @@ -4977,7 +4976,7 @@ test_misc26(void) CHECK_I(ret, "H5Pclose"); } - + /**************************************************************** ** ** test_misc27(): Ensure that objects with incorrect # of object @@ -5022,7 +5021,7 @@ test_misc27(void) CHECK(ret, FAIL, "H5Fclose"); } /* end test_misc27() */ - + /**************************************************************** ** ** test_misc28(): Ensure that the dataset chunk cache will hold @@ -5199,7 +5198,7 @@ test_misc28(void) CHECK_I(ret, "H5Pclose"); } /* end test_misc28() */ - + /**************************************************************** ** ** test_misc29(): Ensure that speculative metadata reads don't @@ -5239,7 +5238,7 @@ test_misc30_get_info_cb(hid_t loc_id, const char *name, const H5L_info_t H5_ATTR { H5O_info_t object_info; - return H5Oget_info_by_name(loc_id, name, &object_info, H5P_DEFAULT); + return H5Oget_info_by_name(loc_id, name, &object_info, H5P_DEFAULT); } static int @@ -5248,7 +5247,7 @@ test_misc30_get_info(hid_t loc_id) return H5Literate(loc_id, H5_INDEX_NAME, H5_ITER_INC, NULL, test_misc30_get_info_cb, NULL); } - + /**************************************************************** ** ** test_misc30(): Exercise local heap code that loads prefix @@ -5280,15 +5279,15 @@ test_misc30(void) CHECK(ret, FAIL, "H5Gclose"); ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - + for(i = 0; i < 20; i++) { char gname[32]; fid = H5Fopen(MISC30_FILE, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); - + if(get_info) { - ret = test_misc30_get_info(fid); + ret = test_misc30_get_info(fid); CHECK(ret, FAIL, "test_misc30_get_info"); } @@ -5300,20 +5299,20 @@ test_misc30(void) CHECK(ret, FAIL, "H5Gclose"); ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - } - + } + fid = H5Fopen(MISC30_FILE, H5F_ACC_RDONLY, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); ret = H5Fget_filesize(fid, &file_size[get_info]); CHECK(fid, FAIL, "H5Fget_filesize"); ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - } - + } + VERIFY(file_size[0], file_size[1], "test_misc30"); } /* end test_misc30() */ - + /**************************************************************** ** ** test_misc31(): Test reentering library through deprecated @@ -5404,14 +5403,14 @@ test_misc31(void) CHECK(ret, FAIL, "H5Fclose"); ret = H5Tclose(dtype_id); CHECK(ret, FAIL, "H5Tclose"); - + #else /* H5_NO_DEPRECATED_SYMBOLS */ /* Output message about test being skipped */ MESSAGE(5, (" ...Skipped")); #endif /* H5_NO_DEPRECATED_SYMBOLS */ } /* end test_misc31() */ - + /**************************************************************** * * test_misc32(): Simple test of filter memory allocation @@ -5475,7 +5474,7 @@ test_misc32(void) resized = H5resize_memory(NULL, 0); CHECK_PTR_NULL(resized, "H5resize_memory"); /*BAD*/ #endif /* NDEBUG */ - + } /* end test_misc32() */ /**************************************************************** @@ -5585,7 +5584,7 @@ test_misc34(void) } /* end test_misc34() */ - + /**************************************************************** ** ** test_misc(): Main misc. test routine. @@ -5638,15 +5637,15 @@ test_misc(void) } /* test_misc() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_misc + * Function: cleanup_misc * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Albert Cheng + * Programmer: Albert Cheng * July 2, 1998 * * Modifications: diff --git a/test/trefer.c b/test/trefer.c index 05c0130..7cbb77f 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: trefer +* Test program: trefer * * Test the Reference functionality * @@ -21,24 +21,22 @@ #include "testhdf5.h" -#include "hdf5.h" - #define FILE1 "trefer1.h5" -#define FILE2 "trefer2.h5" -#define FILE3 "trefer3.h5" +#define FILE2 "trefer2.h5" +#define FILE3 "trefer3.h5" /* 1-D dataset with fixed dimensions */ -#define SPACE1_RANK 1 -#define SPACE1_DIM1 4 +#define SPACE1_RANK 1 +#define SPACE1_DIM1 4 /* 2-D dataset with fixed dimensions */ -#define SPACE2_RANK 2 -#define SPACE2_DIM1 10 -#define SPACE2_DIM2 10 +#define SPACE2_RANK 2 +#define SPACE2_DIM1 10 +#define SPACE2_DIM2 10 /* Larger 1-D dataset with fixed dimensions */ -#define SPACE3_RANK 1 -#define SPACE3_DIM1 100 +#define SPACE3_RANK 1 +#define SPACE3_DIM1 100 /* Element selection information */ #define POINT1_NPOINTS 10 @@ -81,7 +79,7 @@ test_reference_params(void) unsigned *tu32; /* Temporary pointer to uint32 data */ int i; /* counting variables */ const char *write_comment = "Foo!"; /* Comments for group */ - hid_t ret_id; /* Generic hid_t return value */ + hid_t ret_id; /* Generic hid_t return value */ ssize_t name_size; /* Size of reference name */ herr_t ret; /* Generic return value */ @@ -104,7 +102,7 @@ test_reference_params(void) /* Create dataset access property list */ dapl_id = H5Pcreate(H5P_DATASET_ACCESS); CHECK(dapl_id, FAIL, "H5Pcreate"); - + /* Create a group */ group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(group, FAIL, "H5Gcreate2"); @@ -247,13 +245,13 @@ test_reference_params(void) static void test_reference_obj(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset, /* Dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, /* Dataset ID */ dset2; /* Dereferenced dataset ID */ - hid_t group; /* Group ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Datatype ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hid_t group; /* Group ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ + hsize_t dims1[] = {SPACE1_DIM1}; hid_t dapl_id; /* Dataset access property list */ hobj_ref_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ @@ -265,7 +263,7 @@ test_reference_obj(void) char read_comment[10]; H5O_type_t obj_type; /* Object type */ ssize_t size; /* Comment length */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Object Reference Functions\n")); @@ -286,7 +284,7 @@ test_reference_obj(void) /* Create dataset access property list */ dapl_id = H5Pcreate(H5P_DATASET_ACCESS); CHECK(dapl_id, FAIL, "H5Pcreate"); - + /* Create a group */ group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(group, FAIL, "H5Gcreate2"); @@ -496,23 +494,23 @@ test_reference_obj(void) static void test_reference_region(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dset1, /* Dataset ID */ - dset2; /* Dereferenced dataset ID */ - hid_t sid1, /* Dataspace ID #1 */ - sid2; /* Dataspace ID #2 */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dset1, /* Dataset ID */ + dset2; /* Dereferenced dataset ID */ + hid_t sid1, /* Dataspace ID #1 */ + sid2; /* Dataspace ID #2 */ hid_t dapl_id; /* Dataset access property list */ - hsize_t dims1[] = {SPACE1_DIM1}, - dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ - hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ - hsize_t * coords; /* Coordinate buffer */ - hsize_t low[SPACE2_RANK]; /* Selection bounds */ - hsize_t high[SPACE2_RANK]; /* Selection bounds */ - hdset_reg_ref_t *wbuf, /* buffer to write to disk */ + hsize_t dims1[] = {SPACE1_DIM1}, + dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ + hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ + hsize_t * coords; /* Coordinate buffer */ + hsize_t low[SPACE2_RANK]; /* Selection bounds */ + hsize_t high[SPACE2_RANK]; /* Selection bounds */ + hdset_reg_ref_t *wbuf, /* buffer to write to disk */ *rbuf; /* buffer read from disk */ hdset_reg_ref_t nvrbuf[3]={{0},{101},{255}}; /* buffer with non-valid refs */ uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ @@ -522,7 +520,7 @@ test_reference_region(void) int i, j; /* counting variables */ hssize_t hssize_ret; /* hssize_t return value */ htri_t tri_ret; /* htri_t return value */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ haddr_t addr = HADDR_UNDEF; /* test for undefined reference */ hid_t dset_NA; /* Dataset id for undefined reference */ hid_t space_NA; /* Dataspace id for undefined reference */ @@ -550,7 +548,7 @@ test_reference_region(void) /* Create dataset access property list */ dapl_id = H5Pcreate(H5P_DATASET_ACCESS); CHECK(dapl_id, FAIL, "H5Pcreate"); - + /* Create a dataset */ dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(dset2, FAIL, "H5Dcreate2"); @@ -659,7 +657,7 @@ test_reference_region(void) /* Close and release resources for undefined region reference tests */ ret = H5Dclose(dset_NA); CHECK(ret, FAIL, "H5Dclose"); - ret = H5Sclose(space_NA); + ret = H5Sclose(space_NA); CHECK(ret, FAIL, "H5Sclose"); /* Close disk dataspace */ @@ -682,10 +680,10 @@ test_reference_region(void) fid1 = H5Fopen(FILE2, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid1, FAIL, "H5Fopen"); - /* - * Start the test of an undefined reference + /* + * Start the test of an undefined reference */ - + /* Open the dataset of the undefined references */ dset_NA = H5Dopen2(fid1, "DS_NA", H5P_DEFAULT); CHECK(dset_NA, FAIL, "H5Dopen2"); @@ -693,28 +691,28 @@ test_reference_region(void) /* Read the data */ ret = H5Dread(dset_NA, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata_NA); CHECK(ret, FAIL, "H5Dread"); - + /* * Dereference an undefined reference (should fail) */ H5E_BEGIN_TRY { dset2 = H5Rdereference2(dset_NA, H5P_DEFAULT, H5R_DATASET_REGION, &rdata_NA[0]); - } H5E_END_TRY; - VERIFY(dset2, FAIL, "H5Rdereference2"); + } H5E_END_TRY; + VERIFY(dset2, FAIL, "H5Rdereference2"); /* Close and release resources. */ ret = H5Dclose(dset_NA); CHECK(ret, FAIL, "H5Dclose"); - /* This close should fail since H5Rdereference2 never created + /* This close should fail since H5Rdereference2 never created * the id of the referenced object. */ H5E_BEGIN_TRY { ret = H5Dclose(dset2); - } H5E_END_TRY; - VERIFY(ret, FAIL, "H5Dclose"); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Dclose"); - /* - * End the test of an undefined reference + /* + * End the test of an undefined reference */ /* Open the dataset */ @@ -893,22 +891,22 @@ test_reference_region(void) static void test_reference_region_1D(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dset1, /* Dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dset1, /* Dataset ID */ dset3; /* Dereferenced dataset ID */ - hid_t sid1, /* Dataspace ID #1 */ - sid3; /* Dataspace ID #3 */ + hid_t sid1, /* Dataspace ID #1 */ + sid3; /* Dataspace ID #3 */ hid_t dapl_id; /* Dataset access property list */ - hsize_t dims1[] = {SPACE1_DIM1}, - dims3[] = {SPACE3_DIM1}; - hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */ - hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ + hsize_t dims1[] = {SPACE1_DIM1}, + dims3[] = {SPACE3_DIM1}; + hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */ + hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ hsize_t * coords; /* Coordinate buffer */ - hsize_t low[SPACE3_RANK]; /* Selection bounds */ - hsize_t high[SPACE3_RANK]; /* Selection bounds */ + hsize_t low[SPACE3_RANK]; /* Selection bounds */ + hsize_t high[SPACE3_RANK]; /* Selection bounds */ hdset_reg_ref_t *wbuf, /* buffer to write to disk */ *rbuf; /* buffer read from disk */ uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ @@ -916,7 +914,7 @@ test_reference_region_1D(void) uint8_t *tu8; /* Temporary pointer to uint8 data */ H5O_type_t obj_type; /* Object type */ int i; /* counting variables */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n")); @@ -938,7 +936,7 @@ test_reference_region_1D(void) /* Create dataset access property list */ dapl_id = H5Pcreate(H5P_DATASET_ACCESS); CHECK(dapl_id, FAIL, "H5Pcreate"); - + /* Create a dataset */ dset3 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(dset3, FAIL, "H5Dcreate2"); @@ -1178,14 +1176,14 @@ test_reference_region_1D(void) static void test_reference_obj_deleted(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset, /* Dataset ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, /* Dataset ID */ dset2; /* Dereferenced dataset ID */ - hid_t sid1; /* Dataspace ID */ + hid_t sid1; /* Dataspace ID */ hobj_ref_t oref; /* Object Reference to test */ H5O_type_t obj_type; /* Object type */ - haddr_t addr = HADDR_UNDEF; /* test for undefined reference */ - herr_t ret; /* Generic return value */ + haddr_t addr = HADDR_UNDEF; /* test for undefined reference */ + herr_t ret; /* Generic return value */ /* Create file */ fid1 = H5Fcreate(FILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1444,25 +1442,25 @@ test_reference_group(void) static void test_reference_compat(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset, dset2; /* Dataset ID */ - hid_t group, group2; /* Group ID */ - hid_t sid1, /* Dataspace IDs */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, dset2; /* Dataset ID */ + hid_t group, group2; /* Group ID */ + hid_t sid1, /* Dataspace IDs */ sid2; - hid_t tid1, tid2; /* Datatype ID */ - hsize_t dims1[] = {SPACE1_DIM1}, - dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ - hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ + hid_t tid1, tid2; /* Datatype ID */ + hsize_t dims1[] = {SPACE1_DIM1}, + dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ + hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ hobj_ref_t *wbuf_obj, /* Buffer to write to disk */ *rbuf_obj; /* Buffer read from disk */ hdset_reg_ref_t *wbuf_reg, /* Buffer to write to disk */ *rbuf_reg; /* Buffer read from disk */ H5G_obj_t obj_type; /* Object type */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deprecated Object Reference Functions\n")); @@ -1750,15 +1748,15 @@ test_reference(void) } /* test_reference() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_reference + * Function: cleanup_reference * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * September 8, 1998 * * Modifications: diff --git a/test/ttime.c b/test/ttime.c index 2eb2117..48c9ba8 100644 --- a/test/ttime.c +++ b/test/ttime.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: ttime +* Test program: ttime * * Test the Time Datatype functionality * @@ -21,8 +21,6 @@ #include "testhdf5.h" -#include "hdf5.h" - #define DATAFILE "ttime.h5" #ifdef NOT_YET #define DATASETNAME "Dataset" @@ -215,15 +213,15 @@ test_time(void) } /* test_time() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_time + * Function: cleanup_time * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * October 19, 2000 * * Modifications: diff --git a/test/ttsafe.h b/test/ttsafe.h index 6cf449f..c29fadc 100644 --- a/test/ttsafe.h +++ b/test/ttsafe.h @@ -22,9 +22,6 @@ * Include required headers. This file tests internal library functions, * so we include the private headers here. */ -#include "hdf5.h" -#include "H5private.h" -#include "H5Eprivate.h" #include "testhdf5.h" diff --git a/test/tvlstr.c b/test/tvlstr.c index 7b520f2..3315d68 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: tvlstr +* Test program: tvlstr * * Test the Variable-Length String functionality * @@ -21,14 +21,12 @@ #include "testhdf5.h" -#include "hdf5.h" - #define DATAFILE "tvlstr.h5" #define DATAFILE2 "tvlstr2.h5" /* 1-D dataset with fixed dimensions */ -#define SPACE1_RANK 1 -#define SPACE1_DIM1 4 +#define SPACE1_RANK 1 +#define SPACE1_DIM1 4 #define VLSTR_TYPE "vl_string_type" @@ -115,17 +113,17 @@ test_vlstrings_basic(void) char *rdata[SPACE1_DIM1]; /* Information read in */ char *wdata2; hid_t dataspace, dataset2; - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Datatype ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ hid_t xfer_pid; /* Dataset transfer property list ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; hsize_t size; /* Number of bytes which will be used */ unsigned i; /* counting variable */ size_t str_used; /* String data in memory */ size_t mem_used=0; /* Memory used during allocation */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic VL String Functionality\n")); @@ -247,14 +245,14 @@ test_vlstrings_special(void) const char *wdata2[SPACE1_DIM1] = {NULL, NULL, NULL, NULL}; char *rdata[SPACE1_DIM1]; /* Information read in */ char *fill; /* Fill value */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Datatype ID */ - hid_t dcpl; /* Dataset creation property list ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ + hid_t dcpl; /* Dataset creation property list ID */ + hsize_t dims1[] = {SPACE1_DIM1}; unsigned i; /* counting variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Special VL Strings\n")); @@ -477,14 +475,14 @@ test_compact_vlstring(void) { const char *wdata[SPACE1_DIM1] = {"one", "two", "three", "four"}; char *rdata[SPACE1_DIM1]; /* Information read in */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Datatype ID */ - hid_t plist; /* Dataset creation property list */ - hsize_t dims1[] = {SPACE1_DIM1}; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ + hid_t plist; /* Dataset creation property list */ + hsize_t dims1[] = {SPACE1_DIM1}; unsigned i; /* counting variable */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing VL Strings in compact dataset\n")); @@ -873,15 +871,15 @@ test_vlstrings(void) test_vl_rewrite(); } /* test_vlstrings() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_vlstrings + * Function: cleanup_vlstrings * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * September 10, 1999 * * Modifications: diff --git a/test/tvltypes.c b/test/tvltypes.c index 0c4cb9d..e5a3d34 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -13,7 +13,7 @@ /*********************************************************** * -* Test program: tvltypes +* Test program: tvltypes * * Test the Variable-Length Datatype functionality * @@ -21,24 +21,23 @@ #include "testhdf5.h" -#include "hdf5.h" #include "H5Dprivate.h" #define FILENAME "tvltypes.h5" /* 1-D dataset with fixed dimensions */ -#define SPACE1_RANK 1 +#define SPACE1_RANK 1 #define SPACE1_DIM1 4 /* 1-D dataset with fixed dimensions */ -#define SPACE3_RANK 1 +#define SPACE3_RANK 1 #define SPACE3_DIM1 128 #define L1_INCM 16 #define L2_INCM 8 #define L3_INCM 3 /* 1-D dataset with fixed dimensions */ -#define SPACE4_RANK 1 +#define SPACE4_RANK 1 #define SPACE4_DIM_SMALL 128 #define SPACE4_DIM_LARGE (H5D_TEMP_BUF_SIZE / 64) @@ -104,7 +103,7 @@ static void test_vltypes_dataset_create(void) { hid_t fid1; /* HDF5 File IDs */ - hid_t dcpl; /* Dataset Property list */ + hid_t dcpl; /* Dataset Property list */ hid_t dataset; /* Dataset ID */ hsize_t dims1[] = {SPACE1_DIM1}; hid_t sid1; /* Dataspace ID */ @@ -136,7 +135,7 @@ test_vltypes_dataset_create(void) /* Create a dataset, supposed to fail */ H5E_BEGIN_TRY { - dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, dcpl, H5P_DEFAULT); + dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, dcpl, H5P_DEFAULT); } H5E_END_TRY; VERIFY(dataset, FAIL, "H5Dcreate2"); @@ -230,18 +229,18 @@ test_vltypes_vlen_atomic(void) hvl_t wdata2[SPACE1_DIM1]; /* Information to write */ hvl_t rdata[SPACE1_DIM1]; /* Information read in */ hvl_t fill; /* Fill value */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ hid_t sid2; /* ID of bad dataspace (no extent set) */ - hid_t tid1; /* Datatype ID */ + hid_t tid1; /* Datatype ID */ hid_t dcpl_pid; /* Dataset creation property list ID */ hid_t xfer_pid; /* Dataset transfer property list ID */ hsize_t dims1[] = {SPACE1_DIM1}; hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Atomic VL Datatype Functionality\n")); @@ -556,7 +555,7 @@ rewrite_vltypes_vlen_atomic(void) hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - unsigned increment=4; + unsigned increment=4; herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -709,16 +708,16 @@ test_vltypes_vlen_compound(void) } s1; hvl_t wdata[SPACE1_DIM1]; /* Information to write */ hvl_t rdata[SPACE1_DIM1]; /* Information read in */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1, tid2; /* Datatype IDs */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1, tid2; /* Datatype IDs */ hid_t xfer_pid; /* Dataset transfer property list ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Basic Compound VL Datatype Functionality\n")); @@ -863,7 +862,7 @@ rewrite_vltypes_vlen_compound(void) hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - unsigned increment=4; + unsigned increment=4; herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -1001,14 +1000,14 @@ test_vltypes_compound_vlen_vlen(void) } s1; s1 *wdata; /* data to write */ s1 *rdata; /* data to read */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1, tid2, tid3; /* Datatype IDs */ - hsize_t dims1[] = {SPACE3_DIM1}; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1, tid2, tid3; /* Datatype IDs */ + hsize_t dims1[] = {SPACE3_DIM1}; unsigned i,j,k; /* counting variables */ hvl_t *t1, *t2; /* Temporary pointer to VL information */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Compound Datatypes with VL Atomic Datatype Component Functionality\n")); @@ -1182,21 +1181,21 @@ test_vltypes_compound_vlstr(void) s1 wdata2[SPACE1_DIM1]; /* data to write */ s1 rdata[SPACE1_DIM1]; /* data to read */ s1 rdata2[SPACE1_DIM1]; /* data to read */ - char str[64] = "a\0"; - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset, dset2; /* Dataset ID */ - hid_t sid1, sid2, filespace, filespace2; /* Dataspace ID */ - hid_t tid1, tid2, tid3, tid4, tid5; /* Datatype IDs */ - hid_t cparms; - hsize_t dims1[] = {SPACE1_DIM1}; - hsize_t chunk_dims[] = {SPACE1_DIM1/2}; - hsize_t maxdims[] = {H5S_UNLIMITED}; - hsize_t size[] = {SPACE1_DIM1}; - hsize_t offset[] = {0}; + char str[64] = "a\0"; + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, dset2; /* Dataset ID */ + hid_t sid1, sid2, filespace, filespace2; /* Dataspace ID */ + hid_t tid1, tid2, tid3, tid4, tid5; /* Datatype IDs */ + hid_t cparms; + hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t chunk_dims[] = {SPACE1_DIM1/2}; + hsize_t maxdims[] = {H5S_UNLIMITED}; + hsize_t size[] = {SPACE1_DIM1}; + hsize_t offset[] = {0}; unsigned i,j; /* counting variables */ s2 *t1, *t2; /* Temporary pointer to VL information */ - int val; - herr_t ret; /* Generic return value */ + int val; + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing VL Datatype of Compound Datatype with VL String Functionality\n")); @@ -1374,10 +1373,10 @@ test_vltypes_compound_vlstr(void) wdata2[i].v.p=(s2*)HDmalloc((i+1)*sizeof(s2)); wdata2[i].v.len=i+1; for(t1=(s2*)(wdata2[i].v).p, j=0; j<i+1; j++, t1++) { - strcat(str, "pp"); - t1->string = (char*)HDmalloc(strlen(str)*sizeof(char)+1); + strcat(str, "pp"); + t1->string = (char*)HDmalloc(strlen(str)*sizeof(char)+1); strcpy(t1->string, str); - t1->color = green; + t1->color = green; } } /* end for */ @@ -1467,17 +1466,17 @@ test_vltypes_compound_vlen_atomic(void) s1 wdata[SPACE1_DIM1]; /* Information to write */ s1 rdata[SPACE1_DIM1]; /* Information read in */ s1 fill; /* Fill value */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1, tid2; /* Datatype IDs */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1, tid2; /* Datatype IDs */ hid_t xfer_pid; /* Dataset transfer property list ID */ hid_t dcpl_pid; /* Dataset creation property list ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Compound Datatypes with VL Atomic Datatype Component Functionality\n")); @@ -1671,9 +1670,9 @@ test_vltypes_compound_vlen_atomic(void) /**************************************************************** ** ** rewrite_vltypes_compound_vlen_atomic(): Check memory leak for -** basic VL datatype code. +** basic VL datatype code. ** Check memory leak for compound datatypes with VL datatypes -** of atomic datatypes. +** of atomic datatypes. ** ****************************************************************/ static void @@ -1694,7 +1693,7 @@ rewrite_vltypes_compound_vlen_atomic(void) hsize_t size; /* Number of bytes which will be used */ unsigned i,j; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - unsigned increment=4; + unsigned increment=4; herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -1855,16 +1854,16 @@ test_vltypes_vlen_vlen_atomic(void) hvl_t wdata[SPACE1_DIM1]; /* Information to write */ hvl_t rdata[SPACE1_DIM1]; /* Information read in */ hvl_t *t1, *t2; /* Temporary pointer to VL information */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1, tid2; /* Datatype IDs */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1, tid2; /* Datatype IDs */ hid_t xfer_pid; /* Dataset transfer property list ID */ - hsize_t dims1[] = {SPACE1_DIM1}; + hsize_t dims1[] = {SPACE1_DIM1}; hsize_t size; /* Number of bytes which will be used */ unsigned i,j,k; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing VL Datatypes with VL Atomic Datatype Component Functionality\n")); @@ -2049,12 +2048,12 @@ rewrite_longer_vltypes_vlen_vlen_atomic(void) hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ hid_t sid1; /* Dataspace ID */ - hid_t tid2; /* Datatype IDs */ + hid_t tid2; /* Datatype IDs */ hid_t xfer_pid; /* Dataset transfer property list ID */ hsize_t size; /* Number of bytes which will be used */ unsigned i,j,k; /* counting variables */ size_t mem_used=0; /* Memory used during allocation */ - unsigned increment=1; + unsigned increment=1; herr_t ret; /* Generic return value */ /* Output message about test being performed */ @@ -3171,15 +3170,15 @@ test_vltypes(void) /* These next tests use the same file */ test_vltypes_dataset_create(); /* Check dataset of VL when fill value - * won't be rewritten to it.*/ + * won't be rewritten to it.*/ test_vltypes_funcs(); /* Test functions with VL types */ test_vltypes_vlen_atomic(); /* Test VL atomic datatypes */ - rewrite_vltypes_vlen_atomic(); /* Check VL memory leak */ + rewrite_vltypes_vlen_atomic(); /* Check VL memory leak */ test_vltypes_vlen_compound(); /* Test VL compound datatypes */ - rewrite_vltypes_vlen_compound(); /* Check VL memory leak */ + rewrite_vltypes_vlen_compound(); /* Check VL memory leak */ test_vltypes_compound_vlen_atomic(); /* Test compound datatypes with VL atomic components */ - rewrite_vltypes_compound_vlen_atomic();/* Check VL memory leak */ - test_vltypes_vlen_vlen_atomic(); /* Test VL datatype with VL atomic components */ + rewrite_vltypes_compound_vlen_atomic();/* Check VL memory leak */ + test_vltypes_vlen_vlen_atomic(); /* Test VL datatype with VL atomic components */ rewrite_longer_vltypes_vlen_vlen_atomic(); /*overwrite with VL data of longer sequence*/ rewrite_shorter_vltypes_vlen_vlen_atomic(); /*overwrite with VL data of shorted sequence*/ test_vltypes_compound_vlen_vlen();/* Test compound datatypes with VL atomic components */ @@ -3187,15 +3186,15 @@ test_vltypes(void) test_vltypes_fill_value(); /* Test fill value for VL data */ } /* test_vltypes() */ - + /*------------------------------------------------------------------------- - * Function: cleanup_vltypes + * Function: cleanup_vltypes * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * June 8, 1999 * * Modifications: |