summaryrefslogtreecommitdiffstats
path: root/test/tfile.c
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2021-02-08 16:56:16 (GMT)
committerGitHub <noreply@github.com>2021-02-08 16:56:16 (GMT)
commit22c67ff6570f16050f0a5654cf1c84df917bb598 (patch)
tree38fb63aa498b250c2543fe7e22a511706de96a42 /test/tfile.c
parent551f15f8ae02ca9c995619b216121081eb07633e (diff)
downloadhdf5-hdf5-1_8_22.zip
hdf5-hdf5-1_8_22.tar.gz
hdf5-hdf5-1_8_22.tar.bz2
1.8/master (#317)hdf5-1_8_22
* Revert incorrect bool type * Correct grep text for filter test * Check sizeof type to use correct ref_type * h5dump reg ref chnages has no error file * Fix comment * Remove unneeded files * Verify the decoded version for "all" and "none" selection. * Remove double entry * Add missing include * Snapshot version 1.8 release 22 (snap4) Update version to 1.8-snap5 * Fixes for test failures with --disable-tests --disable-tools options. Don't test ph5diff if tests are disabled. * Correct conditions for parallel builds with and without tests. * Snapshot version 1.8 release 22 (snap5) Update version to 1.8.22-snap6 * TRILAB-192 merging warnings changes from develop * Autotools reconfigure update * Restore page ejects. * Restore page eject chars * Fix orphaned token * Update LT files * Correct extra flags and merge TRILAB-24 * Update release note for CMake warnings * H5repack bug fixes from develop * TRILAB-192 - merge changes from develop Single source, config files, for warnings for both autotools and CMake. Update CMake libraries, tools, tests to use correct flags. * Add missing m4 file * Remove 128bit config check fo 1.8 * TRILAB-192 update LTparse files * A fix in the cleaning up code for datatype when datatype initialization via H5D__init_type() fails. The code to fix the problem is the same as what is done in H5D__open_oid(). * Add missing " and update function calls incorrectly named load_gcc_arguments. Commit changes to gnu-cxxflags to remove unmatched " and to gnu-fflags to not add C warnings flags to H5_FCFLAGS. * TRILAB-192 - cleanup edits and match CMake CXX to autotools * Fix shadowed type * TRILAB-192 correct fortran commands * TRILAB-192 version of std=f2008 special check * Fix shadow variable * Add prefix_relto_examplesdir function to set relative path to h5c++. * TRILAB-192 - parser files cannot handle this warning * Parallel Fortran tests now use the MPI module instead of including mpif.h. * Don't add general warnings flags for unsupported old versions of gcc and g++ (older than gcc/g++ 4.2). Correct gnu-cxxflags to determine warnings flags to be added based on C++ compiler version instead of C compiler version. * Snapshot version 1.8 release 22 (snap6) Update version to 1.8.22-snap7 * TRILAB-244 separate CXX warnings and errors from C * Fix NoFilter build * Move ADD_H5_FLAGS macro from *CompilerFlags.cmake files to config/cmake_ext_mod/HDFMacros.cmake for common use. * Restrict errors to gcc 4.8 and above. * OESS-65 replace szip with aec szip * Correct CMake version * Correct -Werror=unused-variable * Add -Werror= flags to lists displayed in libhdf5.settings. * Fix -Werror=unused-variable * More fixes for unused variable * Resolve warning errors from -Werror= flags: -Werror=bad-function-cast -Werror=bad-function-cast -Werror=implicit-function-declaration -Werror=nested-externs * Remove verbose assignments in smoke_check 3 and 5 functions. * Update to use optimization flags, C++ error flags, and correct libhdf5.settings.in to remove unworkable changes. * Update config/gnu-cxxflags. * Add missing headers * Fix ifort warning flag. Restore AC_DEFUN([PAC_PROG_FC_DEFAULT_REALisDBLE] in m4/aclocal_fc.m4. Add --enable-symbols, --enable-profiling, and --enable-optimization options to autotools configure; all configure flags for --enable-production and --disable-production should match HDF5 1.10 and 1.12 production and debug default flags. * Add github actions file * Correct path * OESS-65 Fix packaging * Update reference name * Correct filename * disable pr action and enable fail fast * Snapshot 1.8.22-snap7 Update version to 1.8.22-snap8. * Correct mingw path * Correct mingw paths * Revise gnu-*flags and cmake/HDF*CompilerFlags.cmake files to add warning flags for GCC compilers version 4.8 and above. Removed files from gnu-warnings that only apply to versions < 4.8. Consolidated warnings from versions < 4.8 that apply to versions >= 4.8 into the 4.8 warnings files. * Update MANIFEST for removal of older warnings files. * Yanked all MPI-1 calls Added batch scripts in bin/batch. * Snapshot 1.8.22-snap8. Update version to 1.8.22-snap9. * Squashed commit of the following: commit 45b0cbc71929930a874e1c09e0770aa64d0ae697 Author: Larry Knox <lrknox@hdfgroup.org> Date: Thu Apr 23 13:14:56 2020 -0500 Add C++ warnings treated as error for autotools builds. commit 6debcddcc766601799d5bd661bd60946f951a07e Author: Larry Knox <lrknox@hdfgroup.org> Date: Fri Jun 19 16:50:03 2020 -0500 Remove tests for develop branch from testh5cc.sh.in. Add @H5_ECXXFLAGS@ to AM_CXXFLAGS. commit fed497e7f207313b2a133d3b68c942b7d7104b90 Author: Larry Knox <lrknox@hdfgroup.org> Date: Fri Jun 12 15:06:39 2020 -0500 Merge pull request #2646 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit '998c6470d78e14228695419c3b514c35ecf3d69e': Remove unnecessary version conditions for Clang compilers. commit 92e52ce5c211bd1d3991a3b8bb67287ac7b652aa Author: Larry Knox <lrknox@hdfgroup.org> Date: Wed Jun 10 18:53:45 2020 -0500 Merge pull request #2639 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit 'a33667faf226f5d8c9633bf537893e8fce1bf1f6': Add c++ to --enable-sanitize-checks option. commit 2e802534fb997b81fa98fdd1c7d97d4310898e0d Author: Larry Knox <lrknox@hdfgroup.org> Date: Wed Jun 10 15:18:36 2020 -0500 Merge pull request #2633 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit '20eab963899841c9a003baebead8e3bc07d9e127': Remove duplicate entries in MANIFEST. Make changes to CMake CompilerFlags.cmake files so extra flags are loaded for non-GNU compilers. Update new clang files to not pick up clang as vendor for pgCC. Add new files to MANIFEST Temporary demotion of 2 -Werror warning flags that fail on macos 10.12 Remove Production flag unknown to Apple clang. commit 96ef60a58a23847a7da89a891f2415055ec2ab60 Author: Larry Knox <lrknox@hdfgroup.org> Date: Mon Jun 8 16:24:49 2020 -0500 Merge pull request #2631 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit 'b942a4d8a3e27317cac50ce37ff5302d477664d8': Clean up code to get clang version in config/linux-gnulibc1 commit 8a7c687da568e8b50b38fa53da1ca63759be6ec4 Author: Larry Knox <lrknox@hdfgroup.org> Date: Mon Jun 8 11:42:37 2020 -0500 Merge pull request #2623 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit 'c7626f79fdee4eee13925e240ef41e61f3367eab': Add flags from config/clang-warnings/*general files to H5 C and CXX flags for all versions of Clang and Clang++ compilers. Switched from cut to awk in testcheck_version.sh.in to avoid dependence on tab vs. " " in version definitions in H5public.h. Add files for adding warning flags for clang compilers in autotools configure. commit db3ef7ff3c1ed79167cecef831501411cff8291f Merge: 5a0f8d7 f9f1310 Author: Larry Knox <lrknox@hdfgroup.org> Date: Fri Jun 19 14:46:22 2020 -0500 Merge branch 'hdf5_1_12' of https://bitbucket.hdfgroup.org/scm/~lrknox/hdf5_lrk into hdf5_1_12 commit 5a0f8d7940ae57b445f545a0abd7e303ce6924ee Author: Larry Knox <lrknox@hdfgroup.org> Date: Wed Jun 10 20:15:41 2020 -0500 Merge pull request #2636 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:HDFFV-11000-update-testh5cc.sh.in-for-version to develop * commit '5c0bd670d6e9919c463fbc05de99e2ba55b0761e': Add tests for all version to H5_NO_DEPRECATED_SYMBOLS section and to section for current version, with and without default API version flags. HDFFV-11000: update-testh5cc.sh.in to test sample versioned functions in HDF5 1.10, 1.12 and develop. * Update configure and Makefile.ins after bin/reconfigure. * Fix MANIFEST * Fix HDFFV-10591 Description: h52gif produced a segfault when a buffer overflow occurred because the data size was corrupted and became very large. This commit added a check on the data size against the buffer size to prevent the segfault. It also added error reporting to h52gif to display an error message instead of silently exiting when the failure occurred. Platforms tested: Linux/64 (jelly) * Snapshot 1.8.22-snap9. Update version to 1.8.22-snap10. * Merge pull request #2686 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit '800f93f7c994f88dfa716746153ded4b1e690e3a': Remove path to szip header file from AM_CPPFLAGS when configure check of libsz fails. Fix for HDFFV-10830. * Regenerate configure. * Merge from 1.10-1.12-dev - LT parse needs update * Incorporate pull request #2693 from develop for the fix to HDFFV-11080: (1) Patch up the file pointer when reading attribute of variable length datatype (2) Test to verify the fix when doing multiple threads (3) Update MANIFEST (4) Add new test to Cmake * Switch bison and flex update of LT files from bin/genltanalyse to bin/genparser, and from automatically updating the LT files whenever reconfigure is run to running only on man<F12>ual command. * Update hl/sr/H5LT files. Add bin/genparser to MANIFEST; remove bin/genltanalyze. * Fix to the merge of PR #2708 for HDFFV-11080 to the 1.8 branch. Need to checkin test/Makefile.in for the new file added. * Fix HDFFV-11120 and HDFFV-11121 (CVE-2018-13870 and CVE-2018-13869) Description: When a buffer overflow occurred because a name length was corrupted and became very large, h5dump produced a segfault on one file and a memcpy parameter overlap on another file. This commit added checks that detect a read pass the end of the buffer to prevent these error conditions. Platforms tested: Linux/64 (jelly) * Fixed typo * Check for header szlib.h only when libsz passes AC_CHECK_LIB, so that H5_HAVE_SALIB_H is not defined when szip is not enabled, to prevent compile failures for incompatible szlib. * HDFFV-11127 - force RTLD_LOCAL in dlopen * spelling * Remove extra parens * Remove unnecessary assignment freom configure.ac. * Add hypen to subrelease regex * Add special case when H5_VERS_SUBRELEASE is 0 * Revert H5_VERS_SUBRELEASE check * The version string has a second use for packaging * MinGW uses "MinGW Makefiles" * Snapshot 1.8.22-snap10. Update version to 1.8.22-snap11. * Merge clang-format changes from develop * remove stray file * Source formatted * Add options to github actions. * Add back file, remove py file * HDFFV-11096 Correct h5dump usage text * Update formating * remove autogen for 1.8 branch * Fix comment whitespace * Change '==' to 'eq' in test script * Merge from develop github updates bin scripts parser updates * Snapshot 1.8.22-snap11. Update version to 1.8.22-snap12. * Merge from 1.10 Comments, whitespace Simple init and if block brackets. Minimal code changes limited to return value and spelling * Update autotools files * Update FD source * More merges from 1.10 comments and inits * Comment fixes * Fix macro argument * Remove autogen file and cache dir * Revert autotools files to previous version * Correct boolean value and missing define * URL and options corrections * revert autoconf files * Fix compile issues with vfd drivers. * Fix HDFS test * Remove extra #endif * Move init above execution * Multiple changes to bring branch up-to-date (#87) Correct TARGET variable and CMake config file location. Add option to allow filter plugins to be built inline. Update CMake tools macros. * hdf5 1 8 release text (#113) * Multiple changes to bring branch up-to-date Correct TARGET variable and CMake config file location. Add option to allow filter plugins to be built inline. Update CMake tools macros. * release text updates - mostly whitespace * Fixed HDFFV-10480 and HDFFV-11159 (#145) * Fixed HDFFV-10480 and HDFFV-11159 Description Checked against buffer size to prevent segfault, in case of data corruption. + HDFFV-11159 CVE-2018-14033 Buffer over-read in H5O_layout_decode + HDFFV-10480 CVE-2018-11206 Buffer over-read in H5O_fill_new[/old]_decode and A user's patch was applied to this previously, but it is redone for a more correct fix, that is the check now accounted for the previous advance of the buffer pointer. Platforms tested: Linux/64 (jelly) * Fixed typo * Update HDF5 1.8 copyright headers with updated copyright URL (#148) * Update URL for COPYING file in copyright headers. * Make fortran copyright headers uniformly spaced. * Update url for Copyright file in c++/src/footer.html. * OESS-98 Update plugin build option (#171) * 1.8 has extra fortran CMake option (#176) * 1.8 has extra fortran CMake option * Update license URL * OESS-98 fix tools test for plugins (#180) * Hdf5 1 8 (#169) * Fixed HDFFV-10480 and HDFFV-11159 Description Checked against buffer size to prevent segfault, in case of data corruption. + HDFFV-11159 CVE-2018-14033 Buffer over-read in H5O_layout_decode + HDFFV-10480 CVE-2018-11206 Buffer over-read in H5O_fill_new[/old]_decode and A user's patch was applied to this previously, but it is redone for a more correct fix, that is the check now accounted for the previous advance of the buffer pointer. Platforms tested: Linux/64 (jelly) * Fixed typo * Fixed HDFFV-11150 Description Replaced an HDassert with a check for null pointer in H5O_dec_rc() to catch null pointer in corrupted data situation. Reversed the fix in svn-r24463 in which a check for null pointer prior to calling H5O_dec_rc() Platforms tested: Linux/64 (jelly) * HDF5 1 8 fix fortran build on macs (#186) * Correct fortran and shared libs option * Fix for no shared fortran build * OESS-98 fix hdf5 link target (#191) * Partial changes to RELEASE.txt for release. (#185) * Partial changes to RELEASE.txt for release. * Update supported and tested platforms. * Update version to 1.8.22-12. * close #195. (#196) * Update HDF5PluginMacros.cmake * Update HDF5PluginMacros.cmake * Update directory for SZ filter in HDF5PluginMacros.cmake. Updates for release: Switch configure default to production mode. Set HDF5_GENERATE_HEADERS to OFF. * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Restores maintainer mode in the autotools (#200) (#203) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> * Hdf5 1 8 22 (#212) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Brings ttsafe_attr_vlen.c changes from develop (#214) Fixes exposed pthread problem on Windows. * Update SO numbers for Hdf5 1 8 22 (#215) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Hdf5 1 8 22 (#224) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> * Update CMake/HDF5Examples version in bin/release * Update CMake/HDF5Examples version number in bin/release (#225) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> * Fixed typo in an error message. (#228) * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * Bring 3 small changes from Hdf5 1.8 to 1.8.22 (#241) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Stat st blocks fix 1822 (#251) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * Fixes Autotools detection of the st_blocks field in stat (#246) * Fixes Autotools detection of the st_blocks field in stat The Autotools and CMake will now both correctly determine if the stat struct has the st_blocks field and set H5_HAVE_STAT_ST_BLOCKS appropriately. * Fixes a typo in configure.ac * Restore lines in RELEASE.txt. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Stat st blocks fix 1822 (#256) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * Fixes Autotools detection of the st_blocks field in stat (#246) * Fixes Autotools detection of the st_blocks field in stat The Autotools and CMake will now both correctly determine if the stat struct has the st_blocks field and set H5_HAVE_STAT_ST_BLOCKS appropriately. * Fixes a typo in configure.ac * Restore lines in RELEASE.txt. * Updated configure with reconfigure. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * RELEASE.txt cleanup. * Hdf5 1 8 22 (#261) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Hdf5 1 8 22 (#266) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. * Hdf5 1 8 22 - Reverts lock/unlock callback signature to 1.8.21 version (#267) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Update version in H5public.h * Hdf5 1 8 22 (#269) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. * Update version in H5public.h Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Set version 1.8.22 for release. * dd RELEASE.txt entry for HDFFV-10741. * Hdf5 1 8 22 (#279) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. * Update version in H5public.h * Set version 1.8.22 for release. * dd RELEASE.txt entry for HDFFV-10741. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Improve performance of multiple calls to H5Sget_select_elem_pointlist (#270) (#277) * Cache the pointer to the next point to process after the last call to H5S__get_select_elem_pointlist. This allows the normal process of iterating over the points in batches to be much more efficient, as the library does not need to traverse the entirety of the preceding points every time the funciton is re-entered. * Update RELEASE.txt for point selection iteration performance fix. * Hdf5 1 8 22 (#281) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. * Update version in H5public.h * Set version 1.8.22 for release. * dd RELEASE.txt entry for HDFFV-10741. * Improve performance of multiple calls to H5Sget_select_elem_pointlist (#270) (#277) * Cache the pointer to the next point to process after the last call to H5S__get_select_elem_pointlist. This allows the normal process of iterating over the points in batches to be much more efficient, as the library does not need to traverse the entirety of the preceding points every time the funciton is re-entered. * Update RELEASE.txt for point selection iteration performance fix. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> Co-authored-by: Neil Fortner <nfortne2@hdfgroup.org> * Hdf5 1 8 22 (#284) * Fixed typo in an error message. * Updated for HDFFV-11150, HDFFV-10480, and HDFFV-11159 * Update "Support for New Platforms and Compilers" section in RELEASE.txt; add check_version workaround for binary compatibility to "Known Problems". * Add SUSE Linux to tested platforms. * Update numbers in config/lt_vers.am and run bin/reconfigure for so numbers. * Update version in 3 files missed by merge. Co-authored-by: Allen Byrne <byrn@hdfgroup.org> Co-authored-by: Vailin Choi <vchoi@hdfgroup.org> Co-authored-by: vchoi <vchoi@jelly.ad.hdfgroup.org> Co-authored-by: hdftest <hdftest@hdfgroup.org> Co-authored-by: Jordan Henderson <jhenderson@hdfgroup.org> Co-authored-by: Dana Robinson <derobins@hdfgroup.org> Co-authored-by: Binh-Minh Ribler <bmribler@hdfgroup.org> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org> Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Neil Fortner <nfortne2@hdfgroup.org>
Diffstat (limited to 'test/tfile.c')
-rw-r--r--test/tfile.c1182
1 files changed, 573 insertions, 609 deletions
diff --git a/test/tfile.c b/test/tfile.c
index db6b787..b063998 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -6,20 +6,19 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
- * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/***********************************************************
-*
-* Test program: tfile
-*
-* Test the low-level file I/O features.
-*
-*************************************************************/
-
-#include "hdf5.h"
+ *
+ * Test program: tfile
+ *
+ * Test the low-level file I/O features.
+ *
+ *************************************************************/
+
#include "testhdf5.h"
#include "H5srcdir.h"
@@ -32,89 +31,86 @@
*/
#define H5F_PACKAGE
#define H5F_TESTING
-#include "H5Fpkg.h" /* File access */
-
-#define BAD_USERBLOCK_SIZE1 (hsize_t)1
-#define BAD_USERBLOCK_SIZE2 (hsize_t)2
-#define BAD_USERBLOCK_SIZE3 (hsize_t)3
-#define BAD_USERBLOCK_SIZE4 (hsize_t)64
-#define BAD_USERBLOCK_SIZE5 (hsize_t)511
-#define BAD_USERBLOCK_SIZE6 (hsize_t)513
-#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"
+#include "H5Fpkg.h" /* File access */
+
+#define BAD_USERBLOCK_SIZE1 (hsize_t)1
+#define BAD_USERBLOCK_SIZE2 (hsize_t)2
+#define BAD_USERBLOCK_SIZE3 (hsize_t)3
+#define BAD_USERBLOCK_SIZE4 (hsize_t)64
+#define BAD_USERBLOCK_SIZE5 (hsize_t)511
+#define BAD_USERBLOCK_SIZE6 (hsize_t)513
+#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 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_RANK 2
-#define F2_DIM0 4
-#define F2_DIM1 6
-#define F2_DSET "dset"
-#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 GRP_NAME "/group"
-#define DSET_NAME "dataset"
-#define ATTR_NAME "attr"
-#define TYPE_NAME "type"
-#define DSET_VL "vlinteger"
-#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_8 8
-
-#define GROUP1 "Group1"
-#define DSET1 "Dataset1"
-#define DSET2 "/Group1/Dataset2"
-
-#define TESTA_GROUPNAME "group"
-#define TESTA_DSETNAME "dataset"
-#define TESTA_ATTRNAME "attribute"
-#define TESTA_DTYPENAME "compound"
-#define TESTA_NAME_BUF_SIZE 64
-#define TESTA_RANK 2
-#define TESTA_NX 4
-#define TESTA_NY 5
-
-#define USERBLOCK_SIZE ((hsize_t) 512)
+#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_RANK 2
+#define F2_DIM0 4
+#define F2_DIM1 6
+#define F2_DSET "dset"
+#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 GRP_NAME "/group"
+#define DSET_NAME "dataset"
+#define ATTR_NAME "attr"
+#define TYPE_NAME "type"
+#define DSET_VL "vlinteger"
+#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_8 8
+
+#define GROUP1 "Group1"
+#define DSET1 "Dataset1"
+#define DSET2 "/Group1/Dataset2"
+
+#define TESTA_GROUPNAME "group"
+#define TESTA_DSETNAME "dataset"
+#define TESTA_ATTRNAME "attribute"
+#define TESTA_DTYPENAME "compound"
+#define TESTA_NAME_BUF_SIZE 64
+#define TESTA_RANK 2
+#define TESTA_NX 4
+#define TESTA_NY 5
+
+#define USERBLOCK_SIZE ((hsize_t)512)
/* Declaration for test_libver_macros2() */
-#define FILE5 "tfile5.h5" /* Test file */
+#define FILE5 "tfile5.h5" /* Test file */
/* Declaration for test_get_obj_ids() */
-#define FILE6 "tfile6.h5" /* Test file */
-#define NGROUPS 2
-#define NDSETS 4
+#define FILE6 "tfile6.h5" /* Test file */
+#define NGROUPS 2
+#define NDSETS 4
-static void
-create_objects(hid_t, hid_t, hid_t *, hid_t *, hid_t *, hid_t *);
-static void
-test_obj_count_and_id(hid_t, hid_t, hid_t, hid_t, hid_t, hid_t);
-static void
-check_file_id(hid_t, hid_t);
+static void create_objects(hid_t, hid_t, hid_t *, hid_t *, hid_t *, hid_t *);
+static void test_obj_count_and_id(hid_t, hid_t, hid_t, hid_t, hid_t, hid_t);
+static void check_file_id(hid_t, hid_t);
/****************************************************************
**
@@ -124,14 +120,14 @@ check_file_id(hid_t, hid_t);
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"));
@@ -223,33 +219,26 @@ test_file_create(void)
CHECK(tmpl1, FAIL, "H5Pcreate");
/* Try setting some bad userblock sizes */
- H5E_BEGIN_TRY {
- ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE1);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE1); }
+ H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY {
- ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE2);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE2); }
+ H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY {
- ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE3);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE3); }
+ H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY {
- ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE4);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE4); }
+ H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY {
- ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE5);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE5); }
+ H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY {
- ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE6);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE6); }
+ H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_userblock");
- H5E_BEGIN_TRY {
- ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE7);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { ret = H5Pset_userblock(tmpl1, BAD_USERBLOCK_SIZE7); }
+ H5E_END_TRY;
VERIFY(ret, FAIL, "H5Pset_userblock");
/* Set the new file-creation parameters */
@@ -275,36 +264,37 @@ test_file_create(void)
/* Make certain we can create a dataset properly in the file with the userblock */
{
- hid_t dataset_id, dataspace_id; /* identifiers */
- hsize_t dims[F2_RANK];
- unsigned data[F2_DIM0][F2_DIM1];
- unsigned i,j;
-
- /* Create the data space for the dataset. */
- dims[0] = F2_DIM0;
- dims[1] = F2_DIM1;
- dataspace_id = H5Screate_simple(F2_RANK, dims, NULL);
- CHECK(dataspace_id, FAIL, "H5Screate_simple");
-
- /* Create the dataset. */
- dataset_id = H5Dcreate2(fid2, F2_DSET, H5T_NATIVE_UINT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dataset_id, FAIL, "H5Dcreate2");
-
- for(i = 0; i < F2_DIM0; i++)
- for(j = 0; j < F2_DIM1; j++)
- data[i][j] = i * 10 + j;
-
- /* Write data to the new dataset */
- ret = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
- CHECK(ret, FAIL, "H5Dwrite");
-
- /* End access to the dataset and release resources used by it. */
- ret = H5Dclose(dataset_id);
- CHECK(ret, FAIL, "H5Dclose");
-
- /* Terminate access to the data space. */
- ret = H5Sclose(dataspace_id);
- CHECK(ret, FAIL, "H5Sclose");
+ hid_t dataset_id, dataspace_id; /* identifiers */
+ hsize_t dims[F2_RANK];
+ unsigned data[F2_DIM0][F2_DIM1];
+ unsigned i, j;
+
+ /* Create the data space for the dataset. */
+ dims[0] = F2_DIM0;
+ dims[1] = F2_DIM1;
+ dataspace_id = H5Screate_simple(F2_RANK, dims, NULL);
+ CHECK(dataspace_id, FAIL, "H5Screate_simple");
+
+ /* Create the dataset. */
+ dataset_id =
+ H5Dcreate2(fid2, F2_DSET, H5T_NATIVE_UINT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset_id, FAIL, "H5Dcreate2");
+
+ for (i = 0; i < F2_DIM0; i++)
+ for (j = 0; j < F2_DIM1; j++)
+ data[i][j] = i * 10 + j;
+
+ /* Write data to the new dataset */
+ ret = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* End access to the dataset and release resources used by it. */
+ ret = H5Dclose(dataset_id);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Terminate access to the data space. */
+ ret = H5Sclose(dataspace_id);
+ CHECK(ret, FAIL, "H5Sclose");
}
/* Get the file-creation template */
@@ -383,7 +373,7 @@ test_file_create(void)
/* Close third file */
ret = H5Fclose(fid3);
CHECK(ret, FAIL, "H5Fclose");
-} /* test_file_create() */
+} /* test_file_create() */
/****************************************************************
**
@@ -393,17 +383,17 @@ test_file_create(void)
static void
test_file_open(void)
{
- 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 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 */
/*
* Test single file open
@@ -448,7 +438,6 @@ test_file_open(void)
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
-
/*
* Test two file opens: one is opened H5F_ACC_RDONLY and H5F_CLOSE_WEAK.
* It's closed with an object left open. Then another is opened
@@ -501,7 +490,7 @@ test_file_open(void)
ret = H5Pclose(fapl_id);
CHECK(ret, FAIL, "H5Pclose");
-} /* test_file_open() */
+} /* test_file_open() */
/****************************************************************
**
@@ -511,12 +500,12 @@ test_file_open(void)
static void
test_file_reopen(void)
{
- hid_t fid = -1; /* file ID from initial open */
- hid_t rfid = -1; /* file ID from reopen */
- hid_t did = -1; /* dataset ID (both opens) */
- hid_t sid = -1; /* dataspace ID for dataset creation */
- hsize_t dims = 6; /* dataspace size */
- herr_t ret; /* Generic return value */
+ hid_t fid = -1; /* file ID from initial open */
+ hid_t rfid = -1; /* file ID from reopen */
+ hid_t did = -1; /* dataset ID (both opens) */
+ hid_t sid = -1; /* dataspace ID for dataset creation */
+ hsize_t dims = 6; /* dataspace size */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing File Re-opening\n"));
@@ -554,7 +543,7 @@ test_file_reopen(void)
CHECK(ret, FAIL, "H5Fclose");
HDremove(REOPEN_FILE);
-} /* test_file_reopen() */
+} /* test_file_reopen() */
/****************************************************************
**
@@ -565,11 +554,11 @@ test_file_reopen(void)
static void
test_file_close(void)
{
- hid_t fid1, fid2;
- hid_t fapl_id, access_id;
- hid_t dataset_id, group_id1, group_id2, group_id3;
- H5F_close_degree_t fc_degree;
- herr_t ret;
+ hid_t fid1, fid2;
+ hid_t fapl_id, access_id;
+ hid_t dataset_id, group_id1, group_id2, group_id3;
+ H5F_close_degree_t fc_degree;
+ herr_t ret;
/* Test behavior while opening file multiple times with different
* file close degree value
@@ -605,7 +594,6 @@ test_file_close(void)
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
-
/* Test behavior while opening file multiple times with different file
* close degree
*/
@@ -630,7 +618,6 @@ test_file_close(void)
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
-
/* Test behavior while opening file multiple times with file close
* degree STRONG */
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_STRONG);
@@ -664,7 +651,6 @@ test_file_close(void)
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
-
/* Test behavior while opening file multiple times with file close
* degree SEMI */
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_SEMI);
@@ -729,7 +715,6 @@ test_file_close(void)
ret = H5Fclose(fid2);
CHECK(ret, FAIL, "H5Fclose");
-
/* Test behavior while opening file multiple times with file close
* degree WEAK */
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_WEAK);
@@ -756,8 +741,7 @@ test_file_close(void)
create_objects(fid1, fid2, &dataset_id, &group_id1, &group_id2, &group_id3);
/* 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);
+ test_obj_count_and_id(fid1, fid2, dataset_id, group_id1, group_id2, group_id3);
/* Close first open */
ret = H5Fclose(fid1);
@@ -780,7 +764,6 @@ test_file_close(void)
ret = H5Gclose(group_id3);
CHECK(ret, FAIL, "H5Gclose");
-
/* Test behavior while opening file multiple times with file close
* degree DEFAULT */
ret = H5Pset_fclose_degree(fapl_id, H5F_CLOSE_DEFAULT);
@@ -809,26 +792,26 @@ test_file_close(void)
access_id = H5Fget_access_plist(fid1);
CHECK(access_id, FAIL, "H5Fget_access_plist");
- ret= H5Pget_fclose_degree(access_id, &fc_degree);
+ ret = H5Pget_fclose_degree(access_id, &fc_degree);
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:
+ switch (fc_degree) {
+ 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);
@@ -836,8 +819,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");
@@ -852,7 +835,8 @@ 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");
break;
@@ -872,83 +856,83 @@ 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)
+create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1, 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
* is changed, remember to check this part and update the macros.
*/
{
- oid_count = H5Fget_obj_count(fid1, H5F_OBJ_ALL);
- CHECK(oid_count, FAIL, "H5Fget_obj_count");
- VERIFY(oid_count, OBJ_ID_COUNT_2, "H5Fget_obj_count");
+ oid_count = H5Fget_obj_count(fid1, H5F_OBJ_ALL);
+ CHECK(oid_count, FAIL, "H5Fget_obj_count");
+ VERIFY(oid_count, OBJ_ID_COUNT_2, "H5Fget_obj_count");
- oid_count = H5Fget_obj_count(fid1, H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR);
- CHECK(oid_count, FAIL, "H5Fget_obj_count");
- VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count");
+ oid_count = H5Fget_obj_count(fid1, H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_DATATYPE | H5F_OBJ_ATTR);
+ CHECK(oid_count, FAIL, "H5Fget_obj_count");
+ VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count");
- oid_count = H5Fget_obj_count(fid2, H5F_OBJ_ALL);
- CHECK(oid_count, FAIL, "H5Fget_obj_count");
- VERIFY(oid_count, OBJ_ID_COUNT_2, "H5Fget_obj_count");
+ oid_count = H5Fget_obj_count(fid2, H5F_OBJ_ALL);
+ CHECK(oid_count, FAIL, "H5Fget_obj_count");
+ VERIFY(oid_count, OBJ_ID_COUNT_2, "H5Fget_obj_count");
- oid_count = H5Fget_obj_count(fid2, H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR);
- CHECK(oid_count, FAIL, "H5Fget_obj_count");
- VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count");
+ oid_count = H5Fget_obj_count(fid2, H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_DATATYPE | H5F_OBJ_ATTR);
+ CHECK(oid_count, FAIL, "H5Fget_obj_count");
+ VERIFY(oid_count, OBJ_ID_COUNT_0, "H5Fget_obj_count");
}
/* create a dataset in the first file open */
{
- hid_t dataset_id, dataspace_id; /* identifiers */
- hsize_t dims[F2_RANK];
- unsigned data[F2_DIM0][F2_DIM1];
- unsigned i,j;
-
- /* Create the data space for the dataset. */
- dims[0] = F2_DIM0;
- dims[1] = F2_DIM1;
- dataspace_id = H5Screate_simple(F2_RANK, dims, NULL);
- CHECK(dataspace_id, FAIL, "H5Screate_simple");
-
- /* Create the dataset. */
- dataset_id = H5Dcreate2(fid1, "/dset", H5T_NATIVE_UINT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dataset_id, FAIL, "H5Dcreate2");
-
- for(i = 0; i < F2_DIM0; i++)
- for(j = 0; j < F2_DIM1; j++)
- data[i][j] = i * 10 + j;
-
- /* Write data to the new dataset */
- ret = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
- CHECK(ret, FAIL, "H5Dwrite");
-
- if(ret_did != NULL)
- *ret_did = dataset_id;
-
- /* Terminate access to the data space. */
- ret = H5Sclose(dataspace_id);
- CHECK(ret, FAIL, "H5Sclose");
+ hid_t dataset_id, dataspace_id; /* identifiers */
+ hsize_t dims[F2_RANK];
+ unsigned data[F2_DIM0][F2_DIM1];
+ unsigned i, j;
+
+ /* Create the data space for the dataset. */
+ dims[0] = F2_DIM0;
+ dims[1] = F2_DIM1;
+ dataspace_id = H5Screate_simple(F2_RANK, dims, NULL);
+ CHECK(dataspace_id, FAIL, "H5Screate_simple");
+
+ /* Create the dataset. */
+ dataset_id =
+ H5Dcreate2(fid1, "/dset", H5T_NATIVE_UINT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset_id, FAIL, "H5Dcreate2");
+
+ for (i = 0; i < F2_DIM0; i++)
+ for (j = 0; j < F2_DIM1; j++)
+ data[i][j] = i * 10 + j;
+
+ /* Write data to the new dataset */
+ ret = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ if (ret_did != NULL)
+ *ret_did = dataset_id;
+
+ /* Terminate access to the data space. */
+ ret = H5Sclose(dataspace_id);
+ CHECK(ret, FAIL, "H5Sclose");
}
/* Create a group in the second file open */
{
- hid_t gid1, gid2, gid3;
+ hid_t gid1, gid2, gid3;
gid1 = H5Gcreate2(fid2, "/group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(gid1, FAIL, "H5Gcreate2");
- if(ret_gid1 != NULL)
+ if (ret_gid1 != NULL)
*ret_gid1 = gid1;
gid2 = H5Gopen2(fid2, "/group", H5P_DEFAULT);
CHECK(gid2, FAIL, "H5Gopen2");
- if(ret_gid2 != NULL)
+ if (ret_gid2 != NULL)
*ret_gid2 = gid2;
gid3 = H5Gopen2(fid2, "/group", H5P_DEFAULT);
CHECK(gid3, FAIL, "H5Gopen2");
- if(ret_gid3 != NULL)
+ if (ret_gid3 != NULL)
*ret_gid3 = gid3;
}
@@ -957,28 +941,28 @@ create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1,
* is changed, remember to check this part and update the macros.
*/
{
- oid_count = H5Fget_obj_count(fid1, H5F_OBJ_ALL);
- CHECK(oid_count, FAIL, "H5Fget_obj_count");
- VERIFY(oid_count, OBJ_ID_COUNT_6, "H5Fget_obj_count");
+ oid_count = H5Fget_obj_count(fid1, H5F_OBJ_ALL);
+ CHECK(oid_count, FAIL, "H5Fget_obj_count");
+ VERIFY(oid_count, OBJ_ID_COUNT_6, "H5Fget_obj_count");
- oid_count = H5Fget_obj_count(fid1, H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR);
- CHECK(oid_count, FAIL, "H5Fget_obj_count");
- VERIFY(oid_count, OBJ_ID_COUNT_4, "H5Fget_obj_count");
+ oid_count = H5Fget_obj_count(fid1, H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_DATATYPE | H5F_OBJ_ATTR);
+ CHECK(oid_count, FAIL, "H5Fget_obj_count");
+ VERIFY(oid_count, OBJ_ID_COUNT_4, "H5Fget_obj_count");
- oid_count = H5Fget_obj_count(fid2, H5F_OBJ_ALL);
- CHECK(oid_count, FAIL, "H5Fget_obj_count");
- VERIFY(oid_count, OBJ_ID_COUNT_6, "H5Fget_obj_count");
+ oid_count = H5Fget_obj_count(fid2, H5F_OBJ_ALL);
+ CHECK(oid_count, FAIL, "H5Fget_obj_count");
+ VERIFY(oid_count, OBJ_ID_COUNT_6, "H5Fget_obj_count");
- oid_count = H5Fget_obj_count(fid2, H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR);
- CHECK(oid_count, FAIL, "H5Fget_obj_count");
- VERIFY(oid_count, OBJ_ID_COUNT_4, "H5Fget_obj_count");
+ oid_count = H5Fget_obj_count(fid2, H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_DATATYPE | H5F_OBJ_ATTR);
+ CHECK(oid_count, FAIL, "H5Fget_obj_count");
+ VERIFY(oid_count, OBJ_ID_COUNT_4, "H5Fget_obj_count");
}
}
/****************************************************************
**
** 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().
**
@@ -986,35 +970,35 @@ create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1,
static void
test_get_obj_ids(void)
{
- hid_t fid, gid[NGROUPS], dset[NDSETS];
- hid_t filespace;
- hsize_t file_dims[F2_RANK] = {F2_DIM0, F2_DIM1};
- ssize_t oid_count, ret_count;
- hid_t *oid_list = NULL;
- herr_t ret;
- int i, m, n;
+ hid_t fid, gid[NGROUPS], dset[NDSETS];
+ hid_t filespace;
+ hsize_t file_dims[F2_RANK] = {F2_DIM0, F2_DIM1};
+ ssize_t oid_count, ret_count;
+ hid_t * oid_list = NULL;
+ herr_t ret;
+ int i, m, n;
ssize_t oid_list_size = NDSETS;
- char gname[64], dname[64];
+ char gname[64], dname[64];
/* Create a new file */
fid = H5Fcreate(FILE6, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fcreate");
- filespace = H5Screate_simple(F2_RANK, file_dims, NULL);
+ filespace = H5Screate_simple(F2_RANK, file_dims, NULL);
CHECK(filespace, FAIL, "H5Screate_simple");
/* creates NGROUPS groups under the root group */
- for(m = 0; m < NGROUPS; m++) {
- sprintf(gname, "group%d", m);
+ for (m = 0; m < NGROUPS; m++) {
+ HDsprintf(gname, "group%d", m);
gid[m] = H5Gcreate2(fid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(gid[m], FAIL, "H5Gcreate2");
}
/* create NDSETS datasets under the root group */
- for(n = 0; n < NDSETS; n++) {
- sprintf(dname, "dataset%d", n);
- dset[n] = H5Dcreate2(fid, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(dset[n], FAIL, "H5Dcreate2");
+ for (n = 0; n < NDSETS; n++) {
+ HDsprintf(dname, "dataset%d", n);
+ dset[n] = H5Dcreate2(fid, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset[n], FAIL, "H5Dcreate2");
}
/* The number of opened objects should be NGROUPS + NDSETS + 1. One is opened file. */
@@ -1025,17 +1009,17 @@ test_get_obj_ids(void)
oid_list = (hid_t *)HDcalloc((size_t)oid_list_size, sizeof(hid_t));
CHECK(oid_list, NULL, "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]) {
+ for (i = 0; i < ret_count; i++) {
+ if (fid != oid_list[i]) {
ret = H5Oclose(oid_list[i]);
CHECK(ret, FAIL, "H5Oclose");
}
@@ -1047,34 +1031,34 @@ 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");
/* Close all object IDs on the list except the file ID. The first ID is still the file ID */
- for(i = 0; i< ret_count; i++) {
- if(fid != oid_list[i]) {
+ for (i = 0; i < ret_count; i++) {
+ if (fid != oid_list[i]) {
ret = H5Oclose(oid_list[i]);
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(FILE6, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fopen");
/* Open NDSETS datasets under the root group */
- for(n = 0; n < NDSETS; n++) {
- sprintf(dname, "dataset%d", n);
- dset[n] = H5Dopen2(fid, dname, H5P_DEFAULT);
- CHECK(dset[n], FAIL, "H5Dcreate2");
+ for (n = 0; n < NDSETS; n++) {
+ HDsprintf(dname, "dataset%d", n);
+ dset[n] = H5Dopen2(fid, dname, H5P_DEFAULT);
+ CHECK(dset[n], FAIL, "H5Dcreate2");
}
/* Close the file first */
@@ -1094,8 +1078,8 @@ test_get_obj_ids(void)
VERIFY(ret_count, NDSETS, "H5Fget_obj_count");
/* Close all open objects with H5Oclose */
- for(n = 0; n < oid_count; n++)
- H5Oclose(oid_list[n]);
+ for (n = 0; n < oid_count; n++)
+ H5Oclose(oid_list[n]);
HDfree(oid_list);
}
@@ -1108,12 +1092,12 @@ test_get_obj_ids(void)
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 plist;
- hsize_t dims[F2_RANK];
- unsigned intent;
- herr_t ret;
+ hid_t fid, fid2, fid3;
+ hid_t datatype_id, dataset_id, dataspace_id, group_id, attr_id;
+ hid_t plist;
+ hsize_t dims[F2_RANK];
+ unsigned intent;
+ herr_t ret;
/* Create a file */
fid = H5Fcreate(FILE4, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -1169,12 +1153,13 @@ test_get_file_id(void)
/* Create a dataset in the group. Make a duplicated file ID from the
* dataset. And close this duplicated ID.
*/
- dims[0] = F2_DIM0;
- dims[1] = F2_DIM1;
+ dims[0] = F2_DIM0;
+ dims[1] = F2_DIM1;
dataspace_id = H5Screate_simple(F2_RANK, dims, NULL);
CHECK(dataspace_id, FAIL, "H5Screate_simple");
- dataset_id = H5Dcreate2(group_id, DSET_NAME, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ dataset_id =
+ H5Dcreate2(group_id, DSET_NAME, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(dataset_id, FAIL, "H5Dcreate2");
/* Test H5Iget_file_id() */
@@ -1207,9 +1192,8 @@ test_get_file_id(void)
plist = H5Pcreate(H5P_FILE_ACCESS);
CHECK(plist, FAIL, "H5Pcreate");
- H5E_BEGIN_TRY {
- fid2 = H5Iget_file_id(plist);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { fid2 = H5Iget_file_id(plist); }
+ H5E_END_TRY;
VERIFY(fid2, FAIL, "H5Iget_file_id");
/* Close objects */
@@ -1243,15 +1227,15 @@ test_get_file_id(void)
static void
check_file_id(hid_t fid, hid_t object_id)
{
- hid_t new_fid;
- herr_t ret;
+ hid_t new_fid;
+ herr_t ret;
/* Return a duplicated file ID even not expecting user to do it.
* And close this duplicated ID
*/
new_fid = H5Iget_file_id(object_id);
- if(fid >=0)
+ if (fid >= 0)
VERIFY(new_fid, fid, "H5Iget_file_id");
else
CHECK(new_fid, FAIL, "H5Iget_file_id");
@@ -1266,12 +1250,11 @@ 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)
+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 fid3, fid4;
- ssize_t oid_count, ret_count;
- herr_t ret;
+ hid_t fid3, fid4;
+ ssize_t oid_count, ret_count;
+ herr_t ret;
/* Create two new files */
fid3 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -1308,31 +1291,30 @@ 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) {
+
+ if (oid_count > 0) {
hid_t *oid_list;
oid_list = (hid_t *)HDcalloc((size_t)oid_count, sizeof(hid_t));
- if(oid_list != NULL) {
- int i;
+ 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++) {
+ for (i = 0; i < oid_count; i++) {
H5I_type_t id_type;
id_type = H5Iget_type(oid_list[i]);
- switch(id_type) {
+ switch (id_type) {
case H5I_FILE:
- if(oid_list[i] != fid1 && oid_list[i] != fid2
- && oid_list[i] != fid3 && oid_list[i] != fid4)
+ if (oid_list[i] != fid1 && oid_list[i] != fid2 && oid_list[i] != fid3 &&
+ oid_list[i] != fid4)
ERROR("H5Fget_obj_ids");
break;
case H5I_GROUP:
- if(oid_list[i] != gid1 && oid_list[i] != gid2
- && oid_list[i] != gid3)
+ if (oid_list[i] != gid1 && oid_list[i] != gid2 && oid_list[i] != gid3)
ERROR("H5Fget_obj_ids");
break;
@@ -1343,11 +1325,11 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1,
default:
ERROR("H5Fget_obj_ids");
} /* end switch */
- } /* end for */
+ } /* end for */
HDfree(oid_list);
} /* end if */
- } /* end if */
+ } /* end if */
/* close the two new files */
ret = H5Fclose(fid3);
@@ -1367,11 +1349,11 @@ test_obj_count_and_id(hid_t fid1, hid_t fid2, hid_t did, hid_t gid1,
static void
test_file_perm(void)
{
- hid_t file; /* File opened with read-write permission */
- hid_t filero; /* Same file opened with read-only permission */
- hid_t dspace; /* Dataspace ID */
- hid_t dset; /* Dataset ID */
- herr_t ret;
+ hid_t file; /* File opened with read-write permission */
+ hid_t filero; /* Same file opened with read-only permission */
+ hid_t dspace; /* Dataspace ID */
+ hid_t dset; /* Dataset ID */
+ herr_t ret;
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File Permissions\n"));
@@ -1395,11 +1377,13 @@ test_file_perm(void)
CHECK(filero, FAIL, "H5Fopen");
/* Create a dataset with the read-only file handle (should fail) */
- H5E_BEGIN_TRY {
+ H5E_BEGIN_TRY
+ {
dset = H5Dcreate2(filero, F2_DSET, H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- } H5E_END_TRY;
+ }
+ H5E_END_TRY;
VERIFY(dset, FAIL, "H5Dcreate2");
- if(dset!=FAIL) {
+ if (dset != FAIL) {
ret = H5Dclose(dset);
CHECK(ret, FAIL, "H5Dclose");
} /* end if */
@@ -1418,21 +1402,21 @@ 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 */
- hid_t filero; /* Same file opened with read-only permission */
- hid_t dspace; /* Dataspace ID */
- hid_t group; /* Group ID */
- hid_t dset; /* Dataset ID */
- hid_t type; /* Datatype ID */
- hid_t attr; /* Attribute ID */
- herr_t ret;
+ hid_t file; /* File opened with read-write permission */
+ hid_t filero; /* Same file opened with read-only permission */
+ hid_t dspace; /* Dataspace ID */
+ hid_t group; /* Group ID */
+ hid_t dset; /* Dataset ID */
+ hid_t type; /* Datatype ID */
+ hid_t attr; /* Attribute ID */
+ herr_t ret;
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File Permissions again\n"));
@@ -1452,30 +1436,29 @@ test_file_perm2(void)
CHECK(filero, FAIL, "H5Fopen");
/* Create a group with the read-only file handle (should fail) */
- H5E_BEGIN_TRY {
- group = H5Gcreate2(filero, "MY_GROUP", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { group = H5Gcreate2(filero, "MY_GROUP", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_END_TRY;
VERIFY(group, FAIL, "H5Gcreate2");
/* Create a dataset with the read-only file handle (should fail) */
- H5E_BEGIN_TRY {
+ H5E_BEGIN_TRY
+ {
dset = H5Dcreate2(filero, F2_DSET, H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- } H5E_END_TRY;
+ }
+ H5E_END_TRY;
VERIFY(dset, FAIL, "H5Dcreate2");
/* Create an attribute with the read-only file handle (should fail) */
- H5E_BEGIN_TRY {
- attr = H5Acreate2(filero, "MY_ATTR", H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { attr = H5Acreate2(filero, "MY_ATTR", H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_END_TRY;
VERIFY(attr, FAIL, "H5Acreate2");
type = H5Tcopy(H5T_NATIVE_SHORT);
CHECK(type, FAIL, "H5Tcopy");
/* Commit a datatype with the read-only file handle (should fail) */
- H5E_BEGIN_TRY {
- ret = H5Tcommit2(filero, "MY_DTYPE", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { ret = H5Tcommit2(filero, "MY_DTYPE", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_END_TRY;
VERIFY(ret, FAIL, "H5Tcommit2");
ret = H5Tclose(type);
@@ -1495,25 +1478,25 @@ test_file_perm2(void)
** situations.
**
** 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.)
**
*****************************************************************/
static void
test_file_freespace(void)
{
- hid_t file; /* File opened with read-write permission */
- h5_stat_size_t empty_filesize; /* Size of file when empty */
- h5_stat_size_t mod_filesize; /* Size of file after being modified */
- hssize_t free_space; /* Amount of free space in file */
- hid_t dspace; /* Dataspace ID */
- hid_t dset; /* Dataset ID */
- hid_t dcpl; /* Dataset creation property list */
- int k; /* Local index variable */
- unsigned u; /* Local index variable */
- char name[32]; /* Dataset name */
- herr_t ret;
+ hid_t file; /* File opened with read-write permission */
+ h5_stat_size_t empty_filesize; /* Size of file when empty */
+ h5_stat_size_t mod_filesize; /* Size of file after being modified */
+ hssize_t free_space; /* Amount of free space in file */
+ hid_t dspace; /* Dataspace ID */
+ hid_t dset; /* Dataset ID */
+ hid_t dcpl; /* Dataset creation property list */
+ int k; /* Local index variable */
+ unsigned u; /* Local index variable */
+ char name[32]; /* Dataset name */
+ herr_t ret;
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File Free Space\n"));
@@ -1550,7 +1533,7 @@ test_file_freespace(void)
CHECK(ret, FAIL, "H5Pset_alloc_time");
/* Create datasets in file */
- for(u = 0; u < 10; u++) {
+ for (u = 0; u < 10; u++) {
sprintf(name, "Dataset %u", u);
dset = H5Dcreate2(file, name, H5T_STD_U32LE, dspace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
CHECK(dset, FAIL, "H5Dcreate2");
@@ -1573,7 +1556,7 @@ test_file_freespace(void)
VERIFY(free_space, 2360, "H5Fget_freespace");
/* Delete datasets in file */
- for(k = 9; k >= 0; k--) {
+ for (k = 9; k >= 0; k--) {
sprintf(name, "Dataset %u", (unsigned)k);
ret = H5Ldelete(file, name, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Ldelete");
@@ -1605,14 +1588,14 @@ test_file_freespace(void)
static void
test_file_ishdf5(void)
{
- hid_t file; /* File opened with read-write permission */
- hid_t fcpl; /* File creation property list */
- int fd; /* File Descriptor */
- ssize_t nbytes; /* Number of bytes written */
- unsigned u; /* Local index variable */
- unsigned char buf[1024]; /* Buffer of data to write */
- htri_t status; /* Whether a file is an HDF5 file */
- herr_t ret;
+ hid_t file; /* File opened with read-write permission */
+ hid_t fcpl; /* File creation property list */
+ int fd; /* File Descriptor */
+ ssize_t nbytes; /* Number of bytes written */
+ unsigned u; /* Local index variable */
+ unsigned char buf[1024]; /* Buffer of data to write */
+ htri_t status; /* Whether a file is an HDF5 file */
+ herr_t ret;
/* Output message about test being performed */
MESSAGE(5, ("Testing Detection of HDF5 Files\n"));
@@ -1629,7 +1612,6 @@ test_file_ishdf5(void)
status = H5Fis_hdf5(FILE1);
VERIFY(status, TRUE, "H5Fis_hdf5");
-
/* Create a file creation property list with a non-default user block size */
fcpl = H5Pcreate(H5P_FILE_CREATE);
CHECK(fcpl, FAIL, "H5Pcreate");
@@ -1653,14 +1635,13 @@ test_file_ishdf5(void)
status = H5Fis_hdf5(FILE1);
VERIFY(status, TRUE, "H5Fis_hdf5");
-
/* Create non-HDF5 file and check it */
- fd=HDopen(FILE1, O_RDWR|O_CREAT|O_TRUNC, 0666);
+ fd = HDopen(FILE1, O_RDWR | O_CREAT | O_TRUNC, 0666);
CHECK(fd, FAIL, "HDopen");
/* Initialize information to write */
- for(u=0; u<1024; u++)
- buf[u]=(unsigned char)u;
+ for (u = 0; u < 1024; u++)
+ buf[u] = (unsigned char)u;
/* Write some information */
nbytes = HDwrite(fd, buf, (size_t)1024);
@@ -1686,12 +1667,12 @@ test_file_ishdf5(void)
static void
test_file_open_dot(void)
{
- hid_t fid; /* File ID */
- hid_t gid, gid2; /* Group IDs */
- hid_t did; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t tid, tid2; /* Datatype IDs */
- herr_t ret;
+ hid_t fid; /* File ID */
+ hid_t gid, gid2; /* Group IDs */
+ hid_t did; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t tid, tid2; /* Datatype IDs */
+ herr_t ret;
/* Output message about test being performed */
MESSAGE(5, ("Testing opening objects with \".\" for a name\n"));
@@ -1709,27 +1690,23 @@ test_file_open_dot(void)
CHECK(sid, FAIL, "H5Screate");
/* Create a dataset with no name using the file ID */
- H5E_BEGIN_TRY {
- did = H5Dcreate2(fid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { did = H5Dcreate2(fid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_END_TRY;
VERIFY(did, FAIL, "H5Dcreate2");
/* Create a dataset with no name using the group ID */
- H5E_BEGIN_TRY {
- did = H5Dcreate2(gid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { did = H5Dcreate2(gid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_END_TRY;
VERIFY(did, FAIL, "H5Dcreate2");
/* Open a dataset with no name using the file ID */
- H5E_BEGIN_TRY {
- did = H5Dopen2(fid, ".", H5P_DEFAULT);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { did = H5Dopen2(fid, ".", H5P_DEFAULT); }
+ H5E_END_TRY;
VERIFY(did, FAIL, "H5Dopen2");
/* Open a dataset with no name using the group ID */
- H5E_BEGIN_TRY {
- did = H5Dopen2(gid, ".", H5P_DEFAULT);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { did = H5Dopen2(gid, ".", H5P_DEFAULT); }
+ H5E_END_TRY;
VERIFY(did, FAIL, "H5Dopen2");
/* Make a copy of a datatype to use for creating a named datatype */
@@ -1737,39 +1714,33 @@ test_file_open_dot(void)
CHECK(tid, FAIL, "H5Tcopy");
/* Create a named datatype with no name using the file ID */
- H5E_BEGIN_TRY {
- ret = H5Tcommit2(fid, ".", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { ret = H5Tcommit2(fid, ".", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_END_TRY;
VERIFY(ret, FAIL, "H5Tcommit2");
/* Create a named datatype with no name using the group ID */
- H5E_BEGIN_TRY {
- ret = H5Tcommit2(gid, ".", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { ret = H5Tcommit2(gid, ".", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_END_TRY;
VERIFY(ret, FAIL, "H5Tcommit2");
/* Open a named datatype with no name using the file ID */
- H5E_BEGIN_TRY {
- tid2 = H5Topen2(fid, ".", H5P_DEFAULT);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { tid2 = H5Topen2(fid, ".", H5P_DEFAULT); }
+ H5E_END_TRY;
VERIFY(tid2, FAIL, "H5Topen2");
/* Open a named datatype with no name using the group ID */
- H5E_BEGIN_TRY {
- tid2 = H5Topen2(gid, ".", H5P_DEFAULT);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { tid2 = H5Topen2(gid, ".", H5P_DEFAULT); }
+ H5E_END_TRY;
VERIFY(tid2, FAIL, "H5Topen2");
/* Create a group with no name using the file ID */
- H5E_BEGIN_TRY {
- gid2 = H5Gcreate2(fid, ".", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { gid2 = H5Gcreate2(fid, ".", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_END_TRY;
VERIFY(gid2, FAIL, "H5Gcreate2");
/* Create a group with no name using the group ID */
- H5E_BEGIN_TRY {
- gid2 = H5Gcreate2(gid, ".", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { gid2 = H5Gcreate2(gid, ".", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); }
+ H5E_END_TRY;
VERIFY(gid2, FAIL, "H5Gcreate2");
/* Open a group with no name using the file ID (should open the root group) */
@@ -1786,7 +1757,6 @@ test_file_open_dot(void)
ret = H5Gclose(gid2);
CHECK(ret, FAIL, "H5Gclose");
-
/* Close everything */
ret = H5Sclose(sid);
CHECK(ret, FAIL, "H5Sclose");
@@ -1809,13 +1779,13 @@ test_file_open_dot(void)
static void
test_file_open_overlap(void)
{
- hid_t fid1, fid2;
- hid_t did1, did2;
- hid_t gid;
- hid_t sid;
- int nobjs; /* # of open objects */
+ hid_t fid1, fid2;
+ hid_t did1, did2;
+ hid_t gid;
+ hid_t sid;
+ int nobjs; /* # of open objects */
unsigned intent;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing opening overlapping file opens\n"));
@@ -1846,8 +1816,8 @@ test_file_open_overlap(void)
CHECK(did1, FAIL, "H5Dcreate2");
/* Check number of objects opened in first file */
- nobjs = H5Fget_obj_count(fid1, H5F_OBJ_LOCAL|H5F_OBJ_ALL);
- VERIFY(nobjs, 3, "H5Fget_obj_count"); /* 3 == file, dataset & group */
+ nobjs = H5Fget_obj_count(fid1, H5F_OBJ_LOCAL | H5F_OBJ_ALL);
+ VERIFY(nobjs, 3, "H5Fget_obj_count"); /* 3 == file, dataset & group */
/* Close dataset */
ret = H5Dclose(did1);
@@ -1861,14 +1831,13 @@ test_file_open_overlap(void)
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
-
/* Create dataset with second file ID */
did2 = H5Dcreate2(fid2, DSET2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(did2, FAIL, "H5Dcreate2");
/* Check number of objects opened in first file */
nobjs = H5Fget_obj_count(fid2, H5F_OBJ_ALL);
- VERIFY(nobjs, 2, "H5Fget_obj_count"); /* 3 == file & dataset */
+ VERIFY(nobjs, 2, "H5Fget_obj_count"); /* 3 == file & dataset */
/* Close dataspace */
ret = H5Sclose(sid);
@@ -1907,13 +1876,13 @@ test_file_getname(void)
hsize_t dims[TESTA_RANK] = {TESTA_NX, TESTA_NY};
char name[TESTA_NAME_BUF_SIZE];
ssize_t name_len;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing H5Fget_name() functionality\n"));
/* Create a new file_id using default properties. */
- file_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT );
+ file_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file_id, FAIL, "H5Fcreate");
/* Get and verify file name */
@@ -1936,13 +1905,13 @@ test_file_getname(void)
/* Try get file name from data space. Supposed to fail because
* it's illegal operation. */
- H5E_BEGIN_TRY {
- name_len = H5Fget_name(space_id, name, (size_t)TESTA_NAME_BUF_SIZE);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { name_len = H5Fget_name(space_id, name, (size_t)TESTA_NAME_BUF_SIZE); }
+ H5E_END_TRY;
VERIFY(name_len, FAIL, "H5Fget_name");
/* Create a new dataset */
- dataset_id = H5Dcreate2(file_id, TESTA_DSETNAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ dataset_id =
+ H5Dcreate2(file_id, TESTA_DSETNAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(dataset_id, FAIL, "H5Dcreate2");
/* Get and verify file name */
@@ -1964,10 +1933,10 @@ test_file_getname(void)
CHECK(type_id, FAIL, "H5Tcreate");
/* Insert fields */
- ret = H5Tinsert (type_id, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT);
+ ret = H5Tinsert(type_id, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT);
CHECK(ret, FAIL, "H5Tinsert");
- ret = H5Tinsert (type_id, "b", HOFFSET(s1_t,b), H5T_NATIVE_FLOAT);
+ ret = H5Tinsert(type_id, "b", HOFFSET(s1_t, b), H5T_NATIVE_FLOAT);
CHECK(ret, FAIL, "H5Tinsert");
/* Save it on file */
@@ -2010,21 +1979,21 @@ test_file_getname(void)
static void
test_file_double_root_open(void)
{
- hid_t file1_id, file2_id;
- hid_t grp1_id, grp2_id;
- herr_t ret; /* Generic return value */
+ hid_t file1_id, file2_id;
+ hid_t grp1_id, grp2_id;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing double root group open\n"));
file1_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file1_id, FAIL, "H5Fcreate");
- file2_id = H5Fopen (FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
+ file2_id = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file2_id, FAIL, "H5Fopen");
- grp1_id = H5Gopen2(file1_id, "/", H5P_DEFAULT);
+ grp1_id = H5Gopen2(file1_id, "/", H5P_DEFAULT);
CHECK(grp1_id, FAIL, "H5Gopen2");
- grp2_id = H5Gopen2(file2_id, "/", H5P_DEFAULT);
+ grp2_id = H5Gopen2(file2_id, "/", H5P_DEFAULT);
CHECK(grp2_id, FAIL, "H5Gopen2");
/* Note "assymetric" close order */
@@ -2049,21 +2018,21 @@ test_file_double_root_open(void)
static void
test_file_double_group_open(void)
{
- hid_t file1_id, file2_id;
- hid_t grp1_id, grp2_id;
- herr_t ret; /* Generic return value */
+ hid_t file1_id, file2_id;
+ hid_t grp1_id, grp2_id;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing double non-root group open\n"));
file1_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file1_id, FAIL, "H5Fcreate");
- file2_id = H5Fopen (FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
+ file2_id = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file2_id, FAIL, "H5Fopen");
- grp1_id = H5Gcreate2(file1_id, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ grp1_id = H5Gcreate2(file1_id, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(grp1_id, FAIL, "H5Gcreate2");
- grp2_id = H5Gopen2(file2_id, GRP_NAME, H5P_DEFAULT);
+ grp2_id = H5Gopen2(file2_id, GRP_NAME, H5P_DEFAULT);
CHECK(grp2_id, FAIL, "H5Gopen2");
/* Note "assymetric" close order */
@@ -2088,26 +2057,27 @@ test_file_double_group_open(void)
static void
test_file_double_dataset_open(void)
{
- hid_t file1_id, file2_id;
- hid_t dset1_id, dset2_id;
- hid_t space_id;
- herr_t ret; /* Generic return value */
+ hid_t file1_id, file2_id;
+ hid_t dset1_id, dset2_id;
+ hid_t space_id;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing double dataset open\n"));
file1_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file1_id, FAIL, "H5Fcreate");
- file2_id = H5Fopen (FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
+ file2_id = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file2_id, FAIL, "H5Fopen");
/* Create dataspace for dataset */
space_id = H5Screate(H5S_SCALAR);
CHECK(space_id, FAIL, "H5Screate");
- dset1_id = H5Dcreate2(file1_id, DSET_NAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ dset1_id =
+ H5Dcreate2(file1_id, DSET_NAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(dset1_id, FAIL, "H5Dcreate2");
- dset2_id = H5Dopen2(file2_id, DSET_NAME, H5P_DEFAULT);
+ dset2_id = H5Dopen2(file2_id, DSET_NAME, H5P_DEFAULT);
CHECK(dset2_id, FAIL, "H5Dopen2");
/* Close "supporting" dataspace */
@@ -2130,20 +2100,20 @@ test_file_double_dataset_open(void)
**
** test_open2x_vlen():
** This is the helper routine used by test_open2x_vlen().
-** This is modified based on the customer's test program.
-** (HDFFV-9469):
-** --read from the specified dataset
+** This is modified based on the customer's test program.
+** (HDFFV-9469):
+** --read from the specified dataset
**
*****************************************************************/
-static void
+static void
CheckRead(hid_t did)
{
- hid_t mtid = -1;
- hid_t sid = -1;
- hvl_t *read = NULL;
- herr_t ret;
- int ndims;
- hsize_t dims[1]={1};
+ hid_t mtid = -1;
+ hid_t sid = -1;
+ hvl_t * read = NULL;
+ herr_t ret;
+ int ndims;
+ hsize_t dims[1] = {1};
mtid = H5Tvlen_create(H5T_NATIVE_INT64);
CHECK(mtid, FAIL, "H5Tvlen_create");
@@ -2154,7 +2124,7 @@ CheckRead(hid_t did)
ndims = H5Sget_simple_extent_dims(sid, dims, NULL);
CHECK(ndims, FAIL, "H5Sget_simple_extent_dims");
- read = (hvl_t *) HDmalloc (dims[0] * sizeof (hvl_t));
+ read = (hvl_t *)HDmalloc(dims[0] * sizeof(hvl_t));
CHECK_PTR(read, "HDmalloc");
ret = H5Dread(did, mtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, read);
@@ -2176,32 +2146,32 @@ CheckRead(hid_t did)
**
** test_open2x_vlen():
** This test is modified based on the customer's test program.
-** (HDFFV-9469):
-** --open a file and a dataset with variable length type twice
-** --close both opens of the file
-** --close the dataset from first open
-** --verify that reading from the dataset (second open) is successful
+** (HDFFV-9469):
+** --open a file and a dataset with variable length type twice
+** --close both opens of the file
+** --close the dataset from first open
+** --verify that reading from the dataset (second open) is successful
**
*****************************************************************/
static void
test_open2x_vlen(void)
{
- hid_t fid1 = -1, fid2 = -1;
- hid_t did1 = -1, did2 = -1;
- hid_t sid = -1;
- hid_t ftid = -1;
- hid_t mtid = -1;
- hsize_t dims[1] = { 1 };
- int64_t integers[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
- hvl_t written;
- herr_t ret; /* Generic return value */
+ hid_t fid1 = -1, fid2 = -1;
+ hid_t did1 = -1, did2 = -1;
+ hid_t sid = -1;
+ hid_t ftid = -1;
+ hid_t mtid = -1;
+ hsize_t dims[1] = {1};
+ int64_t integers[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
+ hvl_t written;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing open file and variable length dataset twice and closing 1 dataset\n"));
/* Setting up the test file */
- written.p = integers;
+ written.p = integers;
written.len = 10;
fid1 = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -2239,7 +2209,6 @@ test_open2x_vlen(void)
ret = H5Fclose(fid1);
CHECK(ret, FAIL, "H5Fclose");
-
/* First open of the file */
fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
CHECK(fid1, FAIL, "H5Fopen");
@@ -2292,23 +2261,23 @@ test_open2x_vlen(void)
static void
test_file_double_datatype_open(void)
{
- hid_t file1_id, file2_id;
- hid_t type1_id, type2_id;
- herr_t ret; /* Generic return value */
+ hid_t file1_id, file2_id;
+ hid_t type1_id, type2_id;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing double dataset open\n"));
file1_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(file1_id, FAIL, "H5Fcreate");
- file2_id = H5Fopen (FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
+ file2_id = H5Fopen(FILE1, H5F_ACC_RDONLY, H5P_DEFAULT);
CHECK(file2_id, FAIL, "H5Fopen");
- type1_id = H5Tcopy(H5T_NATIVE_INT);
+ type1_id = H5Tcopy(H5T_NATIVE_INT);
CHECK(type1_id, FAIL, "H5Tcopy");
- ret = H5Tcommit2(file1_id, TYPE_NAME, type1_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ ret = H5Tcommit2(file1_id, TYPE_NAME, type1_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Tcommit2");
- type2_id = H5Topen2(file2_id, TYPE_NAME, H5P_DEFAULT);
+ type2_id = H5Topen2(file2_id, TYPE_NAME, H5P_DEFAULT);
CHECK(type2_id, FAIL, "H5Topen2");
/* Note "assymetric" close order */
@@ -2337,14 +2306,14 @@ test_file_double_datatype_open(void)
static void
test_userblock_file_size(void)
{
- hid_t file1_id, file2_id;
- hid_t group1_id, group2_id;
- hid_t dset1_id, dset2_id;
- hid_t space_id;
- hid_t fcpl2_id;
+ hid_t file1_id, file2_id;
+ hid_t group1_id, group2_id;
+ hid_t dset1_id, dset2_id;
+ hid_t space_id;
+ hid_t fcpl2_id;
hsize_t dims[2] = {3, 4};
hsize_t filesize1, filesize2, filesize;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing file size with user block\n"));
@@ -2410,7 +2379,8 @@ test_userblock_file_size(void)
CHECK(ret, FAIL, "H5Fget_filesize");
/* Verify that the file sizes differ exactly by the userblock size */
- VERIFY_TYPE((unsigned long long)filesize2, (unsigned long long)(filesize1 + USERBLOCK_SIZE), unsigned long long, "%llu", "H5Fget_filesize");
+ VERIFY_TYPE((unsigned long long)filesize2, (unsigned long long)(filesize1 + USERBLOCK_SIZE),
+ unsigned long long, "%llu", "H5Fget_filesize");
/* Close files */
ret = H5Fclose(file1_id);
@@ -2451,9 +2421,9 @@ test_userblock_file_size(void)
static void
test_cached_stab_info(void)
{
- hid_t file_id;
- hid_t group_id;
- herr_t ret; /* Generic return value */
+ hid_t file_id;
+ hid_t group_id;
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing cached symbol table information\n"));
@@ -2500,10 +2470,10 @@ test_cached_stab_info(void)
static void
test_rw_noupdate(void)
{
- int fd; /* File Descriptor */
+ int fd; /* File Descriptor */
h5_stat_t sb1, sb2; /* Info from 'stat' call */
- double diff; /* Difference in modification times */
- herr_t ret; /* Generic return value */
+ double diff; /* Difference in modification times */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing to verify that nothing is written if nothing is changed.\n"));
@@ -2536,12 +2506,15 @@ test_rw_noupdate(void)
diff = HDdifftime(sb2.st_mtime, sb1.st_mtime);
/* Check That Timestamps Are Equal */
- if(diff > 0.0F) {
+ if (diff > 0.0F) {
/* Output message about test being performed */
- MESSAGE(1, ("Testing to verify that nothing is written if nothing is changed: This test is skipped on this system because the modification time from stat is the same as the last access time.\n"));
+ MESSAGE(
+ 1,
+ ("Testing to verify that nothing is written if nothing is changed: This test is skipped on this "
+ "system because the modification time from stat is the same as the last access time.\n"));
} /* end if */
else {
- hid_t file_id; /* HDF5 File ID */
+ hid_t file_id; /* HDF5 File ID */
/* Create and Close a HDF5 File */
file_id = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -2569,7 +2542,7 @@ test_rw_noupdate(void)
/* Ensure That Timestamps Are Equal */
diff = HDdifftime(sb2.st_mtime, sb1.st_mtime);
- ret = (diff > 0.0F);
+ ret = (diff > 0.0F);
VERIFY(ret, 0, "Timestamp");
} /* end else */
} /* end test_rw_noupdate() */
@@ -2587,20 +2560,20 @@ test_rw_noupdate(void)
static int
test_userblock_alignment_helper1(hid_t fcpl, hid_t fapl)
{
- hid_t fid; /* File ID */
- int curr_num_errs = GetTestNumErrs(); /* Retrieve the current # of errors */
- herr_t ret; /* Generic return value */
+ hid_t fid; /* File ID */
+ int curr_num_errs = GetTestNumErrs(); /* Retrieve the current # of errors */
+ herr_t ret; /* Generic return value */
/* Create a file with FAPL & FCPL */
fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl);
CHECK(fid, FAIL, "H5Fcreate");
/* Only proceed further if file ID is OK */
- if(fid > 0) {
- hid_t gid; /* Group ID */
- hid_t sid; /* Dataspace ID */
- hid_t did; /* Dataset ID */
- int val = 2; /* Dataset value */
+ if (fid > 0) {
+ hid_t gid; /* Group ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t did; /* Dataset ID */
+ int val = 2; /* Dataset value */
/* Create a group */
gid = H5Gcreate2(fid, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -2633,7 +2606,7 @@ test_userblock_alignment_helper1(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
} /* end if */
- return((GetTestNumErrs() == curr_num_errs) ? 0 : -1);
+ return ((GetTestNumErrs() == curr_num_errs) ? 0 : -1);
} /* end test_userblock_alignment_helper1() */
/****************************************************************
@@ -2649,19 +2622,19 @@ test_userblock_alignment_helper1(hid_t fcpl, hid_t fapl)
static int
test_userblock_alignment_helper2(hid_t fapl, hbool_t open_rw)
{
- hid_t fid; /* File ID */
- int curr_num_errs = GetTestNumErrs(); /* Retrieve the current # of errors */
- herr_t ret; /* Generic return value */
+ hid_t fid; /* File ID */
+ int curr_num_errs = GetTestNumErrs(); /* Retrieve the current # of errors */
+ herr_t ret; /* Generic return value */
/* Re-open file */
fid = H5Fopen(FILE1, (open_rw ? H5F_ACC_RDWR : H5F_ACC_RDONLY), fapl);
CHECK(fid, FAIL, "H5Fopen");
/* Only proceed further if file ID is OK */
- if(fid > 0) {
+ if (fid > 0) {
hid_t gid; /* Group ID */
hid_t did; /* Dataset ID */
- int val = -1; /* Dataset value */
+ int val = -1; /* Dataset value */
/* Open group */
gid = H5Gopen2(fid, "group1", H5P_DEFAULT);
@@ -2681,8 +2654,8 @@ test_userblock_alignment_helper2(hid_t fapl, hbool_t open_rw)
CHECK(ret, FAIL, "H5Dclose");
/* Only create new objects if file is open R/W */
- if(open_rw) {
- hid_t gid2; /* Group ID */
+ if (open_rw) {
+ hid_t gid2; /* Group ID */
/* Create a new group */
gid2 = H5Gcreate2(gid, "group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -2702,7 +2675,7 @@ test_userblock_alignment_helper2(hid_t fapl, hbool_t open_rw)
CHECK(ret, FAIL, "H5Fclose");
} /* end if */
- return((GetTestNumErrs() == curr_num_errs) ? 0 : -1);
+ return ((GetTestNumErrs() == curr_num_errs) ? 0 : -1);
} /* end test_userblock_alignment_helper2() */
/****************************************************************
@@ -2719,10 +2692,10 @@ test_userblock_alignment_helper2(hid_t fapl, hbool_t open_rw)
static void
test_userblock_alignment(void)
{
- hid_t fid; /* File ID */
- hid_t fcpl; /* File creation property list ID */
- hid_t fapl; /* File access property list ID */
- herr_t ret; /* Generic return value */
+ hid_t fid; /* File ID */
+ hid_t fcpl; /* File creation property list ID */
+ hid_t fapl; /* File access property list ID */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing that non-zero userblocks and object alignment interact correctly.\n"));
@@ -2756,7 +2729,6 @@ test_userblock_alignment(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
-
/* Case 2:
* Userblock size = 512, alignment = 16
* (userblock is integral mult. of alignment)
@@ -2787,7 +2759,6 @@ test_userblock_alignment(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
-
/* Case 3:
* Userblock size = 512, alignment = 512
* (userblock is equal to alignment)
@@ -2818,7 +2789,6 @@ test_userblock_alignment(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
-
/* Case 4:
* Userblock size = 512, alignment = 3
* (userblock & alignment each individually valid, but userblock is
@@ -2839,9 +2809,8 @@ test_userblock_alignment(void)
CHECK(ret, FAIL, "H5Pset_alignment");
/* Create a file with FAPL & FCPL */
- H5E_BEGIN_TRY {
- fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl); }
+ H5E_END_TRY;
VERIFY(fid, FAIL, "H5Fcreate");
/* Release property lists */
@@ -2850,7 +2819,6 @@ test_userblock_alignment(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
-
/* Case 5:
* Userblock size = 512, alignment = 1024
* (userblock & alignment each individually valid, but userblock is
@@ -2871,9 +2839,8 @@ test_userblock_alignment(void)
CHECK(ret, FAIL, "H5Pset_alignment");
/* Create a file with FAPL & FCPL */
- H5E_BEGIN_TRY {
- fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, fcpl, fapl); }
+ H5E_END_TRY;
VERIFY(fid, FAIL, "H5Fcreate");
/* Release property lists */
@@ -2882,7 +2849,6 @@ test_userblock_alignment(void)
ret = H5Pclose(fapl);
CHECK(ret, FAIL, "H5Pclose");
-
/* Case 6:
* File created with:
* Userblock size = 512, alignment = 512
@@ -2933,13 +2899,13 @@ test_userblock_alignment(void)
**
****************************************************************/
static void
-test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create,
- H5F_libver_t libver_mod, unsigned oh_vers_mod)
+test_libver_bounds_real(H5F_libver_t libver_create, unsigned oh_vers_create, H5F_libver_t libver_mod,
+ unsigned oh_vers_mod)
{
- hid_t file, group; /* Handles */
- hid_t fapl; /* File access property list */
- H5O_info_t oinfo; /* Object info */
- herr_t ret; /* Return value */
+ hid_t file, group; /* Handles */
+ hid_t fapl; /* File access property list */
+ H5O_info_t oinfo; /* Object info */
+ herr_t ret; /* Return value */
/*
* Create a new file using the creation properties.
@@ -3039,64 +3005,64 @@ test_libver_bounds(void)
/****************************************************************
**
** 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
test_libver_macros(void)
{
- unsigned major = H5_VERS_MAJOR;
- unsigned minor = H5_VERS_MINOR;
- unsigned release = H5_VERS_RELEASE;
+ unsigned major = H5_VERS_MAJOR;
+ unsigned minor = H5_VERS_MINOR;
+ unsigned release = H5_VERS_RELEASE;
/* Output message about test being performed */
MESSAGE(5, ("Testing macros for library version comparison\n"));
- VERIFY(H5_VERSION_GE(major,minor,release), TRUE, "H5_VERSION_GE");
- VERIFY(H5_VERSION_GE(major-1,minor,release), TRUE, "H5_VERSION_GE");
- VERIFY(H5_VERSION_GE(major-1,minor+1,release), TRUE, "H5_VERSION_GE");
- VERIFY(H5_VERSION_GE(major-1,minor,release+1), TRUE, "H5_VERSION_GE");
- VERIFY(H5_VERSION_GE(major,minor-1,release), TRUE, "H5_VERSION_GE");
- VERIFY(H5_VERSION_GE(major,minor-1,release+1), TRUE, "H5_VERSION_GE");
- VERIFY(H5_VERSION_GE(major,minor,release-1), TRUE, "H5_VERSION_GE");
-
- VERIFY(H5_VERSION_GE(major+1,minor,release), FALSE, "H5_VERSION_GE");
- VERIFY(H5_VERSION_GE(major+1,minor-1,release), FALSE, "H5_VERSION_GE");
- VERIFY(H5_VERSION_GE(major+1,minor-1,release-1), FALSE, "H5_VERSION_GE");
- VERIFY(H5_VERSION_GE(major,minor+1,release), FALSE, "H5_VERSION_GE");
- VERIFY(H5_VERSION_GE(major,minor+1,release-1), FALSE, "H5_VERSION_GE");
- VERIFY(H5_VERSION_GE(major,minor,release+1), FALSE, "H5_VERSION_GE");
-
- VERIFY(H5_VERSION_LE(major,minor,release), TRUE, "H5_VERSION_LE");
- VERIFY(H5_VERSION_LE(major+1,minor,release), TRUE, "H5_VERSION_LE");
- VERIFY(H5_VERSION_LE(major+1,minor-1,release), TRUE, "H5_VERSION_LE");
- VERIFY(H5_VERSION_LE(major+1,minor-1,release-1), TRUE, "H5_VERSION_LE");
- VERIFY(H5_VERSION_LE(major,minor+1,release), TRUE, "H5_VERSION_LE");
- VERIFY(H5_VERSION_LE(major,minor+1,release-1), TRUE, "H5_VERSION_LE");
- VERIFY(H5_VERSION_LE(major,minor,release+1), TRUE, "H5_VERSION_LE");
-
- VERIFY(H5_VERSION_LE(major-1,minor,release), FALSE, "H5_VERSION_LE");
- VERIFY(H5_VERSION_LE(major-1,minor+1,release), FALSE, "H5_VERSION_LE");
- VERIFY(H5_VERSION_LE(major-1,minor+1,release+1), FALSE, "H5_VERSION_LE");
- VERIFY(H5_VERSION_LE(major,minor-1,release), FALSE, "H5_VERSION_LE");
- VERIFY(H5_VERSION_LE(major,minor-1,release+1), FALSE, "H5_VERSION_LE");
- VERIFY(H5_VERSION_LE(major,minor,release-1), FALSE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_GE(major, minor, release), TRUE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major - 1, minor, release), TRUE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major - 1, minor + 1, release), TRUE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major - 1, minor, release + 1), TRUE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major, minor - 1, release), TRUE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major, minor - 1, release + 1), TRUE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major, minor, release - 1), TRUE, "H5_VERSION_GE");
+
+ VERIFY(H5_VERSION_GE(major + 1, minor, release), FALSE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major + 1, minor - 1, release), FALSE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major + 1, minor - 1, release - 1), FALSE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major, minor + 1, release), FALSE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major, minor + 1, release - 1), FALSE, "H5_VERSION_GE");
+ VERIFY(H5_VERSION_GE(major, minor, release + 1), FALSE, "H5_VERSION_GE");
+
+ VERIFY(H5_VERSION_LE(major, minor, release), TRUE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major + 1, minor, release), TRUE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major + 1, minor - 1, release), TRUE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major + 1, minor - 1, release - 1), TRUE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major, minor + 1, release), TRUE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major, minor + 1, release - 1), TRUE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major, minor, release + 1), TRUE, "H5_VERSION_LE");
+
+ VERIFY(H5_VERSION_LE(major - 1, minor, release), FALSE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major - 1, minor + 1, release), FALSE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major - 1, minor + 1, release + 1), FALSE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major, minor - 1, release), FALSE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major, minor - 1, release + 1), FALSE, "H5_VERSION_LE");
+ VERIFY(H5_VERSION_LE(major, minor, release - 1), FALSE, "H5_VERSION_LE");
} /* test_libver_macros() */
/****************************************************************
**
** 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.
**
****************************************************************/
static void
test_libver_macros2(void)
{
- hid_t file;
- hid_t grp;
- htri_t status;
- herr_t ret; /* Return value */
+ hid_t file;
+ hid_t grp;
+ htri_t status;
+ herr_t ret; /* Return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing macros for library version comparison with a file\n"));
@@ -3119,11 +3085,11 @@ 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)
+#if H5_VERSION_GE(1, 8, 0)
ret = H5Ldelete(file, "Group", H5P_DEFAULT);
CHECK(ret, FAIL, "H5Lunlink");
@@ -3133,9 +3099,8 @@ test_libver_macros2(void)
ret = H5Gunlink(file, "Group");
CHECK(ret, FAIL, "H5Gunlink");
- H5E_BEGIN_TRY {
- grp = H5Gopen(file, "Group");
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { grp = H5Gopen(file, "Group"); }
+ H5E_END_TRY;
VERIFY(grp, FAIL, "H5Gopen");
#endif
@@ -3158,42 +3123,42 @@ test_file(void)
/* Output message about test being performed */
MESSAGE(5, ("Testing Low-Level File I/O\n"));
- test_file_create(); /* Test file creation(also creation templates)*/
- test_file_open(); /* Test file opening */
- test_file_reopen(); /* Test file reopening */
- test_file_close(); /* Test file close behavior */
- test_get_file_id(); /* Test H5Iget_file_id */
- test_get_obj_ids(); /* Test H5Fget_obj_ids for Jira Issue 8528 */
- test_file_perm(); /* Test file access permissions */
- test_file_perm2(); /* Test file access permission again */
- test_file_freespace(); /* Test file free space information */
- test_file_ishdf5(); /* Test detecting HDF5 files correctly */
- test_file_open_dot(); /* Test opening objects with "." for a name */
- test_file_open_overlap(); /* Test opening files in an overlapping manner */
- test_file_getname(); /* Test basic H5Fget_name() functionality */
- test_file_double_root_open(); /* Test opening root group from two files works properly */
- test_file_double_group_open(); /* Test opening same group from two files works properly */
- test_file_double_dataset_open(); /* Test opening same dataset from two files works properly */
- test_file_double_datatype_open(); /* Test opening same named datatype from two files works properly */
- test_open2x_vlen(); /* Test opening file and variable length dataset twice and closing 1 dataset */
+ test_file_create(); /* Test file creation(also creation templates)*/
+ test_file_open(); /* Test file opening */
+ test_file_reopen(); /* Test file reopening */
+ test_file_close(); /* Test file close behavior */
+ test_get_file_id(); /* Test H5Iget_file_id */
+ test_get_obj_ids(); /* Test H5Fget_obj_ids for Jira Issue 8528 */
+ test_file_perm(); /* Test file access permissions */
+ test_file_perm2(); /* Test file access permission again */
+ test_file_freespace(); /* Test file free space information */
+ test_file_ishdf5(); /* Test detecting HDF5 files correctly */
+ test_file_open_dot(); /* Test opening objects with "." for a name */
+ test_file_open_overlap(); /* Test opening files in an overlapping manner */
+ test_file_getname(); /* Test basic H5Fget_name() functionality */
+ test_file_double_root_open(); /* Test opening root group from two files works properly */
+ test_file_double_group_open(); /* Test opening same group from two files works properly */
+ test_file_double_dataset_open(); /* Test opening same dataset from two files works properly */
+ test_file_double_datatype_open(); /* Test opening same named datatype from two files works properly */
+ test_open2x_vlen(); /* Test opening file and variable length dataset twice and closing 1 dataset */
test_userblock_file_size(); /* Tests that files created with a userblock have the correct size */
test_cached_stab_info(); /* Tests that files are created with cached stab info in the superblock */
test_rw_noupdate(); /* Test to ensure that RW permissions don't write the file unless dirtied */
- test_userblock_alignment(); /* Tests that files created with a userblock and alignment interact properly */
+ test_userblock_alignment(); /* Tests that files created with a userblock and alignment interact properly
+ */
test_libver_bounds(); /* Test compatibility for file space management */
test_libver_macros(); /* Test the macros for library version comparison */
test_libver_macros2(); /* Show the use of the macros for library version comparison */
} /* 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:
@@ -3209,4 +3174,3 @@ cleanup_file(void)
HDremove(FILE3);
HDremove(FILE4);
}
-