summaryrefslogtreecommitdiffstats
path: root/test/getname.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/getname.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/getname.c')
-rw-r--r--test/getname.c3360
1 files changed, 2070 insertions, 1290 deletions
diff --git a/test/getname.c b/test/getname.c
index 18a8c4d..159ff24 100644
--- a/test/getname.c
+++ b/test/getname.c
@@ -6,7 +6,7 @@
* 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. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -18,39 +18,32 @@
* Purpose: Tests the "ID to name" functionality
*/
-#define H5G_PACKAGE /*suppress error about including H5Gpkg */
-#define H5I_PACKAGE /*suppress error about including H5Ipkg */
+#define H5G_PACKAGE /*suppress error about including H5Gpkg */
+#define H5I_PACKAGE /*suppress error about including H5Ipkg */
/* Define these macros to indicate that the testing APIs should be available */
#define H5G_TESTING
#define H5I_TESTING
#include "h5test.h"
-#include "H5Gpkg.h" /* Groups */
-#include "H5Ipkg.h" /* IDs */
-
+#include "H5Gpkg.h" /* Groups */
+#include "H5Ipkg.h" /* IDs */
/* Compound datatype */
typedef struct s1_t {
unsigned int a;
unsigned int b;
- float c;
+ float c;
} s1_t;
-const char *FILENAME[] = {
- "getname",
- "getname1",
- "getname2",
- "getname3",
- NULL
-};
+const char *FILENAME[] = {"getname", "getname1", "getname2", "getname3", NULL};
-#define NAME_BUF_SIZE 64
-#define SMALL_NAME_BUF_SIZE 2
+#define NAME_BUF_SIZE 64
+#define SMALL_NAME_BUF_SIZE 2
/* Object reference macros */
-#define SPACE1_RANK 1
-#define SPACE1_DIM1 8
+#define SPACE1_RANK 1
+#define SPACE1_DIM1 8
/* Dataset region reference macros */
#define REFREG_DSETNAMEV "MATRIX"
@@ -59,27 +52,32 @@ const char *FILENAME[] = {
static int
check_name(hid_t id, const char *chk_name, const char *chk_user_path)
{
- char name[NAME_BUF_SIZE]; /* Buffer to hold name and its size */
- char user_path[NAME_BUF_SIZE]; /* Buffer to hold user path */
- size_t user_path_len; /* Length of user path */
- unsigned user_path_hidden; /* Whether the user path is hidden */
+ char name[NAME_BUF_SIZE]; /* Buffer to hold name and its size */
+ char user_path[NAME_BUF_SIZE]; /* Buffer to hold user path */
+ size_t user_path_len; /* Length of user path */
+ unsigned user_path_hidden; /* Whether the user path is hidden */
/* Get name */
*name = '\0';
- if(H5Iget_name(id, name, NAME_BUF_SIZE) < 0) TEST_ERROR
+ if (H5Iget_name(id, name, NAME_BUF_SIZE) < 0)
+ TEST_ERROR
/* Get user path */
*user_path = '\0';
- if(H5G__user_path_test(id, user_path, &user_path_len, &user_path_hidden) < 0) TEST_ERROR
+ if (H5G__user_path_test(id, user_path, &user_path_len, &user_path_hidden) < 0)
+ TEST_ERROR
/* Check on name from H5Iget_name() */
- if(HDstrcmp(name, chk_name)) goto error;
+ if (HDstrcmp(name, chk_name))
+ goto error;
/* Check on user path */
- if(HDstrcmp(user_path, chk_user_path)) goto error;
+ if (HDstrcmp(user_path, chk_user_path))
+ goto error;
/* Check that if user path is hidden, the name from H5Iget_name() and the user path should be different */
- if(user_path_hidden && !HDstrcmp(chk_name, chk_user_path)) TEST_ERROR
+ if (user_path_hidden && !HDstrcmp(chk_name, chk_user_path))
+ TEST_ERROR
/* Everything matches */
return 0;
@@ -92,16 +90,16 @@ error:
static int
test_main(hid_t file_id, hid_t fapl)
{
- char filename1[1024];
- char filename2[1024];
- char filename3[1024];
- hid_t file1_id, file2_id, file3_id;
- hid_t group_id, group2_id, group3_id, group4_id, group5_id, group6_id, group7_id;
- hid_t dataset_id, dataset2_id;
- hid_t space_id;
- hid_t type_id, type2_id;
- hsize_t dims[1] = { 5 };
- size_t name_len; /* Name length */
+ char filename1[1024];
+ char filename2[1024];
+ char filename3[1024];
+ hid_t file1_id, file2_id, file3_id;
+ hid_t group_id, group2_id, group3_id, group4_id, group5_id, group6_id, group7_id;
+ hid_t dataset_id, dataset2_id;
+ hid_t space_id;
+ hid_t type_id, type2_id;
+ hsize_t dims[1] = {5};
+ size_t name_len; /* Name length */
H5O_info_t oinfo; /* Object info structs */
hid_t dtype; /* Object identifier for testing */
hid_t dtype_anon; /* Object identifier for testing anonymous */
@@ -113,42 +111,46 @@ test_main(hid_t file_id, hid_t fapl)
h5_fixname(FILENAME[3], fapl, filename3, sizeof filename3);
/*-------------------------------------------------------------------------
- * Test H5Iget_name with one group
- *-------------------------------------------------------------------------
- */
+ * Test H5Iget_name with one group
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with one group");
/* Create group "g0" in the root group using absolute name */
- if((group_id = H5Gcreate2(file_id, "/g0", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g0", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g0", "/g0") < 0) TEST_ERROR
+ if (check_name(group_id, "/g0", "/g0") < 0)
+ TEST_ERROR
/* Close */
H5Gclose(group_id);
PASSED();
-
-
/*-------------------------------------------------------------------------
- * Test H5Iget_name with more than one group
- *-------------------------------------------------------------------------
- */
+ * Test H5Iget_name with more than one group
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with more than one group");
/* Create group "g1" in the root group using absolute name */
- if((group_id = H5Gcreate2(file_id, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create group "g2" in group "g1" using absolute name */
- if((group2_id = H5Gcreate2(file_id, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR
+ if (check_name(group_id, "/g1", "/g1") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g1/g2", "/g1/g2") < 0)
+ TEST_ERROR
/* Close */
H5Gclose(group_id);
@@ -156,106 +158,123 @@ test_main(hid_t file_id, hid_t fapl)
PASSED();
-
/*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Gopen2
- *-------------------------------------------------------------------------
- */
+ * Test H5Iget_name with H5Gopen2
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Gopen2");
/* Reopen the group */
- if((group_id = H5Gopen2(file_id, "/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(file_id, "/g1", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Reopen the group */
- if((group2_id = H5Gopen2(file_id, "/g1/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group2_id = H5Gopen2(file_id, "/g1/g2", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR
+ if (check_name(group_id, "/g1", "/g1") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g1/g2", "/g1/g2") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
-
-
/*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Dcreate2
- *-------------------------------------------------------------------------
- */
+ * Test H5Iget_name with H5Dcreate2
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Dcreate2");
/* Create the dataspace */
- if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR
+ if ((space_id = H5Screate_simple(1, dims, NULL)) < 0)
+ TEST_ERROR
/* Create a new dataset */
- if((dataset_id = H5Dcreate2(file_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if ((dataset_id =
+ H5Dcreate2(file_id, "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(dataset_id, "/d1", "/d1") < 0) TEST_ERROR
+ if (check_name(dataset_id, "/d1", "/d1") < 0)
+ TEST_ERROR
/* Close */
- if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
+ if (H5Dclose(dataset_id) < 0)
+ FAIL_STACK_ERROR
/* Reopen the group */
- if((group_id = H5Gopen2(file_id, "g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(file_id, "g1", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create a new dataset inside "g1" */
- if((dataset_id = H5Dcreate2(group_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((dataset_id =
+ H5Dcreate2(group_id, "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(dataset_id, "/g1/d1", "/g1/d1") < 0) TEST_ERROR
+ if (check_name(dataset_id, "/g1/d1", "/g1/d1") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
- if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Dclose(dataset_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Sclose(space_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
-
/*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Dopen2
- *-------------------------------------------------------------------------
- */
+ * Test H5Iget_name with H5Dopen2
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Dopen2");
/* Reopen the dataset */
- if((dataset_id = H5Dopen2(file_id, "d1", H5P_DEFAULT)) < 0) TEST_ERROR
+ if ((dataset_id = H5Dopen2(file_id, "d1", H5P_DEFAULT)) < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(dataset_id, "/d1", "/d1") < 0) TEST_ERROR
+ if (check_name(dataset_id, "/d1", "/d1") < 0)
+ TEST_ERROR
/* Close */
- if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
-
+ if (H5Dclose(dataset_id) < 0)
+ FAIL_STACK_ERROR
/* Reopen the group */
- if((group_id = H5Gopen2(file_id, "g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(file_id, "g1", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Reopen the dataset */
- if((dataset_id = H5Dopen2(group_id, "d1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((dataset_id = H5Dopen2(group_id, "d1", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(dataset_id, "/g1/d1", "/g1/d1") < 0) TEST_ERROR
+ if (check_name(dataset_id, "/g1/d1", "/g1/d1") < 0)
+ TEST_ERROR
/* Close */
- if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
+ if (H5Dclose(dataset_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
-
/*-------------------------------------------------------------------------
* Test H5Iget_name with a long path
*-------------------------------------------------------------------------
@@ -264,33 +283,46 @@ test_main(hid_t file_id, hid_t fapl)
TESTING("H5Iget_name with a long path");
/* Create group "g2/bar/baz" */
- if((group_id = H5Gcreate2(file_id, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "g2/bar", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file_id, "g2/bar/baz", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "g2/bar", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file_id, "g2/bar/baz", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create a dataset */
- if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR
- if((dataset_id = H5Dcreate2(group3_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if ((space_id = H5Screate_simple(1, dims, NULL)) < 0)
+ TEST_ERROR
+ if ((dataset_id = H5Dcreate2(group3_id, "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT,
+ H5P_DEFAULT)) < 0)
+ TEST_ERROR
/* Close */
- if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
- if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Dclose(dataset_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Sclose(space_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
/* Reopen the dataset */
- if((dataset_id = H5Dopen2(file_id, "/g2/bar/baz/d1", H5P_DEFAULT)) < 0) TEST_ERROR
+ if ((dataset_id = H5Dopen2(file_id, "/g2/bar/baz/d1", H5P_DEFAULT)) < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(dataset_id, "/g2/bar/baz/d1", "/g2/bar/baz/d1") < 0) TEST_ERROR
+ if (check_name(dataset_id, "/g2/bar/baz/d1", "/g2/bar/baz/d1") < 0)
+ TEST_ERROR
/* Close */
- if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
+ if (H5Dclose(dataset_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
/*-------------------------------------------------------------------------
* Test H5Iget_name with H5Tcommit2
*-------------------------------------------------------------------------
@@ -299,18 +331,24 @@ test_main(hid_t file_id, hid_t fapl)
TESTING("H5Iget_name with H5Tcommit2");
/* Create a datatype */
- if((type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) TEST_ERROR
+ if ((type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0)
+ TEST_ERROR
/* Insert fields */
- if(H5Tinsert(type_id, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0) TEST_ERROR
- if(H5Tinsert(type_id, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0) TEST_ERROR
- if(H5Tinsert(type_id, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT) < 0) TEST_ERROR
+ if (H5Tinsert(type_id, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0)
+ TEST_ERROR
+ if (H5Tinsert(type_id, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0)
+ TEST_ERROR
+ if (H5Tinsert(type_id, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT) < 0)
+ TEST_ERROR
/* Save datatype for later */
- if(H5Tcommit2(file_id, "t1", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if (H5Tcommit2(file_id, "t1", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(type_id, "/t1", "/t1") < 0) TEST_ERROR
+ if (check_name(type_id, "/t1", "/t1") < 0)
+ TEST_ERROR
/* Close datatype */
H5Tclose(type_id);
@@ -325,399 +363,503 @@ test_main(hid_t file_id, hid_t fapl)
TESTING("H5Iget_name with H5Topen2");
/* Open the named datatype */
- if((type_id = H5Topen2(file_id, "t1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((type_id = H5Topen2(file_id, "t1", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(type_id, "/t1", "/t1") < 0) TEST_ERROR
+ if (check_name(type_id, "/t1", "/t1") < 0)
+ TEST_ERROR
/* Close datatype */
- if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR
+ if (H5Tclose(type_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Lmove and H5Gopen2
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Lmove and H5Gopen2
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Lmove and H5Gopen2");
/* Reopen the group */
- if((group_id = H5Gopen2(file_id, "/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(file_id, "/g1", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Rename group */
- if(H5Lmove(file_id, "/g1", H5L_SAME_LOC, "/g1a", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(file_id, "/g1", H5L_SAME_LOC, "/g1a", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g1a", "/g1a") < 0) TEST_ERROR
+ if (check_name(group_id, "/g1a", "/g1a") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Lmove and H5Dopen2
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Lmove and H5Dopen2
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Lmove and H5Dopen2");
/* Reopen the dataset */
- if((dataset_id = H5Dopen2(file_id, "/d1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((dataset_id = H5Dopen2(file_id, "/d1", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Rename dataset */
- if(H5Lmove(file_id, "/d1", H5L_SAME_LOC, "/d1a", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(file_id, "/d1", H5L_SAME_LOC, "/d1a", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(dataset_id, "/d1a", "/d1a") < 0) FAIL_STACK_ERROR
+ if (check_name(dataset_id, "/d1a", "/d1a") < 0)
+ FAIL_STACK_ERROR
/* Close */
- if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
+ if (H5Dclose(dataset_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Lmove and H5Topen2
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Lmove and H5Topen2
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Lmove and H5Topen2");
/* Open the named datatype */
- if((type_id = H5Topen2(file_id, "/t1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((type_id = H5Topen2(file_id, "/t1", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Rename datatype */
- if(H5Lmove(file_id, "/t1", H5L_SAME_LOC, "/t1a", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(file_id, "/t1", H5L_SAME_LOC, "/t1a", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(type_id, "/t1a", "/t1a") < 0) FAIL_STACK_ERROR
+ if (check_name(type_id, "/t1a", "/t1a") < 0)
+ FAIL_STACK_ERROR
/* Close datatype */
- if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR
+ if (H5Tclose(type_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
/*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Lmove and relative names
- *-------------------------------------------------------------------------
- */
+ * Test H5Iget_name with H5Lmove and relative names
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Lmove and relative names");
/* Create group "/g3" */
- if((group_id = H5Gcreate2(file_id, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create group "/g3/foo" using absolute name */
- if((group2_id = H5Gcreate2(file_id, "/g3/foo1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "/g3/foo1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Open group "/g3/foo" again */
- if((group3_id = H5Gopen2(file_id, "/g3/foo1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group3_id = H5Gopen2(file_id, "/g3/foo1", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Rename group */
- if(H5Lmove(group_id, "foo1", H5L_SAME_LOC, "foo2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(group_id, "foo1", H5L_SAME_LOC, "foo2", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g3", "/g3") < 0) TEST_ERROR
+ if (check_name(group_id, "/g3", "/g3") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group2_id, "/g3/foo2", "/g3/foo2") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g3/foo2", "/g3/foo2") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group3_id, "/g3/foo2", "/g3/foo2") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g3/foo2", "/g3/foo2") < 0)
+ TEST_ERROR
/* Rename group again */
- if(H5Lmove(file_id, "g3/foo2", H5L_SAME_LOC, "g3/foo1", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(file_id, "g3/foo2", H5L_SAME_LOC, "g3/foo1", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g3", "/g3") < 0) TEST_ERROR
+ if (check_name(group_id, "/g3", "/g3") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group2_id, "/g3/foo1", "/g3/foo1") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g3/foo1", "/g3/foo1") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group3_id, "/g3/foo1", "/g3/foo1") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g3/foo1", "/g3/foo1") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Lmove and a long path
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Lmove and a long path
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Lmove and a long path");
/* Create group "g4/A/B" */
- if((group_id = H5Gcreate2(file_id, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "g4/A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file_id, "g4/A/B", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "g4/A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file_id, "g4/A/B", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create group "g5/C" */
- if((group4_id = H5Gcreate2(file_id, "g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group5_id = H5Gcreate2(file_id, "g5/C", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group4_id = H5Gcreate2(file_id, "g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group5_id = H5Gcreate2(file_id, "g5/C", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "/g4/A/B", "/g4/A/B") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g4/A/B", "/g4/A/B") < 0)
+ TEST_ERROR
/* Move group "B" to "D"*/
- if(H5Lmove(file_id, "/g4/A/B", H5L_SAME_LOC, "/g5/C/D", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(file_id, "/g4/A/B", H5L_SAME_LOC, "/g5/C/D", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "/g5/C/D", "/g5/C/D") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g5/C/D", "/g5/C/D") < 0)
+ TEST_ERROR
/* Move group "/g5/C/D" back to "/g4/A/B" using relative name */
- if(H5Lmove(group5_id, "D", group2_id, "B", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(group5_id, "D", group2_id, "B", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "/g4/A/B", "/g4/A/B") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g4/A/B", "/g4/A/B") < 0)
+ TEST_ERROR
/* Move group "/g4/A/B" to "/g4/F/B" using relative name */
- if(H5Lmove(group_id, "A", group_id, "F", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(group_id, "A", group_id, "F", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "/g4/F/B", "/g4/F/B") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g4/F/B", "/g4/F/B") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group2_id, "/g4/F", "/g4/F") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g4/F", "/g4/F") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group5_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group4_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group5_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Lmove and a long path #2
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Lmove and a long path #2
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Lmove and a long path #2");
/* Create group "g6/A/B" and "g7" */
- if((group_id = H5Gcreate2(file_id, "g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "g6/A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file_id, "g6/A/B", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group4_id = H5Gcreate2(file_id, "g7", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "g6/A", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file_id, "g6/A/B", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group4_id = H5Gcreate2(file_id, "g7", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "/g6/A/B", "/g6/A/B") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g6/A/B", "/g6/A/B") < 0)
+ TEST_ERROR
/* Move group "A" to "C"*/
- if(H5Lmove(file_id, "/g6/A", H5L_SAME_LOC, "/g7/C", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(file_id, "/g6/A", H5L_SAME_LOC, "/g7/C", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g7/C", "/g7/C") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g7/C", "/g7/C") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group3_id, "/g7/C/B", "/g7/C/B") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g7/C/B", "/g7/C/B") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group4_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Ldelete
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Ldelete
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Ldelete");
/* Create a new group. */
- if((group_id = H5Gcreate2(file_id, "/g8", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g8", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Delete */
- if(H5Ldelete(file_id, "/g8", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Ldelete(file_id, "/g8", H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "", "") < 0) TEST_ERROR
+ if (check_name(group_id, "", "") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Ldelete and a long path
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Ldelete and a long path
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Ldelete and a long path");
/* Create group "g9/a/b" */
- if((group_id = H5Gcreate2(file_id, "g9", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "g9/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file_id, "g9/a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "g9", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "g9/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file_id, "g9/a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Delete */
- if(H5Ldelete(file_id, "/g9/a", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Ldelete(file_id, "/g9/a", H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "", "") < 0) TEST_ERROR
+ if (check_name(group2_id, "", "") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group3_id, "", "") < 0) TEST_ERROR
+ if (check_name(group3_id, "", "") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
/* Recreate groups */
- if((group2_id = H5Gcreate2(group_id, "a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(group_id, "a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(group_id, "a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(group_id, "a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Delete, using relative path */
- if(H5Ldelete(group_id, "a", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Ldelete(group_id, "a", H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "", "") < 0) TEST_ERROR
+ if (check_name(group2_id, "", "") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group3_id, "", "") < 0) TEST_ERROR
+ if (check_name(group3_id, "", "") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
/* Create group "g10/a/b" */
- if((group_id = H5Gcreate2(file_id, "g10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "g10/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file_id, "g10/a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "g10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "g10/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file_id, "g10/a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Delete */
- if(H5Ldelete(file_id, "/g10/a/b", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Ldelete(file_id, "/g10/a/b", H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "", "") < 0) TEST_ERROR
+ if (check_name(group3_id, "", "") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
/* Recreate group */
- if((group3_id = H5Gcreate2(group_id, "a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(group_id, "a/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Delete, using relative path */
- if(H5Ldelete(group_id, "a/b", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Ldelete(group_id, "a/b", H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "", "") < 0) TEST_ERROR
+ if (check_name(group3_id, "", "") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Ldelete, same names
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Ldelete, same names
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Ldelete, same names");
/* Create group "g11/g" */
- if((group_id = H5Gcreate2(file_id, "g11", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "g11/g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "g11", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "g11/g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create two datasets "g11/d" and "g11/g/d"*/
- if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR
- if((dataset_id = H5Dcreate2(group_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((dataset2_id = H5Dcreate2(group2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((space_id = H5Screate_simple(1, dims, NULL)) < 0)
+ FAIL_STACK_ERROR
+ if ((dataset_id =
+ H5Dcreate2(group_id, "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((dataset2_id =
+ H5Dcreate2(group2_id, "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Delete */
- if(H5Ldelete(file_id, "/g11/d", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Ldelete(file_id, "/g11/d", H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(dataset_id, "", "") < 0) TEST_ERROR
+ if (check_name(dataset_id, "", "") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(dataset2_id, "/g11/g/d", "/g11/g/d") < 0) TEST_ERROR
+ if (check_name(dataset2_id, "/g11/g/d", "/g11/g/d") < 0)
+ TEST_ERROR
/* Close */
- if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
- if(H5Dclose(dataset2_id) < 0) FAIL_STACK_ERROR
- if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
+ if (H5Dclose(dataset_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Dclose(dataset2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Sclose(space_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Fmount; with IDs on the list
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Fmount; with IDs on the list
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Fmount; with IDs on the list");
/* Create a group "g12" in the first file */
- if((group_id = H5Gcreate2(file_id, "/g12", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g12", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
/* Create second file and dataset "d" in it */
- if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+ if ((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
/* Create a dataspace */
- if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR
+ if ((space_id = H5Screate_simple(1, dims, NULL)) < 0)
+ TEST_ERROR
/* Create the dataset */
- if((dataset_id = H5Dcreate2(file1_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if ((dataset_id =
+ H5Dcreate2(file1_id, "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
/* Close */
- if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
+ if (H5Dclose(dataset_id) < 0)
+ FAIL_STACK_ERROR
/* Mount second file under "g12" in the first file */
- if(H5Fmount(file_id, "/g12", file1_id, H5P_DEFAULT) < 0) TEST_ERROR
+ if (H5Fmount(file_id, "/g12", file1_id, H5P_DEFAULT) < 0)
+ TEST_ERROR
/* Access dataset D in the first file under "/G/D" name */
- if((dataset_id = H5Dopen2(file_id, "/g12/d", H5P_DEFAULT)) < 0) TEST_ERROR
+ if ((dataset_id = H5Dopen2(file_id, "/g12/d", H5P_DEFAULT)) < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(dataset_id, "/g12/d", "/g12/d") < 0) TEST_ERROR
+ if (check_name(dataset_id, "/g12/d", "/g12/d") < 0)
+ TEST_ERROR
- if(H5Funmount(file_id, "/g12") < 0) TEST_ERROR
+ if (H5Funmount(file_id, "/g12") < 0)
+ TEST_ERROR
/* Close */
- if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
- if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
-
+ if (H5Dclose(dataset_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file1_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Sclose(space_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
/*-------------------------------------------------------------------------
* Test H5Iget_name with H5Fmount; long name
*-------------------------------------------------------------------------
@@ -726,199 +868,271 @@ test_main(hid_t file_id, hid_t fapl)
TESTING("H5Iget_name with H5Fmount; long name");
/* Create a group "g13/g1/g2" in the first file */
- if((group_id = H5Gcreate2(file_id, "/g13", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "/g13/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file_id, "/g13/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g13", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "/g13/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file_id, "/g13/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
/* Create second file and group "g" in it */
file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
- if((group_id = H5Gcreate2(file1_id, "/g14", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file1_id, "/g14/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file1_id, "/g14/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file1_id, "/g14", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file1_id, "/g14/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file1_id, "/g14/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
/* Mount second file under "/g13/g1" in the first file */
- if(H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Access group in the first file */
- if((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR
-
- if(H5Funmount(file_id, "/g13/g1") < 0) FAIL_STACK_ERROR
+ if (check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0)
+ TEST_ERROR
+ if (H5Funmount(file_id, "/g13/g1") < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g14/g3/g4", "") < 0) TEST_ERROR
+ if (check_name(group_id, "/g14/g3/g4", "") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
-
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
/* Access group in the file to mount */
- if((group3_id = H5Gopen2(file1_id, "/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group3_id = H5Gopen2(file1_id, "/g14/g3/g4", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Mount second file under "/g13/g1" in the first file(again) */
- if(H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Get a group ID for the parent of the newly mounted group */
- if((group2_id = H5Gopen2(file_id, "/g13", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group2_id = H5Gopen2(file_id, "/g13", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Access group in the first file */
- if((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR
- if(check_name(group3_id, "/g14/g3/g4", "/g14/g3/g4") < 0) TEST_ERROR
+ if (check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0)
+ TEST_ERROR
+ if (check_name(group3_id, "/g14/g3/g4", "/g14/g3/g4") < 0)
+ TEST_ERROR
- if(H5Funmount(group2_id, "g1") < 0) FAIL_STACK_ERROR
+ if (H5Funmount(group2_id, "g1") < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g14/g3/g4", "") < 0) TEST_ERROR
- if(check_name(group3_id, "/g14/g3/g4", "/g14/g3/g4") < 0) TEST_ERROR
+ if (check_name(group_id, "/g14/g3/g4", "") < 0)
+ TEST_ERROR
+ if (check_name(group3_id, "/g14/g3/g4", "/g14/g3/g4") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
/* Mount second file under "/g13/g1" in the first file(again) */
- if(H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Fmount(file_id, "/g13/g1", file1_id, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Get a group ID for the newly mounted group */
- if((group2_id = H5Gopen2(file_id, "/g13/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group2_id = H5Gopen2(file_id, "/g13/g1", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Access group in the first file */
- if((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR
- if(check_name(group2_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR
+ if (check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0)
+ TEST_ERROR
+ if (check_name(group2_id, "/g13/g1", "/g13/g1") < 0)
+ TEST_ERROR
- if(H5Funmount(group2_id, ".") < 0) FAIL_STACK_ERROR
+ if (H5Funmount(group2_id, ".") < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g14/g3/g4", "") < 0) TEST_ERROR
- if(check_name(group2_id, "/", "") < 0) TEST_ERROR
+ if (check_name(group_id, "/g14/g3/g4", "") < 0)
+ TEST_ERROR
+ if (check_name(group2_id, "/", "") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
/* Mount second file under "/g13/g1" in the first file, using relative path */
- if((group3_id = H5Gopen2(file_id, "/g13", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group3_id = H5Gopen2(file_id, "/g13", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "/g13", "/g13") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g13", "/g13") < 0)
+ TEST_ERROR
- if(H5Fmount(group3_id, "g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Fmount(group3_id, "g1", file1_id, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Get a group ID for the newly mounted group */
- if((group2_id = H5Gopen2(file_id, "/g13/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group2_id = H5Gopen2(file_id, "/g13/g1", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g13/g1", "/g13/g1") < 0)
+ TEST_ERROR
/* Access group in the first file */
- if((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR
+ if (check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
/* Access group in the first file, with relative path */
- if((group_id = H5Gopen2(group2_id, "g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(group2_id, "g14/g3/g4", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR
+ if (check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
- if(H5Funmount(group2_id, ".") < 0) FAIL_STACK_ERROR
+ if (H5Funmount(group2_id, ".") < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/", "") < 0) TEST_ERROR
+ if (check_name(group2_id, "/", "") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
/* Mount second file under "/g13/g1" in the first file, using relative path */
- if((group3_id = H5Gopen2(file_id, "/g13/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group3_id = H5Gopen2(file_id, "/g13/g1", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g13/g1", "/g13/g1") < 0)
+ TEST_ERROR
- if(H5Fmount(group3_id, ".", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Fmount(group3_id, ".", file1_id, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Get a group ID for the newly mounted group */
- if((group2_id = H5Gopen2(file_id, "/g13/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group2_id = H5Gopen2(file_id, "/g13/g1", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g13/g1", "/g13/g1") < 0)
+ TEST_ERROR
/* Access group in the first file */
- if((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(file_id, "/g13/g1/g14/g3/g4", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR
+ if (check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
/* Access group in the first file, with relative path */
- if((group_id = H5Gopen2(group2_id, "g14/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(group2_id, "g14/g3/g4", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0) TEST_ERROR
+ if (check_name(group_id, "/g13/g1/g14/g3/g4", "/g13/g1/g14/g3/g4") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
- if(H5Funmount(group2_id, ".") < 0) FAIL_STACK_ERROR
+ if (H5Funmount(group2_id, ".") < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/", "") < 0) TEST_ERROR
- if(check_name(group3_id, "/g13/g1", "/g13/g1") < 0) TEST_ERROR
+ if (check_name(group2_id, "/", "") < 0)
+ TEST_ERROR
+ if (check_name(group3_id, "/g13/g1", "/g13/g1") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
-
- if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file1_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
-/*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Funmount
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Funmount
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Funmount");
/* Create a group "g15/g1/g2" in the first file */
- if((group_id = H5Gcreate2(file_id, "/g15", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "/g15/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file_id, "/g15/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group4_id = H5Gcreate2(file_id, "/g15/g1/g2/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g15", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "/g15/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file_id, "/g15/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group4_id = H5Gcreate2(file_id, "/g15/g1/g2/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
H5Gclose(group_id);
@@ -929,47 +1143,62 @@ test_main(hid_t file_id, hid_t fapl)
/* Create second file and group "g" in it */
file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
- if((group_id = H5Gcreate2(file1_id, "/g16", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file1_id, "/g16/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file1_id, "/g16/g4/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file1_id, "/g16", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file1_id, "/g16/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file1_id, "/g16/g4/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
/* Access group in the first file */
- if((group_id = H5Gopen2(file_id, "/g15/g1/g2/g3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(file_id, "/g15/g1/g2/g3", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Mount second file under "/g13/g1" in the first file */
- if(H5Fmount(file_id, "/g15/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Fmount(file_id, "/g15/g1", file1_id, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Access group in the second file */
- if((group2_id = H5Gopen2(file_id, "/g15/g1/g16/g4/g5", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group2_id = H5Gopen2(file_id, "/g15/g1/g16/g4/g5", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "", "/g15/g1/g2/g3") < 0) TEST_ERROR
+ if (check_name(group_id, "", "/g15/g1/g2/g3") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group2_id, "/g15/g1/g16/g4/g5", "/g15/g1/g16/g4/g5") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g15/g1/g16/g4/g5", "/g15/g1/g16/g4/g5") < 0)
+ TEST_ERROR
- if(H5Funmount(file_id, "/g15/g1") < 0) FAIL_STACK_ERROR
+ if (H5Funmount(file_id, "/g15/g1") < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g15/g1/g2/g3", "/g15/g1/g2/g3") < 0) TEST_ERROR
+ if (check_name(group_id, "/g15/g1/g2/g3", "/g15/g1/g2/g3") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group2_id, "/g16/g4/g5", "") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g16/g4/g5", "") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
-
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file1_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
/*-------------------------------------------------------------------------
* Test H5Iget_name with a defined type dataset
*-------------------------------------------------------------------------
@@ -978,278 +1207,352 @@ test_main(hid_t file_id, hid_t fapl)
TESTING("H5Iget_name with a defined type dataset");
/* Create a datatype */
- if((type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) FAIL_STACK_ERROR
+ if ((type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0)
+ FAIL_STACK_ERROR
/* Insert fields */
- if(H5Tinsert(type_id, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0) FAIL_STACK_ERROR
- if(H5Tinsert(type_id, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0) FAIL_STACK_ERROR
- if(H5Tinsert(type_id, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT) < 0) FAIL_STACK_ERROR
+ if (H5Tinsert(type_id, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0)
+ FAIL_STACK_ERROR
+ if (H5Tinsert(type_id, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0)
+ FAIL_STACK_ERROR
+ if (H5Tinsert(type_id, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT) < 0)
+ FAIL_STACK_ERROR
/* Create group "g17" */
- if((group_id = H5Gcreate2(file_id, "g17", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "g17", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Save datatype for later */
- if(H5Tcommit2(group_id, "t", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Tcommit2(group_id, "t", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Create a dataspace */
- if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR
+ if ((space_id = H5Screate_simple(1, dims, NULL)) < 0)
+ FAIL_STACK_ERROR
/* Create a new dataset */
- if((dataset_id = H5Dcreate2(group_id , "d", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((dataset_id = H5Dcreate2(group_id, "d", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
+ 0)
+ FAIL_STACK_ERROR
/* Close */
- if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
- if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR
- if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
+ if (H5Dclose(dataset_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Tclose(type_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Sclose(space_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
/* Open the named datatype */
- if((type_id = H5Topen2(file_id, "/g17/t", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((type_id = H5Topen2(file_id, "/g17/t", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(type_id, "/g17/t", "/g17/t") < 0) TEST_ERROR
+ if (check_name(type_id, "/g17/t", "/g17/t") < 0)
+ TEST_ERROR
/* Close datatype */
- if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR
+ if (H5Tclose(type_id) < 0)
+ FAIL_STACK_ERROR
/* Reopen the dataset */
- if((dataset_id = H5Dopen2(file_id, "/g17/d", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((dataset_id = H5Dopen2(file_id, "/g17/d", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Get datatype*/
- if((type_id = H5Dget_type(dataset_id)) < 0) FAIL_STACK_ERROR
+ if ((type_id = H5Dget_type(dataset_id)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(type_id, "/g17/t", "/g17/t") < 0) TEST_ERROR
+ if (check_name(type_id, "/g17/t", "/g17/t") < 0)
+ TEST_ERROR
/* Close */
- if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
- if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR
+ if (H5Dclose(dataset_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Tclose(type_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with objects that have two names
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with objects that have two names
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with datasets that have two names");
/* Open dataset named "d"*/
- if((dataset_id = H5Dopen2(file_id, "/g17/d", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((dataset_id = H5Dopen2(file_id, "/g17/d", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create link to dataset named "link" */
- if(H5Lcreate_hard(dataset_id, ".", file_id, "/g17/link", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
- if((dataset2_id = H5Dopen2(file_id, "/g17/link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if (H5Lcreate_hard(dataset_id, ".", file_id, "/g17/link", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
+ if ((dataset2_id = H5Dopen2(file_id, "/g17/link", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Make sure that the two IDs use two different names */
- if(check_name(dataset_id, "/g17/d", "/g17/d") < 0) TEST_ERROR
- if(check_name(dataset2_id, "/g17/link", "/g17/link") < 0) TEST_ERROR
+ if (check_name(dataset_id, "/g17/d", "/g17/d") < 0)
+ TEST_ERROR
+ if (check_name(dataset2_id, "/g17/link", "/g17/link") < 0)
+ TEST_ERROR
- if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
- if(H5Dclose(dataset2_id) < 0) FAIL_STACK_ERROR
+ if (H5Dclose(dataset_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Dclose(dataset2_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with different files, test1
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with different files, test1
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with different files");
/* Create a new file using default properties. */
- if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+ if ((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
/* Create a new file using default properties. */
- if((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+ if ((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
/* Create the dataspace */
- if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR
+ if ((space_id = H5Screate_simple(1, dims, NULL)) < 0)
+ FAIL_STACK_ERROR
/* Create a new dataset */
- if((dataset_id = H5Dcreate2(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((dataset_id =
+ H5Dcreate2(file2_id, "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create a new dataset */
- if((dataset2_id = H5Dcreate2(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((dataset2_id =
+ H5Dcreate2(file3_id, "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Delete */
- if(H5Ldelete(file2_id, "/d", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Ldelete(file2_id, "/d", H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(dataset_id, "", "") < 0) TEST_ERROR
+ if (check_name(dataset_id, "", "") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(dataset2_id, "/d", "/d") < 0) TEST_ERROR
+ if (check_name(dataset2_id, "/d", "/d") < 0)
+ TEST_ERROR
/* Close */
- if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
- if(H5Dclose(dataset2_id) < 0) FAIL_STACK_ERROR
- if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file2_id) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file3_id) < 0) FAIL_STACK_ERROR
+ if (H5Dclose(dataset_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Dclose(dataset2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Sclose(space_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file3_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with different files, test2
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with different files, test2
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with different files #2");
/* Create a new file using default properties. */
- if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+ if ((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
/* Create a new file using default properties. */
- if((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+ if ((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
/* Create the dataspace */
- if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR
+ if ((space_id = H5Screate_simple(1, dims, NULL)) < 0)
+ FAIL_STACK_ERROR
/* Create a new dataset */
- if((dataset_id = H5Dcreate2(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((dataset_id =
+ H5Dcreate2(file2_id, "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create a new dataset */
- if((dataset2_id = H5Dcreate2(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((dataset2_id =
+ H5Dcreate2(file3_id, "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Delete */
- if(H5Ldelete(file3_id, "/d", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Ldelete(file3_id, "/d", H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(dataset_id, "/d", "/d") < 0) TEST_ERROR
+ if (check_name(dataset_id, "/d", "/d") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(dataset2_id, "", "") < 0) TEST_ERROR
+ if (check_name(dataset2_id, "", "") < 0)
+ TEST_ERROR
/* Close */
- if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
- if(H5Dclose(dataset2_id) < 0) FAIL_STACK_ERROR
- if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file2_id) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file3_id) < 0) FAIL_STACK_ERROR
+ if (H5Dclose(dataset_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Dclose(dataset2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Sclose(space_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file3_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with a small buffer for name
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with a small buffer for name
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with a small buffer for name");
/* Reopen the group */
- if((group_id = H5Gopen2(file_id, "/g17", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(file_id, "/g17", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
-{
- /*small buffer to hold name and its size */
- char name2[SMALL_NAME_BUF_SIZE];
+ {
+ /*small buffer to hold name and its size */
+ char name2[SMALL_NAME_BUF_SIZE];
- /* Get name */
- *name2 = '\0';
- name_len=(size_t)H5Iget_name(group_id, name2, SMALL_NAME_BUF_SIZE);
+ /* Get name */
+ *name2 = '\0';
+ name_len = (size_t)H5Iget_name(group_id, name2, SMALL_NAME_BUF_SIZE);
- /* Check that name is longer */
- if(name_len <= SMALL_NAME_BUF_SIZE) TEST_ERROR
- if(HDstrcmp(name2, "/")) TEST_ERROR
-}
+ /* Check that name is longer */
+ if (name_len <= SMALL_NAME_BUF_SIZE)
+ TEST_ERROR
+ if (HDstrcmp(name2, "/"))
+ TEST_ERROR
+ }
/* Verify */
- if(check_name(group_id, "/g17", "/g17") < 0) TEST_ERROR
+ if (check_name(group_id, "/g17", "/g17") < 0)
+ TEST_ERROR
/* Close */
H5Gclose(group_id);
PASSED();
-
/*-------------------------------------------------------------------------
- * Test H5Iget_name with a dynamic buffer for name
- *-------------------------------------------------------------------------
- */
+ * Test H5Iget_name with a dynamic buffer for name
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with a dynamic buffer for name");
/* Reopen the group */
- if((group_id = H5Gopen2(file_id, "/g17", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(file_id, "/g17", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Get name */
name_len = (size_t)H5Iget_name(group_id, NULL, NAME_BUF_SIZE);
-{
- /* dynamic buffer to hold name */
- char *name3;
+ {
+ /* dynamic buffer to hold name */
+ char *name3;
- /* Include the extra null character */
- name3 = (char *)HDmalloc(name_len + 1);
- if(!name3) TEST_ERROR
+ /* Include the extra null character */
+ name3 = (char *)HDmalloc(name_len + 1);
+ if (!name3)
+ TEST_ERROR
- /* Get name with dynamic buffer */
- *name3 = '\0';
- if(H5Iget_name(group_id, name3, name_len + 1) < 0) TEST_ERROR
+ /* Get name with dynamic buffer */
+ *name3 = '\0';
+ if (H5Iget_name(group_id, name3, name_len + 1) < 0)
+ TEST_ERROR
- /* Verify */
- if(HDstrcmp(name3, "/g17")) TEST_ERROR
- *name3 = '\0';
+ /* Verify */
+ if (HDstrcmp(name3, "/g17"))
+ TEST_ERROR
+ *name3 = '\0';
- /* Get name with smaller buffer */
- *name3 = '\0';
- if(H5Iget_name(group_id, name3, 3) < 0) TEST_ERROR
+ /* Get name with smaller buffer */
+ *name3 = '\0';
+ if (H5Iget_name(group_id, name3, 3) < 0)
+ TEST_ERROR
- /* Verify */
- if(HDstrcmp(name3, "/g")) TEST_ERROR
+ /* Verify */
+ if (HDstrcmp(name3, "/g"))
+ TEST_ERROR
- HDfree(name3);
-}
+ HDfree(name3);
+ }
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
-/*-------------------------------------------------------------------------
- * Test H5Iget_name with invalid IDs
- *-------------------------------------------------------------------------
- */
-
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with invalid IDs
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with invalid IDs");
/* Create a dataspace */
- if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR
+ if ((space_id = H5Screate_simple(1, dims, NULL)) < 0)
+ TEST_ERROR
/* Define a datatype */
- if((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR
+ if ((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0)
+ TEST_ERROR
/* Create a new dataset */
- if((dataset_id = H5Dcreate2(file_id , "d2", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if ((dataset_id = H5Dcreate2(file_id, "d2", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
+ 0)
+ TEST_ERROR
-{
- char name[NAME_BUF_SIZE]; /* Buffer to hold name and its size */
+ {
+ char name[NAME_BUF_SIZE]; /* Buffer to hold name and its size */
- /* Get name for non commited datatype, it should fail */
- H5E_BEGIN_TRY {
- if(H5Iget_name(type_id, name, NAME_BUF_SIZE) > 0) TEST_ERROR
- } H5E_END_TRY;
+ /* Get name for non commited datatype, it should fail */
+ H5E_BEGIN_TRY
+ {
+ if (H5Iget_name(type_id, name, NAME_BUF_SIZE) > 0)
+ TEST_ERROR
+ }
+ H5E_END_TRY;
- /* Get name for dataspace, it should fail */
- H5E_BEGIN_TRY {
- if(H5Iget_name(space_id, name, NAME_BUF_SIZE) > 0) TEST_ERROR
- } H5E_END_TRY;
-}
+ /* Get name for dataspace, it should fail */
+ H5E_BEGIN_TRY
+ {
+ if (H5Iget_name(space_id, name, NAME_BUF_SIZE) > 0)
+ TEST_ERROR
+ }
+ H5E_END_TRY;
+ }
/* Close */
- if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
- if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
- if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR
+ if (H5Dclose(dataset_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Sclose(space_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Tclose(type_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
/*-------------------------------------------------------------------------
* Test H5Iget_name with added names with mounting
*-------------------------------------------------------------------------
@@ -1258,701 +1561,969 @@ test_main(hid_t file_id, hid_t fapl)
TESTING("H5Iget_name with added names with mounting");
/* Create a group "g18/g2" in the first file */
- if((group_id = H5Gcreate2(file_id, "/g18", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "/g18/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g18", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "/g18/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Also create a dataset and a datatype */
- if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR
- if((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR
- if((dataset_id = H5Dcreate2(file_id, "g18/d2", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((space_id = H5Screate_simple(1, dims, NULL)) < 0)
+ FAIL_STACK_ERROR
+ if ((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0)
+ FAIL_STACK_ERROR
+ if ((dataset_id =
+ H5Dcreate2(file_id, "g18/d2", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
- if(H5Tcommit2(file_id, "g18/t2", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Tcommit2(file_id, "g18/t2", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Create second file and group "/g3/g4/g5" in it */
- if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file1_id, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group4_id = H5Gcreate2(file1_id, "/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group5_id = H5Gcreate2(file1_id, "/g3/g4/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file1_id, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group4_id = H5Gcreate2(file1_id, "/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group5_id = H5Gcreate2(file1_id, "/g3/g4/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Mount first file at "g3/g4" in the second file */
- if(H5Fmount(file1_id, "/g3/g4", file_id, H5P_DEFAULT) < 0) TEST_ERROR
+ if (H5Fmount(file1_id, "/g3/g4", file_id, H5P_DEFAULT) < 0)
+ TEST_ERROR
/* Get name for the group ID in the first file, should be "/g18/g2" still */
- if(check_name(group2_id, "/g18/g2", "/g18/g2") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g18/g2", "/g18/g2") < 0)
+ TEST_ERROR
/* Get name for the dataset ID in the first file, should be "/g18/g2/d2" still */
- if(check_name(dataset_id, "/g18/d2", "/g18/d2") < 0) TEST_ERROR
+ if (check_name(dataset_id, "/g18/d2", "/g18/d2") < 0)
+ TEST_ERROR
/* Get name for the datatype ID in the first file, should be "/g18/g2/t2" still */
- if(check_name(type_id, "/g18/t2", "/g18/t2") < 0) TEST_ERROR
+ if (check_name(type_id, "/g18/t2", "/g18/t2") < 0)
+ TEST_ERROR
/* Open the mounted group, dataset, and datatype through their new names */
- if((group6_id = H5Gopen2(file1_id, "/g3/g4/g18/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((dataset2_id = H5Dopen2(file1_id, "/g3/g4/g18/d2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((type2_id = H5Topen2(file1_id, "/g3/g4/g18/t2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group6_id = H5Gopen2(file1_id, "/g3/g4/g18/g2", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((dataset2_id = H5Dopen2(file1_id, "/g3/g4/g18/d2", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((type2_id = H5Topen2(file1_id, "/g3/g4/g18/t2", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify names */
- if(check_name(group6_id, "/g3/g4/g18/g2", "/g3/g4/g18/g2") < 0) TEST_ERROR
- if(check_name(dataset2_id, "/g3/g4/g18/d2", "/g3/g4/g18/d2") < 0) TEST_ERROR
- if(check_name(type2_id, "/g3/g4/g18/t2", "/g3/g4/g18/t2") < 0) TEST_ERROR
+ if (check_name(group6_id, "/g3/g4/g18/g2", "/g3/g4/g18/g2") < 0)
+ TEST_ERROR
+ if (check_name(dataset2_id, "/g3/g4/g18/d2", "/g3/g4/g18/d2") < 0)
+ TEST_ERROR
+ if (check_name(type2_id, "/g3/g4/g18/t2", "/g3/g4/g18/t2") < 0)
+ TEST_ERROR
/* Verify that old IDs still refer to objects by their old names */
- if(check_name(group2_id, "/g18/g2", "/g18/g2") < 0) TEST_ERROR
- if(check_name(dataset_id, "/g18/d2", "/g18/d2") < 0) TEST_ERROR
- if(check_name(type_id, "/g18/t2", "/g18/t2") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g18/g2", "/g18/g2") < 0)
+ TEST_ERROR
+ if (check_name(dataset_id, "/g18/d2", "/g18/d2") < 0)
+ TEST_ERROR
+ if (check_name(type_id, "/g18/t2", "/g18/t2") < 0)
+ TEST_ERROR
/* Unmount */
- if(H5Funmount(file1_id, "/g3/g4") < 0) FAIL_STACK_ERROR
+ if (H5Funmount(file1_id, "/g3/g4") < 0)
+ FAIL_STACK_ERROR
/* Get name for the IDs of the first file, should be unchanged */
- if(check_name(group2_id, "/g18/g2", "/g18/g2") < 0) TEST_ERROR
- if(check_name(dataset_id, "/g18/d2", "/g18/d2") < 0) TEST_ERROR
- if(check_name(type_id, "/g18/t2", "/g18/t2") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g18/g2", "/g18/g2") < 0)
+ TEST_ERROR
+ if (check_name(dataset_id, "/g18/d2", "/g18/d2") < 0)
+ TEST_ERROR
+ if (check_name(type_id, "/g18/t2", "/g18/t2") < 0)
+ TEST_ERROR
/* Get name for the IDs of the second file, should be local names now */
- if(check_name(group6_id, "/g18/g2", "") < 0) TEST_ERROR
- if(check_name(dataset2_id, "/g18/d2", "") < 0) TEST_ERROR
- if(check_name(type2_id, "/g18/t2", "") < 0) TEST_ERROR
-
- if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR
- if(H5Tclose(type2_id) < 0) FAIL_STACK_ERROR
- if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
- if(H5Dclose(dataset2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group5_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group6_id) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
+ if (check_name(group6_id, "/g18/g2", "") < 0)
+ TEST_ERROR
+ if (check_name(dataset2_id, "/g18/d2", "") < 0)
+ TEST_ERROR
+ if (check_name(type2_id, "/g18/t2", "") < 0)
+ TEST_ERROR
- PASSED();
+ if (H5Tclose(type_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Tclose(type2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Dclose(dataset_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Dclose(dataset2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group4_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group5_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group6_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file1_id) < 0)
+ FAIL_STACK_ERROR
+ PASSED();
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Fclose
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Fclose
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Fclose");
/* Create a file and group "/g1/g2" in it */
- if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
- if((group_id = H5Gcreate2(file1_id, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file1_id, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file1_id, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file1_id, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g1/g2", "/g1/g2") < 0)
+ TEST_ERROR
/* Close file */
- if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
+ if (H5Fclose(file1_id) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g1/g2", "/g1/g2") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Fmount and H5Ldelete
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Fmount and H5Ldelete
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Fmount and H5Ldelete");
/* Create a file and group "/g1/g2" in it */
- if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
- if((group_id = H5Gcreate2(file1_id, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file1_id, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file1_id, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file1_id, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create a new file and group "/g3/g4" in it */
- if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file2_id, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group4_id = H5Gcreate2(file2_id, "/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file2_id, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group4_id = H5Gcreate2(file2_id, "/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Mount first file at "/g3/g4" in the second file */
- if(H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Open the mounted group */
- if((group5_id = H5Gopen2(file2_id, "/g3/g4/g1/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group5_id = H5Gopen2(file2_id, "/g3/g4/g1/g2", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR
+ if (check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0)
+ TEST_ERROR
/* Delete */
- if(H5Ldelete(file1_id, "/g3/g4/g1/g2", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Ldelete(file1_id, "/g3/g4/g1/g2", H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group5_id, "", "") < 0) TEST_ERROR
+ if (check_name(group5_id, "", "") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group2_id, "", "") < 0) TEST_ERROR
+ if (check_name(group2_id, "", "") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group5_id) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file2_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group4_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group5_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file1_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file2_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Fmount and H5Lmove
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Fmount and H5Lmove
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Fmount and H5Lmove");
/* Create a file and group "/g1/g2" in it */
- if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
- if((group_id = H5Gcreate2(file1_id, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file1_id, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file1_id, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file1_id, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create a new file and group "/g3/g4" in it */
- if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file2_id, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group4_id = H5Gcreate2(file2_id, "/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file2_id, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group4_id = H5Gcreate2(file2_id, "/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Mount first file at "g3/g4" in the second file */
- if(H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group4_id, "/g3/g4", "/g3/g4") < 0) TEST_ERROR
+ if (check_name(group4_id, "/g3/g4", "/g3/g4") < 0)
+ TEST_ERROR
/* Open the mounted group */
- if((group5_id = H5Gopen2(file2_id, "/g3/g4/g1/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group5_id = H5Gopen2(file2_id, "/g3/g4/g1/g2", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR
+ if (check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0)
+ TEST_ERROR
/* Open another mounted group, in the middle of the path */
- if((group6_id = H5Gopen2(file2_id, "/g3/g4/g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group6_id = H5Gopen2(file2_id, "/g3/g4/g1", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0) TEST_ERROR
+ if (check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0)
+ TEST_ERROR
/* Rename group */
- if(H5Lmove(file2_id, "/g3/g4/g1/g2", H5L_SAME_LOC, "/g3/g4/g1/g5", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(file2_id, "/g3/g4/g1/g2", H5L_SAME_LOC, "/g3/g4/g1/g5", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group5_id, "/g3/g4/g1/g5", "/g3/g4/g1/g5") < 0) TEST_ERROR
- if(check_name(group2_id, "/g1/g5", "/g1/g5") < 0) TEST_ERROR
+ if (check_name(group5_id, "/g3/g4/g1/g5", "/g3/g4/g1/g5") < 0)
+ TEST_ERROR
+ if (check_name(group2_id, "/g1/g5", "/g1/g5") < 0)
+ TEST_ERROR
/* Rename group */
- if(H5Lmove(file2_id, "/g3/g4/g1", H5L_SAME_LOC, "/g3/g4/g1a", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(file2_id, "/g3/g4/g1", H5L_SAME_LOC, "/g3/g4/g1a", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group5_id, "/g3/g4/g1a/g5", "/g3/g4/g1a/g5") < 0) TEST_ERROR
- if(check_name(group2_id, "/g1a/g5", "/g1a/g5") < 0) TEST_ERROR
+ if (check_name(group5_id, "/g3/g4/g1a/g5", "/g3/g4/g1a/g5") < 0)
+ TEST_ERROR
+ if (check_name(group2_id, "/g1a/g5", "/g1a/g5") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group6_id, "/g3/g4/g1a", "/g3/g4/g1a") < 0) TEST_ERROR
- if(check_name(group_id, "/g1a", "/g1a") < 0) TEST_ERROR
+ if (check_name(group6_id, "/g3/g4/g1a", "/g3/g4/g1a") < 0)
+ TEST_ERROR
+ if (check_name(group_id, "/g1a", "/g1a") < 0)
+ TEST_ERROR
/* Rename middle group back, using relative path */
- if(H5Lmove(group3_id, "g4/g1a", H5L_SAME_LOC, "g4/g1", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(group3_id, "g4/g1a", H5L_SAME_LOC, "g4/g1", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group5_id, "/g3/g4/g1/g5", "/g3/g4/g1/g5") < 0) TEST_ERROR
- if(check_name(group2_id, "/g1/g5", "/g1/g5") < 0) TEST_ERROR
- if(check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0) TEST_ERROR
- if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR
+ if (check_name(group5_id, "/g3/g4/g1/g5", "/g3/g4/g1/g5") < 0)
+ TEST_ERROR
+ if (check_name(group2_id, "/g1/g5", "/g1/g5") < 0)
+ TEST_ERROR
+ if (check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0)
+ TEST_ERROR
+ if (check_name(group_id, "/g1", "/g1") < 0)
+ TEST_ERROR
/* Rename end group back, using relative path */
- if(H5Lmove(group3_id, "g4/g1/g5", H5L_SAME_LOC, "g4/g1/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(group3_id, "g4/g1/g5", H5L_SAME_LOC, "g4/g1/g2", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR
- if(check_name(group2_id, "/g1/g2", "/g1/g2") < 0) TEST_ERROR
- if(check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0) TEST_ERROR
- if(check_name(group_id, "/g1", "/g1") < 0) TEST_ERROR
+ if (check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0)
+ TEST_ERROR
+ if (check_name(group2_id, "/g1/g2", "/g1/g2") < 0)
+ TEST_ERROR
+ if (check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0)
+ TEST_ERROR
+ if (check_name(group_id, "/g1", "/g1") < 0)
+ TEST_ERROR
/* Rename mount point */
- if(H5Lmove(file2_id, "/g3/g4", H5L_SAME_LOC, "/g3/g4a", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(file2_id, "/g3/g4", H5L_SAME_LOC, "/g3/g4a", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group4_id, "/g3/g4a", "/g3/g4a") < 0) TEST_ERROR
- if(check_name(group5_id, "/g3/g4a/g1/g2", "/g3/g4a/g1/g2") < 0) TEST_ERROR
- if(check_name(group6_id, "/g3/g4a/g1", "/g3/g4a/g1") < 0) TEST_ERROR
+ if (check_name(group4_id, "/g3/g4a", "/g3/g4a") < 0)
+ TEST_ERROR
+ if (check_name(group5_id, "/g3/g4a/g1/g2", "/g3/g4a/g1/g2") < 0)
+ TEST_ERROR
+ if (check_name(group6_id, "/g3/g4a/g1", "/g3/g4a/g1") < 0)
+ TEST_ERROR
/* Rename mount point back, using relative path*/
- if(H5Lmove(group3_id, "g4a", H5L_SAME_LOC, "g4", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(group3_id, "g4a", H5L_SAME_LOC, "g4", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group4_id, "/g3/g4", "/g3/g4") < 0) TEST_ERROR
- if(check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0) TEST_ERROR
- if(check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0) TEST_ERROR
+ if (check_name(group4_id, "/g3/g4", "/g3/g4") < 0)
+ TEST_ERROR
+ if (check_name(group5_id, "/g3/g4/g1/g2", "/g3/g4/g1/g2") < 0)
+ TEST_ERROR
+ if (check_name(group6_id, "/g3/g4/g1", "/g3/g4/g1") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group5_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group6_id) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file2_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group4_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group5_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group6_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file1_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file2_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Lcreate_hard
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Lcreate_hard
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Lcreate_hard");
/* Create group "g19/g1" */
- if((group_id = H5Gcreate2(file_id, "/g19", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "/g19/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g19", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "/g19/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create hard link to "g19/g1/ group */
- if(H5Lcreate_hard(file_id, "/g19/g1", H5L_SAME_LOC, "/g19/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lcreate_hard(file_id, "/g19/g1", H5L_SAME_LOC, "/g19/g2", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g19/g1", "/g19/g1") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g19/g1", "/g19/g1") < 0)
+ TEST_ERROR
/* Open the group */
- if((group3_id = H5Gopen2(file_id, "/g19/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group3_id = H5Gopen2(file_id, "/g19/g2", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g19/g2", "/g19/g2") < 0)
+ TEST_ERROR
/* Rename original group */
- if(H5Lmove(file_id, "/g19/g1", H5L_SAME_LOC, "/g19/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(file_id, "/g19/g1", H5L_SAME_LOC, "/g19/g3", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g19/g3", "/g19/g3") < 0) TEST_ERROR
- if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g19/g3", "/g19/g3") < 0)
+ TEST_ERROR
+ if (check_name(group3_id, "/g19/g2", "/g19/g2") < 0)
+ TEST_ERROR
/* Rename original group back, using relative path */
- if(H5Lmove(group_id, "g3", H5L_SAME_LOC, "g1", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(group_id, "g3", H5L_SAME_LOC, "g1", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g19/g1", "/g19/g1") < 0) TEST_ERROR
- if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g19/g1", "/g19/g1") < 0)
+ TEST_ERROR
+ if (check_name(group3_id, "/g19/g2", "/g19/g2") < 0)
+ TEST_ERROR
/* Create another hard link to "/g19/g1" group */
- if(H5Lcreate_hard(file_id, "/g19/g1", H5L_SAME_LOC, "/g19/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lcreate_hard(file_id, "/g19/g1", H5L_SAME_LOC, "/g19/g3", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Open the group */
- if((group4_id = H5Gopen2(file_id, "/g19/g3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group4_id = H5Gopen2(file_id, "/g19/g3", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group4_id, "/g19/g3", "/g19/g3") < 0) TEST_ERROR
+ if (check_name(group4_id, "/g19/g3", "/g19/g3") < 0)
+ TEST_ERROR
/* Delete group */
- if(H5Ldelete(file_id, "/g19/g3", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Ldelete(file_id, "/g19/g3", H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group4_id, "/g19/g1", "") < 0) TEST_ERROR
- if(check_name(group2_id, "/g19/g1", "/g19/g1") < 0) TEST_ERROR
- if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR
+ if (check_name(group4_id, "/g19/g1", "") < 0)
+ TEST_ERROR
+ if (check_name(group2_id, "/g19/g1", "/g19/g1") < 0)
+ TEST_ERROR
+ if (check_name(group3_id, "/g19/g2", "/g19/g2") < 0)
+ TEST_ERROR
/* Close the unlinked group */
- if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group4_id) < 0)
+ FAIL_STACK_ERROR
/* Create another hard link to "/g19/g1" group */
- if(H5Lcreate_hard(file_id, "/g19/g1", H5L_SAME_LOC, "/g19/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lcreate_hard(file_id, "/g19/g1", H5L_SAME_LOC, "/g19/g3", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Open the group */
- if((group4_id = H5Gopen2(file_id, "/g19/g3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group4_id = H5Gopen2(file_id, "/g19/g3", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group4_id, "/g19/g3", "/g19/g3") < 0) TEST_ERROR
+ if (check_name(group4_id, "/g19/g3", "/g19/g3") < 0)
+ TEST_ERROR
/* Delete group, using relative path */
- if(H5Ldelete(group_id, "g3", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Ldelete(group_id, "g3", H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group4_id, "/g19/g1", "") < 0) TEST_ERROR
- if(check_name(group2_id, "/g19/g1", "/g19/g1") < 0) TEST_ERROR
- if(check_name(group3_id, "/g19/g2", "/g19/g2") < 0) TEST_ERROR
+ if (check_name(group4_id, "/g19/g1", "") < 0)
+ TEST_ERROR
+ if (check_name(group2_id, "/g19/g1", "/g19/g1") < 0)
+ TEST_ERROR
+ if (check_name(group3_id, "/g19/g2", "/g19/g2") < 0)
+ TEST_ERROR
/* Close the unlinked group */
- if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group4_id) < 0)
+ FAIL_STACK_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Lcreate_soft
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Lcreate_soft
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Lcreate_soft");
/* Create group "g20/g1" */
- if((group_id = H5Gcreate2(file_id, "/g20", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "/g20/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g20", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "/g20/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create symbolic link to "g20/g1/ group */
- if(H5Lcreate_soft("/g20/g1", file_id, "/g20/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lcreate_soft("/g20/g1", file_id, "/g20/g2", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g20/g1", "/g20/g1") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g20/g1", "/g20/g1") < 0)
+ TEST_ERROR
/* Open the group */
- if((group3_id = H5Gopen2(file_id, "/g20/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group3_id = H5Gopen2(file_id, "/g20/g2", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "/g20/g2", "/g20/g2") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g20/g2", "/g20/g2") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Lcreate_soft and move target
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Lcreate_soft and move target
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Lcreate_soft and move target");
/* Create group "g21/g1" */
- if((group_id = H5Gcreate2(file_id, "/g21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "/g21/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "/g21/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create symbolic link to "g21/g1/ group */
- if(H5Lcreate_soft("/g21/g1", file_id, "/g21/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lcreate_soft("/g21/g1", file_id, "/g21/g2", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g21/g1", "/g21/g1") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g21/g1", "/g21/g1") < 0)
+ TEST_ERROR
/* Open the group */
- if((group3_id = H5Gopen2(file_id, "/g21/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group3_id = H5Gopen2(file_id, "/g21/g2", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Rename group */
- if(H5Lmove(file_id, "/g21/g1", H5L_SAME_LOC, "/g21/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(file_id, "/g21/g1", H5L_SAME_LOC, "/g21/g3", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g21/g3", "/g21/g3") < 0) TEST_ERROR
- if(check_name(group3_id, "/g21/g2", "/g21/g2") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g21/g3", "/g21/g3") < 0)
+ TEST_ERROR
+ if (check_name(group3_id, "/g21/g2", "/g21/g2") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Lcreate_soft and move source
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Lcreate_soft and move source
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Lcreate_soft and move source");
/* Create group "g22/g1" */
- if((group_id = H5Gcreate2(file_id, "/g22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "/g22/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "/g22/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create symbolic link to "g22/g1/ group */
- if(H5Lcreate_soft("/g22/g1", file_id, "/g22/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lcreate_soft("/g22/g1", file_id, "/g22/g2", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g22/g1", "/g22/g1") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g22/g1", "/g22/g1") < 0)
+ TEST_ERROR
/* Open the group */
- if((group3_id = H5Gopen2(file_id, "/g22/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group3_id = H5Gopen2(file_id, "/g22/g2", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Rename soft link */
- if(H5Lmove(file_id, "/g22/g2", H5L_SAME_LOC, "/g22/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(file_id, "/g22/g2", H5L_SAME_LOC, "/g22/g3", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g22/g1", "/g22/g1") < 0) TEST_ERROR
- if(check_name(group3_id, "/g22/g3", "/g22/g3") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g22/g1", "/g22/g1") < 0)
+ TEST_ERROR
+ if (check_name(group3_id, "/g22/g3", "/g22/g3") < 0)
+ TEST_ERROR
/* Rename soft link, using relative paths */
- if(H5Lmove(group_id, "g3", H5L_SAME_LOC, "g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(group_id, "g3", H5L_SAME_LOC, "g2", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g22/g1", "/g22/g1") < 0) TEST_ERROR
- if(check_name(group3_id, "/g22/g2", "/g22/g2") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g22/g1", "/g22/g1") < 0)
+ TEST_ERROR
+ if (check_name(group3_id, "/g22/g2", "/g22/g2") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Lcreate_soft and unlink target
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Lcreate_soft and unlink target
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Lcreate_soft and unlink target");
/* Create group "g23/g1" */
- if((group_id = H5Gcreate2(file_id, "/g23", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "/g23/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g23", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "/g23/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create symbolic link to "g23/g1/ group */
- if(H5Lcreate_soft("/g23/g1", file_id, "/g23/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lcreate_soft("/g23/g1", file_id, "/g23/g2", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g23/g1", "/g23/g1") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g23/g1", "/g23/g1") < 0)
+ TEST_ERROR
/* Open the group */
- if((group3_id = H5Gopen2(file_id, "/g23/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group3_id = H5Gopen2(file_id, "/g23/g2", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Delete group */
- if(H5Ldelete(file_id, "/g23/g1", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Ldelete(file_id, "/g23/g1", H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "/g23/g2", "/g23/g2") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g23/g2", "/g23/g2") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Lcreate_soft and unlink source
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with H5Lcreate_soft and unlink source
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with H5Lcreate_soft and unlink source");
/* Create group "g24/g1" */
- if((group_id = H5Gcreate2(file_id, "/g24", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "/g24/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g24", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "/g24/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create symbolic link to "g24/g1/ group */
- if(H5Lcreate_soft("/g24/g1", file_id, "/g24/g2", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lcreate_soft("/g24/g1", file_id, "/g24/g2", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g24/g1", "/g24/g1") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g24/g1", "/g24/g1") < 0)
+ TEST_ERROR
/* Open the group */
- if((group3_id = H5Gopen2(file_id, "/g24/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group3_id = H5Gopen2(file_id, "/g24/g2", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Delete symbolic link */
- if(H5Ldelete(file_id, "/g24/g2", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Ldelete(file_id, "/g24/g2", H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "/g24/g1", "") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g24/g1", "") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with several nested mounted files
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with several nested mounted files
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with several nested mounted files");
/* Create a group "g25/g1/g2" in the first file */
- if((group_id = H5Gcreate2(file_id, "/g25", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "/g25/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file_id, "/g25/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g25", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "/g25/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file_id, "/g25/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
/* Create second file and group "/g26/g3/g4" in it */
- if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+ if ((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
- if((group_id = H5Gcreate2(file1_id, "/g26", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file1_id, "/g26/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file1_id, "/g26/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file1_id, "/g26", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file1_id, "/g26/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file1_id, "/g26/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
/* Create third file and group "/g27/g5/g6" in it */
- if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+ if ((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
- if((group_id = H5Gcreate2(file2_id, "/g27", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file2_id, "/g27/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file2_id, "/g27/g5/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file2_id, "/g27", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file2_id, "/g27/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file2_id, "/g27/g5/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
/* Create fourth file and group "/g28/g5/g6" in it */
- if((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+ if ((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
- if((group_id = H5Gcreate2(file3_id, "/g28", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file3_id, "/g28/g7", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file3_id, "/g28/g7/g8", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file3_id, "/g28", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file3_id, "/g28/g7", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file3_id, "/g28/g7/g8", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
/* Access group which will be hidden in the first file */
- if((group_id = H5Gopen2(file_id, "/g25/g1/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(file_id, "/g25/g1/g2", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g25/g1/g2", "/g25/g1/g2") < 0) TEST_ERROR
+ if (check_name(group_id, "/g25/g1/g2", "/g25/g1/g2") < 0)
+ TEST_ERROR
/* Mount second file under "/g25/g1" in the first file */
- if(H5Fmount(file_id, "/g25/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Fmount(file_id, "/g25/g1", file1_id, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "", "/g25/g1/g2") < 0) TEST_ERROR
+ if (check_name(group_id, "", "/g25/g1/g2") < 0)
+ TEST_ERROR
/* Access group which will be hidden in the second file */
- if((group2_id = H5Gopen2(file_id, "/g25/g1/g26/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group2_id = H5Gopen2(file_id, "/g25/g1/g26/g3/g4", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g25/g1/g26/g3/g4", "/g25/g1/g26/g3/g4") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g25/g1/g26/g3/g4", "/g25/g1/g26/g3/g4") < 0)
+ TEST_ERROR
/* Mount third file under "/g25/g1/g26/g3" in the first file */
- if(H5Fmount(file_id, "/g25/g1/g26/g3", file2_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Fmount(file_id, "/g25/g1/g26/g3", file2_id, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "", "/g25/g1/g26/g3/g4") < 0) TEST_ERROR
+ if (check_name(group2_id, "", "/g25/g1/g26/g3/g4") < 0)
+ TEST_ERROR
/* Access group in the third file */
- if((group3_id = H5Gopen2(file_id, "/g25/g1/g26/g3/g27/g5/g6", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group3_id = H5Gopen2(file_id, "/g25/g1/g26/g3/g27/g5/g6", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "/g25/g1/g26/g3/g27/g5/g6", "/g25/g1/g26/g3/g27/g5/g6") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g25/g1/g26/g3/g27/g5/g6", "/g25/g1/g26/g3/g27/g5/g6") < 0)
+ TEST_ERROR
/* Mount fourth file under "/g25/g1/g26/g3/g27/g5" in the first file */
- if(H5Fmount(file_id, "/g25/g1/g26/g3/g27/g5", file3_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Fmount(file_id, "/g25/g1/g26/g3/g27/g5", file3_id, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "", "/g25/g1/g26/g3/g27/g5/g6") < 0) TEST_ERROR
+ if (check_name(group3_id, "", "/g25/g1/g26/g3/g27/g5/g6") < 0)
+ TEST_ERROR
/* Access group in the fourth file */
- if((group4_id = H5Gopen2(file_id, "/g25/g1/g26/g3/g27/g5/g28/g7/g8", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group4_id = H5Gopen2(file_id, "/g25/g1/g26/g3/g27/g5/g28/g7/g8", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group4_id, "/g25/g1/g26/g3/g27/g5/g28/g7/g8", "/g25/g1/g26/g3/g27/g5/g28/g7/g8") < 0) TEST_ERROR
+ if (check_name(group4_id, "/g25/g1/g26/g3/g27/g5/g28/g7/g8", "/g25/g1/g26/g3/g27/g5/g28/g7/g8") < 0)
+ TEST_ERROR
- if(H5Funmount(file_id, "/g25/g1/g26/g3/g27/g5") < 0) FAIL_STACK_ERROR
+ if (H5Funmount(file_id, "/g25/g1/g26/g3/g27/g5") < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group4_id, "/g28/g7/g8", "") < 0) TEST_ERROR
- if(check_name(group3_id, "/g25/g1/g26/g3/g27/g5/g6", "/g25/g1/g26/g3/g27/g5/g6") < 0) TEST_ERROR
- if(check_name(group2_id, "", "/g25/g1/g26/g3/g4") < 0) TEST_ERROR
- if(check_name(group_id, "", "/g25/g1/g2") < 0) TEST_ERROR
+ if (check_name(group4_id, "/g28/g7/g8", "") < 0)
+ TEST_ERROR
+ if (check_name(group3_id, "/g25/g1/g26/g3/g27/g5/g6", "/g25/g1/g26/g3/g27/g5/g6") < 0)
+ TEST_ERROR
+ if (check_name(group2_id, "", "/g25/g1/g26/g3/g4") < 0)
+ TEST_ERROR
+ if (check_name(group_id, "", "/g25/g1/g2") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group4_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file3_id) < 0)
+ FAIL_STACK_ERROR
- if(H5Funmount(file_id, "/g25/g1/g26/g3") < 0) FAIL_STACK_ERROR
+ if (H5Funmount(file_id, "/g25/g1/g26/g3") < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "/g27/g5/g6", "") < 0) TEST_ERROR
- if(check_name(group2_id, "/g25/g1/g26/g3/g4", "/g25/g1/g26/g3/g4") < 0) TEST_ERROR
- if(check_name(group_id, "", "/g25/g1/g2") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g27/g5/g6", "") < 0)
+ TEST_ERROR
+ if (check_name(group2_id, "/g25/g1/g26/g3/g4", "/g25/g1/g26/g3/g4") < 0)
+ TEST_ERROR
+ if (check_name(group_id, "", "/g25/g1/g2") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file2_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file2_id) < 0)
+ FAIL_STACK_ERROR
- if(H5Funmount(file_id, "/g25/g1") < 0) FAIL_STACK_ERROR
+ if (H5Funmount(file_id, "/g25/g1") < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g26/g3/g4", "") < 0) TEST_ERROR
- if(check_name(group_id, "/g25/g1/g2", "/g25/g1/g2") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g26/g3/g4", "") < 0)
+ TEST_ERROR
+ if (check_name(group_id, "/g25/g1/g2", "/g25/g1/g2") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file1_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name and H5Lmove with repeated path components
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name and H5Lmove with repeated path components
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name and H5Lmove with repeated path components");
/* Create a group "g29/g1/g2/g1/g2" in a file */
- if((group_id = H5Gcreate2(file_id, "/g29", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "/g29/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file_id, "/g29/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group4_id = H5Gcreate2(file_id, "/g29/g1/g2/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group5_id = H5Gcreate2(file_id, "/g29/g1/g2/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g29", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "/g29/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file_id, "/g29/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group4_id = H5Gcreate2(file_id, "/g29/g1/g2/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group5_id = H5Gcreate2(file_id, "/g29/g1/g2/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Rename group */
- if(H5Lmove(file_id, "/g29/g1/g2/g1/g2", H5L_SAME_LOC, "/g29/g1/g2/g1/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(file_id, "/g29/g1/g2/g1/g2", H5L_SAME_LOC, "/g29/g1/g2/g1/g3", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group5_id, "/g29/g1/g2/g1/g3", "/g29/g1/g2/g1/g3") < 0) TEST_ERROR
+ if (check_name(group5_id, "/g29/g1/g2/g1/g3", "/g29/g1/g2/g1/g3") < 0)
+ TEST_ERROR
/* Rename group in middle of path, keeping within the same group */
- if(H5Lmove(file_id, "/g29/g1/g2/g1", H5L_SAME_LOC, "/g29/g1/g2/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(file_id, "/g29/g1/g2/g1", H5L_SAME_LOC, "/g29/g1/g2/g3", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group4_id, "/g29/g1/g2/g3", "/g29/g1/g2/g3") < 0) TEST_ERROR
- if(check_name(group5_id, "/g29/g1/g2/g3/g3", "/g29/g1/g2/g3/g3") < 0) TEST_ERROR
+ if (check_name(group4_id, "/g29/g1/g2/g3", "/g29/g1/g2/g3") < 0)
+ TEST_ERROR
+ if (check_name(group5_id, "/g29/g1/g2/g3/g3", "/g29/g1/g2/g3/g3") < 0)
+ TEST_ERROR
/* Rename group in middle of path, moving to another group in file */
- if(H5Lmove(file_id, "/g29/g1/g2/g3", H5L_SAME_LOC, "/g29/g3", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lmove(file_id, "/g29/g1/g2/g3", H5L_SAME_LOC, "/g29/g3", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group4_id, "/g29/g3", "/g29/g3") < 0) TEST_ERROR
- if(check_name(group5_id, "/g29/g3/g3", "/g29/g3/g3") < 0) TEST_ERROR
+ if (check_name(group4_id, "/g29/g3", "/g29/g3") < 0)
+ TEST_ERROR
+ if (check_name(group5_id, "/g29/g3/g3", "/g29/g3/g3") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group5_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group4_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group5_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
-/*-------------------------------------------------------------------------
- * Test H5Iget_name with higher mounted file
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with higher mounted file
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with higher mounted file");
/* Create a group "/g30/g1/g2" in the first file */
- if((group_id = H5Gcreate2(file_id, "/g30", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "/g30/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file_id, "/g30/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g30", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "/g30/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file_id, "/g30/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
H5Gclose(group_id);
@@ -1962,9 +2533,12 @@ test_main(hid_t file_id, hid_t fapl)
/* Create second file and group "/g31/g3/g4" in it */
file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
- if((group_id = H5Gcreate2(file1_id, "/g31", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file1_id, "/g31/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file1_id, "/g31/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file1_id, "/g31", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file1_id, "/g31/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file1_id, "/g31/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
H5Gclose(group_id);
@@ -1974,9 +2548,12 @@ test_main(hid_t file_id, hid_t fapl)
/* Create third file and group "/g32/g5/g6" in it */
file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
- if((group_id = H5Gcreate2(file2_id, "/g32", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file2_id, "/g32/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file2_id, "/g32/g5/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file2_id, "/g32", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file2_id, "/g32/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file2_id, "/g32/g5/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
H5Gclose(group_id);
@@ -1986,9 +2563,12 @@ test_main(hid_t file_id, hid_t fapl)
/* Create fourth file and group "/g33/g5/g6" in it */
file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
- if((group_id = H5Gcreate2(file3_id, "/g33", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file3_id, "/g33/g7", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file3_id, "/g33/g7/g8", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file3_id, "/g33", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file3_id, "/g33/g7", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file3_id, "/g33/g7/g8", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
H5Gclose(group_id);
@@ -1996,73 +2576,102 @@ test_main(hid_t file_id, hid_t fapl)
H5Gclose(group3_id);
/* Access group which will be hidden in the first file */
- if((group_id = H5Gopen2(file_id, "/g30/g1/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(file_id, "/g30/g1/g2", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g30/g1/g2", "/g30/g1/g2") < 0) TEST_ERROR
+ if (check_name(group_id, "/g30/g1/g2", "/g30/g1/g2") < 0)
+ TEST_ERROR
/* Mount second file under "/g30/g1" in the first file */
- if(H5Fmount(file_id, "/g30/g1", file1_id, H5P_DEFAULT) < 0) TEST_ERROR
+ if (H5Fmount(file_id, "/g30/g1", file1_id, H5P_DEFAULT) < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group_id, "", "/g30/g1/g2") < 0) TEST_ERROR
+ if (check_name(group_id, "", "/g30/g1/g2") < 0)
+ TEST_ERROR
/* Access group which will be hidden in the second file */
- if((group2_id = H5Gopen2(file_id, "/g30/g1/g31/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group2_id = H5Gopen2(file_id, "/g30/g1/g31/g3/g4", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g30/g1/g31/g3/g4", "/g30/g1/g31/g3/g4") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g30/g1/g31/g3/g4", "/g30/g1/g31/g3/g4") < 0)
+ TEST_ERROR
/* Mount third file under "/g30/g1/g31/g3" in the first file */
- if(H5Fmount(file_id, "/g30/g1/g31/g3", file2_id, H5P_DEFAULT) < 0) TEST_ERROR
+ if (H5Fmount(file_id, "/g30/g1/g31/g3", file2_id, H5P_DEFAULT) < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group2_id, "", "/g30/g1/g31/g3/g4") < 0) TEST_ERROR
+ if (check_name(group2_id, "", "/g30/g1/g31/g3/g4") < 0)
+ TEST_ERROR
/* Access group which will be hidden in the third file */
- if((group3_id = H5Gopen2(file_id, "/g30/g1/g31/g3/g32/g5/g6", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group3_id = H5Gopen2(file_id, "/g30/g1/g31/g3/g32/g5/g6", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "/g30/g1/g31/g3/g32/g5/g6", "/g30/g1/g31/g3/g32/g5/g6") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g30/g1/g31/g3/g32/g5/g6", "/g30/g1/g31/g3/g32/g5/g6") < 0)
+ TEST_ERROR
/* Mount fourth file under "/g30" in the first file, hiding the files below it */
- if(H5Fmount(file_id, "/g30", file3_id, H5P_DEFAULT) < 0) TEST_ERROR
+ if (H5Fmount(file_id, "/g30", file3_id, H5P_DEFAULT) < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group3_id, "", "/g30/g1/g31/g3/g32/g5/g6") < 0) TEST_ERROR
+ if (check_name(group3_id, "", "/g30/g1/g31/g3/g32/g5/g6") < 0)
+ TEST_ERROR
/* Access group which will be in the fourth file */
- if((group4_id = H5Gopen2(file_id, "/g30/g33/g7/g8", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group4_id = H5Gopen2(file_id, "/g30/g33/g7/g8", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group4_id, "/g30/g33/g7/g8", "/g30/g33/g7/g8") < 0) TEST_ERROR
+ if (check_name(group4_id, "/g30/g33/g7/g8", "/g30/g33/g7/g8") < 0)
+ TEST_ERROR
/* Unmount fourth file */
- if(H5Funmount(file_id, "/g30") < 0) TEST_ERROR
+ if (H5Funmount(file_id, "/g30") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group4_id, "/g33/g7/g8", "") < 0) TEST_ERROR
- if(check_name(group3_id, "/g30/g1/g31/g3/g32/g5/g6", "/g30/g1/g31/g3/g32/g5/g6") < 0) TEST_ERROR
- if(check_name(group2_id, "", "/g30/g1/g31/g3/g4") < 0) TEST_ERROR
- if(check_name(group_id, "", "/g30/g1/g2") < 0) TEST_ERROR
+ if (check_name(group4_id, "/g33/g7/g8", "") < 0)
+ TEST_ERROR
+ if (check_name(group3_id, "/g30/g1/g31/g3/g32/g5/g6", "/g30/g1/g31/g3/g32/g5/g6") < 0)
+ TEST_ERROR
+ if (check_name(group2_id, "", "/g30/g1/g31/g3/g4") < 0)
+ TEST_ERROR
+ if (check_name(group_id, "", "/g30/g1/g2") < 0)
+ TEST_ERROR
/* Unmount third file */
- if(H5Funmount(file_id, "/g30/g1/g31/g3") < 0) TEST_ERROR
+ if (H5Funmount(file_id, "/g30/g1/g31/g3") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group4_id, "/g33/g7/g8", "") < 0) TEST_ERROR
- if(check_name(group3_id, "/g32/g5/g6", "") < 0) TEST_ERROR
- if(check_name(group2_id, "/g30/g1/g31/g3/g4", "/g30/g1/g31/g3/g4") < 0) TEST_ERROR
- if(check_name(group_id, "", "/g30/g1/g2") < 0) TEST_ERROR
+ if (check_name(group4_id, "/g33/g7/g8", "") < 0)
+ TEST_ERROR
+ if (check_name(group3_id, "/g32/g5/g6", "") < 0)
+ TEST_ERROR
+ if (check_name(group2_id, "/g30/g1/g31/g3/g4", "/g30/g1/g31/g3/g4") < 0)
+ TEST_ERROR
+ if (check_name(group_id, "", "/g30/g1/g2") < 0)
+ TEST_ERROR
/* Unmount second file */
- if(H5Funmount(file_id, "/g30/g1") < 0) TEST_ERROR
+ if (H5Funmount(file_id, "/g30/g1") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group4_id, "/g33/g7/g8", "") < 0) TEST_ERROR
- if(check_name(group3_id, "/g32/g5/g6", "") < 0) TEST_ERROR
- if(check_name(group2_id, "/g31/g3/g4", "") < 0) TEST_ERROR
- if(check_name(group_id, "/g30/g1/g2", "/g30/g1/g2") < 0) TEST_ERROR
+ if (check_name(group4_id, "/g33/g7/g8", "") < 0)
+ TEST_ERROR
+ if (check_name(group3_id, "/g32/g5/g6", "") < 0)
+ TEST_ERROR
+ if (check_name(group2_id, "/g31/g3/g4", "") < 0)
+ TEST_ERROR
+ if (check_name(group_id, "/g30/g1/g2", "/g30/g1/g2") < 0)
+ TEST_ERROR
/* Close groups */
H5Gclose(group_id);
@@ -2077,166 +2686,230 @@ test_main(hid_t file_id, hid_t fapl)
PASSED();
-
-/*-------------------------------------------------------------------------
- * Test H5Iget_name with multiple hard links and mounted files
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with multiple hard links and mounted files
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with multiple hard links and mounted files");
/* Create second file and group "/g35/g3/g4" in it */
- if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+ if ((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
- if((group_id = H5Gcreate2(file1_id, "/g35", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file1_id, "/g35/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file1_id, "/g35/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file1_id, "/g35", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file1_id, "/g35/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file1_id, "/g35/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
/* Create group "/g34/g1/g2" in first file */
- if((group_id = H5Gcreate2(file_id, "/g34", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "/g34/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file_id, "/g34/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g34", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "/g34/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file_id, "/g34/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create hard link to "/g34/g1/g2 group */
- if(H5Lcreate_hard(file_id, "/g34/g1/g2", H5L_SAME_LOC, "/g34/g2a", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Lcreate_hard(file_id, "/g34/g1/g2", H5L_SAME_LOC, "/g34/g2a", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "/g34/g1/g2", "/g34/g1/g2") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g34/g1/g2", "/g34/g1/g2") < 0)
+ TEST_ERROR
/* Open the link to the group */
- if((group4_id = H5Gopen2(file_id, "/g34/g2a", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group4_id = H5Gopen2(file_id, "/g34/g2a", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0) TEST_ERROR
+ if (check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0)
+ TEST_ERROR
/* Mount second file under "/g34/g1" in the first file */
- if(H5Fmount(file_id, "/g34/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Fmount(file_id, "/g34/g1", file1_id, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "", "/g34/g1/g2") < 0) TEST_ERROR
- if(check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0) TEST_ERROR
+ if (check_name(group3_id, "", "/g34/g1/g2") < 0)
+ TEST_ERROR
+ if (check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0)
+ TEST_ERROR
/* Unmount second file */
- if(H5Funmount(file_id, "/g34/g1") < 0) FAIL_STACK_ERROR
+ if (H5Funmount(file_id, "/g34/g1") < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group3_id, "/g34/g1/g2", "/g34/g1/g2") < 0) TEST_ERROR
- if(check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0) TEST_ERROR
+ if (check_name(group3_id, "/g34/g1/g2", "/g34/g1/g2") < 0)
+ TEST_ERROR
+ if (check_name(group4_id, "/g34/g2a", "/g34/g2a") < 0)
+ TEST_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group4_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file1_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
- /*-------------------------------------------------------------------------
- * Test H5Iget_name with mounted files and unlinking
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with mounted files and unlinking
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with mounted files and unlinking");
/* Create group "/g36/g1/g2" in first file */
- if((group_id = H5Gcreate2(file_id, "/g36", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file_id, "/g36/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file_id, "/g36/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file_id, "/g36", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file_id, "/g36/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file_id, "/g36/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
/* Create second file and group "/g37/g4" in it */
- if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+ if ((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
- if((group_id = H5Gcreate2(file1_id, "/g37", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file1_id, "/g37/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file1_id, "/g37/g4/g5a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group4_id = H5Gcreate2(file1_id, "/g37/g4/g5b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file1_id, "/g37", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file1_id, "/g37/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file1_id, "/g37/g4/g5a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group4_id = H5Gcreate2(file1_id, "/g37/g4/g5b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Mount second file under "/g36/g1" in the first file */
- if(H5Fmount(file_id, "/g36/g1", file1_id, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Fmount(file_id, "/g36/g1", file1_id, H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Open group in mounted file */
- if((group5_id = H5Gopen2(file_id, "/g36/g1/g37/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group5_id = H5Gopen2(file_id, "/g36/g1/g37/", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group5_id, "/g36/g1/g37", "/g36/g1/g37") < 0) TEST_ERROR
+ if (check_name(group5_id, "/g36/g1/g37", "/g36/g1/g37") < 0)
+ TEST_ERROR
/* Open group to delete in mounted file */
- if((group6_id = H5Gopen2(file_id, "/g36/g1/g37/g4/g5a", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group6_id = H5Gopen2(file_id, "/g36/g1/g37/g4/g5a", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group6_id, "/g36/g1/g37/g4/g5a", "/g36/g1/g37/g4/g5a") < 0) TEST_ERROR
+ if (check_name(group6_id, "/g36/g1/g37/g4/g5a", "/g36/g1/g37/g4/g5a") < 0)
+ TEST_ERROR
/* Delete end group in mounted file, using relative paths */
- if(H5Ldelete(group5_id, "g4/g5a", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Ldelete(group5_id, "g4/g5a", H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group6_id, "", "") < 0) TEST_ERROR
- if(check_name(group3_id, "", "") < 0) TEST_ERROR
+ if (check_name(group6_id, "", "") < 0)
+ TEST_ERROR
+ if (check_name(group3_id, "", "") < 0)
+ TEST_ERROR
/* Close deleted group */
- if(H5Gclose(group6_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group6_id) < 0)
+ FAIL_STACK_ERROR
/* Open groups to delete in mounted file */
- if((group6_id = H5Gopen2(file_id, "/g36/g1/g37/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group7_id = H5Gopen2(file_id, "/g36/g1/g37/g4/g5b", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group6_id = H5Gopen2(file_id, "/g36/g1/g37/g4", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group7_id = H5Gopen2(file_id, "/g36/g1/g37/g4/g5b", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group6_id, "/g36/g1/g37/g4", "/g36/g1/g37/g4") < 0) TEST_ERROR
- if(check_name(group7_id, "/g36/g1/g37/g4/g5b", "/g36/g1/g37/g4/g5b") < 0) TEST_ERROR
+ if (check_name(group6_id, "/g36/g1/g37/g4", "/g36/g1/g37/g4") < 0)
+ TEST_ERROR
+ if (check_name(group7_id, "/g36/g1/g37/g4/g5b", "/g36/g1/g37/g4/g5b") < 0)
+ TEST_ERROR
/* Delete middle group in mounted file, using relative paths */
- if(H5Ldelete(group5_id, "g4", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
+ if (H5Ldelete(group5_id, "g4", H5P_DEFAULT) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group6_id, "", "") < 0) TEST_ERROR
- if(check_name(group2_id, "", "") < 0) TEST_ERROR
- if(check_name(group7_id, "", "") < 0) TEST_ERROR
- if(check_name(group4_id, "", "") < 0) TEST_ERROR
+ if (check_name(group6_id, "", "") < 0)
+ TEST_ERROR
+ if (check_name(group2_id, "", "") < 0)
+ TEST_ERROR
+ if (check_name(group7_id, "", "") < 0)
+ TEST_ERROR
+ if (check_name(group4_id, "", "") < 0)
+ TEST_ERROR
/* Close deleted groups */
- if(H5Gclose(group6_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group7_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group6_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group7_id) < 0)
+ FAIL_STACK_ERROR
/* Close group in mounted file */
- if(H5Gclose(group5_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group5_id) < 0)
+ FAIL_STACK_ERROR
- if(H5Funmount(file_id, "/g36/g1") < 0) FAIL_STACK_ERROR
+ if (H5Funmount(file_id, "/g36/g1") < 0)
+ FAIL_STACK_ERROR
/* Close */
- if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR
- if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR
- if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR
+ if (H5Gclose(group_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group2_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group3_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Gclose(group4_id) < 0)
+ FAIL_STACK_ERROR
+ if (H5Fclose(file1_id) < 0)
+ FAIL_STACK_ERROR
PASSED();
-
-/*-------------------------------------------------------------------------
- * Test H5Iget_name with mounting already mounted files
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with mounting already mounted files
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with mounting already mounted files");
/* Create file and group "/g38/g1/g2" in it */
- if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+ if ((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
- if((group_id = H5Gcreate2(file1_id, "/g38", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file1_id, "/g38/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file1_id, "/g38/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file1_id, "/g38", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file1_id, "/g38/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file1_id, "/g38/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
H5Gclose(group_id);
@@ -2244,11 +2917,15 @@ test_main(hid_t file_id, hid_t fapl)
H5Gclose(group3_id);
/* Create second file and group "/g39/g1/g2" in it */
- if((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+ if ((file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
- if((group_id = H5Gcreate2(file2_id, "/g39", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file2_id, "/g39/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file2_id, "/g39/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file2_id, "/g39", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file2_id, "/g39/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file2_id, "/g39/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
H5Gclose(group_id);
@@ -2256,11 +2933,15 @@ test_main(hid_t file_id, hid_t fapl)
H5Gclose(group3_id);
/* Create third file and group "/g40/g5/g6" in it */
- if((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
+ if ((file3_id = H5Fcreate(filename3, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ FAIL_STACK_ERROR
- if((group_id = H5Gcreate2(file3_id, "/g40", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file3_id, "/g40/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file3_id, "/g40/g5/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file3_id, "/g40", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file3_id, "/g40/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file3_id, "/g40/g5/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
H5Gclose(group_id);
@@ -2268,34 +2949,46 @@ test_main(hid_t file_id, hid_t fapl)
H5Gclose(group3_id);
/* Mount second file under "/g38/g1" in the first file */
- if(H5Fmount(file1_id, "/g38/g1", file2_id, H5P_DEFAULT) < 0) TEST_ERROR
+ if (H5Fmount(file1_id, "/g38/g1", file2_id, H5P_DEFAULT) < 0)
+ TEST_ERROR
- if((group_id = H5Gopen2(file1_id, "/g38/g1/g39/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(file1_id, "/g38/g1/g39/g3/g4", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g38/g1/g39/g3/g4", "/g38/g1/g39/g3/g4") < 0) TEST_ERROR
+ if (check_name(group_id, "/g38/g1/g39/g3/g4", "/g38/g1/g39/g3/g4") < 0)
+ TEST_ERROR
/* Mount first file under "/g40/g5" in the third file */
- if(H5Fmount(file3_id, "/g40/g5", file1_id, H5P_DEFAULT) < 0) TEST_ERROR
+ if (H5Fmount(file3_id, "/g40/g5", file1_id, H5P_DEFAULT) < 0)
+ TEST_ERROR
- if((group2_id = H5Gopen2(file3_id, "/g40/g5/g38/g1/g39/g3/g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group2_id = H5Gopen2(file3_id, "/g40/g5/g38/g1/g39/g3/g4", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g40/g5/g38/g1/g39/g3/g4", "/g40/g5/g38/g1/g39/g3/g4") < 0) TEST_ERROR
- if(check_name(group_id, "/g38/g1/g39/g3/g4", "/g38/g1/g39/g3/g4") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g40/g5/g38/g1/g39/g3/g4", "/g40/g5/g38/g1/g39/g3/g4") < 0)
+ TEST_ERROR
+ if (check_name(group_id, "/g38/g1/g39/g3/g4", "/g38/g1/g39/g3/g4") < 0)
+ TEST_ERROR
/* Unmount first file */
- if(H5Funmount(file3_id, "/g40/g5") < 0) TEST_ERROR
+ if (H5Funmount(file3_id, "/g40/g5") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group2_id, "/g38/g1/g39/g3/g4", "") < 0) TEST_ERROR
- if(check_name(group_id, "/g38/g1/g39/g3/g4", "/g38/g1/g39/g3/g4") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g38/g1/g39/g3/g4", "") < 0)
+ TEST_ERROR
+ if (check_name(group_id, "/g38/g1/g39/g3/g4", "/g38/g1/g39/g3/g4") < 0)
+ TEST_ERROR
/* Unmount second file */
- if(H5Funmount(file1_id, "/g38/g1") < 0) TEST_ERROR
+ if (H5Funmount(file1_id, "/g38/g1") < 0)
+ TEST_ERROR
/* Verify */
- if(check_name(group_id, "/g39/g3/g4", "") < 0) TEST_ERROR
+ if (check_name(group_id, "/g39/g3/g4", "") < 0)
+ TEST_ERROR
/* Close */
H5Gclose(group_id);
@@ -2306,19 +2999,22 @@ test_main(hid_t file_id, hid_t fapl)
PASSED();
-/*-------------------------------------------------------------------------
- * Test H5Iget_name with opening object in unmounted file
- *-------------------------------------------------------------------------
- */
+ /*-------------------------------------------------------------------------
+ * Test H5Iget_name with opening object in unmounted file
+ *-------------------------------------------------------------------------
+ */
TESTING("H5Iget_name with opening object in unmounted file");
/* Create file and group "/g39/g1/g2" in it */
file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
- if((group_id = H5Gcreate2(file1_id, "/g41", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file1_id, "/g41/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file1_id, "/g41/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file1_id, "/g41", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file1_id, "/g41/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file1_id, "/g41/g1/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
H5Gclose(group_id);
@@ -2328,9 +3024,12 @@ test_main(hid_t file_id, hid_t fapl)
/* Create second file and group "/g42/g1/g2" in it */
file2_id = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
- if((group_id = H5Gcreate2(file2_id, "/g42", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group2_id = H5Gcreate2(file2_id, "/g42/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((group3_id = H5Gcreate2(file2_id, "/g42/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gcreate2(file2_id, "/g42", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group2_id = H5Gcreate2(file2_id, "/g42/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
+ if ((group3_id = H5Gcreate2(file2_id, "/g42/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Close */
H5Gclose(group_id);
@@ -2338,20 +3037,26 @@ test_main(hid_t file_id, hid_t fapl)
H5Gclose(group3_id);
/* Mount second file under "/g41/g1" in the first file */
- if(H5Fmount(file1_id, "/g41/g1", file2_id, H5P_DEFAULT) < 0) TEST_ERROR
+ if (H5Fmount(file1_id, "/g41/g1", file2_id, H5P_DEFAULT) < 0)
+ TEST_ERROR
- if((group_id = H5Gopen2(file1_id, "/g41/g1/g42/g3", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group_id = H5Gopen2(file1_id, "/g41/g1/g42/g3", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group_id, "/g41/g1/g42/g3", "/g41/g1/g42/g3") < 0) TEST_ERROR
+ if (check_name(group_id, "/g41/g1/g42/g3", "/g41/g1/g42/g3") < 0)
+ TEST_ERROR
/* Unmount file */
- if(H5Funmount(file1_id, "/g41/g1") < 0) TEST_ERROR
+ if (H5Funmount(file1_id, "/g41/g1") < 0)
+ TEST_ERROR
- if((group2_id = H5Gopen2(group_id, "g4", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group2_id = H5Gopen2(group_id, "g4", H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Verify */
- if(check_name(group2_id, "/g42/g3/g4", "") < 0) TEST_ERROR
+ if (check_name(group2_id, "/g42/g3/g4", "") < 0)
+ TEST_ERROR
/* Close */
H5Gclose(group_id);
@@ -2368,346 +3073,414 @@ test_main(hid_t file_id, hid_t fapl)
TESTING("H5Iget_name with anonymous datatypes");
/* Commit the type anonymously and link it in */
- if((dtype = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR
+ if ((dtype = H5Tcopy(H5T_NATIVE_INT)) < 0)
+ TEST_ERROR
/* Test H5Iget_name with created datatype, should fail because not committed */
- H5E_BEGIN_TRY {
- if((size = H5Iget_name(dtype, NULL, 0)) >= 0) TEST_ERROR
- } H5E_END_TRY;
+ H5E_BEGIN_TRY
+ {
+ if ((size = H5Iget_name(dtype, NULL, 0)) >= 0)
+ TEST_ERROR
+ }
+ H5E_END_TRY;
+
+ if (H5Tcommit_anon(file2_id, dtype, H5P_DEFAULT, H5P_DEFAULT))
+ TEST_ERROR
- if(H5Tcommit_anon(file2_id, dtype, H5P_DEFAULT, H5P_DEFAULT)) TEST_ERROR
-
/* Test H5Iget_name with anonymously created datatype, should pass because committed */
- if((size = H5Iget_name(dtype, NULL, 0)) != 0) TEST_ERROR
+ if ((size = H5Iget_name(dtype, NULL, 0)) != 0)
+ TEST_ERROR
/* Create a link to the object */
- if( H5Olink(dtype, file2_id, "datatype", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if (H5Olink(dtype, file2_id, "datatype", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR
/* Commit a second datatype with no links to it and commit it */
- if((dtype_anon = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR
- if(H5Tcommit_anon(file2_id, dtype_anon, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
+ if ((dtype_anon = H5Tcopy(H5T_NATIVE_INT)) < 0)
+ TEST_ERROR
+ if (H5Tcommit_anon(file2_id, dtype_anon, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ TEST_ERROR
/* Test H5Iget_name with anonymously created datatype, should pass because committed */
- if((size = H5Iget_name(dtype_anon, NULL,0)) != 0) TEST_ERROR
+ if ((size = H5Iget_name(dtype_anon, NULL, 0)) != 0)
+ TEST_ERROR
/* Store the address of the datatype for later use */
- if(H5Oget_info(dtype_anon, &oinfo) < 0) TEST_ERROR
+ if (H5Oget_info(dtype_anon, &oinfo) < 0)
+ TEST_ERROR
/* Update the reference count to dtype_anon to preserve the datatype */
- if(H5Oincr_refcount(dtype_anon) < 0) TEST_ERROR
+ if (H5Oincr_refcount(dtype_anon) < 0)
+ TEST_ERROR
- if(H5Tclose(dtype) < 0) TEST_ERROR
- if(H5Tclose(dtype_anon) < 0) TEST_ERROR
- if(H5Fclose(file2_id) < 0) TEST_ERROR
+ if (H5Tclose(dtype) < 0)
+ TEST_ERROR
+ if (H5Tclose(dtype_anon) < 0)
+ TEST_ERROR
+ if (H5Fclose(file2_id) < 0)
+ TEST_ERROR
/* Re-open the file and check that the anonymous datatypes persist */
- if( (file2_id = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
+ if ((file2_id = H5Fopen(filename2, H5F_ACC_RDONLY, fapl)) < 0)
+ TEST_ERROR
/* Check the H5Iget_name does not return an error for anon committed datatypes */
- if((dtype_anon = H5Oopen_by_addr(file2_id, oinfo.addr)) < 0) TEST_ERROR
+ if ((dtype_anon = H5Oopen_by_addr(file2_id, oinfo.addr)) < 0)
+ TEST_ERROR
- if((size = H5Iget_name(dtype_anon,NULL,0)) != 0) TEST_ERROR
+ if ((size = H5Iget_name(dtype_anon, NULL, 0)) != 0)
+ TEST_ERROR
- if(H5Tclose(dtype_anon) < 0) TEST_ERROR
- if(H5Fclose(file2_id) < 0) TEST_ERROR
+ if (H5Tclose(dtype_anon) < 0)
+ TEST_ERROR
+ if (H5Fclose(file2_id) < 0)
+ TEST_ERROR
PASSED();
- return(0);
+ return (0);
error:
- return(1);
+ return (1);
}
static int
test_obj_ref(hid_t fapl)
{
- char filename1[1024];
- char filename2[1024];
- hid_t fid1, fid2; /* HDF5 File IDs */
- hid_t dataset, dataset2; /* Dataset ID */
- hid_t group, group2; /* Group ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1; /* Datatype ID */
- hsize_t dims1[] = {SPACE1_DIM1};
- hobj_ref_t wbuf[SPACE1_DIM1]; /* Buffer to write to disk */
- int tu32[SPACE1_DIM1]; /* Int data */
- int i; /* counting variables */
- char buf[100];
+ char filename1[1024];
+ char filename2[1024];
+ hid_t fid1, fid2; /* HDF5 File IDs */
+ hid_t dataset, dataset2; /* Dataset ID */
+ hid_t group, group2; /* Group ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1; /* Datatype ID */
+ hsize_t dims1[] = {SPACE1_DIM1};
+ hobj_ref_t wbuf[SPACE1_DIM1]; /* Buffer to write to disk */
+ int tu32[SPACE1_DIM1]; /* Int data */
+ ssize_t namelen; /* Length of the name */
+ int i; /* counting variables */
+ char buf[100];
/* Initialize the file names */
h5_fixname(FILENAME[1], fapl, filename1, sizeof filename1);
h5_fixname(FILENAME[2], fapl, filename2, sizeof filename2);
/* Create files */
- if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ if ((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
- if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ if ((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
/* Create dataspace for datasets */
- if((sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL)) < 0)
+ if ((sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL)) < 0)
FAIL_STACK_ERROR
/* Create a group */
- if((group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group = H5Gcreate2(fid1, "Group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create a single dataset inside the second file, which will be mounted
* and used to mask objects in the first file */
- if((dataset = H5Dcreate2(fid2, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if ((dataset = H5Dcreate2(fid2, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
+ 0)
FAIL_STACK_ERROR
- if(H5Dclose(dataset) < 0)
+ if (H5Dclose(dataset) < 0)
FAIL_STACK_ERROR
/* Create a dataset(inside Group1) */
- if((dataset = H5Dcreate2(group, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if ((dataset =
+ H5Dcreate2(group, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Initialize data buffer */
- for(i = 0; i < SPACE1_DIM1; i++)
+ for (i = 0; i < SPACE1_DIM1; i++)
tu32[i] = i * 3;
/* Write selection to disk */
- if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, tu32) < 0)
+ if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, tu32) < 0)
FAIL_STACK_ERROR
/* Close Dataset */
- if(H5Dclose(dataset) < 0)
+ if (H5Dclose(dataset) < 0)
FAIL_STACK_ERROR
/* Create another dataset(inside Group1) */
- if((dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if ((dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT,
+ H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Close Dataset */
- if(H5Dclose(dataset) < 0)
+ if (H5Dclose(dataset) < 0)
FAIL_STACK_ERROR
/* Create a datatype to refer to */
- if((tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0)
+ if ((tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0)
FAIL_STACK_ERROR
/* Insert fields */
- if(H5Tinsert(tid1, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0)
+ if (H5Tinsert(tid1, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0)
FAIL_STACK_ERROR
- if(H5Tinsert(tid1, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0)
+ if (H5Tinsert(tid1, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0)
FAIL_STACK_ERROR
- if(H5Tinsert(tid1, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT) < 0)
+ if (H5Tinsert(tid1, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT) < 0)
FAIL_STACK_ERROR
/* Save datatype for later */
- if(H5Tcommit2(group, "Datatype1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
+ if (H5Tcommit2(group, "Datatype1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
/* Close datatype */
- if(H5Tclose(tid1) < 0)
+ if (H5Tclose(tid1) < 0)
FAIL_STACK_ERROR
/* Create a new group in group1 */
- if((group2 = H5Gcreate2(group, "Group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if ((group2 = H5Gcreate2(group, "Group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ FAIL_STACK_ERROR
/* Create a hard link to group1 in group2 */
- if(H5Lcreate_hard(fid1, "/Group1", H5L_SAME_LOC, "/Group1/Group2/Link", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ if (H5Lcreate_hard(fid1, "/Group1", H5L_SAME_LOC, "/Group1/Group2/Link", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
/* Create dataset in that group */
- if((dataset = H5Dcreate2(group2, "Dataset4", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if ((dataset = H5Dcreate2(group2, "Dataset4", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT,
+ H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Close Dataset */
- if(H5Dclose(dataset) < 0)
+ if (H5Dclose(dataset) < 0)
FAIL_STACK_ERROR
/* Close group */
- if(H5Gclose(group) < 0)
+ if (H5Gclose(group) < 0)
FAIL_STACK_ERROR
- if(H5Gclose(group2) < 0)
+ if (H5Gclose(group2) < 0)
FAIL_STACK_ERROR
/* Open up that hard link and make a new dataset there */
- if((group = H5Gopen2(fid1, "/Group1/Group2/Link", H5P_DEFAULT)) < 0)
+ if ((group = H5Gopen2(fid1, "/Group1/Group2/Link", H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
- if((dataset = H5Dcreate2(group, "Dataset5", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if ((dataset = H5Dcreate2(group, "Dataset5", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT,
+ H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
- if(H5Dclose(dataset) < 0)
+ if (H5Dclose(dataset) < 0)
FAIL_STACK_ERROR
- if(H5Gclose(group) < 0)
+ if (H5Gclose(group) < 0)
FAIL_STACK_ERROR
-
/* Create a dataset to store references */
- if((dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if ((dataset =
+ H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Create reference to dataset */
- if(H5Rcreate(&wbuf[0], fid1, "/Dataset3", H5R_OBJECT, (hid_t)-1) < 0)
+ if (H5Rcreate(&wbuf[0], fid1, "/Dataset3", H5R_OBJECT, (hid_t)-1) < 0)
FAIL_STACK_ERROR
/* Create reference to dataset */
- if(H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)-1) < 0)
+ if (H5Rcreate(&wbuf[1], fid1, "/Group1/Dataset2", H5R_OBJECT, (hid_t)-1) < 0)
FAIL_STACK_ERROR
/* Create reference to group */
- if(H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, (hid_t)-1) < 0)
+ if (H5Rcreate(&wbuf[2], fid1, "/Group1", H5R_OBJECT, (hid_t)-1) < 0)
FAIL_STACK_ERROR
/* Create reference to named datatype */
- if(H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1) < 0)
+ if (H5Rcreate(&wbuf[3], fid1, "/Group1/Datatype1", H5R_OBJECT, (hid_t)-1) < 0)
FAIL_STACK_ERROR
- if(H5Rcreate(&wbuf[4], fid1, "/Group1/Group2/Dataset4", H5R_OBJECT, (hid_t)-1) < 0)
+ if (H5Rcreate(&wbuf[4], fid1, "/Group1/Group2/Dataset4", H5R_OBJECT, (hid_t)-1) < 0)
FAIL_STACK_ERROR
- if(H5Rcreate(&wbuf[5], fid1, "/Group1/Group2", H5R_OBJECT, (hid_t)-1) < 0)
+ if (H5Rcreate(&wbuf[5], fid1, "/Group1/Group2", H5R_OBJECT, (hid_t)-1) < 0)
FAIL_STACK_ERROR
- if(H5Rcreate(&wbuf[6], fid1, "/Group1/Group2/Link/Dataset5", H5R_OBJECT, (hid_t)-1) < 0)
+ if (H5Rcreate(&wbuf[6], fid1, "/Group1/Group2/Link/Dataset5", H5R_OBJECT, (hid_t)-1) < 0)
FAIL_STACK_ERROR
/* Create reference to root group */
- if(H5Rcreate(&wbuf[7], fid1, "/", H5R_OBJECT, (hid_t)-1) < 0)
+ if (H5Rcreate(&wbuf[7], fid1, "/", H5R_OBJECT, (hid_t)-1) < 0)
FAIL_STACK_ERROR
/* Write selection to disk */
- if(H5Dwrite(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0)
+ if (H5Dwrite(dataset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0)
FAIL_STACK_ERROR
TESTING("getting path to normal dataset in root group");
- if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[0])) < 0) FAIL_STACK_ERROR
- *buf = '\0';
- i = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
- if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
- if(!((HDstrcmp(buf, "/Dataset3") == 0) &&(i == 9))) TEST_ERROR
+ if ((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[0])) < 0)
+ FAIL_STACK_ERROR
+ *buf = '\0';
+ namelen = H5Iget_name(dataset2, (char *)buf, sizeof(buf));
+ if (H5Dclose(dataset2) < 0)
+ FAIL_STACK_ERROR
+ if (!((HDstrcmp(buf, "/Dataset3") == 0) && (namelen == 9)))
+ TEST_ERROR
*buf = '\0';
- i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], (char*)buf, sizeof(buf));
- if(!((HDstrcmp(buf, "/Dataset3") == 0) &&(i == 9))) TEST_ERROR
+
+ namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[0], (char *)buf, sizeof(buf));
+ if (!((HDstrcmp(buf, "/Dataset3") == 0) && (namelen == 9)))
+ TEST_ERROR
PASSED()
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to dataset in /Group1");
- if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[1])) < 0) FAIL_STACK_ERROR
- *buf = '\0';
- i = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
- if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
- if(!((HDstrcmp(buf, "/Group1/Dataset2") == 0) &&(i == 16))) TEST_ERROR
- *buf = '\0';
- i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[1], (char*)buf, sizeof(buf));
- if(!((HDstrcmp(buf, "/Group1/Dataset2") == 0) &&(i == 16))) TEST_ERROR
+ if ((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[1])) < 0)
+ FAIL_STACK_ERROR
+ *buf = '\0';
+ namelen = H5Iget_name(dataset2, (char *)buf, sizeof(buf));
+ if (H5Dclose(dataset2) < 0)
+ FAIL_STACK_ERROR
+ if (!((HDstrcmp(buf, "/Group1/Dataset2") == 0) && (namelen == 16)))
+ TEST_ERROR
+ *buf = '\0';
+ namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[1], (char *)buf, sizeof(buf));
+ if (!((HDstrcmp(buf, "/Group1/Dataset2") == 0) && (namelen == 16)))
+ TEST_ERROR
PASSED()
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to /Group1");
- if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[2])) < 0) FAIL_STACK_ERROR
- *buf = '\0';
- i = H5Iget_name(group, (char*)buf, sizeof(buf));
- if(H5Gclose(group) < 0) FAIL_STACK_ERROR
- if(!((HDstrcmp(buf, "/Group1") == 0) &&(i == 7))) TEST_ERROR
- *buf = '\0';
- i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[2], (char*)buf, sizeof(buf));
- if(!((HDstrcmp(buf, "/Group1") == 0) &&(i == 7))) TEST_ERROR
+ if ((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[2])) < 0)
+ FAIL_STACK_ERROR
+ *buf = '\0';
+ namelen = H5Iget_name(group, (char *)buf, sizeof(buf));
+ if (H5Gclose(group) < 0)
+ FAIL_STACK_ERROR
+ if (!((HDstrcmp(buf, "/Group1") == 0) && (namelen == 7)))
+ TEST_ERROR
+ *buf = '\0';
+ namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[2], (char *)buf, sizeof(buf));
+ if (!((HDstrcmp(buf, "/Group1") == 0) && (namelen == 7)))
+ TEST_ERROR
PASSED()
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to datatype in /Group1");
- if((tid1 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[3])) < 0) FAIL_STACK_ERROR
- *buf = '\0';
- i = H5Iget_name(tid1, (char*)buf, sizeof(buf));
- if(H5Tclose(tid1) < 0) FAIL_STACK_ERROR
- if(!((HDstrcmp(buf, "/Group1/Datatype1") == 0) &&(i == 17))) TEST_ERROR
- *buf = '\0';
- i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[3], (char*)buf, sizeof(buf));
- if(!((HDstrcmp(buf, "/Group1/Datatype1") == 0) &&(i == 17))) TEST_ERROR
+ if ((tid1 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[3])) < 0)
+ FAIL_STACK_ERROR
+ *buf = '\0';
+ namelen = H5Iget_name(tid1, (char *)buf, sizeof(buf));
+ if (H5Tclose(tid1) < 0)
+ FAIL_STACK_ERROR
+ if (!((HDstrcmp(buf, "/Group1/Datatype1") == 0) && (namelen == 17)))
+ TEST_ERROR
+ *buf = '\0';
+ namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[3], (char *)buf, sizeof(buf));
+ if (!((HDstrcmp(buf, "/Group1/Datatype1") == 0) && (namelen == 17)))
+ TEST_ERROR
PASSED()
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to dataset in nested group");
- if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[4])) < 0) FAIL_STACK_ERROR
- *buf = '\0';
- i = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
- if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
- if(!((HDstrcmp(buf, "/Group1/Group2/Dataset4") == 0) &&(i == 23))) TEST_ERROR
- *buf = '\0';
- i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[4], (char*)buf, sizeof(buf));
- if(!((HDstrcmp(buf, "/Group1/Group2/Dataset4") == 0) &&(i == 23))) TEST_ERROR
+ if ((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[4])) < 0)
+ FAIL_STACK_ERROR
+ *buf = '\0';
+ namelen = H5Iget_name(dataset2, (char *)buf, sizeof(buf));
+ if (H5Dclose(dataset2) < 0)
+ FAIL_STACK_ERROR
+ if (!((HDstrcmp(buf, "/Group1/Group2/Dataset4") == 0) && (namelen == 23)))
+ TEST_ERROR
+ *buf = '\0';
+ namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[4], (char *)buf, sizeof(buf));
+ if (!((HDstrcmp(buf, "/Group1/Group2/Dataset4") == 0) && (namelen == 23)))
+ TEST_ERROR
PASSED()
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to nested group");
- if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[5])) < 0) FAIL_STACK_ERROR
- *buf = '\0';
- i = H5Iget_name(group, (char*)buf, sizeof(buf));
- if(H5Gclose(group) < 0) FAIL_STACK_ERROR
- if(!((HDstrcmp(buf, "/Group1/Group2") == 0) &&(i == 14))) TEST_ERROR
- *buf = '\0';
- i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[5], (char*)buf, sizeof(buf));
- if(!((HDstrcmp(buf, "/Group1/Group2") == 0) &&(i == 14))) TEST_ERROR
+ if ((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[5])) < 0)
+ FAIL_STACK_ERROR
+ *buf = '\0';
+ namelen = H5Iget_name(group, (char *)buf, sizeof(buf));
+ if (H5Gclose(group) < 0)
+ FAIL_STACK_ERROR
+ if (!((HDstrcmp(buf, "/Group1/Group2") == 0) && (namelen == 14)))
+ TEST_ERROR
+ *buf = '\0';
+ namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[5], (char *)buf, sizeof(buf));
+ if (!((HDstrcmp(buf, "/Group1/Group2") == 0) && (namelen == 14)))
+ TEST_ERROR
PASSED()
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to dataset created via hard link");
- if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[6])) < 0) FAIL_STACK_ERROR
- *buf = '\0';
- i = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
- if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
- if(!((HDstrcmp(buf, "/Group1/Dataset5") == 0) &&(i == 16))) TEST_ERROR
- *buf = '\0';
- i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[6], (char*)buf, sizeof(buf));
- if(!((HDstrcmp(buf, "/Group1/Dataset5") == 0) &&(i == 16))) TEST_ERROR
+ if ((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[6])) < 0)
+ FAIL_STACK_ERROR
+ *buf = '\0';
+ namelen = H5Iget_name(dataset2, (char *)buf, sizeof(buf));
+ if (H5Dclose(dataset2) < 0)
+ FAIL_STACK_ERROR
+ if (!((HDstrcmp(buf, "/Group1/Dataset5") == 0) && (namelen == 16)))
+ TEST_ERROR
+ *buf = '\0';
+ namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[6], (char *)buf, sizeof(buf));
+ if (!((HDstrcmp(buf, "/Group1/Dataset5") == 0) && (namelen == 16)))
+ TEST_ERROR
PASSED()
HDmemset(buf, 0, sizeof(buf));
TESTING("getting path to root group");
- if((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[7])) < 0) FAIL_STACK_ERROR
- *buf = '\0';
- i = H5Iget_name(group, (char*)buf, sizeof(buf));
- if(H5Gclose(group) < 0) FAIL_STACK_ERROR
- if(!((HDstrcmp(buf, "/") == 0) &&(i == 1))) TEST_ERROR
- *buf = '\0';
- i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[7], (char*)buf, sizeof(buf));
- if(!((HDstrcmp(buf, "/") == 0) &&(i == 1))) TEST_ERROR
+ if ((group = H5Rdereference(dataset, H5R_OBJECT, &wbuf[7])) < 0)
+ FAIL_STACK_ERROR
+ *buf = '\0';
+ namelen = H5Iget_name(group, (char *)buf, sizeof(buf));
+ if (H5Gclose(group) < 0)
+ FAIL_STACK_ERROR
+ if (!((HDstrcmp(buf, "/") == 0) && (namelen == 1)))
+ TEST_ERROR
+ *buf = '\0';
+ namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[7], (char *)buf, sizeof(buf));
+ if (!((HDstrcmp(buf, "/") == 0) && (namelen == 1)))
+ TEST_ERROR
PASSED()
/* Now we mount fid2 at /Group2 and look for dataset4. It shouldn't be found */
- if(H5Fmount(fid1, "/Group1/Group2", fid2, H5P_DEFAULT) < 0)
+ if (H5Fmount(fid1, "/Group1/Group2", fid2, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
TESTING("getting path to dataset hidden by a mounted file");
- if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[4])) < 0) FAIL_STACK_ERROR
- *buf = '\0';
- i = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
- if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
- if(i != 0) TEST_ERROR
- *buf = '\0';
- i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[4], (char*)buf, sizeof(buf));
- if(i != 0) TEST_ERROR
+ if ((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[4])) < 0)
+ FAIL_STACK_ERROR
+ *buf = '\0';
+ namelen = H5Iget_name(dataset2, (char *)buf, sizeof(buf));
+ if (H5Dclose(dataset2) < 0)
+ FAIL_STACK_ERROR
+ if (namelen != 0)
+ TEST_ERROR
+ *buf = '\0';
+ namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[4], (char *)buf, sizeof(buf));
+ if (namelen != 0)
+ TEST_ERROR
PASSED()
/* Now we try unlinking dataset2 from the file and searching for it. It shouldn't be found */
- if((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[1])) < 0)
+ if ((dataset2 = H5Rdereference(dataset, H5R_OBJECT, &wbuf[1])) < 0)
FAIL_STACK_ERROR
- if(H5Ldelete(fid1, "/Group1/Dataset2", H5P_DEFAULT) < 0)
+ if (H5Ldelete(fid1, "/Group1/Dataset2", H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
TESTING("getting path to dataset that has been unlinked");
- *buf = '\0';
- i = H5Iget_name(dataset2, (char*)buf, sizeof(buf));
- if(H5Dclose(dataset2) < 0) FAIL_STACK_ERROR
- if(i != 0) TEST_ERROR
- *buf = '\0';
- i = H5Rget_name(dataset, H5R_OBJECT, &wbuf[1], (char*)buf, sizeof(buf));
- if(i != 0) TEST_ERROR
+ *buf = '\0';
+ namelen = H5Iget_name(dataset2, (char *)buf, sizeof(buf));
+ if (H5Dclose(dataset2) < 0)
+ FAIL_STACK_ERROR
+ if (namelen != 0)
+ TEST_ERROR
+ *buf = '\0';
+ namelen = H5Rget_name(dataset, H5R_OBJECT, &wbuf[1], (char *)buf, sizeof(buf));
+ if (namelen != 0)
+ TEST_ERROR
PASSED()
/* Close disk dataspace */
- if(H5Sclose(sid1) < 0)
+ if (H5Sclose(sid1) < 0)
FAIL_STACK_ERROR
/* Close Dataset */
- if(H5Dclose(dataset) < 0)
+ if (H5Dclose(dataset) < 0)
FAIL_STACK_ERROR
/* Close file */
- if(H5Fclose(fid1) < 0)
+ if (H5Fclose(fid1) < 0)
FAIL_STACK_ERROR
- if(H5Fclose(fid2) < 0)
+ if (H5Fclose(fid2) < 0)
FAIL_STACK_ERROR
return 0;
@@ -2719,51 +3492,53 @@ error:
static int
test_reg_ref(hid_t fapl)
{
- char filename1[1024];
- hid_t file_id; /* file identifier */
- hid_t dsetv_id; /*dataset identifiers*/
- hid_t dsetr_id;
- hid_t space_id, spacer_id;
- hsize_t dims[2] = {2,9};
- hsize_t dimsr[1] = {2};
- int rank = 2;
- int rankr = 1;
+ char filename1[1024];
+ hid_t file_id; /* file identifier */
+ hid_t dsetv_id; /*dataset identifiers*/
+ hid_t dsetr_id;
+ hid_t space_id, spacer_id;
+ hsize_t dims[2] = {2, 9};
+ hsize_t dimsr[1] = {2};
+ int rank = 2;
+ int rankr = 1;
hdset_reg_ref_t ref[2];
hdset_reg_ref_t ref_out[2];
- int data[2][9] = {{1,1,2,3,3,4,5,5,6},{1,2,2,3,4,4,5,6,6}};
- hsize_t start[2];
- hsize_t count[2];
- hsize_t coord[2][3] = {{0, 0, 1}, {6, 0, 8}};
- unsigned num_points = 3;
- ssize_t name_size1, name_size2;
- char buf1[NAME_BUF_SIZE], buf2[NAME_BUF_SIZE];
+ int data[2][9] = {{1, 1, 2, 3, 3, 4, 5, 5, 6}, {1, 2, 2, 3, 4, 4, 5, 6, 6}};
+ hsize_t start[2];
+ hsize_t count[2];
+ hsize_t coord[2][3] = {{0, 0, 1}, {6, 0, 8}};
+ unsigned num_points = 3;
+ ssize_t name_size1, name_size2;
+ char buf1[NAME_BUF_SIZE], buf2[NAME_BUF_SIZE];
/* Initialize the file name */
h5_fixname(FILENAME[1], fapl, filename1, sizeof filename1);
/* Create file with default file create property but vfd access property. */
- if((file_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- TEST_ERROR
+ if ((file_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
/* Create dataspace for datasets */
- if((space_id = H5Screate_simple(rank, dims, NULL)) < 0)
- TEST_ERROR
- if((spacer_id = H5Screate_simple(rankr, dimsr, NULL)) < 0)
- TEST_ERROR
+ if ((space_id = H5Screate_simple(rank, dims, NULL)) < 0)
+ TEST_ERROR
+ if ((spacer_id = H5Screate_simple(rankr, dimsr, NULL)) < 0)
+ TEST_ERROR
/* Create integer dataset */
- if((dsetv_id = H5Dcreate2(file_id, REFREG_DSETNAMEV, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ if ((dsetv_id = H5Dcreate2(file_id, REFREG_DSETNAMEV, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT,
+ H5P_DEFAULT)) < 0)
+ TEST_ERROR
- /* Write data to the dataset */
- if(H5Dwrite(dsetv_id, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT, data) < 0)
- TEST_ERROR
- if(H5Dclose(dsetv_id) < 0)
- TEST_ERROR
+ /* Write data to the dataset */
+ if (H5Dwrite(dsetv_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0)
+ TEST_ERROR
+ if (H5Dclose(dsetv_id) < 0)
+ TEST_ERROR
/* Dataset with references */
- if((dsetr_id = H5Dcreate2(file_id, REFREG_DSETNAMER, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ if ((dsetr_id = H5Dcreate2(file_id, REFREG_DSETNAMER, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT,
+ H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ TEST_ERROR
/*
* Create a reference to the hyperslab.
@@ -2772,50 +3547,50 @@ test_reg_ref(hid_t fapl)
start[1] = 3;
count[0] = 2;
count[1] = 3;
- if(H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
- TEST_ERROR
- if(H5Rcreate(&ref[0], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id) < 0)
- TEST_ERROR
+ if (H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
+ TEST_ERROR
+ if (H5Rcreate(&ref[0], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id) < 0)
+ TEST_ERROR
/* Create a reference to elements selection */
- if(H5Sselect_none(space_id) < 0)
- TEST_ERROR
- if(H5Sselect_elements(space_id, H5S_SELECT_SET, num_points, (const hsize_t *)coord) < 0)
- TEST_ERROR
- if(H5Rcreate(&ref[1], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id) < 0)
- TEST_ERROR
+ if (H5Sselect_none(space_id) < 0)
+ TEST_ERROR
+ if (H5Sselect_elements(space_id, H5S_SELECT_SET, num_points, (const hsize_t *)coord) < 0)
+ TEST_ERROR
+ if (H5Rcreate(&ref[1], file_id, REFREG_DSETNAMEV, H5R_DATASET_REGION, space_id) < 0)
+ TEST_ERROR
/* Write dataset with the references */
- if(H5Dwrite(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref) < 0)
- TEST_ERROR
+ if (H5Dwrite(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref) < 0)
+ TEST_ERROR
/* Close all objects */
- if(H5Sclose(space_id) < 0)
- TEST_ERROR
- if(H5Sclose(spacer_id) < 0)
- TEST_ERROR
- if(H5Dclose(dsetr_id) < 0)
- TEST_ERROR
- if(H5Fclose(file_id) < 0)
- TEST_ERROR
-
+ if (H5Sclose(space_id) < 0)
+ TEST_ERROR
+ if (H5Sclose(spacer_id) < 0)
+ TEST_ERROR
+ if (H5Dclose(dsetr_id) < 0)
+ TEST_ERROR
+ if (H5Fclose(file_id) < 0)
+ TEST_ERROR
/* Reopen the file to read selections back */
- if((file_id = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0)
- TEST_ERROR
+ if ((file_id = H5Fopen(filename1, H5F_ACC_RDWR, fapl)) < 0)
+ TEST_ERROR
/* Reopen the dataset with object references and read references to the buffer */
- if((dsetr_id = H5Dopen2(file_id, REFREG_DSETNAMER, H5P_DEFAULT)) < 0)
- TEST_ERROR
+ if ((dsetr_id = H5Dopen2(file_id, REFREG_DSETNAMER, H5P_DEFAULT)) < 0)
+ TEST_ERROR
- if(H5Dread(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_out) < 0)
- TEST_ERROR
+ if (H5Dread(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_out) < 0)
+ TEST_ERROR
/* Get name of the dataset the first region reference points to using H5Rget_name */
TESTING("H5Rget_name to get name from region reference(hyperslab)");
- *buf1 = '\0';
- name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], (char*)buf1, NAME_BUF_SIZE);
- if(!((HDstrcmp(buf1, "/MATRIX") == 0) &&(name_size1 == 7))) TEST_ERROR
+ *buf1 = '\0';
+ name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], (char *)buf1, NAME_BUF_SIZE);
+ if (!((HDstrcmp(buf1, "/MATRIX") == 0) && (name_size1 == 7)))
+ TEST_ERROR
PASSED()
TESTING("H5Iget_name to get name from region reference(hyperslab)");
@@ -2824,39 +3599,45 @@ test_reg_ref(hid_t fapl)
dsetv_id = H5Rdereference(dsetr_id, H5R_DATASET_REGION, &ref_out[0]);
/* Get name of the dataset the first region reference points using H5Iget_name */
- *buf2 = '\0';
- name_size2 = H5Iget_name(dsetv_id, (char*)buf2, NAME_BUF_SIZE);
- if(!((HDstrcmp(buf2, "/MATRIX") == 0) &&(name_size2 == 7))) TEST_ERROR
+ *buf2 = '\0';
+ name_size2 = H5Iget_name(dsetv_id, (char *)buf2, NAME_BUF_SIZE);
+ if (!((HDstrcmp(buf2, "/MATRIX") == 0) && (name_size2 == 7)))
+ TEST_ERROR
- if(H5Dclose(dsetv_id) < 0) TEST_ERROR
+ if (H5Dclose(dsetv_id) < 0)
+ TEST_ERROR
PASSED()
/* Get name of the dataset the second region reference points to using H5Rget_name */
TESTING("H5Rget_name to get name from region reference(pnt selec)");
- *buf1 = '\0';
- name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[1], (char*)buf1, NAME_BUF_SIZE);
- if(!((HDstrcmp(buf1, "/MATRIX") == 0) &&(name_size1 == 7))) TEST_ERROR
+ *buf1 = '\0';
+ name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[1], (char *)buf1, NAME_BUF_SIZE);
+ if (!((HDstrcmp(buf1, "/MATRIX") == 0) && (name_size1 == 7)))
+ TEST_ERROR
PASSED()
TESTING("H5Iget_name to get name from region reference(pnt selec)");
/* Dereference the second reference */
- if((dsetv_id = H5Rdereference(dsetr_id, H5R_DATASET_REGION, &ref_out[1])) < 0) TEST_ERROR
+ if ((dsetv_id = H5Rdereference(dsetr_id, H5R_DATASET_REGION, &ref_out[1])) < 0)
+ TEST_ERROR
/* Get name of the dataset the first region reference points using H5Iget_name */
- *buf2 = '\0';
- name_size2 = H5Iget_name(dsetv_id, (char*)buf2, NAME_BUF_SIZE);
- if(!((HDstrcmp(buf2, "/MATRIX") == 0) &&(name_size2 == 7))) TEST_ERROR
+ *buf2 = '\0';
+ name_size2 = H5Iget_name(dsetv_id, (char *)buf2, NAME_BUF_SIZE);
+ if (!((HDstrcmp(buf2, "/MATRIX") == 0) && (name_size2 == 7)))
+ TEST_ERROR
- if(H5Dclose(dsetv_id) < 0) TEST_ERROR
+ if (H5Dclose(dsetv_id) < 0)
+ TEST_ERROR
PASSED()
- if(H5Dclose(dsetr_id) < 0)
- TEST_ERROR
- if(H5Fclose(file_id) < 0)
- TEST_ERROR
+ if (H5Dclose(dsetr_id) < 0)
+ TEST_ERROR
+ if (H5Fclose(file_id) < 0)
+ TEST_ERROR
return 0;
@@ -2864,7 +3645,6 @@ error:
return 1;
}
-
/*-------------------------------------------------------------------------
* Function: test_elinks
*
@@ -2883,73 +3663,74 @@ error:
static int
test_elinks(hid_t fapl)
{
- char filename1[1024], filename2[1024]; /* Filenames */
- hid_t fid1, fid2; /* HDF5 File IDs */
- hid_t group, group2; /* Group IDs */
- char name[NAME_BUF_SIZE]; /* Buffer for storing object's name */
- ssize_t namelen; /* Length of object's name */
- hbool_t name_cached; /* Indicate if name is cached */
+ char filename1[1024], filename2[1024]; /* Filenames */
+ hid_t fid1, fid2; /* HDF5 File IDs */
+ hid_t group, group2; /* Group IDs */
+ char name[NAME_BUF_SIZE]; /* Buffer for storing object's name */
+ ssize_t namelen; /* Length of object's name */
+ hbool_t name_cached; /* Indicate if name is cached */
/* Initialize the file names */
h5_fixname(FILENAME[1], fapl, filename1, sizeof filename1);
h5_fixname(FILENAME[2], fapl, filename2, sizeof filename2);
/* Create files */
- if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ if ((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
- if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ if ((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR
/* Create a group in the second file */
- if((group2 = H5Gcreate2(fid2, "Group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if ((group2 = H5Gcreate2(fid2, "Group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Close Group */
- if(H5Gclose(group2) < 0)
+ if (H5Gclose(group2) < 0)
FAIL_STACK_ERROR
/* Create an external link in first file to the group in the second file */
- if(H5Lcreate_external(filename2, "Group2", fid1, "Link_to_Group2", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ if (H5Lcreate_external(filename2, "Group2", fid1, "Link_to_Group2", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
/* Create an external link in second file to the external link in the first file */
- if(H5Lcreate_external(filename1, "Link_to_Group2", fid2, "Link_to_Link_to_Group2", H5P_DEFAULT, H5P_DEFAULT) < 0)
+ if (H5Lcreate_external(filename1, "Link_to_Group2", fid2, "Link_to_Link_to_Group2", H5P_DEFAULT,
+ H5P_DEFAULT) < 0)
FAIL_STACK_ERROR
/* Open the group in thesecond file through the external link */
- if((group = H5Gopen2(fid1, "Link_to_Group2", H5P_DEFAULT)) < 0)
+ if ((group = H5Gopen2(fid1, "Link_to_Group2", H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Query the external link object's name */
- *name = '\0';
+ *name = '\0';
name_cached = FALSE;
- namelen = H5I_get_name_test(group, (char*)name, sizeof(name), &name_cached);
- if(!((HDstrcmp(name, "/Group2") == 0) && (namelen == 7) && name_cached))
+ namelen = H5I_get_name_test(group, (char *)name, sizeof(name), &name_cached);
+ if (!((HDstrcmp(name, "/Group2") == 0) && (namelen == 7) && name_cached))
TEST_ERROR
/* Close Group */
- if(H5Gclose(group) < 0)
+ if (H5Gclose(group) < 0)
FAIL_STACK_ERROR
/* Open the group in the second file through the external link to the external link */
- if((group = H5Gopen2(fid2, "Link_to_Link_to_Group2", H5P_DEFAULT)) < 0)
+ if ((group = H5Gopen2(fid2, "Link_to_Link_to_Group2", H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Query the external link to external link object's name */
- *name = '\0';
+ *name = '\0';
name_cached = FALSE;
- namelen = H5I_get_name_test(group, (char*)name, sizeof(name), &name_cached);
- if(!((HDstrcmp(name, "/Group2") == 0) && (namelen == 7) && name_cached))
+ namelen = H5I_get_name_test(group, (char *)name, sizeof(name), &name_cached);
+ if (!((HDstrcmp(name, "/Group2") == 0) && (namelen == 7) && name_cached))
TEST_ERROR
/* Close Group */
- if(H5Gclose(group) < 0)
+ if (H5Gclose(group) < 0)
FAIL_STACK_ERROR
/* Close files */
- if(H5Fclose(fid1) < 0)
+ if (H5Fclose(fid1) < 0)
FAIL_STACK_ERROR
- if(H5Fclose(fid2) < 0)
+ if (H5Fclose(fid2) < 0)
FAIL_STACK_ERROR
return 0;
@@ -2961,10 +3742,10 @@ error:
int
main(void)
{
- hid_t file_id =(-1);
- int nerrors = 0;
+ hid_t file_id = (-1);
+ int nerrors = 0;
hid_t fapl;
- char filename0[1024];
+ char filename0[1024];
/* Reset the library and get the file access property list */
h5_reset();
@@ -2974,7 +3755,8 @@ main(void)
/* Create a new file_id using default create property but vfd access
* property.
*/
- if((file_id = H5Fcreate(filename0,H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
+ if ((file_id = H5Fcreate(filename0, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ TEST_ERROR
/* Call "main" test routine */
nerrors += test_main(file_id, fapl);
@@ -2988,7 +3770,7 @@ main(void)
/* Verify symbol table messages are cached */
nerrors += (h5_verify_cached_stabs(FILENAME, fapl) < 0 ? 1 : 0);
- if(nerrors)
+ if (nerrors)
goto error;
puts("All getname tests passed.");
@@ -2997,12 +3779,10 @@ main(void)
return 0;
error:
- H5E_BEGIN_TRY {
- H5Fclose(file_id);
- } H5E_END_TRY;
+ H5E_BEGIN_TRY { H5Fclose(file_id); }
+ H5E_END_TRY;
puts("***** GET NAME TESTS FAILED *****");
return 1;
}
-