summaryrefslogtreecommitdiffstats
path: root/test/links.c
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2023-10-12 16:32:23 (GMT)
committerGitHub <noreply@github.com>2023-10-12 16:32:23 (GMT)
commitea3f92605761e1ff17d858df303dc375df7efc1c (patch)
tree716311100f8d0f0dc77bca31245878546952aabc /test/links.c
parent0feda66ff0dccdf77453b7c881c80be244e0ae12 (diff)
downloadhdf5-ea3f92605761e1ff17d858df303dc375df7efc1c.zip
hdf5-ea3f92605761e1ff17d858df303dc375df7efc1c.tar.gz
hdf5-ea3f92605761e1ff17d858df303dc375df7efc1c.tar.bz2
1.14 sync with develop (#3660)
* Rework tools.cmake and add C flags (#3110) * Fix gh pages so that the doxygen files are uploaded (#3102) * Add workspace path * add debug * Make one job so workspace files are available * Put doxygen docs under docs folder in gh-pages * Fix a misc warning in test/vol.c (#3112) The compiler complains about using integers instead of size_t for some sizes. * Remove H5detect and H5make_libsettings (#3104) Removes H5detect and H5make_libsettings from the build and replaces their functionality with things that don't affect cross-compiling. H5detect --> floating-point types are now detected on library load H5make_libsettings --> Moved functionality to a new H5build_settings.c template file * clang-tidy clang-analyzer-core issues addressed (#3113) src/H5system.c:1293:13: warning: Dereference of null pointer [clang-analyzer-core.NullDereference] src/H5trace.c:4048:17: warning: Passed-by-value struct argument contains uninitialized data (e.g., via the field chain: 'initial.user') [clang-analyzer-core.CallAndMessage] * Add note for issue 3056 (#3117) * Use 1.14 toolchain (#3116) * Remove the checkposix script (#3122) This script was used to ensure that all non-HDF5 calls were prefixed with 'HD'. We are removing this scheme so this script is no longer needed. * Remove unused HD macros (#3120) * Remove unused HD macros The library prefixes most C and POSIX API calls with 'HD'. We are going to start removing these so the code looks like normal C. This PR removes most of the unused HD markup macros. * Replace ntohl/ntohs * Adds an optional version arg to bin/format_source (#3119) * Clean up mirror VFD code in utils dir (#3121) * Remove dead code * Replace mybzero with memset * Replace hbool_t/TRUE/FALSE with bool/true/false * Fix spelling issues flagged by codespell (#3130) * Make autogen.sh output message consistent (#3128) * Add Python for HDF-EOS zoo description (#3129) * Fix function name in comment in ros3 VFD (#3131) * Revert long double checks (#3133) * Revert "Remove long double conversion work-arounds (#3097)" This reverts commit 1e1dac1dac58fa18f6b7788346d1ba7d3315b0f9. * Update comments to reflect newer systems * Add java options to build scripts (#3127) * Add java options to build scripts Previously, cmakehdf5 turned on compiling of the java interface by default due to a value set in cacheinit.cmake. Now, consistent with how Fortran and CPP interfaces are handled, the script overwrites this default value to disable the libraries, fixing #2958. I also implemented the --enable-java/--disable java options for cmakehdf5, and -java for buildhdf5. Allen said these scripts should mention that compilers are to be specified in environment variables, but missing compilers causes errors at the CMake level, and CMake's error messages are already pretty informative (See the one in #2958 about JAVA_COMPILER). * Removed .lnt linter files (#3143) These were last usefully modified in 2004 * Fix path to libhdf5.settings in cmakehdf5 (#3140) * Many clang -Wextra-semi-stmt fixes (#2537) * Adds semicolons to function-like macros * Adds a do..while(0) loop to some macros * Removes semicolons when inappropriate, especially H5E_TRY_BEGIN/END * Remove HD prefix from network calls (#3142) HDsocket(), etc. Only affects the mirror VFD and its test code. * Remove hbool_t/TRUE/FALSE from java (#3145) Replaces with bool/true/false * CMake: (feature) ROS3 and cmake config file. (#3146) - Added a cmake variable to the hdf5-config.cmake file which indicate if the library has been build with or without the read-only S3 functionality. * Define minimal permissions for new GitHub workflows (#3147) * Track s3 i/o when S3COMMS_DEBUG enabled (#3139) * Track s3 i/o when S3COMMS_DEBUG enabled * Fix the snapshots workflow (#3148) * Add upload url as artifact * Change doxygen path and comment log-url upload * zip doxygen files for upload * add workspace var * chore: fix grammar (#3150) * chore: fix grammar * Removes the HD prefix from java C99 calls (#3149) POSIX calls (HDstrndup, etc.) are unchanged * Correct the zip usage (#3153) * Many fixes to various compiler warnings (#3124) * Fixed various -Wmissing-variable-declarations by adding static keyword * In a few cases, renamed the variable suffix from _g to _s. * Fixed some -Wmissing-variable-declarations by using different declaration macros * Fixed various -Wconditional-uninitialized warnings by just initializing variable to zero * Fixed various -Wcomma warnings * Fixed clang -Wstrict-prototypes warnings * Fixed various -Wunused-variable warnings * Updated some casts to fix the only 3 -Wcast-qual warnings * Fixed the only -Wsometimes-uninitialized warning * Create Security Policy (#3152) * Fix #1978 h5vers usage message. (#3162) Update Platforms Tested in RELEASE.txt. * speed-up building HDF5 (#3087) Disables building the tests when building the netCDF, etc. * Remove dead code behind #ifdef OLD_WAY (#3163) * Remove H5F_evict_tagged_metadata() (#3165) The rest of the library just calls H5AC_evict_tagged_metadata() directly. * Add missing space in zip command (#3167) * Fixed check for a VOL's async compatibility (#3164) * cap flag fix in test * added async comp. output * Update Linux workflows (#3173) * Consolidate environment setup * Turn on ros3 VFD in CMake (Linux only) * Add gh-pages doxygen link (#3175) * Fix the doxygen to gh pages and artifact creation (#3176) * Tidy the list of options in main.yml (#3181) * Remove HD/hbool_t from fortran (#3182) * Remove HD/hbool_t from high-level lib (#3183) * Remove HDva_(arg|copy|end|start) (#3184) * Drop HD prefix & hbool_t from H5TS (#3180) * Remove HD from fork/exec*/wait* (#3190) These are not C99 but are hidden behind ifdefs and are highly unlikely to ever have non-POSIX equivalents. * Fix assertion failure when attempting to use IOC VFD directly (#3187) * Rename HDqsort() to qsort() (#3193) * Rename HDqsort() to qsort() * Committing clang-format changes --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Rename HDpipe() to pipe() (#3192) Pipe is POSIX but implemented in Microsoft's CRT * Rename HDassert() to assert() (#3191) * Change HDassert to assert * Fix bin/make_err * Rename HD(f)printf() to (f)printf() (#3194) * Add note about HDF5_VOL_CONNECTOR to tools usage (#3159) * Rename HDsystem() to system() (#3197) system() is only used in the iopipe test and the things it calls (which are POSIX-y) are protected by an ifdef. * Remove HD from HDposix_memalign() (#3196) The posix_memalign call is only used in the direct VFD, which can only be built if posix_memalign() is available. * Remove HD from memory allocate/free calls (#3195) * HDcalloc * HDfree * HDmalloc * HDrealloc * chore: fix grammar (#3207) * docs: remove redundancy in Data Transfer section of user guide (#3208) * Remove checks for setsysinfo, which is unused (#3205) * Autotools * CMake * Remove HD from protected POSIX calls (#3203) These calls are non-C99 but protected by ifdefs and have no Windows equivalents: * HDalarm * HDasprintf * HDclock_gettime * HDfcntl * HDgethostname * HDgetrusage * HDsymlink * Rename HDato*() to ato*() (#3201) * Remove some "Programmer" comments (#3209) These are meaningless noise. Removes the "Programmer" lines on comment start lines: /* Programmer: John Smith These complicate my sed script that will rip out the rest of the comments. * Rename HDexit() and related to exit(), etc. (#3202) * HDatexit * HDexit * HD_exit * Remove HD from strto* calls (#3204) * HDstrtod * HDstrtol * HDstrtoll * HDstrtoul * HDstrtoull * HDstrtoumax * Remove HD from C std lib file ops (#3206) * HDfclose * HDferror * HDfeof * HDfflush * HDfopen * HDfread * HDfwrite * Remove programmer/date from comments (#3210) * Removes Programmer: and Date: fields * Fixes a few Modifications: fields leftover from previous work * Remove HD from HDmem* calls (#3211) * Remove HD from HDis* (e.g., isalpha) (#3212) * HDisalnum * HDisalpha * HDiscntrl * HDisdigit * HDisgraph * HDislower * HDisprint * HDispunct * HDisspace * HDisupper * HDisxdigit * Update actions for release option, fix branch for daily build (#3185) * Update actions for release option, fix branch for daily build * Scheduled workflows run on latest commit on the develop * Add snapshots location * docs: improve consistency in verb form (#3076) (#3188) * fix gh action if statements (#3213) * Adjust presets timeout and fix build script VS versions (#3215) * Several ros3vfd logging improvements * Committing clang-format changes * Update COPYING (#3231) Fixed old support URL. * addresses compilation fortran warnings on Frontier (#3236) * Fix doc for H5allocate_memory (#3240) * merge bbrelease to release (#3232) * merge bbrelease to release * Fix pre-req workflow * Replace support.hdfgroup.org URLs for alternative COPYING file (#3228) * Replace support.hdfgroup.org URLs for alternative COPYING file locations in copyright headers with https://www.hdfgroup.org/licenses. Replace support.hdfgroup.org URL for alternative COPYING_LBNL_HDF5 with github URL. Tweak chkcopyright script for change from UICOPYRIGHTSTR to THGCOPYRIGHTSTR. * Replace 1_10 reference with develop branch (#3227) * Switch CI to use release script (#3242) * Subfiling VFD source cleanup (#3241) * Subfiling VFD source cleanup Modularize Subfiling CMake code into separate CMakeLists.txt file Update Mercury util code to latest version and update Copyright Generate mercury_util_config.h header file instead of using pre-generated file Remove unnecessary Mercury functionality Fix minor warning in Subfiling VFD code * Remove Mercury headers from Autotools publicly-distributed header list * install h5fuse.sh in bin dir. (#3244) * Disable h5py until fixed properly without spack (#3243) * ROS3: (feature) Temporary security credentials (#3030) - Implemented support for AWS temporary security credentials. For this kind of credentials also a session/security token should be included in the request by adding the x-amz-security-token header. Co-authored-by: Larry Knox <lrknox@hdfgroup.org> Co-authored-by: Jordan Henderson <jhenderson@hdfgroup.org> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Avoid truncating at null byte when copying to std::string (#3083) --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fix CMake builds when Subfiling VFD isn't enabled (#3250) * Fix CMake builds when Subfiling VFD isn't enabled * Add Subfiling VFD entry to hdf5-config.cmake.in * Fix some warnings in developer builds (#3247) * Fix some warnings in developer builds * Switch approach to Winline flag * Fixed more warnings about extra semicolons (#3249) * Require semi-colon after H5_CHECK_OVERFLOW calls Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fix warning in H5C__UPDATE_STATS_FOR_DIRTY_PIN macro (#3259) Add braces to H5C__UPDATE_STATS_FOR_DIRTY_PIN macro to fix warning causing Werror Release builds to fail * Update DEFAULT_API_VERSION documentation for CMake (#3255) * Update DEFAULT_API_VERSION documentation for CMake * Fix hint --------- Co-authored-by: Larry Knox <lrknox@hdfgroup.org> * changed the scope of #ifdef DOXYGEN to now include H5D multi-functions (#3254) * Option changed but not all references (#3252) * Option changed but not all references * remove quotes from binary var * Move 1.12.3 release to October (#3263) * Fixed some -Wunused-variable warnings and one Wsometimes-uninitialized warning (#3260) * removed the use of encoded single apostrophe (#3261) * removed the use of encoded single apostrophe, and fix H5Dread_chunk from write to read * updated sanitizer paragraph * fixed brief description for H5Fget_info * ROS3: (fix) Replaced HDfprintf (#3266) - Replaced the HDfprintf() functions by fprintf() to be consistent with other parts of the library. * chore: make VRFY output consistent (#3268) * CMake: (fix) Threads dependency (#3267) - If the HDF5 library has been build with either thread-safety or subfiling VFD feature on it will have an additional dependency on a threading library. This dependency has been added to the hdf-config.cmake.in file. * chore: fix grammar - get hang -> get hung (#3272) * Another round of fixing -Wextra-semi-stmt warnings (#3264) Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * chore: fix typo - persent -> present (#3273) * Remove py-pip from h5py action (#3265) * Update release schedule (#3317) * Move 1.12.3 to November * Add 1.14.3 in October * Update README.md w/ 1.4.3 info (#3318) * Switch parallel compression to use vector I/O (#3245) Updates parallel compression feature to use vector I/O instead of creating and passing down MPI derived types to VFD * Fix incorrect error check in H5Ofill.c for undefined fill values (#3312) * Fix H5Otoken_to_str call in h5dump and other minor cleanup (#3314) * Fix loading plugin fails with missing directory GH issue #3248 (#3315) * Made HGOTO_ERROR a do-while loop (#3308) * Made HGOTO_ERROR a do-while loop * Update files to skip list and ignore_words_list (#3321) * Update files to skip list and ignore_words_list for codespell to not check files generated by autotools. Autotools generate misspellings that can't be fixed in HDF5 code. * Windows runtime items go into the bin folder (#3320) * A couple of documentation items to fix (#3332) * Fix h5repack for variable-length datatyped datasets (#3331) * Fix CVE-2018-11202 (#3330) A malformed file could result in chunk index memory leaks. Under most conditions (i.e., when the --enable-using-memchecker option is NOT used), this would result in a small memory leak and and infinite loop and abort when shutting down the library. The infinite loop would be due to the "free list" package not being able to clear its resources so the library couldn't shut down. When the "using a memory checker" option is used, the free lists are disabled so there is just a memory leak with no abort on library shutdown. The chunk index resources are now correctly cleaned up when reading misparsed files and valgrind confirms no memory leaks. * Fix CVE-2018-13867 (#3336) * Fixes the last of the -Wextra-semi-stmt warnings (#3326) * Fixed extra semi warning by adjusting alternative macro definitions * Find-replace H5E_END_TRY; -> H5E_END_TRY * Made H5Epush_goto a do-while loop, fixed indentation * Made GOTOERROR and ERRMSG do-while loops * Made Hgoto_error and Hgoto_done do-while loops * Made vrfy_cint_type and vrfy_ctype do-while loops * Made TEST_TYPE_CONTIG and others do-while loops * Removed extraneous semi-colons * Committing clang-format changes --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * Fix a typo in RELEASE.txt * Fix assertion failure in H5D__mpio_collective_filtered_vec_io (#3340) * Make h5dump spacing consistent when printing VLEN datatype (#3351) * Fix for the bug exposed from running test/set_extent.c when selection… (#3319) * Fix for the bug exposed from running test/set_extent.c when selection I/O is enabled. This is a fix from Neil. The test/set_extent.c is modified to test for selection I/O enabled. * Add Fortran ES module to deploy list (#3341) * Add Fortran ES module to deploy list * Change fortran mod file export to use a list of names * test(parallel): verify FALSE case (#3356) * Implementation of the mpio driver with selection I/O. (#3222) * This changes the default selection I/O to on for MPIO. * Work around a testphdf5 failure on Cray MPICH machines (#3361) * set H5_PAC_C_MAX_REAL_PRECISION default to 0 when cross sompiling with (#3364) CMake to fix Fortran build failures. * Add RELEASE.txt notes for recent selection I/O work. (#3374) * Fix possible performance regression introduced with in-place type conversion in 1.14.2 (#3376) * Correct script (#3377) * Correct CI settings (#3384) * Correct CI settings * Correct plugin file name * restore CI tarball name prefix to match bin/release (#3385) * Fix assertion failure during file close on error (#3387) * Fix compile failures with H5C_DO_MEMORY_SANITY_CHECKS enabled (#3388) * Fix valgrind warning about write of uninitialized bytes (#3389) * Fix valgrind warning about write of uninitialized bytes in ScaleOffset filter (#3390) * Update presets, examples uncompress, szip cache (#3391) * Fix serial to parallel chunked dataset file space allocation bug (#3394) * chore: fix typo (#3405) * Fix for CVE-2016-4332 (#3406) This CVE issue was previously listed as fixed (via HDFFV-9950) back in 2016, but with no confirmation test. Now that test files exist for the 2016 Talos CVE issues, we found that CVE-2016-4332 can raise an assert in debug builds. This fix replaces the assert with pointer checks that don't raise errors or asserts. Since the function is in cleanup code, we do our best to close and free things, even when presented with partially- initialized structs. Fixes CVE-2016-4332 and HDFFV-9950 (confirmed via the cve_hdf5 repo) * Fix ph5diff tests for MPIEXEC_MAX_NUMPROCS=1 (#3407) * Enable szip by default in Autotools (#3412) Since libaec is so prevalent and BSD-licensed for both encode and decode, we build the szip filter by default when the szip or aec libraries are found. * Re-enable SZIP default to ON in CMake (#3414) The Autotools were handled in a separate commit * Fix Heap-buffer-overflow WRITE in H5MM_memcpy (#3368) * Add Intel oneAPI actions (#2949) (#2977) * ci: add Intel oneAPI actions (#2949) * ci: fix CMake installation * ci: use absolute paths for libtool installation * ci(oneAPI): update compiler versions and use cron * Add RELEASE.txt entry for compound performance regression fix (#3376) (#3416) * chore: remove gubbins comment (#3420) * Add other types and full type to enum/str/vlen dataformat for structblock[begin/end] (#3353) * Avoid H5Ocopy in h5repack for variable-length string types (#3419) * Skip atomicity tests for OpenMPI major versions < 5 (#3421) * Fix an issue with use of uninitialized memory in trefer_deprec.c test (#3422) * Add parallel examples in doxygen (#3413) * Fix use of uninitialized value in testpar/t_dset.c test (#3423) * Remove extraneous "33" in RELEASE.txt (#3425) * Revise file close assertion failure fix (#3418) * Remove intel oneapi warning (#3426) * Fix for CVE-2018-15671. h5stat -S $POC will result in a crash with segmenetation fault. (#3427) It is because the object in the testfile points back to the root group. When the tool tries to traverse the object, it goes back to the root group and then back again. * chore: match function call and VRFY() output (#3428) * Fix the Fortran extension used in example links (#3430) * Put H5T_CONV_ab macros in do..while loops (#3432) Ever since a recent round of macro cleanup, bin/trace and clang-format have been bickering over what H5Tconv.c should look like and neither produces readable code. This change puts the top-level H5T_CONV_ab macros in do..while loops, adds appropriate semicolons, and adds the missing H5_CLANG_DIAG_ON|OFF and H5_GCC_CLANG_DIAG_ON|OFF macros to the list of statement macros clang-format recognizes. H5Tconv.c is now readable and both bin/trace and clang-format are happy. * Convert some H5MM calls to standard C equivalents (#2382) * H5MM_calloc and malloc are now mapped to stdlib C calls * H5MM_memcpy now maps directly to memcpy in release builds * H5MM_memcpy is still implemented as a separate function that checks for buffer overlap when H5MM_DEBUG is defined (default w/ debug builds) * Switches many library memcpy calls to use H5MM_memcpy * Fixes a possible zero allocation in H5Olayout.c * Add 1.14.4 to the release schedule (#3434) * Output stderr file in CMake testing on failure (#3431) * Add Intel oneAPI badges (#3433) * Add a CVE regression test action (#3445) * * Disable SZIP for Intel oneAPI Action (#3449) * Disable SZIP for Intel oneAPI Action * Disable Fortran and parallel * Update VOL CMake for REST VOL (#3450) * Update VOL CMake for REST VOL * Prevent linking static libs to VOLs * Add an h5py badge to README.md (#3477) * Removed all the ranks printing out testing information (#3457) * Fix Subfiling VFD IOC assignment bug (#3456) * Correct java test dimension (#3482) * Support CMake VOL builds with FetchContent from local directory (#3455) * Update VOL CMake for REST VOL * Prevent linking static libs to VOLs * index on fetch_local: 5c5c3f1505 Prevent linking static libs to VOLs * index on (no branch): 9a36d3e7b1 On fetch_local: WIP:add source dir fetch option for vols * Allow building of VOL from local source * Move LOCAL_DIR option to HDF5_VOL_ALLOW_EXTERNAL * Fix the Fortran include dir in install config files (#3454) * Convert hbool_t --> bool in examples (#3492) * Fix some minor formatting for consistency (#3499) * Create scorecard.yml (#3508) Bring in OSSF Scorecard code scanner as a GitHub action * Convert hbool_t --> bool in testpar (#3495) * hbool_t/TRUE/FALSE --> bool/true/false in tools (#3491) * Convert hbool_t --> bool in test (#3494) * Convert hbool_t --> bool in src (#3496) * hbool_t --> bool in src * Does not remove TRUE/FALSE * Public header files are unchanged * Public API calls are unchanged * TRUE/FALSE --> true/false in src * Add deprecation notice for hbool_t * Added new Fortran API wrappers (#3511) * Added new wrappers for h5get_free_list_sizes_f H5Sselect_intersect_block_f H5Sselect_shape_same_f h5pget_no_selection_io_cause_f h5pget_mpio_no_collective_cause_f H5Lvisit_by_name_f H5Lvisit_f H5Fget_info_f h5dwrite_chunk_f h5dread_chunk_f * added h5pget_file_space_page_size_f, h5pset_file_space_page_size_f, h5pget_file_space_strategy_f, h5pset_file_space_strategy_f, h5info tests * added fortran tests * Update tH5F.F90 * misc. fortran fixes for failing CI dailty tests (#3523) * fixed H5Lvisit* interface * changed integer type for direct write * Consistent initialization of hid_t in the tests (#3521) * Fix windows cpack with debug (#3525) * Add missing row for the ROS3 VFD in table #3415 (#3517) * fixed nvidia compiler issue (#3527) * Identify functions in a subgroup (#3530) * quiet warning on sunspot (gcc 11.2.0) (#3534) * Add API examples doxygen page (#3500) * removed C_INT32_T from Fortran APIs (#3537) * Add NVHPC 23.7 GitHub Actions (#3509) * Add NVHPC 27.3 GitHub Actions * Address @derobins review * Remove HD prefix from math functions (#3538) * Remove HD prefix from HDlog10 calls (#3539) Was missed in a previous commit and causes building subfiling to fail. * fixed arg to C H5Dwrite_chunk (#3541) * Strip HD prefix from string/char C API calls (#3540) * Strip HD prefix from string/char C API calls * HD(f)(put|get)(s|c) * HDstr* * HDv*printf * HD(s)(print|scan)f * HDperror But NOT: * HDstrcase* * HDvasprintf * HDstrtok_r * HDstrndup As those are not C99 and have portability work-around implementations. They will be handled later. * Fix th5_system.c screwup * Convert main.yml CI into callable workflows (#3529) * Fix broken URL. (#3546) * Fix grammar (#3545) * Update oneAPI-C/A badge yml links. (#3564) * Check return values from HDF5 API calls. (#3556) * Adds link to h5fuse.sh in testpar for autotools (#3557) * Make the h5fuse.sh utility available to parallel subfiling tests so h5fuse testing is not skipped. * Some minor formatting and text changes (#3563) * Fix typos and grammar in t_pread. (#3565) * Fix typo (givin->given) in test/testframe.c. (#3567) * Fix ifx unused variable hdferr warning. (#3568) * Correct comments about H5Z_FILTER_NONE (#3572) * Update release script. (#3577) * fixed function declaration (#3579) * Fixed GH-3554 (#3584) Removed the extra condition * Remove h5dwalk.1 man page. (#3589) * Removed the use of -commons linking option on Darwin (#3581) Removed the use of -commons linking option on Darwin as COMMON and EQUIVALENCE is no long used * Fix docs for H5Pset_dxpl_mpio_collective_opt() (#3594) * Fix typo: arange->arrange in src/H5Cmpio.c. (#3597) * Fix docs for H5Acreate2 and H5Acreate_by_name (#3598) * Use HDoff_t with lseek consistently (#3600) lseek on Windows uses __int64 for both the offset and return type instead of off_t like most POSIX systems. This changes ensures we use HDoff_t (which is typdef'd correctly on Windows) w/ lseek. * Replaces HDgetenv with getenv (#3599) * Develop tools move (#3580) Reorganizes the tools files to support the VOL tests * Clean up Subfiling VFD header doxygen formatting (#3601) * Remove `sh` to run bash script. (#3590) * Correct path name of ddl file to be changed (#3607) * Fix potential uninitialized variable (#3602) Moves a union initialization up a bit so it's performed before code that can jump to the cleanup target, where file descriptors could be checked without being initialized. This could only happen in test code and only in an out-of-memory situation. Fixes Coverity 1542254 * Remove unnecessary assignment in test generator (#3603) Fixes what looks like a copy/paste/modify error in the format convert test file generator, where an array element is assigned one value and them immediately overwritten by another value. Fixes Coverity issue 1542285 * Remove useless define TRUE/FALSE statements. (#3604) * Fix typo behaviour and dependes. (#3605) * Fix typos (#3609) * Fixed unused variable in H5CS.c (#3552) (#3612) * Fixed #3552 * Fix grammar (#3614) * Cleanup unused statements (#3553) (#3617) Removed unnecessary assert statements and noise comments. * Fix Intel oneAPI icc warning (#3619) * Fix several spelling/grammar issues (#3621) * Add HPC CDash to README.md (#3623) * Disable static + thread-safe on Windows w/ CMake (#3622) The thread-safety feature on Windows requires a hook in DllMain() and thus is only available when HDF5 is built as a shared library. This was previously a warning, but has now been elevated to a fatal error that cannot be overridden with ALLOW_UNSUPPORTED. Fixes GitHub #3613 * Remove unused member from H5D_shared_t struct. (#3628) * Remove old EXTERNALPROJECT_ADD in favor of FETCH_CONTENT (#3624) * Fix grammar (#3635) * Disambiguate error output messages. (#3634) * Disambiguate error output messages. * Address @brtnfld review. * Fail CMake on Windows when sub-filing VFD is enabled (#3636) * Improve consistency in past tense usage (#3638) * Split out test logic to separate file (#3639) * Drop MPI-2 support (#3643) * Switch IEEE flags for NAG Fortran (#3644) Default is -ieee=stop, which causes problems when the H5T module performs floating-point type introspection. The new mode is -ieee=full * Remove 1.10.11 info from README.md (#3646) * Fixes GH#1027 compilation error (#3654) * Remove 1.10 badge (#3650) * Use real URLs and updated names for plugins (#3651) * synchronize TGZ naming convention/usage * Update parallel compression feature to support multi-dataset I/O (#3591) * Add more tests for selection I/O. (#3528) * Adjust 1.14 files after merging ---------
Diffstat (limited to 'test/links.c')
-rw-r--r--test/links.c3004
1 files changed, 1506 insertions, 1498 deletions
diff --git a/test/links.c b/test/links.c
index 8f6af5b..6f07d32 100644
--- a/test/links.c
+++ b/test/links.c
@@ -160,7 +160,7 @@ typedef struct {
int stop; /* # of iterations to stop after */
int64_t curr; /* Current creation order value */
size_t max_visit; /* Size of "visited link" flag array */
- hbool_t *visited; /* Pointer to array of "visited link" flags */
+ bool *visited; /* Pointer to array of "visited link" flags */
} link_iter_info_t;
/* Link visit structs */
@@ -400,9 +400,9 @@ const H5L_class_t UD_plist_class[1] = {{
static void
fix_ext_filename(char *path_name, char *cwd, const char *file_name)
{
- HDstrcpy(path_name, cwd);
- HDstrcat(path_name, "/");
- HDstrcat(path_name, file_name);
+ strcpy(path_name, cwd);
+ strcat(path_name, "/");
+ strcat(path_name, file_name);
}
/*-------------------------------------------------------------------------
@@ -415,7 +415,7 @@ fix_ext_filename(char *path_name, char *cwd, const char *file_name)
*-------------------------------------------------------------------------
*/
static int
-mklinks(hid_t fapl, hbool_t new_format)
+mklinks(hid_t fapl, bool new_format)
{
hid_t file, scalar, grp, d1;
hsize_t size[1] = {1};
@@ -484,12 +484,13 @@ error:
*-------------------------------------------------------------------------
*/
static int
-new_links(hid_t fapl, hbool_t new_format)
+new_links(hid_t fapl, bool new_format)
{
- hid_t file_a, file_b = (-1);
- hid_t grp1_a = (-1), grp1_b = (-1), grp2_a = (-1), grp2_b = (-1);
- hid_t scalar = (-1);
- hid_t dset1 = (-1), dset2 = (-1);
+ hid_t file_a, file_b = (H5I_INVALID_HID);
+ hid_t grp1_a = (H5I_INVALID_HID), grp1_b = (H5I_INVALID_HID), grp2_a = (H5I_INVALID_HID),
+ grp2_b = (H5I_INVALID_HID);
+ hid_t scalar = (H5I_INVALID_HID);
+ hid_t dset1 = (H5I_INVALID_HID), dset2 = (H5I_INVALID_HID);
char filename[NAME_BUF_SIZE];
hsize_t size[1] = {1};
@@ -610,7 +611,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-cklinks(hid_t fapl, hbool_t new_format)
+cklinks(hid_t fapl, bool new_format)
{
hid_t file;
H5O_info2_t oinfo1, oinfo2;
@@ -649,19 +650,19 @@ cklinks(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR;
if (token_cmp) {
H5_FAILED();
- HDputs(" Hard link test failed. Link seems not to point to the ");
- HDputs(" expected file location.");
+ puts(" Hard link test failed. Link seems not to point to the ");
+ puts(" expected file location.");
TEST_ERROR;
} /* end if */
- if (H5Lexists(file, "/", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file, "/", H5P_DEFAULT) != true)
FAIL_STACK_ERROR;
- if (H5Lexists(file, "d1", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file, "d1", H5P_DEFAULT) != true)
FAIL_STACK_ERROR;
- if (H5Lexists(file, "grp1/hard", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file, "grp1/hard", H5P_DEFAULT) != true)
FAIL_STACK_ERROR;
- if (H5Lexists(file, "/grp1", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file, "/grp1", H5P_DEFAULT) != true)
FAIL_STACK_ERROR;
- if (H5Lexists(file, "/grp1/hard", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file, "/grp1/hard", H5P_DEFAULT) != true)
FAIL_STACK_ERROR;
H5E_BEGIN_TRY
{
@@ -670,7 +671,7 @@ cklinks(hid_t fapl, hbool_t new_format)
H5E_END_TRY
if (status >= 0) {
H5_FAILED();
- HDputs(" H5Lexists() should have failed for a path with missing components.");
+ puts(" H5Lexists() should have failed for a path with missing components.");
TEST_ERROR;
} /* end if */
H5E_BEGIN_TRY
@@ -680,7 +681,7 @@ cklinks(hid_t fapl, hbool_t new_format)
H5E_END_TRY
if (status >= 0) {
H5_FAILED();
- HDputs(" H5Lexists() should have failed for a path with missing components.");
+ puts(" H5Lexists() should have failed for a path with missing components.");
TEST_ERROR;
} /* end if */
@@ -696,18 +697,18 @@ cklinks(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR;
if (token_cmp) {
H5_FAILED();
- HDputs(" Soft link test failed. Link seems not to point to the ");
- HDputs(" expected file location.");
+ puts(" Soft link test failed. Link seems not to point to the ");
+ puts(" expected file location.");
TEST_ERROR;
} /* end if */
if (H5Lget_val(file, "grp1/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- if (HDstrcmp(linkval, "/d1") != 0) {
+ if (strcmp(linkval, "/d1") != 0) {
H5_FAILED();
- HDputs(" Soft link test failed. Wrong link value");
+ puts(" Soft link test failed. Wrong link value");
TEST_ERROR;
} /* end if */
- if (H5Lexists(file, "grp1/soft", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file, "grp1/soft", H5P_DEFAULT) != true)
FAIL_STACK_ERROR;
/* Dangling link */
@@ -718,7 +719,7 @@ cklinks(hid_t fapl, hbool_t new_format)
H5E_END_TRY
if (status >= 0) {
H5_FAILED();
- HDputs(" H5Oget_info_by_name() should have failed for a dangling link.");
+ puts(" H5Oget_info_by_name() should have failed for a dangling link.");
TEST_ERROR;
} /* end if */
if (H5Lget_info2(file, "grp1/dangle", &linfo, H5P_DEFAULT) < 0)
@@ -733,12 +734,12 @@ cklinks(hid_t fapl, hbool_t new_format)
printf(" %d: Can't retrieve link value\n", __LINE__);
TEST_ERROR;
} /* end if */
- if (HDstrcmp(linkval, "foobar") != 0) {
+ if (strcmp(linkval, "foobar") != 0) {
H5_FAILED();
- HDputs(" Dangling link test failed. Wrong link value");
+ puts(" Dangling link test failed. Wrong link value");
TEST_ERROR;
} /* end if */
- if (H5Lexists(file, "grp1/dangle", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file, "grp1/dangle", H5P_DEFAULT) != true)
FAIL_STACK_ERROR;
/* Recursive link */
@@ -749,7 +750,7 @@ cklinks(hid_t fapl, hbool_t new_format)
H5E_END_TRY
if (status >= 0) {
H5_FAILED();
- HDputs(" H5Oget_info_by_name() should have failed for a recursive link.");
+ puts(" H5Oget_info_by_name() should have failed for a recursive link.");
TEST_ERROR;
} /* end if */
if (H5Lget_info2(file, "grp1/recursive", &linfo, H5P_DEFAULT) < 0)
@@ -764,14 +765,14 @@ cklinks(hid_t fapl, hbool_t new_format)
printf(" %d: Can't retrieve link value\n", __LINE__);
TEST_ERROR;
} /* end if */
- if (HDstrcmp(linkval, "/grp1/recursive") != 0) {
+ if (strcmp(linkval, "/grp1/recursive") != 0) {
H5_FAILED();
- HDputs(" Recursive link test failed. Wrong link value");
+ puts(" Recursive link test failed. Wrong link value");
TEST_ERROR;
} /* end if */
/* Non-existent link */
- if (H5Lexists(file, "foobar", H5P_DEFAULT) == TRUE)
+ if (H5Lexists(file, "foobar", H5P_DEFAULT) == true)
FAIL_STACK_ERROR;
/* Cleanup */
@@ -796,7 +797,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-ck_new_links(hid_t fapl, hbool_t new_format)
+ck_new_links(hid_t fapl, bool new_format)
{
hid_t file;
H5O_info2_t oi_dset, oi_hard1, oi_hard2;
@@ -834,8 +835,8 @@ ck_new_links(hid_t fapl, hbool_t new_format)
TEST_ERROR;
if (token_cmp1 || token_cmp2) {
H5_FAILED();
- HDputs(" Hard link test failed. Link seems not to point to the ");
- HDputs(" expected file location.");
+ puts(" Hard link test failed. Link seems not to point to the ");
+ puts(" expected file location.");
TEST_ERROR;
}
@@ -860,13 +861,13 @@ error:
*-------------------------------------------------------------------------
*/
static int
-long_links(hid_t fapl, hbool_t new_format)
+long_links(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group ID */
- hid_t gid2 = -1; /* Datatype ID */
- char *objname = NULL; /* Name of object [Long] */
- size_t u; /* Local index variable */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
+ hid_t gid2 = H5I_INVALID_HID; /* Datatype ID */
+ char *objname = NULL; /* Name of object [Long] */
+ size_t u; /* Local index variable */
char filename[NAME_BUF_SIZE];
if (new_format)
@@ -939,11 +940,11 @@ error:
*-------------------------------------------------------------------------
*/
static int
-toomany(hid_t fapl, hbool_t new_format)
+toomany(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
- char objname[NAME_BUF_SIZE]; /* Object name */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ char objname[NAME_BUF_SIZE]; /* Object name */
char filename[NAME_BUF_SIZE];
if (new_format)
@@ -1063,7 +1064,7 @@ toomany(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/hard21") != 0)
+ if (strcmp(objname, "/hard21") != 0)
TEST_ERROR;
/* Create object in hard-linked group */
@@ -1086,7 +1087,7 @@ toomany(hid_t fapl, hbool_t new_format)
H5E_END_TRY
if (gid >= 0) {
H5_FAILED();
- HDputs(" Should have failed for sequence of too many nested links.");
+ puts(" Should have failed for sequence of too many nested links.");
TEST_ERROR;
} /* end if */
@@ -1097,7 +1098,7 @@ toomany(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/soft16") != 0)
+ if (strcmp(objname, "/soft16") != 0)
TEST_ERROR;
/* Create object using soft links */
@@ -1138,14 +1139,14 @@ error:
*-------------------------------------------------------------------------
*/
static int
-test_lcpl(hid_t fapl, hbool_t new_format)
+test_lcpl(hid_t fapl, bool new_format)
{
- hid_t file_id = -1;
- hid_t group_id = -1;
- hid_t space_id = -1;
- hid_t dset_id = -1;
- hid_t type_id = -1;
- hid_t lcpl_id = -1;
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t group_id = H5I_INVALID_HID;
+ hid_t space_id = H5I_INVALID_HID;
+ hid_t dset_id = H5I_INVALID_HID;
+ hid_t type_id = H5I_INVALID_HID;
+ hid_t lcpl_id = H5I_INVALID_HID;
H5L_info2_t linfo;
char filename[1024];
hsize_t dims[2];
@@ -1351,11 +1352,12 @@ error:
*-------------------------------------------------------------------------
*/
static int
-test_move(hid_t fapl, hbool_t new_format)
+test_move(hid_t fapl, bool new_format)
{
- hid_t file_a = -1, file_b = -1;
- hid_t grp_1 = -1, grp_2 = -1, grp_move = -1, moved_grp = -1;
- char filename[1024];
+ hid_t file_a = H5I_INVALID_HID, file_b = H5I_INVALID_HID;
+ hid_t grp_1 = H5I_INVALID_HID, grp_2 = H5I_INVALID_HID, grp_move = H5I_INVALID_HID,
+ moved_grp = H5I_INVALID_HID;
+ char filename[1024];
if (new_format)
TESTING("H5Lmove (w/new group format)");
@@ -1407,13 +1409,13 @@ test_move(hid_t fapl, hbool_t new_format)
/* Move a soft link across files. Should succeed. */
if (H5Lmove(grp_2, "soft", file_b, "soft_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (H5Lexists(file_b, "soft_new_name", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file_b, "soft_new_name", H5P_DEFAULT) != true)
TEST_ERROR;
/* Move an external link across files. Should succeed. */
if (H5Lmove(grp_2, "ext", file_b, "ext_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (H5Lexists(file_b, "ext_new_name", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file_b, "ext_new_name", H5P_DEFAULT) != true)
TEST_ERROR;
/* Move a group across groups in the same file while renaming it. */
@@ -1434,7 +1436,7 @@ test_move(hid_t fapl, hbool_t new_format)
H5E_END_TRY
if (moved_grp >= 0) {
H5_FAILED();
- HDputs(" Group still in original location?");
+ puts(" Group still in original location?");
TEST_ERROR;
} /* end if */
@@ -1518,11 +1520,12 @@ error:
*-------------------------------------------------------------------------
*/
static int
-test_copy(hid_t fapl, hbool_t new_format)
+test_copy(hid_t fapl, bool new_format)
{
- hid_t file_a = -1, file_b = -1;
- hid_t grp_1 = -1, grp_2 = -1, grp_move = -1, moved_grp = -1;
- char filename[1024];
+ hid_t file_a = H5I_INVALID_HID, file_b = H5I_INVALID_HID;
+ hid_t grp_1 = H5I_INVALID_HID, grp_2 = H5I_INVALID_HID, grp_move = H5I_INVALID_HID,
+ moved_grp = H5I_INVALID_HID;
+ char filename[1024];
if (new_format)
TESTING("H5Lcopy (w/new group format)");
@@ -1574,13 +1577,13 @@ test_copy(hid_t fapl, hbool_t new_format)
/* Copy a soft link across files. Should succeed. */
if (H5Lcopy(grp_2, "soft", file_b, "soft_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (H5Lexists(file_b, "soft_new_name", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file_b, "soft_new_name", H5P_DEFAULT) != true)
TEST_ERROR;
/* Copy an external link across files. Should succeed. */
if (H5Lcopy(grp_2, "ext", file_b, "ext_new_name", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (H5Lexists(file_b, "ext_new_name", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file_b, "ext_new_name", H5P_DEFAULT) != true)
TEST_ERROR;
/* Move a group across groups in the same file while renaming it. */
@@ -1693,13 +1696,13 @@ error:
*-------------------------------------------------------------------------
*/
static int
-test_move_preserves(hid_t fapl_id, hbool_t new_format)
+test_move_preserves(hid_t fapl_id, bool new_format)
{
- hid_t file_id = -1;
- hid_t group_id = -1;
- hid_t fcpl_id = -1; /* Group creation property list ID */
- hid_t lcpl_id = -1;
- hid_t lcpl2_id = -1;
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t group_id = H5I_INVALID_HID;
+ hid_t fcpl_id = H5I_INVALID_HID; /* Group creation property list ID */
+ hid_t lcpl_id = H5I_INVALID_HID;
+ hid_t lcpl2_id = H5I_INVALID_HID;
H5O_info2_t oinfo;
H5L_info2_t linfo;
H5T_cset_t old_cset;
@@ -1756,7 +1759,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
old_cset = linfo.cset;
if (old_cset != H5T_CSET_UTF8)
TEST_ERROR;
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
old_corder = linfo.corder;
if (old_corder != 0)
@@ -1783,7 +1786,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
TEST_ERROR;
if (old_cset != linfo.cset)
TEST_ERROR;
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (old_corder != linfo.corder)
TEST_ERROR;
@@ -1800,7 +1803,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
TEST_ERROR;
if (old_corder == linfo.corder)
TEST_ERROR;
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (linfo.corder != 1)
TEST_ERROR;
@@ -1819,7 +1822,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
TEST_ERROR;
if (H5Lget_info2(file_id, "group_copied", &linfo, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (linfo.corder != 2)
TEST_ERROR;
@@ -1837,7 +1840,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
TEST_ERROR;
if (H5Lget_info2(file_id, "group_copied2", &linfo, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (linfo.corder != 3)
TEST_ERROR;
@@ -1853,7 +1856,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
TEST_ERROR;
if (H5Lget_info2(file_id, "group", &linfo, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (old_corder != linfo.corder)
TEST_ERROR;
@@ -1871,7 +1874,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
TEST_ERROR;
if (H5Lget_info2(file_id, "group_moved", &linfo, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (linfo.corder != 4)
TEST_ERROR;
@@ -1889,7 +1892,7 @@ test_move_preserves(hid_t fapl_id, hbool_t new_format)
TEST_ERROR;
if (H5Lget_info2(file_id, "group_moved_again", &linfo, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (linfo.corder != 5)
TEST_ERROR;
@@ -1933,11 +1936,11 @@ error:
*/
#ifndef H5_NO_DEPRECATED_SYMBOLS
static int
-test_deprec(hid_t fapl, hbool_t new_format)
+test_deprec(hid_t fapl, bool new_format)
{
- hid_t file_id = -1;
- hid_t group1_id = -1;
- hid_t group2_id = -1;
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t group1_id = H5I_INVALID_HID;
+ hid_t group2_id = H5I_INVALID_HID;
H5G_stat_t sb_hard1, sb_hard2, sb_soft1, sb_soft2;
H5G_obj_t obj_type; /* Object type */
hsize_t num_objs; /* Number of objects in a group */
@@ -1966,7 +1969,7 @@ test_deprec(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR;
if (H5Gget_comment(file_id, "group1", sizeof(tmpstr), tmpstr) < 0)
FAIL_STACK_ERROR;
- if (HDstrcmp(tmpstr, "comment") != 0)
+ if (strcmp(tmpstr, "comment") != 0)
TEST_ERROR;
/* Create links using H5Glink and H5Glink2 */
@@ -1982,7 +1985,7 @@ test_deprec(hid_t fapl, hbool_t new_format)
/* Test getting the names for objects */
if (H5Gget_objname_by_idx(group1_id, (hsize_t)0, tmpstr, sizeof(tmpstr)) < 0)
FAIL_STACK_ERROR;
- if (HDstrcmp(tmpstr, "link_to_group2") != 0)
+ if (strcmp(tmpstr, "link_to_group2") != 0)
TEST_ERROR;
H5E_BEGIN_TRY
{
@@ -2014,63 +2017,63 @@ test_deprec(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* Test that H5Glink created hard links properly */
- if (H5Gget_objinfo(file_id, "/group2", TRUE, &sb_hard1) < 0)
+ if (H5Gget_objinfo(file_id, "/group2", true, &sb_hard1) < 0)
FAIL_STACK_ERROR;
- if (H5Gget_objinfo(file_id, "/group1/link_to_group2", TRUE, &sb_hard2) < 0)
+ if (H5Gget_objinfo(file_id, "/group1/link_to_group2", true, &sb_hard2) < 0)
FAIL_STACK_ERROR;
if (memcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno)) != 0) {
H5_FAILED();
- HDputs(" Hard link test failed. Link seems not to point to the ");
- HDputs(" expected file location.");
+ puts(" Hard link test failed. Link seems not to point to the ");
+ puts(" expected file location.");
TEST_ERROR;
} /* end if */
/* Test for the other hard link created */
- if (H5Gget_objinfo(file_id, "/group1", TRUE, &sb_hard1) < 0)
+ if (H5Gget_objinfo(file_id, "/group1", true, &sb_hard1) < 0)
FAIL_STACK_ERROR;
- if (H5Gget_objinfo(file_id, "/group2/link_to_group1", TRUE, &sb_hard2) < 0)
+ if (H5Gget_objinfo(file_id, "/group2/link_to_group1", true, &sb_hard2) < 0)
FAIL_STACK_ERROR;
if (memcmp(&sb_hard1.objno, sb_hard2.objno, sizeof(sb_hard1.objno)) != 0) {
H5_FAILED();
- HDputs(" Hard link test failed. Link seems not to point to the ");
- HDputs(" expected file location.");
+ puts(" Hard link test failed. Link seems not to point to the ");
+ puts(" expected file location.");
TEST_ERROR;
} /* end if */
/* Test the soft link */
- if (H5Gget_objinfo(file_id, "/group2/soft_link_to_group1", FALSE, &sb_soft1) < 0)
+ if (H5Gget_objinfo(file_id, "/group2/soft_link_to_group1", false, &sb_soft1) < 0)
FAIL_STACK_ERROR;
if (sb_soft1.type != H5G_LINK)
TEST_ERROR;
- if (sb_soft1.linklen != HDstrlen("link_to_group1") + 1)
+ if (sb_soft1.linklen != strlen("link_to_group1") + 1)
TEST_ERROR;
if (H5Gget_linkval(group2_id, "soft_link_to_group1", sb_soft1.linklen, tmpstr) < 0)
FAIL_STACK_ERROR;
- if (HDstrcmp("link_to_group1", tmpstr) != 0)
+ if (strcmp("link_to_group1", tmpstr) != 0)
TEST_ERROR;
/* Test non-existing links with H5Gget_objinfo */
H5E_BEGIN_TRY
{
- if (H5Gget_objinfo(file_id, "/group2/soft_link_no_exist", TRUE, NULL) >= 0)
+ if (H5Gget_objinfo(file_id, "/group2/soft_link_no_exist", true, NULL) >= 0)
FAIL_STACK_ERROR;
}
H5E_END_TRY
/* Test the dangling soft link */
- if (H5Gget_objinfo(file_id, "/group2/dangle_soft_link", FALSE, &sb_soft2) < 0)
+ if (H5Gget_objinfo(file_id, "/group2/dangle_soft_link", false, &sb_soft2) < 0)
FAIL_STACK_ERROR;
if (sb_soft2.type != H5G_LINK)
TEST_ERROR;
- if (sb_soft2.linklen != HDstrlen("dangle") + 1)
+ if (sb_soft2.linklen != strlen("dangle") + 1)
TEST_ERROR;
if (H5Gget_linkval(group2_id, "dangle_soft_link", sb_soft2.linklen, tmpstr) < 0)
FAIL_STACK_ERROR;
- if (HDstrcmp("dangle", tmpstr) != 0)
+ if (strcmp("dangle", tmpstr) != 0)
TEST_ERROR;
/* Test H5Gmove and H5Gmove2 */
@@ -2135,7 +2138,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-cklinks_deprec(hid_t fapl, hbool_t new_format)
+cklinks_deprec(hid_t fapl, bool new_format)
{
hid_t file;
H5O_info1_t oinfo1, oinfo2;
@@ -2167,19 +2170,19 @@ cklinks_deprec(hid_t fapl, hbool_t new_format)
} /* end if */
if (H5_addr_ne(oinfo1.addr, oinfo2.addr)) {
H5_FAILED();
- HDputs(" Hard link test failed. Link seems not to point to the ");
- HDputs(" expected file location.");
+ puts(" Hard link test failed. Link seems not to point to the ");
+ puts(" expected file location.");
TEST_ERROR;
} /* end if */
- if (H5Lexists(file, "/", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file, "/", H5P_DEFAULT) != true)
FAIL_STACK_ERROR;
- if (H5Lexists(file, "d1", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file, "d1", H5P_DEFAULT) != true)
FAIL_STACK_ERROR;
- if (H5Lexists(file, "grp1/hard", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file, "grp1/hard", H5P_DEFAULT) != true)
FAIL_STACK_ERROR;
- if (H5Lexists(file, "/grp1", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file, "/grp1", H5P_DEFAULT) != true)
FAIL_STACK_ERROR;
- if (H5Lexists(file, "/grp1/hard", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file, "/grp1/hard", H5P_DEFAULT) != true)
FAIL_STACK_ERROR;
H5E_BEGIN_TRY
{
@@ -2188,7 +2191,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format)
H5E_END_TRY
if (exists >= 0) {
H5_FAILED();
- HDputs(" H5Lexists() should have failed for a path with missing components.");
+ puts(" H5Lexists() should have failed for a path with missing components.");
TEST_ERROR;
} /* end if */
H5E_BEGIN_TRY
@@ -2198,7 +2201,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format)
H5E_END_TRY
if (exists >= 0) {
H5_FAILED();
- HDputs(" H5Lexists() should have failed for a path with missing components.");
+ puts(" H5Lexists() should have failed for a path with missing components.");
TEST_ERROR;
} /* end if */
@@ -2212,18 +2215,18 @@ cklinks_deprec(hid_t fapl, hbool_t new_format)
} /* end if */
if (H5_addr_ne(oinfo1.addr, oinfo2.addr)) {
H5_FAILED();
- HDputs(" Soft link test failed. Link seems not to point to the ");
- HDputs(" expected file location.");
+ puts(" Soft link test failed. Link seems not to point to the ");
+ puts(" expected file location.");
TEST_ERROR;
} /* end if */
if (H5Lget_val(file, "grp1/soft", linkval, sizeof linkval, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- if (HDstrcmp(linkval, "/d1") != 0) {
+ if (strcmp(linkval, "/d1") != 0) {
H5_FAILED();
- HDputs(" Soft link test failed. Wrong link value");
+ puts(" Soft link test failed. Wrong link value");
TEST_ERROR;
} /* end if */
- if (H5Lexists(file, "grp1/soft", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file, "grp1/soft", H5P_DEFAULT) != true)
FAIL_STACK_ERROR;
/* Dangling link */
@@ -2234,7 +2237,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format)
H5E_END_TRY
if (status >= 0) {
H5_FAILED();
- HDputs(" H5Oget_info_by_name() should have failed for a dangling link.");
+ puts(" H5Oget_info_by_name() should have failed for a dangling link.");
TEST_ERROR;
} /* end if */
if (H5Lget_info1(file, "grp1/dangle", &linfo, H5P_DEFAULT) < 0)
@@ -2249,12 +2252,12 @@ cklinks_deprec(hid_t fapl, hbool_t new_format)
printf(" %d: Can't retrieve link value\n", __LINE__);
TEST_ERROR;
} /* end if */
- if (HDstrcmp(linkval, "foobar") != 0) {
+ if (strcmp(linkval, "foobar") != 0) {
H5_FAILED();
- HDputs(" Dangling link test failed. Wrong link value");
+ puts(" Dangling link test failed. Wrong link value");
TEST_ERROR;
} /* end if */
- if (H5Lexists(file, "grp1/dangle", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(file, "grp1/dangle", H5P_DEFAULT) != true)
FAIL_STACK_ERROR;
/* Recursive link */
@@ -2265,7 +2268,7 @@ cklinks_deprec(hid_t fapl, hbool_t new_format)
H5E_END_TRY
if (status >= 0) {
H5_FAILED();
- HDputs(" H5Oget_info_by_name() should have failed for a recursive link.");
+ puts(" H5Oget_info_by_name() should have failed for a recursive link.");
TEST_ERROR;
} /* end if */
if (H5Lget_info1(file, "grp1/recursive", &linfo, H5P_DEFAULT) < 0)
@@ -2280,14 +2283,14 @@ cklinks_deprec(hid_t fapl, hbool_t new_format)
printf(" %d: Can't retrieve link value\n", __LINE__);
TEST_ERROR;
} /* end if */
- if (HDstrcmp(linkval, "/grp1/recursive") != 0) {
+ if (strcmp(linkval, "/grp1/recursive") != 0) {
H5_FAILED();
- HDputs(" Recursive link test failed. Wrong link value");
+ puts(" Recursive link test failed. Wrong link value");
TEST_ERROR;
} /* end if */
/* Non-existent link */
- if (H5Lexists(file, "foobar", H5P_DEFAULT) == TRUE)
+ if (H5Lexists(file, "foobar", H5P_DEFAULT) == true)
FAIL_STACK_ERROR;
/* Cleanup */
@@ -2311,14 +2314,14 @@ error:
*-------------------------------------------------------------------------
*/
static int
-test_lcpl_deprec(hid_t fapl, hbool_t new_format)
+test_lcpl_deprec(hid_t fapl, bool new_format)
{
- hid_t file_id = -1;
- hid_t group_id = -1;
- hid_t space_id = -1;
- hid_t dset_id = -1;
- hid_t type_id = -1;
- hid_t lcpl_id = -1;
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t group_id = H5I_INVALID_HID;
+ hid_t space_id = H5I_INVALID_HID;
+ hid_t dset_id = H5I_INVALID_HID;
+ hid_t type_id = H5I_INVALID_HID;
+ hid_t lcpl_id = H5I_INVALID_HID;
H5L_info1_t linfo;
char filename[1024];
hsize_t dims[2];
@@ -2525,13 +2528,13 @@ error:
*-------------------------------------------------------------------------
*/
static int
-test_move_preserves_deprec(hid_t fapl_id, hbool_t new_format)
+test_move_preserves_deprec(hid_t fapl_id, bool new_format)
{
- hid_t file_id = -1;
- hid_t group_id = -1;
- hid_t fcpl_id = -1; /* Group creation property list ID */
- hid_t lcpl_id = -1;
- hid_t lcpl2_id = -1;
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t group_id = H5I_INVALID_HID;
+ hid_t fcpl_id = H5I_INVALID_HID; /* Group creation property list ID */
+ hid_t lcpl_id = H5I_INVALID_HID;
+ hid_t lcpl2_id = H5I_INVALID_HID;
H5O_info1_t oinfo;
H5L_info1_t linfo;
H5T_cset_t old_cset;
@@ -2589,7 +2592,7 @@ test_move_preserves_deprec(hid_t fapl_id, hbool_t new_format)
old_cset = linfo.cset;
if (old_cset != H5T_CSET_UTF8)
TEST_ERROR;
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
old_corder = linfo.corder;
if (old_corder != 0)
@@ -2616,7 +2619,7 @@ test_move_preserves_deprec(hid_t fapl_id, hbool_t new_format)
TEST_ERROR;
if (old_cset != linfo.cset)
TEST_ERROR;
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (old_corder != linfo.corder)
TEST_ERROR;
@@ -2633,7 +2636,7 @@ test_move_preserves_deprec(hid_t fapl_id, hbool_t new_format)
TEST_ERROR;
if (old_corder == linfo.corder)
TEST_ERROR;
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (linfo.corder != 1)
TEST_ERROR;
@@ -2652,7 +2655,7 @@ test_move_preserves_deprec(hid_t fapl_id, hbool_t new_format)
TEST_ERROR;
if (H5Lget_info1(file_id, "group_copied", &linfo, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (linfo.corder != 2)
TEST_ERROR;
@@ -2670,7 +2673,7 @@ test_move_preserves_deprec(hid_t fapl_id, hbool_t new_format)
TEST_ERROR;
if (H5Lget_info1(file_id, "group_copied2", &linfo, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (linfo.corder != 3)
TEST_ERROR;
@@ -2686,7 +2689,7 @@ test_move_preserves_deprec(hid_t fapl_id, hbool_t new_format)
TEST_ERROR;
if (H5Lget_info1(file_id, "group", &linfo, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (old_corder != linfo.corder)
TEST_ERROR;
@@ -2704,7 +2707,7 @@ test_move_preserves_deprec(hid_t fapl_id, hbool_t new_format)
TEST_ERROR;
if (H5Lget_info1(file_id, "group_moved", &linfo, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (linfo.corder != 4)
TEST_ERROR;
@@ -2722,7 +2725,7 @@ test_move_preserves_deprec(hid_t fapl_id, hbool_t new_format)
TEST_ERROR;
if (H5Lget_info1(file_id, "group_moved_again", &linfo, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (linfo.corder != 5)
TEST_ERROR;
@@ -2765,12 +2768,12 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_root_deprec(hid_t fapl, hbool_t new_format)
+external_link_root_deprec(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
- H5L_info1_t linfo; /* Link information */
- char objname[NAME_BUF_SIZE]; /* Object name */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ H5L_info1_t linfo; /* Link information */
+ char objname[NAME_BUF_SIZE]; /* Object name */
char filename1[NAME_BUF_SIZE];
char filename2[NAME_BUF_SIZE];
const char *file; /* File from external link */
@@ -2794,7 +2797,7 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* Check that external links are registered with the library */
- if (H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE)
+ if (H5Lis_registered(H5L_TYPE_EXTERNAL) != true)
TEST_ERROR;
/* Create file with link to first file */
@@ -2810,21 +2813,21 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format)
goto error;
if (H5L_TYPE_EXTERNAL != linfo.type) {
H5_FAILED();
- HDputs(" Unexpected object type - should have been an external link");
+ puts(" Unexpected object type - should have been an external link");
goto error;
}
if (H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0)
TEST_ERROR;
if (H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0)
TEST_ERROR;
- if (HDstrcmp(file, filename1) != 0) {
+ if (strcmp(file, filename1) != 0) {
H5_FAILED();
- HDputs(" External link file name incorrect");
+ puts(" External link file name incorrect");
goto error;
}
- if (HDstrcmp(path, "/") != 0) {
+ if (strcmp(path, "/") != 0) {
H5_FAILED();
- HDputs(" External link path incorrect");
+ puts(" External link path incorrect");
goto error;
}
@@ -2838,21 +2841,21 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format)
goto error;
if (H5L_TYPE_EXTERNAL != linfo.type) {
H5_FAILED();
- HDputs(" Unexpected object type - should have been an external link");
+ puts(" Unexpected object type - should have been an external link");
goto error;
}
if (H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0)
TEST_ERROR;
if (H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0)
TEST_ERROR;
- if (HDstrcmp(file, filename1) != 0) {
+ if (strcmp(file, filename1) != 0) {
H5_FAILED();
- HDputs(" External link file name incorrect");
+ puts(" External link file name incorrect");
goto error;
}
- if (HDstrcmp(path, "/") != 0) {
+ if (strcmp(path, "/") != 0) {
H5_FAILED();
- HDputs(" External link path incorrect");
+ puts(" External link path incorrect");
goto error;
}
@@ -2869,7 +2872,7 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/") != 0)
+ if (strcmp(objname, "/") != 0)
TEST_ERROR;
/* Create object in external file */
@@ -2914,11 +2917,11 @@ external_link_root_deprec(hid_t fapl, hbool_t new_format)
/* Check names */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/new_group") != 0)
+ if (strcmp(objname, "/new_group") != 0)
TEST_ERROR;
if (H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/newer_group") != 0)
+ if (strcmp(objname, "/newer_group") != 0)
TEST_ERROR;
/* Close opened objects */
@@ -2984,14 +2987,14 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_query_deprec(hid_t fapl, hbool_t new_format)
+external_link_query_deprec(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
- const char *file_name; /* Name of the file the external link points to */
- const char *object_name; /* Name of the object the external link points to */
- H5O_info1_t oi; /* Object information */
- H5L_info1_t li; /* Link information */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
+ const char *file_name; /* Name of the file the external link points to */
+ const char *object_name; /* Name of the object the external link points to */
+ H5O_info1_t oi; /* Object information */
+ H5L_info1_t li; /* Link information */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], /* Names of files to externally link across */
query_buf[NAME_BUF_SIZE]; /* Buffer to hold query result */
@@ -3016,11 +3019,11 @@ external_link_query_deprec(hid_t fapl, hbool_t new_format)
/* Get size of buffer for external link */
if (H5Lget_info1(fid, "src", &li, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (li.u.val_size != (1 + (HDstrlen(filename2) + 1) + (HDstrlen("/dst") + 1)))
+ if (li.u.val_size != (1 + (strlen(filename2) + 1) + (strlen("/dst") + 1)))
TEST_ERROR;
if (H5L_TYPE_EXTERNAL != li.type) {
H5_FAILED();
- HDputs(" Unexpected link class - should have been an external link");
+ puts(" Unexpected link class - should have been an external link");
goto error;
}
@@ -3049,11 +3052,11 @@ external_link_query_deprec(hid_t fapl, hbool_t new_format)
/* Get size of buffer for external link */
if (H5Lget_info1(fid, "src", &li, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (li.u.val_size != (1 + (HDstrlen(filename2) + 1) + (HDstrlen("/dst") + 1)))
+ if (li.u.val_size != (1 + (strlen(filename2) + 1) + (strlen("/dst") + 1)))
TEST_ERROR;
if (H5L_TYPE_EXTERNAL != li.type) {
H5_FAILED();
- HDputs(" Unexpected link class - should have been an external link");
+ puts(" Unexpected link class - should have been an external link");
goto error;
}
@@ -3066,9 +3069,9 @@ external_link_query_deprec(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* Compare the file and object names */
- if (HDstrcmp(file_name, filename2) != 0)
+ if (strcmp(file_name, filename2) != 0)
TEST_ERROR;
- if (HDstrcmp(object_name, "/dst") != 0)
+ if (strcmp(object_name, "/dst") != 0)
TEST_ERROR;
/* Query information about object that external link points to */
@@ -3076,7 +3079,7 @@ external_link_query_deprec(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR;
if (H5O_TYPE_GROUP != oi.type) {
H5_FAILED();
- HDputs(" Unexpected object type - should have been a group");
+ puts(" Unexpected object type - should have been a group");
goto error;
}
@@ -3138,11 +3141,13 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_closing_deprec(hid_t fapl, hbool_t new_format)
+external_link_closing_deprec(hid_t fapl, bool new_format)
{
- hid_t fid1 = (-1), fid2 = (-1), fid3 = (-1), fid4 = (-1);
- hid_t gid = (-1), tid = (-1), tid2 = (-1), sid = (-1), did = (-1);
- hid_t lcpl_id = (-1);
+ hid_t fid1 = (H5I_INVALID_HID), fid2 = (H5I_INVALID_HID), fid3 = (H5I_INVALID_HID),
+ fid4 = (H5I_INVALID_HID);
+ hid_t gid = (H5I_INVALID_HID), tid = (H5I_INVALID_HID), tid2 = (H5I_INVALID_HID), sid = (H5I_INVALID_HID),
+ did = (H5I_INVALID_HID);
+ hid_t lcpl_id = (H5I_INVALID_HID);
hsize_t dims[2];
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE],
filename4[NAME_BUF_SIZE], /* Names of files to externally link across */
@@ -3262,7 +3267,7 @@ external_link_closing_deprec(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR;
if (H5Oget_comment_by_name(fid1, "elink/elink/elink/group1_moved", buf, sizeof(buf), H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- if (HDstrcmp(buf, "comment") != 0)
+ if (strcmp(buf, "comment") != 0)
TEST_ERROR;
/* Test H5*open */
@@ -3366,7 +3371,7 @@ external_link_closing_deprec(hid_t fapl, hbool_t new_format)
/* Add a few regular groups and a soft link in file2 using intermediate group creation */
if ((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0)
TEST_ERROR;
- if (H5Pset_create_intermediate_group(lcpl_id, TRUE) < 0)
+ if (H5Pset_create_intermediate_group(lcpl_id, true) < 0)
TEST_ERROR;
if (H5Lcreate_soft("/elink2", fid1, "elink/file2group1/file2group2/slink", lcpl_id, H5P_DEFAULT) < 0)
TEST_ERROR;
@@ -3449,7 +3454,7 @@ UD_hard_create_deprec(const char H5_ATTR_UNUSED *link_name, hid_t loc_group, con
size_t udata_size, hid_t H5_ATTR_UNUSED lcpl_id)
{
haddr_t addr;
- hid_t target_obj = -1;
+ hid_t target_obj = H5I_INVALID_HID;
herr_t ret_value = 0;
if (udata_size != sizeof(haddr_t)) {
@@ -3523,7 +3528,7 @@ UD_hard_traverse_deprec(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, c
size_t udata_size, hid_t H5_ATTR_UNUSED lapl_id, hid_t H5_ATTR_UNUSED dxpl_id)
{
haddr_t addr;
- hid_t ret_value = -1;
+ hid_t ret_value = H5I_INVALID_HID;
if (udata_size != sizeof(haddr_t))
return FAIL;
@@ -3540,7 +3545,7 @@ static herr_t
UD_hard_delete_deprec(const char H5_ATTR_UNUSED *link_name, hid_t file, const void *udata, size_t udata_size)
{
haddr_t addr;
- hid_t target_obj = -1;
+ hid_t target_obj = H5I_INVALID_HID;
herr_t ret_value = 0;
if (udata_size != sizeof(haddr_t)) {
@@ -3611,11 +3616,11 @@ done:
static int
ud_hard_links_deprec(hid_t fapl)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
- H5L_info1_t li; /* Link information */
- char objname[NAME_BUF_SIZE]; /* Object name */
- h5_stat_size_t empty_size; /* Size of an empty file */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ H5L_info1_t li; /* Link information */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ h5_stat_size_t empty_size; /* Size of an empty file */
char filename[NAME_BUF_SIZE];
TESTING("user-defined hard link using deprecated routines (w/new group format)");
@@ -3636,9 +3641,9 @@ ud_hard_links_deprec(hid_t fapl)
TEST_ERROR;
/* Check that external links are registered and UD hard links are not */
- if (H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE)
+ if (H5Lis_registered(H5L_TYPE_EXTERNAL) != true)
TEST_ERROR;
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != FALSE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != false)
TEST_ERROR;
/* Register "user-defined hard links" with the library */
@@ -3646,9 +3651,9 @@ ud_hard_links_deprec(hid_t fapl)
TEST_ERROR;
/* Check that UD hard links are now registered */
- if (H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE)
+ if (H5Lis_registered(H5L_TYPE_EXTERNAL) != true)
TEST_ERROR;
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != TRUE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != true)
TEST_ERROR;
/* Create a group for the UD hard link to point to */
@@ -3681,7 +3686,7 @@ ud_hard_links_deprec(hid_t fapl)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/group") != 0)
+ if (strcmp(objname, "/group") != 0)
TEST_ERROR;
/* Create object in group */
@@ -3701,7 +3706,7 @@ ud_hard_links_deprec(hid_t fapl)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/group/new_group") != 0)
+ if (strcmp(objname, "/group/new_group") != 0)
TEST_ERROR;
/* Close opened object */
@@ -3716,7 +3721,7 @@ ud_hard_links_deprec(hid_t fapl)
TEST_ERROR;
if (UD_HARD_TYPE != li.type) {
H5_FAILED();
- HDputs(" Unexpected link class - should have been a UD hard link");
+ puts(" Unexpected link class - should have been a UD hard link");
goto error;
} /* end if */
@@ -3768,10 +3773,10 @@ error:
static int
ud_link_reregister_deprec(hid_t fapl)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
- H5L_info1_t li; /* Link information */
- char objname[NAME_BUF_SIZE]; /* Object name */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ H5L_info1_t li; /* Link information */
+ char objname[NAME_BUF_SIZE]; /* Object name */
char filename[NAME_BUF_SIZE];
h5_stat_size_t empty_size; /* Size of an empty file */
@@ -3793,7 +3798,7 @@ ud_link_reregister_deprec(hid_t fapl)
TEST_ERROR;
/* Check that UD hard links are not registered */
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != FALSE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != false)
TEST_ERROR;
/* Register "user-defined hard links" with the library */
@@ -3801,7 +3806,7 @@ ud_link_reregister_deprec(hid_t fapl)
TEST_ERROR;
/* Check that UD hard links are registered */
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != TRUE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != true)
TEST_ERROR;
/* Point a UD defined hard link to a group in the same way as the previous test */
@@ -3827,7 +3832,7 @@ ud_link_reregister_deprec(hid_t fapl)
TEST_ERROR;
/* Check that UD hard links are no longer registered */
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != FALSE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != false)
TEST_ERROR;
/* Verify that we can't traverse the ud link anymore */
@@ -3852,7 +3857,7 @@ ud_link_reregister_deprec(hid_t fapl)
TEST_ERROR;
/* Check that UD hard links are registered again */
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != TRUE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != true)
TEST_ERROR;
/* Open a group through the ud link (now a different class of link).
@@ -3864,7 +3869,7 @@ ud_link_reregister_deprec(hid_t fapl)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/" REREG_TARGET_NAME) != 0)
+ if (strcmp(objname, "/" REREG_TARGET_NAME) != 0)
TEST_ERROR;
/* Create object in group */
@@ -3884,7 +3889,7 @@ ud_link_reregister_deprec(hid_t fapl)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/rereg_target/new_group") != 0)
+ if (strcmp(objname, "/rereg_target/new_group") != 0)
TEST_ERROR;
/* Close opened object */
@@ -3901,7 +3906,7 @@ ud_link_reregister_deprec(hid_t fapl)
* other link type */
if (H5Lregister(UD_hard_class_deprec) < 0)
FAIL_STACK_ERROR;
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != TRUE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != true)
FAIL_STACK_ERROR;
/* Ensure we can open the group through the UD link (now that UD hard
@@ -3932,7 +3937,7 @@ ud_link_reregister_deprec(hid_t fapl)
if (H5Lunregister((H5L_type_t)UD_HARD_TYPE) < 0)
FAIL_STACK_ERROR;
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != FALSE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != false)
FAIL_STACK_ERROR;
PASSED();
@@ -3950,11 +3955,11 @@ error:
} /* end ud_link_reregister_deprec() */
static int
-ud_callbacks_deprec(hid_t fapl, hbool_t new_format)
+ud_callbacks_deprec(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group ID */
- hid_t lcpl = -1; /* Link Creation PL */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
+ hid_t lcpl = H5I_INVALID_HID; /* Link Creation PL */
H5L_info1_t li; /* Link information */
char ud_target_name[] = UD_CB_TARGET; /* Link target name */
char filename[NAME_BUF_SIZE];
@@ -3972,11 +3977,11 @@ ud_callbacks_deprec(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* Check that registered link classes are, and unregistered ones aren't */
- if (H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE)
+ if (H5Lis_registered(H5L_TYPE_EXTERNAL) != true)
TEST_ERROR;
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != FALSE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != false)
TEST_ERROR;
- if (H5Lis_registered((H5L_type_t)UD_CB_TYPE) != FALSE)
+ if (H5Lis_registered((H5L_type_t)UD_CB_TYPE) != false)
TEST_ERROR;
/* Hit two birds with one stone: register UD hard links from previous
@@ -3990,11 +3995,11 @@ ud_callbacks_deprec(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* Check that registered link classes are, and unregistered ones aren't */
- if (H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE)
+ if (H5Lis_registered(H5L_TYPE_EXTERNAL) != true)
TEST_ERROR;
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != TRUE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != true)
TEST_ERROR;
- if (H5Lis_registered((H5L_type_t)UD_CB_TYPE) != TRUE)
+ if (H5Lis_registered((H5L_type_t)UD_CB_TYPE) != true)
TEST_ERROR;
/* Create a group for the UD link to point to */
@@ -4021,14 +4026,14 @@ ud_callbacks_deprec(hid_t fapl, hbool_t new_format)
TEST_ERROR;
if (UD_CB_TYPE != li.type) {
H5_FAILED();
- HDputs(" Unexpected link class - should have been a UD hard link");
+ puts(" Unexpected link class - should have been a UD hard link");
goto error;
}
/* Fill the query buffer */
if (H5Lget_val(fid, UD_CB_LINK_NAME, query_buf, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- if (HDstrcmp(query_buf, "query succeeded") != 0)
+ if (strcmp(query_buf, "query succeeded") != 0)
TEST_ERROR;
/* Move the link */
@@ -4127,14 +4132,14 @@ error:
*-------------------------------------------------------------------------
*/
static int
-lapl_nlinks_deprec(hid_t fapl, hbool_t new_format)
+lapl_nlinks_deprec(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
- hid_t plist = -1; /* lapl ID */
- hid_t tid = -1, sid = -1, did = -1; /* Other IDs */
- hid_t gapl = -1, dapl = -1, tapl = -1; /* Other property lists */
- char objname[NAME_BUF_SIZE]; /* Object name */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ hid_t plist = H5I_INVALID_HID; /* lapl ID */
+ hid_t tid = H5I_INVALID_HID, sid = H5I_INVALID_HID, did = H5I_INVALID_HID; /* Other IDs */
+ hid_t gapl = H5I_INVALID_HID, dapl = H5I_INVALID_HID, tapl = H5I_INVALID_HID; /* Other property lists */
+ char objname[NAME_BUF_SIZE]; /* Object name */
char filename[NAME_BUF_SIZE];
size_t nlinks; /* nlinks for H5Pset_nlinks */
hsize_t dims[2];
@@ -4228,7 +4233,7 @@ lapl_nlinks_deprec(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/soft17") != 0)
+ if (strcmp(objname, "/soft17") != 0)
TEST_ERROR;
/* Create group using soft link */
@@ -4261,7 +4266,7 @@ lapl_nlinks_deprec(hid_t fapl, hbool_t new_format)
H5E_END_TRY
if (gid >= 0) {
H5_FAILED();
- HDputs(" Should have failed for sequence of too many nested links.");
+ puts(" Should have failed for sequence of too many nested links.");
goto error;
}
@@ -4272,7 +4277,7 @@ lapl_nlinks_deprec(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/soft4") != 0)
+ if (strcmp(objname, "/soft4") != 0)
TEST_ERROR;
/* Test other functions that should use a LAPL */
@@ -4434,13 +4439,13 @@ error:
*-------------------------------------------------------------------------
*/
static int
-linkinfo_deprec(hid_t fapl, hbool_t new_format)
+linkinfo_deprec(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group ID */
- hid_t tid = -1; /* Type ID */
- hid_t sid = -1, did = -1; /* Dataspace and dataset IDs */
- H5L_info1_t li; /* Link information */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
+ hid_t tid = H5I_INVALID_HID; /* Type ID */
+ hid_t sid = H5I_INVALID_HID, did = H5I_INVALID_HID; /* Dataspace and dataset IDs */
+ H5L_info1_t li; /* Link information */
char filename[NAME_BUF_SIZE];
if (new_format)
@@ -4549,15 +4554,15 @@ error:
static int
corder_create_compact_deprec(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1, group_id2 = -1; /* Group IDs */
- hid_t gcpl_id = -1; /* Group creation property list ID */
- unsigned max_compact; /* Maximum # of links to store in group compactly */
- unsigned min_dense; /* Minimum # of links to store in group "densely" */
- unsigned nlinks; /* Number of link messages in group's header */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE]; /* File name */
- unsigned u; /* Local index variable */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */
+ hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */
+ unsigned max_compact; /* Maximum # of links to store in group compactly */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ unsigned nlinks; /* Number of link messages in group's header */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ unsigned u; /* Local index variable */
TESTING("creating compact group with creation order indexing using deprecated routines");
@@ -4579,11 +4584,11 @@ corder_create_compact_deprec(hid_t fapl)
TEST_ERROR;
/* Check on group's initial status */
- if (H5G__is_empty_test(group_id) != TRUE)
+ if (H5G__is_empty_test(group_id) != true)
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) == TRUE)
+ if (H5G__is_new_dense_test(group_id) == true)
TEST_ERROR;
/* Query the group creation properties */
@@ -4592,20 +4597,20 @@ corder_create_compact_deprec(hid_t fapl)
/* Create several links, but keep group in compact form */
for (u = 0; u < max_compact; u++) {
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
if (H5Gclose(group_id2) < 0)
TEST_ERROR;
/* Verify state of group */
- if (H5G__has_links_test(group_id, &nlinks) != TRUE)
+ if (H5G__has_links_test(group_id, &nlinks) != true)
TEST_ERROR;
if (nlinks != (u + 1))
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) == TRUE)
+ if (H5G__is_new_dense_test(group_id) == true)
TEST_ERROR;
} /* end for */
@@ -4630,13 +4635,13 @@ corder_create_compact_deprec(hid_t fapl)
FAIL_STACK_ERROR;
/* Verify state of group */
- if (H5G__has_links_test(group_id, &nlinks) != TRUE)
+ if (H5G__has_links_test(group_id, &nlinks) != true)
TEST_ERROR;
if (nlinks != max_compact)
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) == TRUE)
+ if (H5G__is_new_dense_test(group_id) == true)
TEST_ERROR;
/* Loop through links, checking their creation order values */
@@ -4645,12 +4650,12 @@ corder_create_compact_deprec(hid_t fapl)
H5L_info1_t linfo; /* Link information */
/* Retrieve information for link */
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if (H5Lget_info1(group_id, objname, &linfo, H5P_DEFAULT) < 0)
TEST_ERROR;
/* Verify creation order of link */
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (linfo.corder != u)
TEST_ERROR;
@@ -4691,17 +4696,17 @@ error:
static int
corder_create_dense_deprec(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1, group_id2 = -1; /* Group IDs */
- hid_t gcpl_id = -1; /* Group creation property list ID */
- unsigned max_compact; /* Maximum # of links to store in group compactly */
- unsigned min_dense; /* Minimum # of links to store in group "densely" */
- unsigned nlinks; /* Number of link messages in group's header */
- hsize_t name_count; /* # of records in name index */
- hsize_t corder_count; /* # of records in creation order index */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE]; /* File name */
- unsigned u; /* Local index variable */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */
+ hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */
+ unsigned max_compact; /* Maximum # of links to store in group compactly */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ unsigned nlinks; /* Number of link messages in group's header */
+ hsize_t name_count; /* # of records in name index */
+ hsize_t corder_count; /* # of records in creation order index */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ unsigned u; /* Local index variable */
TESTING("creating dense group with creation order indexing using deprecated routines");
@@ -4723,11 +4728,11 @@ corder_create_dense_deprec(hid_t fapl)
TEST_ERROR;
/* Check on group's initial status */
- if (H5G__is_empty_test(group_id) != TRUE)
+ if (H5G__is_empty_test(group_id) != true)
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) == TRUE)
+ if (H5G__is_new_dense_test(group_id) == true)
TEST_ERROR;
/* Query the group creation properties */
@@ -4736,36 +4741,36 @@ corder_create_dense_deprec(hid_t fapl)
/* Create several links, up to limit of compact form */
for (u = 0; u < max_compact; u++) {
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
if (H5Gclose(group_id2) < 0)
TEST_ERROR;
/* Verify state of group */
- if (H5G__has_links_test(group_id, &nlinks) != TRUE)
+ if (H5G__has_links_test(group_id, &nlinks) != true)
TEST_ERROR;
if (nlinks != (u + 1))
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) == TRUE)
+ if (H5G__is_new_dense_test(group_id) == true)
TEST_ERROR;
} /* end for */
/* Create another link, to push group into dense form */
- HDsnprintf(objname, sizeof(objname), "filler %u", max_compact);
+ snprintf(objname, sizeof(objname), "filler %u", max_compact);
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
if (H5Gclose(group_id2) < 0)
TEST_ERROR;
/* Verify state of group */
- if (H5G__has_links_test(group_id, NULL) == TRUE)
+ if (H5G__has_links_test(group_id, NULL) == true)
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Retrieve & verify # of records in the name & creation order indices */
@@ -4795,11 +4800,11 @@ corder_create_dense_deprec(hid_t fapl)
FAIL_STACK_ERROR;
/* Verify state of group */
- if (H5G__has_links_test(group_id, NULL) == TRUE)
+ if (H5G__has_links_test(group_id, NULL) == true)
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Loop through links, checking their creation order values */
@@ -4808,12 +4813,12 @@ corder_create_dense_deprec(hid_t fapl)
H5L_info1_t linfo; /* Link information */
/* Retrieve information for link */
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if (H5Lget_info1(group_id, objname, &linfo, H5P_DEFAULT) < 0)
TEST_ERROR;
/* Verify creation order of link */
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (linfo.corder != u)
TEST_ERROR;
@@ -4855,8 +4860,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, hbool_t hard_link,
- hbool_t use_index)
+link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, bool hard_link, bool use_index)
{
char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
char valname[NAME_BUF_SIZE]; /* Link value name */
@@ -4864,7 +4868,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
H5L_info1_t linfo; /* Link info struct */
/* Make link value for increasing/native order queries */
- HDsnprintf(valname, sizeof(valname), "value %02u", (unsigned)n);
+ snprintf(valname, sizeof(valname), "value %02u", (unsigned)n);
/* Verify the link information for first link, in increasing creation order */
memset(&linfo, 0, sizeof(linfo));
@@ -4887,7 +4891,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(valname, tmpval) != 0)
+ if (strcmp(valname, tmpval) != 0)
TEST_ERROR;
} /* end if */
@@ -4896,7 +4900,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE,
H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(linkname, tmpname) != 0)
+ if (strcmp(linkname, tmpname) != 0)
TEST_ERROR;
/* Don't test "native" order if there is no creation order index, since
@@ -4926,7 +4930,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(valname, tmpval) != 0)
+ if (strcmp(valname, tmpval) != 0)
TEST_ERROR;
} /* end if */
@@ -4935,7 +4939,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(linkname, tmpname) != 0)
+ if (strcmp(linkname, tmpname) != 0)
TEST_ERROR;
} /* end if */
@@ -4960,7 +4964,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(valname, tmpval) != 0)
+ if (strcmp(valname, tmpval) != 0)
TEST_ERROR;
} /* end if */
@@ -4969,7 +4973,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(linkname, tmpname) != 0)
+ if (strcmp(linkname, tmpname) != 0)
TEST_ERROR;
/* Verify the link information for first link, in increasing link name order */
@@ -4992,7 +4996,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpval, (size_t)NAME_BUF_SIZE,
H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(valname, tmpval) != 0)
+ if (strcmp(valname, tmpval) != 0)
TEST_ERROR;
} /* end if */
@@ -5001,7 +5005,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE,
H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(linkname, tmpname) != 0)
+ if (strcmp(linkname, tmpname) != 0)
TEST_ERROR;
/* Don't test "native" order queries on link name order, since there's not
@@ -5028,7 +5032,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(valname, tmpval) != 0)
+ if (strcmp(valname, tmpval) != 0)
TEST_ERROR;
} /* end if */
@@ -5037,7 +5041,7 @@ link_info_by_idx_check_deprec(hid_t group_id, const char *linkname, hsize_t n, h
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(linkname, tmpname) != 0)
+ if (strcmp(linkname, tmpname) != 0)
TEST_ERROR;
/* Success */
@@ -5061,26 +5065,26 @@ error:
static int
link_info_by_idx_deprec(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1; /* Group ID */
- hid_t gcpl_id = -1; /* Group creation property list ID */
- unsigned hard_link; /* Create hard or soft link? */
- unsigned use_index; /* Use index on creation order values */
- unsigned max_compact; /* Maximum # of links to store in group compactly */
- unsigned min_dense; /* Minimum # of links to store in group "densely" */
- H5L_info1_t linfo; /* Link info struct */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char valname[NAME_BUF_SIZE]; /* Link value name */
- char filename[NAME_BUF_SIZE]; /* File name */
- char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
- unsigned u; /* Local index variable */
- ssize_t name_len; /* Length of name */
- herr_t ret; /* Generic return value */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID; /* Group ID */
+ hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */
+ unsigned hard_link; /* Create hard or soft link? */
+ unsigned use_index; /* Use index on creation order values */
+ unsigned max_compact; /* Maximum # of links to store in group compactly */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ H5L_info1_t linfo; /* Link info struct */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char valname[NAME_BUF_SIZE]; /* Link value name */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
+ unsigned u; /* Local index variable */
+ ssize_t name_len; /* Length of name */
+ herr_t ret; /* Generic return value */
/* Loop over creating hard or soft links */
- for (hard_link = FALSE; hard_link <= TRUE; hard_link++) {
+ for (hard_link = false; hard_link <= true; hard_link++) {
/* Loop over using index for creation order value */
- for (use_index = FALSE; use_index <= TRUE; use_index++) {
+ for (use_index = false; use_index <= true; use_index++) {
if (hard_link) {
if (use_index)
TESTING("querying info by index w/creation order index, using hard links and deprecated "
@@ -5141,7 +5145,7 @@ link_info_by_idx_deprec(hid_t fapl)
/* Create several links, up to limit of compact form */
for (u = 0; u < max_compact; u++) {
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Check for creating hard or soft link */
if (hard_link) {
@@ -5156,7 +5160,7 @@ link_info_by_idx_deprec(hid_t fapl)
} /* end if */
else {
/* Make value for link */
- HDsnprintf(valname, sizeof(valname), "value %02u", u);
+ snprintf(valname, sizeof(valname), "value %02u", u);
/* Create soft link */
if (H5Lcreate_soft(valname, group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0)
@@ -5169,7 +5173,7 @@ link_info_by_idx_deprec(hid_t fapl)
} /* end for */
/* Verify state of group */
- if (H5G__has_links_test(group_id, NULL) != TRUE)
+ if (H5G__has_links_test(group_id, NULL) != true)
TEST_ERROR;
/* Check for out of bound offset queries */
@@ -5201,7 +5205,7 @@ link_info_by_idx_deprec(hid_t fapl)
/* Create more links, to push group into dense form */
for (; u < (max_compact * 2); u++) {
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Check for creating hard or soft link */
if (hard_link) {
@@ -5216,7 +5220,7 @@ link_info_by_idx_deprec(hid_t fapl)
} /* end if */
else {
/* Make value for link */
- HDsnprintf(valname, sizeof(valname), "value %02u", u);
+ snprintf(valname, sizeof(valname), "value %02u", u);
/* Create soft link */
if (H5Lcreate_soft(valname, group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0)
@@ -5224,7 +5228,7 @@ link_info_by_idx_deprec(hid_t fapl)
} /* end else */
/* Verify state of group */
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Verify link information for new link */
@@ -5300,22 +5304,22 @@ error:
static int
link_info_by_idx_old_deprec(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1, group_id2 = -1; /* Group IDs */
- unsigned hard_link; /* Create hard or soft link? */
- H5L_info1_t linfo; /* Link info struct */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char valname[NAME_BUF_SIZE]; /* Link value name */
- char filename[NAME_BUF_SIZE]; /* File name */
- haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */
- char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
- char tmpval[NAME_BUF_SIZE]; /* Temporary link value */
- unsigned u; /* Local index variable */
- ssize_t name_len; /* Length of name */
- herr_t ret; /* Generic return value */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */
+ unsigned hard_link; /* Create hard or soft link? */
+ H5L_info1_t linfo; /* Link info struct */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char valname[NAME_BUF_SIZE]; /* Link value name */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */
+ char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
+ char tmpval[NAME_BUF_SIZE]; /* Temporary link value */
+ unsigned u; /* Local index variable */
+ ssize_t name_len; /* Length of name */
+ herr_t ret; /* Generic return value */
/* Loop over creating hard or soft links */
- for (hard_link = FALSE; hard_link <= TRUE; hard_link++) {
+ for (hard_link = false; hard_link <= true; hard_link++) {
if (hard_link)
TESTING("querying info by index in old-style group, using hard links and deprecated routines");
else
@@ -5333,7 +5337,7 @@ link_info_by_idx_old_deprec(hid_t fapl)
/* Create several links */
for (u = 0; u < CORDER_NLINKS; u++) {
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Check for creating hard or soft link */
if (hard_link) {
@@ -5354,7 +5358,7 @@ link_info_by_idx_old_deprec(hid_t fapl)
} /* end if */
else {
/* Make value for link */
- HDsnprintf(valname, sizeof(valname), "value %02u", u);
+ snprintf(valname, sizeof(valname), "value %02u", u);
/* Create soft link */
if (H5Lcreate_soft(valname, group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0)
@@ -5367,10 +5371,10 @@ link_info_by_idx_old_deprec(hid_t fapl)
unsigned dec_u = CORDER_NLINKS - (u + 1); /* Decreasing mapped index */
/* Make link name for increasing/native order queries */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Make link value for increasing/native order queries */
- HDsnprintf(valname, sizeof(valname), "value %02u", u);
+ snprintf(valname, sizeof(valname), "value %02u", u);
/* Verify link information (in increasing order) */
if (hard_link) {
@@ -5384,7 +5388,7 @@ link_info_by_idx_old_deprec(hid_t fapl)
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(valname, tmpval) != 0)
+ if (strcmp(valname, tmpval) != 0)
TEST_ERROR;
} /* end else */
@@ -5392,7 +5396,7 @@ link_info_by_idx_old_deprec(hid_t fapl)
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, tmpname) != 0)
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
/* Verify link information (in native order - native is increasing) */
@@ -5407,7 +5411,7 @@ link_info_by_idx_old_deprec(hid_t fapl)
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(valname, tmpval) != 0)
+ if (strcmp(valname, tmpval) != 0)
TEST_ERROR;
} /* end else */
@@ -5415,14 +5419,14 @@ link_info_by_idx_old_deprec(hid_t fapl)
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, tmpname) != 0)
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
/* Make link name for decreasing order queries */
- HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
+ snprintf(objname, sizeof(objname), "filler %02u", dec_u);
/* Make link value for decreasing order queries */
- HDsnprintf(valname, sizeof(valname), "value %02u", dec_u);
+ snprintf(valname, sizeof(valname), "value %02u", dec_u);
/* Verify link information (in decreasing order) */
if (hard_link) {
@@ -5436,7 +5440,7 @@ link_info_by_idx_old_deprec(hid_t fapl)
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(valname, tmpval) != 0)
+ if (strcmp(valname, tmpval) != 0)
TEST_ERROR;
} /* end else */
@@ -5444,7 +5448,7 @@ link_info_by_idx_old_deprec(hid_t fapl)
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, tmpname) != 0)
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
} /* end for */
@@ -5467,7 +5471,7 @@ link_info_by_idx_old_deprec(hid_t fapl)
TEST_ERROR;
/* Verify state of group */
- if (H5G__has_stab_test(group_id) != TRUE)
+ if (H5G__has_stab_test(group_id) != true)
TEST_ERROR;
/* Close the group */
@@ -5506,27 +5510,27 @@ error:
static int
delete_by_idx_deprec(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1; /* Group ID */
- hid_t gcpl_id = -1; /* Group creation property list ID */
- H5_index_t idx_type; /* Type of index to operate on */
- H5_iter_order_t order; /* Order within in the index */
- unsigned use_index; /* Use index on creation order values */
- unsigned max_compact; /* Maximum # of links to store in group compactly */
- unsigned min_dense; /* Minimum # of links to store in group "densely" */
- H5L_info1_t linfo; /* Link info struct */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE]; /* File name */
- char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
- unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID; /* Group ID */
+ hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */
+ H5_index_t idx_type; /* Type of index to operate on */
+ H5_iter_order_t order; /* Order within in the index */
+ unsigned use_index; /* Use index on creation order values */
+ unsigned max_compact; /* Maximum # of links to store in group compactly */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ H5L_info1_t linfo; /* Link info struct */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
+ unsigned u; /* Local index variable */
+ herr_t ret; /* Generic return value */
/* Loop over operating on different indices on link fields */
for (idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; idx_type++) {
/* Loop over operating in different orders */
for (order = H5_ITER_INC; order <= H5_ITER_DEC; order++) {
/* Loop over using index for creation order value */
- for (use_index = FALSE; use_index <= TRUE; use_index++) {
+ for (use_index = false; use_index <= true; use_index++) {
/* Print appropriate test message */
if (idx_type == H5_INDEX_CRT_ORDER) {
if (order == H5_ITER_INC) {
@@ -5614,7 +5618,7 @@ delete_by_idx_deprec(hid_t fapl)
hid_t group_id2; /* Group ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
@@ -5624,12 +5628,12 @@ delete_by_idx_deprec(hid_t fapl)
TEST_ERROR;
/* Verify link information for new link */
- if (link_info_by_idx_check_deprec(group_id, objname, (hsize_t)u, TRUE, use_index) < 0)
+ if (link_info_by_idx_check_deprec(group_id, objname, (hsize_t)u, true, use_index) < 0)
TEST_ERROR;
} /* end for */
/* Verify state of group (compact) */
- if (H5G__has_links_test(group_id, NULL) != TRUE)
+ if (H5G__has_links_test(group_id, NULL) != true)
TEST_ERROR;
/* Check for out of bound deletion */
@@ -5667,10 +5671,10 @@ delete_by_idx_deprec(hid_t fapl)
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
if (order == H5_ITER_INC)
- HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
+ snprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
- HDsnprintf(objname, sizeof(objname), "filler %02u", (max_compact - (u + 2)));
- if (HDstrcmp(objname, tmpname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u", (max_compact - (u + 2)));
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
} /* end for */
@@ -5679,7 +5683,7 @@ delete_by_idx_deprec(hid_t fapl)
TEST_ERROR;
/* Verify state of group (empty) */
- if (H5G__has_links_test(group_id, NULL) == TRUE)
+ if (H5G__has_links_test(group_id, NULL) == true)
TEST_ERROR;
/* Create more links, to push group into dense form */
@@ -5687,7 +5691,7 @@ delete_by_idx_deprec(hid_t fapl)
hid_t group_id2; /* Group ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
@@ -5698,11 +5702,11 @@ delete_by_idx_deprec(hid_t fapl)
/* Verify state of group (dense) */
if (u >= max_compact)
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Verify link information for new link */
- if (link_info_by_idx_check_deprec(group_id, objname, (hsize_t)u, TRUE, use_index) < 0)
+ if (link_info_by_idx_check_deprec(group_id, objname, (hsize_t)u, true, use_index) < 0)
TEST_ERROR;
} /* end for */
@@ -5741,10 +5745,10 @@ delete_by_idx_deprec(hid_t fapl)
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
if (order == H5_ITER_INC)
- HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
+ snprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
- HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - (u + 2)));
- if (HDstrcmp(objname, tmpname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - (u + 2)));
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
} /* end for */
@@ -5753,9 +5757,9 @@ delete_by_idx_deprec(hid_t fapl)
TEST_ERROR;
/* Verify state of group (empty) */
- if (H5G__has_links_test(group_id, NULL) == TRUE)
+ if (H5G__has_links_test(group_id, NULL) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) == TRUE)
+ if (H5G__is_new_dense_test(group_id) == true)
TEST_ERROR;
/* Check for deletion on empty group again */
@@ -5774,7 +5778,7 @@ delete_by_idx_deprec(hid_t fapl)
hid_t group_id2; /* Group ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
@@ -5785,11 +5789,11 @@ delete_by_idx_deprec(hid_t fapl)
/* Verify state of group (dense) */
if (u >= max_compact)
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Verify link information for new link */
- if (link_info_by_idx_check_deprec(group_id, objname, (hsize_t)u, TRUE, use_index) < 0)
+ if (link_info_by_idx_check_deprec(group_id, objname, (hsize_t)u, true, use_index) < 0)
TEST_ERROR;
} /* end for */
@@ -5819,11 +5823,11 @@ delete_by_idx_deprec(hid_t fapl)
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
if (order == H5_ITER_INC)
- HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1));
+ snprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1));
else
- HDsnprintf(objname, sizeof(objname), "filler %02u",
- ((max_compact * 2) - ((u * 2) + 2)));
- if (HDstrcmp(objname, tmpname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u",
+ ((max_compact * 2) - ((u * 2) + 2)));
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
} /* end for */
@@ -5853,11 +5857,11 @@ delete_by_idx_deprec(hid_t fapl)
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
if (order == H5_ITER_INC)
- HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3));
+ snprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3));
else
- HDsnprintf(objname, sizeof(objname), "filler %02u",
- ((max_compact * 2) - ((u * 2) + 4)));
- if (HDstrcmp(objname, tmpname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u",
+ ((max_compact * 2) - ((u * 2) + 4)));
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
} /* end for */
@@ -5866,9 +5870,9 @@ delete_by_idx_deprec(hid_t fapl)
TEST_ERROR;
/* Verify state of group (empty) */
- if (H5G__has_links_test(group_id, NULL) == TRUE)
+ if (H5G__has_links_test(group_id, NULL) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) == TRUE)
+ if (H5G__is_new_dense_test(group_id) == true)
TEST_ERROR;
/* Close the group */
@@ -5914,16 +5918,16 @@ error:
static int
delete_by_idx_old_deprec(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1, group_id2 = -1; /* Group IDs */
- H5L_info1_t linfo; /* Link info struct */
- H5_iter_order_t order; /* Order within in the index */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE]; /* File name */
- haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */
- char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
- unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */
+ H5L_info1_t linfo; /* Link info struct */
+ H5_iter_order_t order; /* Order within in the index */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ haddr_t objno[CORDER_NLINKS]; /* Addresses of the objects created */
+ char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
+ unsigned u; /* Local index variable */
+ herr_t ret; /* Generic return value */
/* Loop over operating in different orders */
for (order = H5_ITER_INC; order <= H5_ITER_DEC; order++) {
@@ -5960,7 +5964,7 @@ delete_by_idx_old_deprec(hid_t fapl)
H5O_info1_t oi; /* Buffer for querying object's info */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create group */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -6021,10 +6025,10 @@ delete_by_idx_old_deprec(hid_t fapl)
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
if (order == H5_ITER_INC)
- HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
+ snprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
- HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
- if (HDstrcmp(objname, tmpname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u", dec_u);
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
} /* end for */
@@ -6042,7 +6046,7 @@ delete_by_idx_old_deprec(hid_t fapl)
TEST_ERROR;
/* Verify state of group */
- if (H5G__has_stab_test(group_id) != TRUE)
+ if (H5G__has_stab_test(group_id) != true)
TEST_ERROR;
/* Delete links in middle */
@@ -6052,7 +6056,7 @@ delete_by_idx_old_deprec(hid_t fapl)
H5O_info1_t oi; /* Buffer for querying object's info */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create group */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -6095,10 +6099,10 @@ delete_by_idx_old_deprec(hid_t fapl)
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
if (order == H5_ITER_INC)
- HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1));
+ snprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1));
else
- HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
- if (HDstrcmp(objname, tmpname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u", dec_u);
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
} /* end for */
@@ -6129,10 +6133,10 @@ delete_by_idx_old_deprec(hid_t fapl)
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
if (order == H5_ITER_INC)
- HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3));
+ snprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3));
else
- HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
- if (HDstrcmp(objname, tmpname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u", dec_u);
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
} /* end for */
@@ -6141,7 +6145,7 @@ delete_by_idx_old_deprec(hid_t fapl)
TEST_ERROR;
/* Verify state of group */
- if (H5G__has_stab_test(group_id) != TRUE)
+ if (H5G__has_stab_test(group_id) != true)
TEST_ERROR;
/* Close the group */
@@ -6213,8 +6217,8 @@ link_iterate_deprec_cb(hid_t group_id, const char *link_name, const H5L_info1_t
} /* end if */
/* Verify name of link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", (unsigned)my_info.corder);
- if (HDstrcmp(link_name, objname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u", (unsigned)my_info.corder);
+ if (strcmp(link_name, objname) != 0)
return H5_ITER_ERROR;
/* Check if we've visited this link before */
@@ -6222,7 +6226,7 @@ link_iterate_deprec_cb(hid_t group_id, const char *link_name, const H5L_info1_t
return H5_ITER_ERROR;
if (op_data->visited[op_data->curr])
return H5_ITER_ERROR;
- op_data->visited[op_data->curr] = TRUE;
+ op_data->visited[op_data->curr] = true;
/* Advance to next value, in correct direction */
if (op_data->order != H5_ITER_DEC)
@@ -6295,7 +6299,7 @@ link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, H5_iter_order_t o
iter_info->stop = -1;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if (H5Literate1(group_id, idx_type, order, &skip, link_iterate_deprec_cb, iter_info) < 0)
TEST_ERROR;
@@ -6303,7 +6307,7 @@ link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, H5_iter_order_t o
if (skip != max_links)
TEST_ERROR;
for (v = 0; v < max_links; v++)
- if (iter_info->visited[v] == FALSE)
+ if (iter_info->visited[v] == false)
TEST_ERROR;
/* Iterate over links in group, with H5Giterate */
@@ -6312,7 +6316,7 @@ link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, H5_iter_order_t o
iter_info->stop = -1;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if (H5Giterate(group_id, ".", &gskip, group_iterate_deprec_cb, iter_info) < 0)
TEST_ERROR;
@@ -6320,7 +6324,7 @@ link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, H5_iter_order_t o
if (gskip != (int)max_links)
TEST_ERROR;
for (v = 0; v < max_links; v++)
- if (iter_info->visited[v] == FALSE)
+ if (iter_info->visited[v] == false)
TEST_ERROR;
/* Skip over some links in group */
@@ -6329,7 +6333,7 @@ link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, H5_iter_order_t o
iter_info->stop = -1;
iter_info->ncalled = 0;
iter_info->curr = (int64_t)(order != H5_ITER_DEC ? skip : ((max_links - 1) - skip));
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if (H5Literate1(group_id, idx_type, order, &skip, link_iterate_deprec_cb, iter_info) < 0)
TEST_ERROR;
@@ -6338,12 +6342,12 @@ link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, H5_iter_order_t o
TEST_ERROR;
if (order == H5_ITER_INC) {
for (v = 0; v < (max_links / 2); v++)
- if (iter_info->visited[v + (max_links / 2)] == FALSE)
+ if (iter_info->visited[v + (max_links / 2)] == false)
TEST_ERROR;
} /* end if */
else if (order == H5_ITER_DEC) {
for (v = 0; v < (max_links / 2); v++)
- if (iter_info->visited[v] == FALSE)
+ if (iter_info->visited[v] == false)
TEST_ERROR;
} /* end if */
else {
@@ -6351,7 +6355,7 @@ link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, H5_iter_order_t o
assert(order == H5_ITER_NATIVE);
for (v = 0; v < max_links; v++)
- if (iter_info->visited[v] == TRUE)
+ if (iter_info->visited[v] == true)
nvisit++;
if (nvisit != (max_links / 2))
@@ -6364,7 +6368,7 @@ link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, H5_iter_order_t o
iter_info->stop = -1;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? (unsigned)gskip : ((max_links - 1) - (unsigned)gskip);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if (H5Giterate(group_id, ".", &gskip, group_iterate_deprec_cb, iter_info) < 0)
TEST_ERROR;
@@ -6373,12 +6377,12 @@ link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, H5_iter_order_t o
TEST_ERROR;
if (order == H5_ITER_INC) {
for (v = 0; v < (max_links / 2); v++)
- if (iter_info->visited[v + (max_links / 2)] == FALSE)
+ if (iter_info->visited[v + (max_links / 2)] == false)
TEST_ERROR;
} /* end if */
else if (order == H5_ITER_DEC) {
for (v = 0; v < (max_links / 2); v++)
- if (iter_info->visited[v] == FALSE)
+ if (iter_info->visited[v] == false)
TEST_ERROR;
} /* end if */
else {
@@ -6386,7 +6390,7 @@ link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, H5_iter_order_t o
assert(order == H5_ITER_NATIVE);
for (v = 0; v < max_links; v++)
- if (iter_info->visited[v] == TRUE)
+ if (iter_info->visited[v] == true)
nvisit++;
if (nvisit != (max_links / 2))
@@ -6399,7 +6403,7 @@ link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, H5_iter_order_t o
iter_info->stop = 3;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if ((ret = H5Literate1(group_id, idx_type, order, &skip, link_iterate_deprec_cb, iter_info)) < 0)
TEST_ERROR;
if (ret != CORDER_ITER_STOP)
@@ -6413,7 +6417,7 @@ link_iterate_check_deprec(hid_t group_id, H5_index_t idx_type, H5_iter_order_t o
iter_info->stop = 3;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if ((ret = H5Giterate(group_id, ".", &gskip, group_iterate_deprec_cb, iter_info)) < 0)
TEST_ERROR;
if (ret != CORDER_ITER_STOP)
@@ -6452,21 +6456,21 @@ error:
static int
link_iterate_deprec(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1); /* Group ID */
- hid_t gcpl_id = (-1); /* Group creation property list ID */
- H5_index_t idx_type; /* Type of index to operate on */
- H5_iter_order_t order; /* Order within in the index */
- unsigned use_index; /* Use index on creation order values */
- unsigned max_compact; /* Maximum # of links to store in group compactly */
- unsigned min_dense; /* Minimum # of links to store in group "densely" */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE]; /* File name */
- link_iter_info_t iter_info; /* Iterator info */
- hbool_t *visited = NULL; /* Array of flags for visiting links */
- hsize_t skip; /* # of links to skip in group */
- unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ hid_t file_id = (H5I_INVALID_HID); /* File ID */
+ hid_t group_id = (H5I_INVALID_HID); /* Group ID */
+ hid_t gcpl_id = (H5I_INVALID_HID); /* Group creation property list ID */
+ H5_index_t idx_type; /* Type of index to operate on */
+ H5_iter_order_t order; /* Order within in the index */
+ unsigned use_index; /* Use index on creation order values */
+ unsigned max_compact; /* Maximum # of links to store in group compactly */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ link_iter_info_t iter_info; /* Iterator info */
+ bool *visited = NULL; /* Array of flags for visiting links */
+ hsize_t skip; /* # of links to skip in group */
+ unsigned u; /* Local index variable */
+ herr_t ret; /* Generic return value */
/* Create group creation property list */
if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0)
@@ -6478,7 +6482,7 @@ link_iterate_deprec(hid_t fapl)
/* Allocate the "visited link" array */
iter_info.max_visit = max_compact * 2;
- if (NULL == (visited = (hbool_t *)malloc(sizeof(hbool_t) * iter_info.max_visit)))
+ if (NULL == (visited = (bool *)malloc(sizeof(bool) * iter_info.max_visit)))
TEST_ERROR;
iter_info.visited = visited;
@@ -6487,7 +6491,7 @@ link_iterate_deprec(hid_t fapl)
/* Loop over operating in different orders */
for (order = H5_ITER_INC; order <= H5_ITER_NATIVE; order++) {
/* Loop over using index for creation order value */
- for (use_index = FALSE; use_index <= TRUE; use_index++) {
+ for (use_index = false; use_index <= true; use_index++) {
/* Print appropriate test message */
if (idx_type == H5_INDEX_CRT_ORDER) {
if (order == H5_ITER_INC) {
@@ -6570,7 +6574,7 @@ link_iterate_deprec(hid_t fapl)
hid_t group_id2; /* Group ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
@@ -6581,7 +6585,7 @@ link_iterate_deprec(hid_t fapl)
} /* end for */
/* Verify state of group (compact) */
- if (H5G__has_links_test(group_id, NULL) != TRUE)
+ if (H5G__has_links_test(group_id, NULL) != true)
TEST_ERROR;
/* Check for out of bound iteration on compact group */
@@ -6603,7 +6607,7 @@ link_iterate_deprec(hid_t fapl)
hid_t group_id2; /* Group ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
@@ -6614,7 +6618,7 @@ link_iterate_deprec(hid_t fapl)
} /* end for */
/* Verify state of group (dense) */
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Check for out of bound iteration on dense group */
@@ -6709,9 +6713,9 @@ link_iterate_old_deprec_cb(hid_t group_id, const char *link_name, const H5L_info
} /* end if */
/* Verify name of link */
- HDsnprintf(objname, sizeof(objname), "filler %02u",
- (info ? (unsigned)op_data->curr : (unsigned)((op_data->ncalled - 1) + op_data->nskipped)));
- if (HDstrcmp(link_name, objname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u",
+ (info ? (unsigned)op_data->curr : (unsigned)((op_data->ncalled - 1) + op_data->nskipped)));
+ if (strcmp(link_name, objname) != 0)
return H5_ITER_ERROR;
/* Check if we've visited this link before */
@@ -6719,7 +6723,7 @@ link_iterate_old_deprec_cb(hid_t group_id, const char *link_name, const H5L_info
return H5_ITER_ERROR;
if (op_data->visited[op_data->curr])
return H5_ITER_ERROR;
- op_data->visited[op_data->curr] = TRUE;
+ op_data->visited[op_data->curr] = true;
/* Advance to next value, in correct direction */
if (op_data->order != H5_ITER_DEC)
@@ -6775,7 +6779,7 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma
iter_info->stop = -1;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if (H5Literate1(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_deprec_cb, iter_info) < 0)
TEST_ERROR;
@@ -6783,7 +6787,7 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma
if (skip != max_links)
TEST_ERROR;
for (v = 0; v < max_links; v++)
- if (iter_info->visited[v] == FALSE)
+ if (iter_info->visited[v] == false)
TEST_ERROR;
/* Iterate over links in group, with H5Giterate */
@@ -6792,7 +6796,7 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma
iter_info->stop = -1;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if (H5Giterate(group_id, ".", &gskip, group_iterate_old_deprec_cb, iter_info) < 0)
TEST_ERROR;
@@ -6800,7 +6804,7 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma
if (gskip != (int)max_links)
TEST_ERROR;
for (v = 0; v < max_links; v++)
- if (iter_info->visited[v] == FALSE)
+ if (iter_info->visited[v] == false)
TEST_ERROR;
/* Skip over some links in group */
@@ -6809,7 +6813,7 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma
iter_info->stop = -1;
iter_info->ncalled = 0;
iter_info->curr = (int64_t)(order != H5_ITER_DEC ? skip : ((max_links - 1) - skip));
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if (H5Literate1(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_deprec_cb, iter_info) < 0)
TEST_ERROR;
@@ -6818,12 +6822,12 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma
TEST_ERROR;
if (order == H5_ITER_INC) {
for (v = 0; v < (max_links / 2); v++)
- if (iter_info->visited[v + (max_links / 2)] == FALSE)
+ if (iter_info->visited[v + (max_links / 2)] == false)
TEST_ERROR;
} /* end if */
else if (order == H5_ITER_DEC) {
for (v = 0; v < (max_links / 2); v++)
- if (iter_info->visited[v] == FALSE)
+ if (iter_info->visited[v] == false)
TEST_ERROR;
} /* end if */
else {
@@ -6831,7 +6835,7 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma
assert(order == H5_ITER_NATIVE);
for (v = 0; v < max_links; v++)
- if (iter_info->visited[v] == TRUE)
+ if (iter_info->visited[v] == true)
nvisit++;
if (nvisit != (max_links / 2))
@@ -6844,7 +6848,7 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma
iter_info->stop = -1;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? (unsigned)gskip : ((max_links - 1) - (unsigned)gskip);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if (H5Giterate(group_id, ".", &gskip, group_iterate_old_deprec_cb, iter_info) < 0)
TEST_ERROR;
@@ -6853,12 +6857,12 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma
TEST_ERROR;
if (order == H5_ITER_INC) {
for (v = 0; v < (max_links / 2); v++)
- if (iter_info->visited[v + (max_links / 2)] == FALSE)
+ if (iter_info->visited[v + (max_links / 2)] == false)
TEST_ERROR;
} /* end if */
else if (order == H5_ITER_DEC) {
for (v = 0; v < (max_links / 2); v++)
- if (iter_info->visited[v] == FALSE)
+ if (iter_info->visited[v] == false)
TEST_ERROR;
} /* end if */
else {
@@ -6866,7 +6870,7 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma
assert(order == H5_ITER_NATIVE);
for (v = 0; v < max_links; v++)
- if (iter_info->visited[v] == TRUE)
+ if (iter_info->visited[v] == true)
nvisit++;
if (nvisit != (max_links / 2))
@@ -6879,7 +6883,7 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma
iter_info->stop = 3;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if ((ret = H5Literate1(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_deprec_cb, iter_info)) < 0)
TEST_ERROR;
if (ret != CORDER_ITER_STOP)
@@ -6893,7 +6897,7 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma
iter_info->stop = 3;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if ((ret = H5Giterate(group_id, ".", &gskip, group_iterate_old_deprec_cb, iter_info)) < 0)
TEST_ERROR;
if (ret != CORDER_ITER_STOP)
@@ -6915,7 +6919,8 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma
skip = 0;
H5E_BEGIN_TRY
{
- ret = H5Literate1((hid_t)(-1), H5_INDEX_NAME, order, &skip, link_iterate_fail_deprec_cb, NULL);
+ ret = H5Literate1((hid_t)(H5I_INVALID_HID), H5_INDEX_NAME, order, &skip, link_iterate_fail_deprec_cb,
+ NULL);
}
H5E_END_TRY
if (ret >= 0)
@@ -6923,7 +6928,7 @@ link_iterate_old_check_deprec(hid_t group_id, H5_iter_order_t order, unsigned ma
H5E_BEGIN_TRY
{
- ret = H5Giterate((hid_t)(-1), ".", &gskip, group_iterate_old_deprec_cb, iter_info);
+ ret = H5Giterate((hid_t)(H5I_INVALID_HID), ".", &gskip, group_iterate_old_deprec_cb, iter_info);
}
H5E_END_TRY
if (ret >= 0)
@@ -6948,20 +6953,20 @@ error:
static int
link_iterate_old_deprec(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1; /* Group ID */
- H5_iter_order_t order; /* Order within in the index */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE]; /* File name */
- link_iter_info_t iter_info; /* Iterator info */
- hbool_t *visited = NULL; /* Array of flags for visiting links */
- hsize_t skip; /* # of links to skip in group */
- unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID; /* Group ID */
+ H5_iter_order_t order; /* Order within in the index */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ link_iter_info_t iter_info; /* Iterator info */
+ bool *visited = NULL; /* Array of flags for visiting links */
+ hsize_t skip; /* # of links to skip in group */
+ unsigned u; /* Local index variable */
+ herr_t ret; /* Generic return value */
/* Allocate the "visited link" array */
iter_info.max_visit = CORDER_NLINKS;
- if (NULL == (visited = (hbool_t *)malloc(sizeof(hbool_t) * iter_info.max_visit)))
+ if (NULL == (visited = (bool *)malloc(sizeof(bool) * iter_info.max_visit)))
TEST_ERROR;
iter_info.visited = visited;
@@ -7001,7 +7006,7 @@ link_iterate_old_deprec(hid_t fapl)
hid_t group_id2; /* Group ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -7011,7 +7016,7 @@ link_iterate_old_deprec(hid_t fapl)
} /* end for */
/* Verify state of group (symbol table) */
- if (H5G__has_stab_test(group_id) != TRUE)
+ if (H5G__has_stab_test(group_id) != true)
TEST_ERROR;
/* Check for out of bound iteration on old-style group */
@@ -7082,12 +7087,12 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_root(hid_t fapl, hbool_t new_format)
+external_link_root(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
- H5L_info2_t linfo; /* Link information */
- char objname[NAME_BUF_SIZE]; /* Object name */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ H5L_info2_t linfo; /* Link information */
+ char objname[NAME_BUF_SIZE]; /* Object name */
char filename1[NAME_BUF_SIZE];
char filename2[NAME_BUF_SIZE];
const char *file; /* File from external link */
@@ -7111,7 +7116,7 @@ external_link_root(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* Check that external links are registered with the library */
- if (H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE)
+ if (H5Lis_registered(H5L_TYPE_EXTERNAL) != true)
TEST_ERROR;
/* Create file with link to first file */
@@ -7127,21 +7132,21 @@ external_link_root(hid_t fapl, hbool_t new_format)
goto error;
if (H5L_TYPE_EXTERNAL != linfo.type) {
H5_FAILED();
- HDputs(" Unexpected object type - should have been an external link");
+ puts(" Unexpected object type - should have been an external link");
goto error;
}
if (H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0)
TEST_ERROR;
if (H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0)
TEST_ERROR;
- if (HDstrcmp(file, filename1) != 0) {
+ if (strcmp(file, filename1) != 0) {
H5_FAILED();
- HDputs(" External link file name incorrect");
+ puts(" External link file name incorrect");
goto error;
}
- if (HDstrcmp(path, "/") != 0) {
+ if (strcmp(path, "/") != 0) {
H5_FAILED();
- HDputs(" External link path incorrect");
+ puts(" External link path incorrect");
goto error;
}
@@ -7155,21 +7160,21 @@ external_link_root(hid_t fapl, hbool_t new_format)
goto error;
if (H5L_TYPE_EXTERNAL != linfo.type) {
H5_FAILED();
- HDputs(" Unexpected object type - should have been an external link");
+ puts(" Unexpected object type - should have been an external link");
goto error;
}
if (H5Lget_val(fid, "ext_link", objname, sizeof(objname), H5P_DEFAULT) < 0)
TEST_ERROR;
if (H5Lunpack_elink_val(objname, linfo.u.val_size, NULL, &file, &path) < 0)
TEST_ERROR;
- if (HDstrcmp(file, filename1) != 0) {
+ if (strcmp(file, filename1) != 0) {
H5_FAILED();
- HDputs(" External link file name incorrect");
+ puts(" External link file name incorrect");
goto error;
}
- if (HDstrcmp(path, "/") != 0) {
+ if (strcmp(path, "/") != 0) {
H5_FAILED();
- HDputs(" External link path incorrect");
+ puts(" External link path incorrect");
goto error;
}
@@ -7186,7 +7191,7 @@ external_link_root(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/") != 0)
+ if (strcmp(objname, "/") != 0)
TEST_ERROR;
/* Create object in external file */
@@ -7231,11 +7236,11 @@ external_link_root(hid_t fapl, hbool_t new_format)
/* Check names */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/new_group") != 0)
+ if (strcmp(objname, "/new_group") != 0)
TEST_ERROR;
if (H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/newer_group") != 0)
+ if (strcmp(objname, "/newer_group") != 0)
TEST_ERROR;
/* Close opened objects */
@@ -7301,11 +7306,11 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_path(hid_t fapl, hbool_t new_format)
+external_link_path(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
- char objname[NAME_BUF_SIZE]; /* Object name */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ char objname[NAME_BUF_SIZE]; /* Object name */
char filename1[NAME_BUF_SIZE];
char filename2[NAME_BUF_SIZE];
@@ -7357,7 +7362,7 @@ external_link_path(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/A/B/C") != 0)
+ if (strcmp(objname, "/A/B/C") != 0)
TEST_ERROR;
/* Create object in external file */
@@ -7387,7 +7392,7 @@ external_link_path(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/A/B/C/new_group") != 0)
+ if (strcmp(objname, "/A/B/C/new_group") != 0)
TEST_ERROR;
/* Close opened object */
@@ -7423,11 +7428,11 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_mult(hid_t fapl, hbool_t new_format)
+external_link_mult(hid_t fapl, bool new_format)
{
- hid_t fid = -1, fid2 = -1; /* File IDs */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
- char objname[NAME_BUF_SIZE]; /* Object name */
+ hid_t fid = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ char objname[NAME_BUF_SIZE]; /* Object name */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE],
filename4[NAME_BUF_SIZE]; /* Names of files to externally link across */
@@ -7529,7 +7534,7 @@ external_link_mult(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/A/B/C") != 0)
+ if (strcmp(objname, "/A/B/C") != 0)
TEST_ERROR;
/* Create object in external file */
@@ -7559,7 +7564,7 @@ external_link_mult(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/A/B/C/new_group") != 0)
+ if (strcmp(objname, "/A/B/C/new_group") != 0)
TEST_ERROR;
/* Close opened object */
@@ -7621,12 +7626,12 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_self(hid_t fapl, hbool_t new_format)
+external_link_self(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
- hid_t lcpl_id = -1; /* Link Creation Property List ID */
- char objname[NAME_BUF_SIZE]; /* Object name */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ hid_t lcpl_id = H5I_INVALID_HID; /* Link Creation Property List ID */
+ char objname[NAME_BUF_SIZE]; /* Object name */
char filename1[NAME_BUF_SIZE];
char filename2[NAME_BUF_SIZE];
char filename3[NAME_BUF_SIZE];
@@ -7648,7 +7653,7 @@ external_link_self(hid_t fapl, hbool_t new_format)
/* Create an lcpl with intermediate group creation set */
if ((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0)
TEST_ERROR;
- if (H5Pset_create_intermediate_group(lcpl_id, TRUE) < 0)
+ if (H5Pset_create_intermediate_group(lcpl_id, true) < 0)
TEST_ERROR;
/* Create a series of groups within the file: /A/B and /X/Y/Z */
@@ -7675,7 +7680,7 @@ external_link_self(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/X") != 0)
+ if (strcmp(objname, "/X") != 0)
TEST_ERROR;
/* Create object through external link */
@@ -7697,7 +7702,7 @@ external_link_self(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/X/new_group") != 0)
+ if (strcmp(objname, "/X/new_group") != 0)
TEST_ERROR;
/* Close opened object */
@@ -7812,10 +7817,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_pingpong(hid_t fapl, hbool_t new_format)
+external_link_pingpong(hid_t fapl, bool new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1), gid2 = (-1); /* Group IDs */
+ hid_t fid = (H5I_INVALID_HID); /* File ID */
+ hid_t gid = (H5I_INVALID_HID), gid2 = (H5I_INVALID_HID); /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
@@ -7877,7 +7882,7 @@ external_link_pingpong(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/final") != 0)
+ if (strcmp(objname, "/final") != 0)
TEST_ERROR;
/* Create object in external file */
@@ -7907,7 +7912,7 @@ external_link_pingpong(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/final/new_group") != 0)
+ if (strcmp(objname, "/final/new_group") != 0)
TEST_ERROR;
/* Close opened object */
@@ -7964,10 +7969,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_toomany(hid_t fapl, hbool_t new_format)
+external_link_toomany(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
@@ -8069,7 +8074,7 @@ external_link_toomany(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/final") != 0)
+ if (strcmp(objname, "/final") != 0)
TEST_ERROR;
/* Create object in external file */
@@ -8113,12 +8118,12 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_dangling(hid_t fapl, hbool_t new_format)
+external_link_dangling(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
- hid_t rid = -1; /* Root Group ID */
- hid_t status = -1; /* Status */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
+ hid_t rid = H5I_INVALID_HID; /* Root Group ID */
+ hid_t status = H5I_INVALID_HID; /* Status */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
if (new_format)
@@ -8168,7 +8173,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format)
H5E_END_TRY
if (gid >= 0) {
H5_FAILED();
- HDputs(" Should have failed for sequence of too many nested links.");
+ puts(" Should have failed for sequence of too many nested links.");
goto error;
}
@@ -8180,7 +8185,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format)
H5E_END_TRY
if (gid >= 0) {
H5_FAILED();
- HDputs(" Should have failed for sequence of too many nested links.");
+ puts(" Should have failed for sequence of too many nested links.");
goto error;
}
@@ -8192,7 +8197,7 @@ external_link_dangling(hid_t fapl, hbool_t new_format)
H5E_END_TRY
if (status >= 0) {
H5_FAILED();
- HDputs(
+ puts(
" Retrieving name of object by index through dangling file external link should have failed.");
} /* end if */
@@ -8233,11 +8238,11 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_prefix(hid_t fapl, hbool_t new_format)
+external_link_prefix(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
- hid_t gapl_id = -1;
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
+ hid_t gapl_id = H5I_INVALID_HID;
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE];
if (new_format)
@@ -8293,7 +8298,7 @@ external_link_prefix(hid_t fapl, hbool_t new_format)
/* should be able to find the target file from pathnames set via H5Pset_elink_prefix() */
if (gid < 0) {
H5_FAILED();
- HDputs(" Should have found the file in tmp_links directory.");
+ puts(" Should have found the file in tmp_links directory.");
goto error;
}
@@ -8330,10 +8335,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_abs_mainpath(hid_t fapl, hbool_t new_format)
+external_link_abs_mainpath(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE],
cwdpath[NAME_BUF_SIZE];
@@ -8390,7 +8395,7 @@ external_link_abs_mainpath(hid_t fapl, hbool_t new_format)
/* should be able to find the target file from absolute path set for main file */
if (gid < 0) {
H5_FAILED();
- HDputs(" Should have found the file in tmp_links directory.");
+ puts(" Should have found the file in tmp_links directory.");
goto error;
}
@@ -8426,10 +8431,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_rel_mainpath(hid_t fapl, hbool_t new_format)
+external_link_rel_mainpath(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE];
if (new_format)
@@ -8478,7 +8483,7 @@ external_link_rel_mainpath(hid_t fapl, hbool_t new_format)
/* should be able to find the target file from the main file's relative pathname */
if (gid < 0) {
H5_FAILED();
- HDputs(" Should have found the file in current working directory");
+ puts(" Should have found the file in current working directory");
goto error;
}
@@ -8514,10 +8519,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_cwd(hid_t fapl, hbool_t new_format)
+external_link_cwd(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE], cwdpath[NAME_BUF_SIZE];
if (new_format)
@@ -8571,7 +8576,7 @@ external_link_cwd(hid_t fapl, hbool_t new_format)
/* should be able to find the target file from the current working directory */
if (gid < 0) {
H5_FAILED();
- HDputs(" Should have found the file in current working directory");
+ puts(" Should have found the file in current working directory");
goto error;
}
@@ -8608,10 +8613,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_abstar(hid_t fapl, hbool_t new_format)
+external_link_abstar(hid_t fapl, bool new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
+ hid_t fid = (H5I_INVALID_HID); /* File ID */
+ hid_t gid = (H5I_INVALID_HID); /* Group IDs */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE],
cwdpath[NAME_BUF_SIZE];
@@ -8669,7 +8674,7 @@ external_link_abstar(hid_t fapl, hbool_t new_format)
/* should be able to find the target file with absolute path */
if (gid < 0) {
H5_FAILED();
- HDputs(" Should have found the file in tmp_links directory.");
+ puts(" Should have found the file in tmp_links directory.");
goto error;
}
@@ -8706,10 +8711,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_abstar_cur(hid_t fapl, hbool_t new_format)
+external_link_abstar_cur(hid_t fapl, bool new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
+ hid_t fid = (H5I_INVALID_HID); /* File ID */
+ hid_t gid = (H5I_INVALID_HID); /* Group IDs */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE],
cwdpath[NAME_BUF_SIZE];
@@ -8767,7 +8772,7 @@ external_link_abstar_cur(hid_t fapl, hbool_t new_format)
/* should be able to find the target file from main file's current working directory */
if (gid < 0) {
H5_FAILED();
- HDputs(" Should have found the file in current working directory.");
+ puts(" Should have found the file in current working directory.");
goto error;
}
@@ -8803,10 +8808,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_reltar(hid_t fapl, hbool_t new_format)
+external_link_reltar(hid_t fapl, bool new_format)
{
- hid_t fid = (-1); /* File ID */
- hid_t gid = (-1); /* Group IDs */
+ hid_t fid = (H5I_INVALID_HID); /* File ID */
+ hid_t gid = (H5I_INVALID_HID); /* Group IDs */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE];
if (new_format)
@@ -8848,7 +8853,7 @@ external_link_reltar(hid_t fapl, hbool_t new_format)
/* Open object through external link */
if ((gid = H5Gopen2(fid, "ext_link", H5P_DEFAULT)) < 0) {
H5_FAILED();
- HDputs(" Should have found the file in tmp_links directory.");
+ puts(" Should have found the file in tmp_links directory.");
goto error;
} /* end if */
@@ -8886,10 +8891,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_chdir(hid_t fapl, hbool_t new_format)
+external_link_chdir(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE];
if (new_format)
@@ -8948,7 +8953,7 @@ external_link_chdir(hid_t fapl, hbool_t new_format)
*/
if (gid < 0) {
H5_FAILED();
- HDputs(" Should have found the file in tmp_links directory.");
+ puts(" Should have found the file in tmp_links directory.");
goto error;
}
@@ -8992,16 +8997,16 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_set_elink_fapl1(hid_t fapl, hbool_t new_format)
+external_set_elink_fapl1(hid_t fapl, bool new_format)
{
- hid_t fid = (-1);
- hid_t fidA = (-1), fidB = (-1);
- hid_t gidA = (-1), gidB = (-1);
- hid_t oidA = (-1), oidB = (-1);
+ hid_t fid = (H5I_INVALID_HID);
+ hid_t fidA = (H5I_INVALID_HID), fidB = (H5I_INVALID_HID);
+ hid_t gidA = (H5I_INVALID_HID), gidB = (H5I_INVALID_HID);
+ hid_t oidA = (H5I_INVALID_HID), oidB = (H5I_INVALID_HID);
char filename1[NAME_BUF_SIZE], filename2A[NAME_BUF_SIZE], filename2B[NAME_BUF_SIZE],
tmpname[NAME_BUF_SIZE], cwdpath[NAME_BUF_SIZE];
- hid_t fam_fapl = -1, multi_fapl = -1;
- hid_t lapl_idA = -1, lapl_idB = -1;
+ hid_t fam_fapl = H5I_INVALID_HID, multi_fapl = H5I_INVALID_HID;
+ hid_t lapl_idA = H5I_INVALID_HID, lapl_idB = H5I_INVALID_HID;
hid_t memb_fapl[H5FD_MEM_NTYPES];
char sv[H5FD_MEM_NTYPES][64];
H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES];
@@ -9051,33 +9056,33 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format)
memb_map[H5FD_MEM_GHEAP] = H5FD_MEM_GHEAP;
memb_map[H5FD_MEM_LHEAP] = H5FD_MEM_LHEAP;
- HDsnprintf(sv[H5FD_MEM_SUPER], sizeof(sv[H5FD_MEM_SUPER]), "%%s-%c.h5", 's');
+ snprintf(sv[H5FD_MEM_SUPER], sizeof(sv[H5FD_MEM_SUPER]), "%%s-%c.h5", 's');
memb_name[H5FD_MEM_SUPER] = sv[H5FD_MEM_SUPER];
memb_addr[H5FD_MEM_SUPER] = 0;
- HDsnprintf(sv[H5FD_MEM_BTREE], sizeof(sv[H5FD_MEM_BTREE]), "%%s-%c.h5", 'b');
+ snprintf(sv[H5FD_MEM_BTREE], sizeof(sv[H5FD_MEM_BTREE]), "%%s-%c.h5", 'b');
memb_name[H5FD_MEM_BTREE] = sv[H5FD_MEM_BTREE];
memb_addr[H5FD_MEM_BTREE] = HADDR_MAX / 6;
- HDsnprintf(sv[H5FD_MEM_DRAW], sizeof(sv[H5FD_MEM_DRAW]), "%%s-%c.h5", 'r');
+ snprintf(sv[H5FD_MEM_DRAW], sizeof(sv[H5FD_MEM_DRAW]), "%%s-%c.h5", 'r');
memb_name[H5FD_MEM_DRAW] = sv[H5FD_MEM_DRAW];
memb_addr[H5FD_MEM_DRAW] = HADDR_MAX / 3;
- HDsnprintf(sv[H5FD_MEM_GHEAP], sizeof(sv[H5FD_MEM_GHEAP]), "%%s-%c.h5", 'g');
+ snprintf(sv[H5FD_MEM_GHEAP], sizeof(sv[H5FD_MEM_GHEAP]), "%%s-%c.h5", 'g');
memb_name[H5FD_MEM_GHEAP] = sv[H5FD_MEM_GHEAP];
memb_addr[H5FD_MEM_GHEAP] = HADDR_MAX / 2;
- HDsnprintf(sv[H5FD_MEM_LHEAP], sizeof(sv[H5FD_MEM_LHEAP]), "%%s-%c.h5", 'l');
+ snprintf(sv[H5FD_MEM_LHEAP], sizeof(sv[H5FD_MEM_LHEAP]), "%%s-%c.h5", 'l');
memb_name[H5FD_MEM_LHEAP] = sv[H5FD_MEM_LHEAP];
memb_addr[H5FD_MEM_LHEAP] = (HADDR_MAX / 3) * 2;
- HDsnprintf(sv[H5FD_MEM_OHDR], sizeof(sv[H5FD_MEM_OHDR]), "%%s-%c.h5", 'o');
+ snprintf(sv[H5FD_MEM_OHDR], sizeof(sv[H5FD_MEM_OHDR]), "%%s-%c.h5", 'o');
memb_name[H5FD_MEM_OHDR] = sv[H5FD_MEM_OHDR];
memb_addr[H5FD_MEM_OHDR] = (HADDR_MAX / 6) * 5;
/* create "multi" fapl */
multi_fapl = h5_fileaccess();
- if (H5Pset_fapl_multi(multi_fapl, memb_map, memb_fapl, memb_name, memb_addr, TRUE) < 0)
+ if (H5Pset_fapl_multi(multi_fapl, memb_map, memb_fapl, memb_name, memb_addr, true) < 0)
TEST_ERROR;
/* set up name for external linked target file B: "extlinks16B" */
@@ -9129,7 +9134,7 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format)
/* should succeed in opening the target object A in the current working directory */
if (oidA < 0) {
H5_FAILED();
- HDputs(" Should succeed in opening family target file A in current working directory");
+ puts(" Should succeed in opening family target file A in current working directory");
goto error;
}
@@ -9145,7 +9150,7 @@ external_set_elink_fapl1(hid_t fapl, hbool_t new_format)
/* should succeed in opening the target object B in the current working directory */
if (oidB < 0) {
H5_FAILED();
- HDputs(" Should succeed in opening multi target file B in current working directory");
+ puts(" Should succeed in opening multi target file B in current working directory");
goto error;
}
@@ -9209,7 +9214,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
+external_set_elink_fapl2(hid_t fapl, bool new_format)
{
hid_t fid = H5I_INVALID_HID;
hid_t gid = H5I_INVALID_HID;
@@ -9267,7 +9272,7 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
/* create fapl for the target file to be a "core" file */
core_fapl = h5_fileaccess();
- if (H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, TRUE) < 0)
+ if (H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, true) < 0)
TEST_ERROR;
/* set up name for external linked target file: "extlinks17" */
@@ -9323,7 +9328,7 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* create fapl to be a "core" file without backing store */
- if (H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, FALSE) < 0)
+ if (H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, false) < 0)
TEST_ERROR;
/* Set file access property list for link access to use the "core" driver */
@@ -9336,7 +9341,7 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
did = H5Dopen2(fid, "ext_link", dapl_id);
if (did < 0) {
H5_FAILED();
- HDputs(" Should succeed in opening the target dataset");
+ puts(" Should succeed in opening the target dataset");
goto error;
}
@@ -9427,10 +9432,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_set_elink_fapl3(hbool_t new_format)
+external_set_elink_fapl3(bool new_format)
{
- hid_t core_fapl = -1, stdio_fapl = -1;
- hid_t lapl_id = -1, new_lapl_id = -1, l_fapl = -1, out_fapl;
+ hid_t core_fapl = H5I_INVALID_HID, stdio_fapl = H5I_INVALID_HID;
+ hid_t lapl_id = H5I_INVALID_HID, new_lapl_id = H5I_INVALID_HID, l_fapl = H5I_INVALID_HID, out_fapl;
if (new_format)
TESTING("H5Pset/get_fapl() (w/new group format)");
@@ -9439,7 +9444,7 @@ external_set_elink_fapl3(hbool_t new_format)
/* create fapl for the target file to be a "core" file */
core_fapl = h5_fileaccess();
- if (H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, TRUE) < 0)
+ if (H5Pset_fapl_core(core_fapl, (size_t)CORE_INCREMENT, true) < 0)
TEST_ERROR;
stdio_fapl = h5_fileaccess();
@@ -9529,9 +9534,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
+external_set_elink_acc_flags(const char *env_h5_drvr, hid_t fapl, bool new_format)
{
- hid_t file1 = -1, file2 = -1, group = -1, subgroup = -1, gapl = -1;
+ hid_t file1 = H5I_INVALID_HID, file2 = H5I_INVALID_HID, group = H5I_INVALID_HID,
+ subgroup = H5I_INVALID_HID, gapl = H5I_INVALID_HID;
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE];
herr_t ret;
unsigned flags;
@@ -9840,13 +9846,13 @@ external_set_elink_cb_cb(const char *parent_file, const char *parent_group, cons
set_elink_cb_t *op_data = (set_elink_cb_t *)_op_data;
/* Verify file and object names are correct */
- if (HDstrcmp(parent_file, op_data->parent_file) != 0)
+ if (strcmp(parent_file, op_data->parent_file) != 0)
return FAIL;
- if (HDstrcmp(parent_group, "/group1") != 0)
+ if (strcmp(parent_group, "/group1") != 0)
return FAIL;
- if (HDstrcmp(target_file, op_data->target_file) != 0)
+ if (strcmp(target_file, op_data->target_file) != 0)
return FAIL;
- if (HDstrcmp(target_obj, "/") != 0)
+ if (strcmp(target_obj, "/") != 0)
return FAIL;
/* Set flags to be read-write */
@@ -9867,10 +9873,11 @@ external_set_elink_cb_cb(const char *parent_file, const char *parent_group, cons
/* Main test function */
static int
-external_set_elink_cb(hid_t fapl, hbool_t new_format)
+external_set_elink_cb(hid_t fapl, bool new_format)
{
- hid_t file1 = -1, file2 = -1, group = -1, gapl = -1, fam_fapl = -1, ret_fapl = -1, base_driver;
- set_elink_cb_t op_data, *op_data_p;
+ hid_t file1 = H5I_INVALID_HID, file2 = H5I_INVALID_HID, group = H5I_INVALID_HID, gapl = H5I_INVALID_HID,
+ fam_fapl = H5I_INVALID_HID, ret_fapl = H5I_INVALID_HID, base_driver;
+ set_elink_cb_t op_data, *op_data_p;
H5L_elink_traverse_t cb;
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE];
unsigned flags;
@@ -9886,7 +9893,7 @@ external_set_elink_cb(hid_t fapl, hbool_t new_format)
/* Core file driver has issues when used as the member file driver for a family file */
/* Family file driver cannot be used with family or multi drivers for member files */
/* Also disable parallel member drivers, because H5F_HAS_FEATURE(H5FD_FEAT_HAS_MPI)
- would report FALSE, causing problems */
+ would report false, causing problems */
base_driver = H5Pget_driver(fapl);
op_data.base_fapl =
(base_driver == H5FD_FAMILY || base_driver == H5FD_MULTI || base_driver == H5FD_MPIO ||
@@ -10098,10 +10105,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_win1(hid_t fapl, hbool_t new_format)
+external_link_win1(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE],
cwdpath[NAME_BUF_SIZE];
@@ -10117,9 +10124,9 @@ external_link_win1(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* set up name for target link: "/CWD/tmp_links/extlinks10" */
- HDstrcpy(tmpname, &cwdpath[2]); /* stripped the drive letter to make it rel drive but absolute path */
- HDstrcat(tmpname, "/");
- HDstrcat(tmpname, FILENAME[30]);
+ strcpy(tmpname, &cwdpath[2]); /* stripped the drive letter to make it rel drive but absolute path */
+ strcat(tmpname, "/");
+ strcat(tmpname, FILENAME[30]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
/* set up name for target file: "extlinks10" */
@@ -10155,7 +10162,7 @@ external_link_win1(hid_t fapl, hbool_t new_format)
/* should be able to find the target file via main file's CWD*/
if (gid < 0) {
H5_FAILED();
- HDputs(" Should have found the file in CWD.");
+ puts(" Should have found the file in CWD.");
goto error;
}
@@ -10192,10 +10199,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_win2(hid_t fapl, hbool_t new_format)
+external_link_win2(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE],
cwdpath[NAME_BUF_SIZE];
@@ -10213,10 +10220,9 @@ external_link_win2(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* set up name for target link: "/CWD/tmp_links/extlinks11" */
- HDstrcpy(tmpname,
- &cwdpath[2]); /* stripped the drive letter to make it relative drive but absolute path */
- HDstrcat(tmpname, "/");
- HDstrcat(tmpname, FILENAME[31]);
+ strcpy(tmpname, &cwdpath[2]); /* stripped the drive letter to make it relative drive but absolute path */
+ strcat(tmpname, "/");
+ strcat(tmpname, FILENAME[31]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
/* set up name for target file: "tmp_links/extlinks11" */
@@ -10252,7 +10258,7 @@ external_link_win2(hid_t fapl, hbool_t new_format)
/* should be able to find the target file directly */
if (gid < 0) {
H5_FAILED();
- HDputs(" Should have found the file in tmp_links.");
+ puts(" Should have found the file in tmp_links.");
goto error;
}
@@ -10289,10 +10295,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_win3(hid_t fapl, hbool_t new_format)
+external_link_win3(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
int drive = 0;
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE];
@@ -10310,7 +10316,7 @@ external_link_win3(hid_t fapl, hbool_t new_format)
/* set up name for target link: "<drive-letter>:tmp_links/extlinks12" */
drive = HDgetdrive();
- HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive + 'A' - 1), FILENAME[32]);
+ snprintf(tmpname, sizeof(tmpname), "%c:%s", (drive + 'A' - 1), FILENAME[32]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
/* set up name for target file: "tmp_links/extlinks12" */
@@ -10346,7 +10352,7 @@ external_link_win3(hid_t fapl, hbool_t new_format)
/* should be able to find the target file directly */
if (gid < 0) {
H5_FAILED();
- HDputs(" Should have found the file in tmp_links.");
+ puts(" Should have found the file in tmp_links.");
goto error;
}
@@ -10383,10 +10389,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_win4(hid_t fapl, hbool_t new_format)
+external_link_win4(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
int drive = 0;
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE];
@@ -10397,11 +10403,11 @@ external_link_win4(hid_t fapl, hbool_t new_format)
/* set up name for main file: "<drive-letter>:tmp_links/extlinks0" */
drive = HDgetdrive();
- HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive + 'A' - 1), FILENAME[13]);
+ snprintf(tmpname, sizeof(tmpname), "%c:%s", (drive + 'A' - 1), FILENAME[13]);
h5_fixname(tmpname, fapl, filename1, sizeof filename1);
/* set up name for target link: "<drive-letter>:extlinks13" */
- HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive + 'A' - 1), FILENAME[33]);
+ snprintf(tmpname, sizeof(tmpname), "%c:%s", (drive + 'A' - 1), FILENAME[33]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
/* set up name for target file: "tmp_links/extlinks13" */
@@ -10437,7 +10443,7 @@ external_link_win4(hid_t fapl, hbool_t new_format)
/* should be able to find the target file via main file's absolute drive/relative path */
if (gid < 0) {
H5_FAILED();
- HDputs(" Should have found the file in CWD.");
+ puts(" Should have found the file in CWD.");
goto error;
}
@@ -10474,10 +10480,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_win5(hid_t fapl, hbool_t new_format)
+external_link_win5(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
int drive = 0;
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE],
cwdpath[NAME_BUF_SIZE];
@@ -10496,13 +10502,13 @@ external_link_win5(hid_t fapl, hbool_t new_format)
drive += 1;
/* set up name for main file: "/CWD/extlinks0" */
- HDstrcpy(tmpname, &cwdpath[2]); /* stripped the drive letter to make it rel drive but absolute path */
- HDstrcat(tmpname, "/");
- HDstrcat(tmpname, FILENAME[12]);
+ strcpy(tmpname, &cwdpath[2]); /* stripped the drive letter to make it rel drive but absolute path */
+ strcat(tmpname, "/");
+ strcat(tmpname, FILENAME[12]);
h5_fixname(tmpname, fapl, filename1, sizeof filename1);
/* set up name for target link: "<drive-letter+1>:tmp_links/extlinks14" */
- HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive + 'A' - 1), FILENAME[35]);
+ snprintf(tmpname, sizeof(tmpname), "%c:%s", (drive + 'A' - 1), FILENAME[35]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
/* set up name for target file: "tmp_links/extlinks14" */
@@ -10538,7 +10544,7 @@ external_link_win5(hid_t fapl, hbool_t new_format)
/* should be able to find the target file via main file's rel drive/abs path */
if (gid < 0) {
H5_FAILED();
- HDputs(" Should have found the file in CWD.");
+ puts(" Should have found the file in CWD.");
goto error;
}
@@ -10575,10 +10581,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_win6(hid_t fapl, hbool_t new_format)
+external_link_win6(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
int drive = 0;
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE];
@@ -10600,7 +10606,7 @@ external_link_win6(hid_t fapl, hbool_t new_format)
h5_fixname(FILENAME[12], fapl, filename1, sizeof filename1);
/* set up name for target link: "<drive-letter+1>:tmp_links/extlinks15" */
- HDsnprintf(tmpname, sizeof(tmpname), "%c:%s", (drive + 'A' - 1), FILENAME[36]);
+ snprintf(tmpname, sizeof(tmpname), "%c:%s", (drive + 'A' - 1), FILENAME[36]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
/* set up name for target file: "tmp/extlinks15" */
@@ -10636,7 +10642,7 @@ external_link_win6(hid_t fapl, hbool_t new_format)
/* should be able to find the target file via target file's rel path in current drive */
if (gid < 0) {
H5_FAILED();
- HDputs(" Should have found the file in tmp_links.");
+ puts(" Should have found the file in tmp_links.");
goto error;
}
@@ -10673,10 +10679,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_win7(hid_t fapl, hbool_t new_format)
+external_link_win7(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE],
cwdpath[NAME_BUF_SIZE];
@@ -10693,9 +10699,9 @@ external_link_win7(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* set up name for target link: "\\127.0.0.1\c$/tmp_links/extlinks10" */
- HDstrcpy(tmpname, "\\\\127.0.0.1\\c$"); /* absolute path */
- HDstrcat(tmpname, "/");
- HDstrcat(tmpname, FILENAME[30]);
+ strcpy(tmpname, "\\\\127.0.0.1\\c$"); /* absolute path */
+ strcat(tmpname, "/");
+ strcat(tmpname, FILENAME[30]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
/* set up name for target file: "extlinks15" */
@@ -10731,7 +10737,7 @@ external_link_win7(hid_t fapl, hbool_t new_format)
/* should be able to find the target file via main file's local host/main drive*/
if (gid < 0) {
H5_FAILED();
- HDputs(" Should have found the file in local host/main drive.");
+ puts(" Should have found the file in local host/main drive.");
goto error;
}
@@ -10769,10 +10775,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_win8(hid_t fapl, hbool_t new_format)
+external_link_win8(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
int drive = 0;
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE],
cwdpath[NAME_BUF_SIZE];
@@ -10795,7 +10801,7 @@ external_link_win8(hid_t fapl, hbool_t new_format)
/* set up name for target link: "<drive-letter>:\CWD\extlinks10" */
drive = HDgetdrive();
- HDsnprintf(tmpname, sizeof(tmpname), "\\\\?\\%c:%s\\%s", (drive + 'A' - 1), &cwdpath[2], FILENAME[30]);
+ snprintf(tmpname, sizeof(tmpname), "\\\\?\\%c:%s\\%s", (drive + 'A' - 1), &cwdpath[2], FILENAME[30]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
/* set up name for target file: "extlinks10" */
@@ -10831,7 +10837,7 @@ external_link_win8(hid_t fapl, hbool_t new_format)
/* should be able to find the target file directly */
if (gid < 0) {
H5_FAILED();
- HDputs(" Should have found the file in tmp_links.");
+ puts(" Should have found the file in tmp_links.");
goto error;
}
@@ -10868,10 +10874,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_win9(hid_t fapl, hbool_t new_format)
+external_link_win9(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE], tmpname[NAME_BUF_SIZE],
cwdpath[NAME_BUF_SIZE];
@@ -10888,9 +10894,9 @@ external_link_win9(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* set up name for target link: "\\?\UNC\127.0.0.1\c$/tmp_links/extlinks10" */
- HDstrcpy(tmpname, "\\\\?\\UNC\127.0.0.1\\c$"); /* absolute path */
- HDstrcat(tmpname, "/");
- HDstrcat(tmpname, FILENAME[30]);
+ strcpy(tmpname, "\\\\?\\UNC\127.0.0.1\\c$"); /* absolute path */
+ strcat(tmpname, "/");
+ strcat(tmpname, FILENAME[30]);
h5_fixname(tmpname, fapl, filename2, sizeof filename2);
/* set up name for target file: "extlinks15" */
@@ -10926,7 +10932,7 @@ external_link_win9(hid_t fapl, hbool_t new_format)
/* should be able to find the target file via main file's local host/main drive*/
if (gid < 0) {
H5_FAILED();
- HDputs(" Should have found the file in local host/main drive.");
+ puts(" Should have found the file in local host/main drive.");
goto error;
}
@@ -10961,10 +10967,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_recursive(hid_t fapl, hbool_t new_format)
+external_link_recursive(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
char filename1[NAME_BUF_SIZE]; /* Names of files to externally link across */
if (new_format)
@@ -10999,7 +11005,7 @@ external_link_recursive(hid_t fapl, hbool_t new_format)
H5E_END_TRY
if (gid >= 0) {
H5_FAILED();
- HDputs(" Should have failed for recursive external links.");
+ puts(" Should have failed for recursive external links.");
goto error;
}
@@ -11031,14 +11037,14 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_query(hid_t fapl, hbool_t new_format)
+external_link_query(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
- const char *file_name; /* Name of the file the external link points to */
- const char *object_name; /* Name of the object the external link points to */
- H5O_info2_t oi; /* Object information */
- H5L_info2_t li; /* Link information */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
+ const char *file_name; /* Name of the file the external link points to */
+ const char *object_name; /* Name of the object the external link points to */
+ H5O_info2_t oi; /* Object information */
+ H5L_info2_t li; /* Link information */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], /* Names of files to externally link across */
query_buf[NAME_BUF_SIZE]; /* Buffer to hold query result */
@@ -11063,11 +11069,11 @@ external_link_query(hid_t fapl, hbool_t new_format)
/* Get size of buffer for external link */
if (H5Lget_info2(fid, "src", &li, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (li.u.val_size != (1 + (HDstrlen(filename2) + 1) + (HDstrlen("/dst") + 1)))
+ if (li.u.val_size != (1 + (strlen(filename2) + 1) + (strlen("/dst") + 1)))
TEST_ERROR;
if (H5L_TYPE_EXTERNAL != li.type) {
H5_FAILED();
- HDputs(" Unexpected link class - should have been an external link");
+ puts(" Unexpected link class - should have been an external link");
goto error;
}
@@ -11096,11 +11102,11 @@ external_link_query(hid_t fapl, hbool_t new_format)
/* Get size of buffer for external link */
if (H5Lget_info2(fid, "src", &li, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (li.u.val_size != (1 + (HDstrlen(filename2) + 1) + (HDstrlen("/dst") + 1)))
+ if (li.u.val_size != (1 + (strlen(filename2) + 1) + (strlen("/dst") + 1)))
TEST_ERROR;
if (H5L_TYPE_EXTERNAL != li.type) {
H5_FAILED();
- HDputs(" Unexpected link class - should have been an external link");
+ puts(" Unexpected link class - should have been an external link");
goto error;
}
@@ -11113,9 +11119,9 @@ external_link_query(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* Compare the file and object names */
- if (HDstrcmp(file_name, filename2) != 0)
+ if (strcmp(file_name, filename2) != 0)
TEST_ERROR;
- if (HDstrcmp(object_name, "/dst") != 0)
+ if (strcmp(object_name, "/dst") != 0)
TEST_ERROR;
/* Query information about object that external link points to */
@@ -11123,7 +11129,7 @@ external_link_query(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR;
if (H5O_TYPE_GROUP != oi.type) {
H5_FAILED();
- HDputs(" Unexpected object type - should have been a group");
+ puts(" Unexpected object type - should have been a group");
goto error;
}
@@ -11184,10 +11190,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_unlink_compact(hid_t fapl, hbool_t new_format)
+external_link_unlink_compact(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
if (new_format)
@@ -11277,11 +11283,11 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_unlink_dense(hid_t fapl, hbool_t new_format)
+external_link_unlink_dense(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gcpl = -1; /* Group creation property list ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gcpl = H5I_INVALID_HID; /* Group creation property list ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
unsigned nmsgs; /* Number of messages in group's header */
@@ -11307,7 +11313,7 @@ external_link_unlink_dense(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR;
/* Check on root group's status */
- if (H5G__is_empty_test(gid) != TRUE)
+ if (H5G__is_empty_test(gid) != true)
TEST_ERROR;
/* Query the group creation properties */
@@ -11323,18 +11329,18 @@ external_link_unlink_dense(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* Check on root group's status */
- if (H5G__is_empty_test(gid) == TRUE)
+ if (H5G__is_empty_test(gid) == true)
TEST_ERROR;
- if (H5G__has_links_test(gid, &nmsgs) != TRUE)
+ if (H5G__has_links_test(gid, &nmsgs) != true)
TEST_ERROR;
if (nmsgs != 1)
TEST_ERROR;
- if (H5G__has_stab_test(gid) == TRUE)
+ if (H5G__has_stab_test(gid) == true)
TEST_ERROR;
/* Create enough objects in the root group to change it into a "dense" group */
for (u = 0; u < max_compact; u++) {
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if ((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
if (H5Gclose(gid2) < 0)
@@ -11342,11 +11348,11 @@ external_link_unlink_dense(hid_t fapl, hbool_t new_format)
} /* end for */
/* Check on root group's status */
- if (H5G__is_empty_test(gid) == TRUE)
+ if (H5G__is_empty_test(gid) == true)
TEST_ERROR;
- if (H5G__has_links_test(gid, NULL) == TRUE)
+ if (H5G__has_links_test(gid, NULL) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(gid) != TRUE)
+ if (H5G__is_new_dense_test(gid) != true)
TEST_ERROR;
/* Close group creation property list */
@@ -11389,21 +11395,21 @@ external_link_unlink_dense(hid_t fapl, hbool_t new_format)
/* Remove enough objects in the root group to change it into a "compact" group */
for (u = 0; u < ((max_compact - min_dense) + 1); u++) {
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if (H5Ldelete(gid, objname, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
} /* end for */
/* Check on root group's status */
- if (H5G__is_empty_test(gid) == TRUE)
+ if (H5G__is_empty_test(gid) == true)
TEST_ERROR;
- if (H5G__has_links_test(gid, &nmsgs) != TRUE)
+ if (H5G__has_links_test(gid, &nmsgs) != true)
TEST_ERROR;
if (nmsgs != (min_dense - 1))
TEST_ERROR;
- if (H5G__is_new_dense_test(gid) == TRUE)
+ if (H5G__is_new_dense_test(gid) == true)
TEST_ERROR;
- if (H5G__has_stab_test(gid) == TRUE)
+ if (H5G__has_stab_test(gid) == true)
TEST_ERROR;
/* Close root group */
@@ -11454,10 +11460,10 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_move(hid_t fapl, hbool_t new_format)
+external_link_move(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
@@ -11512,7 +11518,7 @@ external_link_move(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
FAIL_STACK_ERROR;
- if (HDstrcmp(objname, "/dst") != 0)
+ if (strcmp(objname, "/dst") != 0)
TEST_ERROR;
/* Create object in external file */
@@ -11572,7 +11578,7 @@ external_link_move(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
FAIL_STACK_ERROR;
- if (HDstrcmp(objname, "/dst") != 0)
+ if (strcmp(objname, "/dst") != 0)
TEST_ERROR;
/* Create object in external file */
@@ -11619,7 +11625,7 @@ external_link_move(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
FAIL_STACK_ERROR;
- if (HDstrcmp(objname, "/dst") != 0)
+ if (strcmp(objname, "/dst") != 0)
TEST_ERROR;
/* Move external link back to original location */
@@ -11629,7 +11635,7 @@ external_link_move(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
FAIL_STACK_ERROR;
- if (HDstrcmp(objname, "/dst") != 0)
+ if (strcmp(objname, "/dst") != 0)
TEST_ERROR;
/* Create object in external file */
@@ -11689,11 +11695,11 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_ride(hid_t fapl, hbool_t new_format)
+external_link_ride(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gcpl = -1; /* Group creation property list ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gcpl = H5I_INVALID_HID; /* Group creation property list ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
char objname[NAME_BUF_SIZE]; /* Object name */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE]; /* Names of files to externally link across */
unsigned nmsgs; /* Number of messages in group's header */
@@ -11719,7 +11725,7 @@ external_link_ride(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR;
/* Check on root group's status */
- if (H5G__is_empty_test(gid) != TRUE)
+ if (H5G__is_empty_test(gid) != true)
TEST_ERROR;
/* Query the group creation properties */
@@ -11730,7 +11736,7 @@ external_link_ride(hid_t fapl, hbool_t new_format)
/* Create enough objects in the root group to change it into a "dense" group */
for (u = 0; u < (max_compact + 1); u++) {
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if ((gid2 = H5Gcreate2(gid, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
if (H5Gclose(gid2) < 0)
@@ -11738,16 +11744,16 @@ external_link_ride(hid_t fapl, hbool_t new_format)
} /* end for */
/* Check on root group's status */
- if (H5G__is_empty_test(gid) == TRUE)
+ if (H5G__is_empty_test(gid) == true)
TEST_ERROR;
- if (H5G__has_links_test(gid, NULL) == TRUE)
+ if (H5G__has_links_test(gid, NULL) == true)
TEST_ERROR;
if (new_format) {
- if (H5G__is_new_dense_test(gid) != TRUE)
+ if (H5G__is_new_dense_test(gid) != true)
TEST_ERROR;
} /* end if */
else {
- if (H5G__has_stab_test(gid) != TRUE)
+ if (H5G__has_stab_test(gid) != true)
TEST_ERROR;
} /* end else */
@@ -11757,11 +11763,11 @@ external_link_ride(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* Check on root group's status */
- if (H5G__is_empty_test(gid) == TRUE)
+ if (H5G__is_empty_test(gid) == true)
TEST_ERROR;
- if (H5G__has_links_test(gid, NULL) == TRUE)
+ if (H5G__has_links_test(gid, NULL) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(gid) != TRUE)
+ if (H5G__is_new_dense_test(gid) != true)
TEST_ERROR;
/* Close group creation property list */
@@ -11803,7 +11809,7 @@ external_link_ride(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/dst") != 0)
+ if (strcmp(objname, "/dst") != 0)
TEST_ERROR;
/* Create object in external file */
@@ -11824,21 +11830,21 @@ external_link_ride(hid_t fapl, hbool_t new_format)
/* Remove enough objects in the root group to change it into a "compact" group */
for (u = 0; u < ((max_compact - min_dense) + 3); u++) {
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if (H5Ldelete(gid, objname, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
} /* end for */
/* Check on root group's status */
- if (H5G__is_empty_test(gid) == TRUE)
+ if (H5G__is_empty_test(gid) == true)
TEST_ERROR;
- if (H5G__has_links_test(gid, &nmsgs) != TRUE)
+ if (H5G__has_links_test(gid, &nmsgs) != true)
TEST_ERROR;
if (nmsgs != (min_dense - 1))
TEST_ERROR;
- if (H5G__has_stab_test(gid) == TRUE)
+ if (H5G__has_stab_test(gid) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(gid) == TRUE)
+ if (H5G__is_new_dense_test(gid) == true)
TEST_ERROR;
/* Close root group */
@@ -11852,7 +11858,7 @@ external_link_ride(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/dst") != 0)
+ if (strcmp(objname, "/dst") != 0)
TEST_ERROR;
/* Create object in external file */
@@ -11921,11 +11927,13 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_closing(hid_t fapl, hbool_t new_format)
+external_link_closing(hid_t fapl, bool new_format)
{
- hid_t fid1 = (-1), fid2 = (-1), fid3 = (-1), fid4 = (-1);
- hid_t gid = (-1), tid = (-1), tid2 = (-1), sid = (-1), did = (-1);
- hid_t lcpl_id = (-1);
+ hid_t fid1 = (H5I_INVALID_HID), fid2 = (H5I_INVALID_HID), fid3 = (H5I_INVALID_HID),
+ fid4 = (H5I_INVALID_HID);
+ hid_t gid = (H5I_INVALID_HID), tid = (H5I_INVALID_HID), tid2 = (H5I_INVALID_HID), sid = (H5I_INVALID_HID),
+ did = (H5I_INVALID_HID);
+ hid_t lcpl_id = (H5I_INVALID_HID);
hsize_t dims[2];
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE],
filename4[NAME_BUF_SIZE], /* Names of files to externally link across */
@@ -12045,7 +12053,7 @@ external_link_closing(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR;
if (H5Oget_comment_by_name(fid1, "elink/elink/elink/group1_moved", buf, sizeof(buf), H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- if (HDstrcmp(buf, "comment") != 0)
+ if (strcmp(buf, "comment") != 0)
TEST_ERROR;
/* Test H5*open */
@@ -12149,7 +12157,7 @@ external_link_closing(hid_t fapl, hbool_t new_format)
/* Add a few regular groups and a soft link in file2 using intermediate group creation */
if ((lcpl_id = H5Pcreate(H5P_LINK_CREATE)) < 0)
TEST_ERROR;
- if (H5Pset_create_intermediate_group(lcpl_id, TRUE) < 0)
+ if (H5Pset_create_intermediate_group(lcpl_id, true) < 0)
TEST_ERROR;
if (H5Lcreate_soft("/elink2", fid1, "elink/file2group1/file2group2/slink", lcpl_id, H5P_DEFAULT) < 0)
TEST_ERROR;
@@ -12237,12 +12245,12 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_endian(hbool_t new_format)
+external_link_endian(bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
- hid_t lapl_id = -1; /* Prop List ID */
- const char *pathbuf = H5_get_srcdir(); /* Path to the files */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ hid_t lapl_id = H5I_INVALID_HID; /* Prop List ID */
+ const char *pathbuf = H5_get_srcdir(); /* Path to the files */
const char *namebuf;
if (new_format)
@@ -12322,12 +12330,12 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_strong(hid_t fapl, hbool_t new_format)
+external_link_strong(hid_t fapl, bool new_format)
{
- hid_t my_fapl = (-1); /* File access property list */
- hid_t fid1 = (-1), fid2 = (-1); /* File ID */
- hid_t gid1 = (-1), gid2 = (-1); /* Group IDs */
- char objname[NAME_BUF_SIZE]; /* Object name */
+ hid_t my_fapl = (H5I_INVALID_HID); /* File access property list */
+ hid_t fid1 = (H5I_INVALID_HID), fid2 = (H5I_INVALID_HID); /* File ID */
+ hid_t gid1 = (H5I_INVALID_HID), gid2 = (H5I_INVALID_HID); /* Group IDs */
+ char objname[NAME_BUF_SIZE]; /* Object name */
char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE];
if (new_format)
@@ -12388,7 +12396,7 @@ external_link_strong(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR;
if (H5Iget_name(gid2, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/A/B/C") != 0)
+ if (strcmp(objname, "/A/B/C") != 0)
TEST_ERROR;
if (H5Gclose(gid2) < 0)
TEST_ERROR;
@@ -12427,31 +12435,31 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
+external_symlink(const char *env_h5_drvr, hid_t fapl, bool new_format)
{
#ifdef H5_HAVE_SYMLINK
- hid_t file1 = H5I_INVALID_HID;
- hid_t file2 = H5I_INVALID_HID;
- hid_t file3 = H5I_INVALID_HID;
- hid_t file4 = H5I_INVALID_HID;
- hid_t file5 = H5I_INVALID_HID;
- hid_t group2 = H5I_INVALID_HID;
- hid_t group3 = H5I_INVALID_HID;
- hid_t group4 = H5I_INVALID_HID;
- hid_t group5 = H5I_INVALID_HID;
- char *filename1 = NULL;
- char *filename2a = NULL;
- char *filename2b = NULL;
- char *filename3a = NULL;
- char *filename3b = NULL;
- char *filename4a = NULL;
- char *filename4b = NULL;
- char *filename5a = NULL;
- char *filename5b = NULL;
- char *tmpname = NULL;
- char *cwdpath = NULL;
- hbool_t have_posix_compat_vfd; /* Whether VFD used is compatible w/POSIX I/O calls */
-#endif /* H5_HAVE_SYMLINK */
+ hid_t file1 = H5I_INVALID_HID;
+ hid_t file2 = H5I_INVALID_HID;
+ hid_t file3 = H5I_INVALID_HID;
+ hid_t file4 = H5I_INVALID_HID;
+ hid_t file5 = H5I_INVALID_HID;
+ hid_t group2 = H5I_INVALID_HID;
+ hid_t group3 = H5I_INVALID_HID;
+ hid_t group4 = H5I_INVALID_HID;
+ hid_t group5 = H5I_INVALID_HID;
+ char *filename1 = NULL;
+ char *filename2a = NULL;
+ char *filename2b = NULL;
+ char *filename3a = NULL;
+ char *filename3b = NULL;
+ char *filename4a = NULL;
+ char *filename4b = NULL;
+ char *filename5a = NULL;
+ char *filename5b = NULL;
+ char *tmpname = NULL;
+ char *cwdpath = NULL;
+ bool have_posix_compat_vfd; /* Whether VFD used is compatible w/POSIX I/O calls */
+#endif /* H5_HAVE_SYMLINK */
if (new_format)
TESTING("external links w/symlink files (w/new group format)");
@@ -12462,11 +12470,11 @@ external_symlink(const char *env_h5_drvr, hid_t fapl, hbool_t new_format)
/* Skip test when using VFDs that can't provide a POSIX compatible file
* descriptor.
*/
- have_posix_compat_vfd = (hbool_t)(!HDstrcmp(env_h5_drvr, "sec2") || !HDstrcmp(env_h5_drvr, "core") ||
- !HDstrcmp(env_h5_drvr, "nomatch"));
+ have_posix_compat_vfd = (bool)(!strcmp(env_h5_drvr, "sec2") || !strcmp(env_h5_drvr, "core") ||
+ !strcmp(env_h5_drvr, "nomatch"));
if (!have_posix_compat_vfd) {
SKIPPED();
- HDputs(" Current VFD doesn't support POSIX I/O calls");
+ puts(" Current VFD doesn't support POSIX I/O calls");
return SUCCEED;
}
@@ -12707,7 +12715,7 @@ error:
#else /* H5_HAVE_SYMLINK */
SKIPPED();
- HDputs(" Current file system or operating system doesn't support symbolic links");
+ puts(" Current file system or operating system doesn't support symbolic links");
return SUCCEED;
#endif /* H5_HAVE_SYMLINK */
@@ -12726,11 +12734,11 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_copy_invalid_object(hid_t fapl, hbool_t new_format)
+external_copy_invalid_object(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group ID */
- hid_t ocpyplid = -1; /* Object copy plist ID */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
+ hid_t ocpyplid = H5I_INVALID_HID; /* Object copy plist ID */
char filename[NAME_BUF_SIZE];
if (new_format)
@@ -12806,11 +12814,11 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_dont_fail_to_source(hid_t fapl, hbool_t new_format)
+external_dont_fail_to_source(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group ID */
- hid_t oid = -1; /* Object ID */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
+ hid_t oid = H5I_INVALID_HID; /* Object ID */
char filename[NAME_BUF_SIZE];
if (new_format)
@@ -12875,14 +12883,14 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_file_cache(hid_t fapl, hbool_t new_format)
+external_file_cache(hid_t fapl, bool new_format)
{
- hid_t my_fapl = -1; /* Temporary FAPL */
- hid_t fid1 = -1; /* File ID */
- hid_t fid2 = -1; /* File ID */
- hid_t fid3 = -1; /* File ID */
- hid_t fid4 = -1; /* File ID */
- hid_t oid = -1; /* Object ID */
+ hid_t my_fapl = H5I_INVALID_HID; /* Temporary FAPL */
+ hid_t fid1 = H5I_INVALID_HID; /* File ID */
+ hid_t fid2 = H5I_INVALID_HID; /* File ID */
+ hid_t fid3 = H5I_INVALID_HID; /* File ID */
+ hid_t fid4 = H5I_INVALID_HID; /* File ID */
+ hid_t oid = H5I_INVALID_HID; /* Object ID */
unsigned efc_size;
char filename1[NAME_BUF_SIZE];
char filename2[NAME_BUF_SIZE];
@@ -13233,14 +13241,14 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_open_twice(hid_t fapl, hbool_t new_format)
+external_open_twice(hid_t fapl, bool new_format)
{
- hid_t fid1 = -1; /* File ID */
- hid_t fid2 = -1; /* File ID */
- hid_t oid1 = -1; /* Object ID */
- hid_t oid2 = -1; /* Object ID */
- hid_t type = -1; /* Datatype ID */
- hid_t space = -1; /* Dataspace ID */
+ hid_t fid1 = H5I_INVALID_HID; /* File ID */
+ hid_t fid2 = H5I_INVALID_HID; /* File ID */
+ hid_t oid1 = H5I_INVALID_HID; /* Object ID */
+ hid_t oid2 = H5I_INVALID_HID; /* Object ID */
+ hid_t type = H5I_INVALID_HID; /* Datatype ID */
+ hid_t space = H5I_INVALID_HID; /* Dataspace ID */
char filename1[NAME_BUF_SIZE];
char filename2[NAME_BUF_SIZE];
@@ -13448,26 +13456,26 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_with_committed_datatype(hid_t fapl, hbool_t new_format)
+external_link_with_committed_datatype(hid_t fapl, bool new_format)
{
- hid_t fid1 = -1, fid2 = -1; /* File IDs */
- hid_t gid1 = -1, gid2 = -1; /* Group IDs */
- hid_t tid = -1; /* Datatype ID */
- hid_t sid = -1; /* Dataspace ID */
- hid_t sid2 = -1; /* Dataspace ID */
- hid_t aid = -1; /* Attribute ID */
- hid_t atid = -1; /* Attribute's datatype ID */
- hid_t did = -1; /* Dataset ID */
- hid_t dtid = -1; /* Dataset's datatype ID */
- hid_t dcpl = -1; /* Dataset creation property list */
- int wdata = 99; /* Attribute data written */
- int wbuf[60]; /* Data buffer for writing */
- int rbuf[60]; /* Data buffer for reading */
- int i; /* Local index variable */
- char filename1[NAME_BUF_SIZE]; /* File name for main file */
- char filename2[NAME_BUF_SIZE]; /* File name for target file */
- hsize_t dims[2] = {5, 12}; /* Dimension sizes */
- hsize_t chunks[2] = {3, 7}; /* Chunk sizes */
+ hid_t fid1 = H5I_INVALID_HID, fid2 = H5I_INVALID_HID; /* File IDs */
+ hid_t gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ hid_t tid = H5I_INVALID_HID; /* Datatype ID */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t sid2 = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t aid = H5I_INVALID_HID; /* Attribute ID */
+ hid_t atid = H5I_INVALID_HID; /* Attribute's datatype ID */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
+ hid_t dtid = H5I_INVALID_HID; /* Dataset's datatype ID */
+ hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */
+ int wdata = 99; /* Attribute data written */
+ int wbuf[60]; /* Data buffer for writing */
+ int rbuf[60]; /* Data buffer for reading */
+ int i; /* Local index variable */
+ char filename1[NAME_BUF_SIZE]; /* File name for main file */
+ char filename2[NAME_BUF_SIZE]; /* File name for target file */
+ hsize_t dims[2] = {5, 12}; /* Dimension sizes */
+ hsize_t chunks[2] = {3, 7}; /* Chunk sizes */
if (new_format)
TESTING("attach committed datatype to external group's attribute/dataset(w/new group format)");
@@ -13529,7 +13537,7 @@ external_link_with_committed_datatype(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR;
/* Verify the datatype is not committed */
- if (H5Tcommitted(atid) == TRUE)
+ if (H5Tcommitted(atid) == true)
FAIL_STACK_ERROR;
/* Close the attribute */
@@ -13568,7 +13576,7 @@ external_link_with_committed_datatype(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR;
/* Verify the datatype is not committed */
- if (H5Tcommitted(dtid) == TRUE)
+ if (H5Tcommitted(dtid) == true)
FAIL_STACK_ERROR;
/* Close the dataset */
@@ -13610,7 +13618,7 @@ external_link_with_committed_datatype(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR;
/* Verify the datatype is committed */
- if (H5Tcommitted(tid) == FALSE)
+ if (H5Tcommitted(tid) == false)
FAIL_STACK_ERROR;
/* Open the group which is externally linked to target file */
@@ -13626,7 +13634,7 @@ external_link_with_committed_datatype(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR;
/* Verify the attribute's datatype is not committed */
- if (H5Tcommitted(atid) == TRUE)
+ if (H5Tcommitted(atid) == true)
FAIL_STACK_ERROR;
/* Close the attribute */
@@ -13646,7 +13654,7 @@ external_link_with_committed_datatype(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR;
/* Verify the dataset's datatype is not committed */
- if (H5Tcommitted(dtid) == TRUE)
+ if (H5Tcommitted(dtid) == true)
FAIL_STACK_ERROR;
/* Read the dataset */
@@ -13715,9 +13723,9 @@ error:
*-------------------------------------------------------------------------
*/
static int
-external_link_public_macros(hid_t fapl, hbool_t new_format)
+external_link_public_macros(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
H5L_info2_t linfo; /* Link information */
char objname[NAME_BUF_SIZE]; /* Object name */
char filename1[NAME_BUF_SIZE];
@@ -13744,7 +13752,7 @@ external_link_public_macros(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* Check that external links are registered with the library */
- if (H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE)
+ if (H5Lis_registered(H5L_TYPE_EXTERNAL) != true)
TEST_ERROR;
/* Create file with link to first file */
@@ -13761,7 +13769,7 @@ external_link_public_macros(hid_t fapl, hbool_t new_format)
if (H5L_TYPE_EXTERNAL != linfo.type) {
H5_FAILED();
- HDputs(" Unexpected object type - should have been an external link");
+ puts(" Unexpected object type - should have been an external link");
goto error;
}
@@ -13771,22 +13779,22 @@ external_link_public_macros(hid_t fapl, hbool_t new_format)
if (H5Lunpack_elink_val(objname, linfo.u.val_size, &flags, &file, &path) < 0)
TEST_ERROR;
- if (HDstrcmp(file, filename1) != 0) {
+ if (strcmp(file, filename1) != 0) {
H5_FAILED();
- HDputs(" External link file name incorrect");
+ puts(" External link file name incorrect");
goto error;
}
- if (HDstrcmp(path, "/") != 0) {
+ if (strcmp(path, "/") != 0) {
H5_FAILED();
- HDputs(" External link path incorrect");
+ puts(" External link path incorrect");
goto error;
}
/* External link version & flags */
if (flags != ((H5L_EXT_VERSION << 4) | H5L_EXT_FLAGS_ALL)) {
H5_FAILED();
- HDputs(" External link version or flags are incorrect");
+ puts(" External link version or flags are incorrect");
goto error;
}
@@ -13828,7 +13836,7 @@ UD_hard_create(const char H5_ATTR_UNUSED *link_name, hid_t loc_group, const void
hid_t H5_ATTR_UNUSED lcpl_id)
{
H5O_token_t token;
- hid_t target_obj = -1;
+ hid_t target_obj = H5I_INVALID_HID;
herr_t ret_value = 0;
if (udata_size != sizeof(H5O_token_t)) {
@@ -13902,7 +13910,7 @@ UD_hard_traverse(const char H5_ATTR_UNUSED *link_name, hid_t cur_group, const vo
hid_t H5_ATTR_UNUSED lapl_id, hid_t H5_ATTR_UNUSED dxpl_id)
{
H5O_token_t token;
- hid_t ret_value = -1;
+ hid_t ret_value = H5I_INVALID_HID;
if (udata_size != sizeof(H5O_token_t))
return FAIL;
@@ -13920,7 +13928,7 @@ static herr_t
UD_hard_delete(const char H5_ATTR_UNUSED *link_name, hid_t file, const void *udata, size_t udata_size)
{
H5O_token_t token;
- hid_t target_obj = -1;
+ hid_t target_obj = H5I_INVALID_HID;
herr_t ret_value = 0;
if (udata_size != sizeof(H5O_token_t)) {
@@ -13991,11 +13999,11 @@ done:
static int
ud_hard_links(hid_t fapl)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
- H5L_info2_t li; /* Link information */
- char objname[NAME_BUF_SIZE]; /* Object name */
- h5_stat_size_t empty_size; /* Size of an empty file */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ H5L_info2_t li; /* Link information */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ h5_stat_size_t empty_size; /* Size of an empty file */
char filename[NAME_BUF_SIZE];
TESTING("user-defined hard link (w/new group format)");
@@ -14016,9 +14024,9 @@ ud_hard_links(hid_t fapl)
TEST_ERROR;
/* Check that external links are registered and UD hard links are not */
- if (H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE)
+ if (H5Lis_registered(H5L_TYPE_EXTERNAL) != true)
TEST_ERROR;
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != FALSE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != false)
TEST_ERROR;
/* Register "user-defined hard links" with the library */
@@ -14026,9 +14034,9 @@ ud_hard_links(hid_t fapl)
TEST_ERROR;
/* Check that UD hard links are now registered */
- if (H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE)
+ if (H5Lis_registered(H5L_TYPE_EXTERNAL) != true)
TEST_ERROR;
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != TRUE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != true)
TEST_ERROR;
/* Create a group for the UD hard link to point to */
@@ -14061,7 +14069,7 @@ ud_hard_links(hid_t fapl)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/group") != 0)
+ if (strcmp(objname, "/group") != 0)
TEST_ERROR;
/* Create object in group */
@@ -14081,7 +14089,7 @@ ud_hard_links(hid_t fapl)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/group/new_group") != 0)
+ if (strcmp(objname, "/group/new_group") != 0)
TEST_ERROR;
/* Close opened object */
@@ -14096,7 +14104,7 @@ ud_hard_links(hid_t fapl)
TEST_ERROR;
if (UD_HARD_TYPE != li.type) {
H5_FAILED();
- HDputs(" Unexpected link class - should have been a UD hard link");
+ puts(" Unexpected link class - should have been a UD hard link");
goto error;
} /* end if */
@@ -14176,10 +14184,10 @@ error:
static int
ud_link_reregister(hid_t fapl)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
- H5L_info2_t li; /* Link information */
- char objname[NAME_BUF_SIZE]; /* Object name */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ H5L_info2_t li; /* Link information */
+ char objname[NAME_BUF_SIZE]; /* Object name */
char filename[NAME_BUF_SIZE];
h5_stat_size_t empty_size; /* Size of an empty file */
@@ -14201,7 +14209,7 @@ ud_link_reregister(hid_t fapl)
TEST_ERROR;
/* Check that UD hard links are not registered */
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != FALSE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != false)
TEST_ERROR;
/* Register "user-defined hard links" with the library */
@@ -14209,7 +14217,7 @@ ud_link_reregister(hid_t fapl)
TEST_ERROR;
/* Check that UD hard links are registered */
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != TRUE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != true)
TEST_ERROR;
/* Point a UD defined hard link to a group in the same way as the previous test */
@@ -14235,7 +14243,7 @@ ud_link_reregister(hid_t fapl)
TEST_ERROR;
/* Check that UD hard links are no longer registered */
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != FALSE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != false)
TEST_ERROR;
/* Verify that we can't traverse the ud link anymore */
@@ -14260,7 +14268,7 @@ ud_link_reregister(hid_t fapl)
TEST_ERROR;
/* Check that UD hard links are registered again */
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != TRUE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != true)
TEST_ERROR;
/* Open a group through the ud link (now a different class of link).
@@ -14272,7 +14280,7 @@ ud_link_reregister(hid_t fapl)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/" REREG_TARGET_NAME) != 0)
+ if (strcmp(objname, "/" REREG_TARGET_NAME) != 0)
TEST_ERROR;
/* Create object in group */
@@ -14292,7 +14300,7 @@ ud_link_reregister(hid_t fapl)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/rereg_target/new_group") != 0)
+ if (strcmp(objname, "/rereg_target/new_group") != 0)
TEST_ERROR;
/* Close opened object */
@@ -14309,7 +14317,7 @@ ud_link_reregister(hid_t fapl)
* other link type */
if (H5Lregister(UD_hard_class) < 0)
FAIL_STACK_ERROR;
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != TRUE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != true)
FAIL_STACK_ERROR;
/* Ensure we can open the group through the UD link (now that UD hard
@@ -14340,7 +14348,7 @@ ud_link_reregister(hid_t fapl)
if (H5Lunregister((H5L_type_t)UD_HARD_TYPE) < 0)
FAIL_STACK_ERROR;
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != FALSE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != false)
FAIL_STACK_ERROR;
PASSED();
@@ -14381,9 +14389,9 @@ UD_cb_create(const char *link_name, hid_t loc_group, const void *udata, size_t u
if (lcpl_id < 0)
TEST_ERROR;
- if (HDstrcmp(link_name, UD_CB_LINK_NAME) != 0 && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME) != 0)
+ if (strcmp(link_name, UD_CB_LINK_NAME) != 0 && strcmp(link_name, NEW_UD_CB_LINK_NAME) != 0)
TEST_ERROR;
- if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0)
+ if (strcmp((const char *)udata, UD_CB_TARGET) != 0)
TEST_ERROR;
if (udata_size != UD_CB_TARGET_LEN)
TEST_ERROR;
@@ -14408,9 +14416,9 @@ UD_cb_traverse(const char *link_name, hid_t cur_group, const void *udata, size_t
if (udata_size > 0 && !udata)
TEST_ERROR;
- if (HDstrcmp(link_name, UD_CB_LINK_NAME) != 0 && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME) != 0)
+ if (strcmp(link_name, UD_CB_LINK_NAME) != 0 && strcmp(link_name, NEW_UD_CB_LINK_NAME) != 0)
TEST_ERROR;
- if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0)
+ if (strcmp((const char *)udata, UD_CB_TARGET) != 0)
TEST_ERROR;
if (udata_size != UD_CB_TARGET_LEN)
TEST_ERROR;
@@ -14435,9 +14443,9 @@ UD_cb_move(const char *new_name, hid_t new_loc, const void *udata, size_t udata_
if (udata_size > 0 && !udata)
TEST_ERROR;
- if (HDstrcmp(new_name, NEW_UD_CB_LINK_NAME) != 0)
+ if (strcmp(new_name, NEW_UD_CB_LINK_NAME) != 0)
TEST_ERROR;
- if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0)
+ if (strcmp((const char *)udata, UD_CB_TARGET) != 0)
TEST_ERROR;
if (udata_size != UD_CB_TARGET_LEN)
TEST_ERROR;
@@ -14459,9 +14467,9 @@ UD_cb_delete(const char *link_name, hid_t file, const void *udata, size_t udata_
if (udata_size > 0 && !udata)
TEST_ERROR;
- if (HDstrcmp(link_name, UD_CB_LINK_NAME) != 0 && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME) != 0)
+ if (strcmp(link_name, UD_CB_LINK_NAME) != 0 && strcmp(link_name, NEW_UD_CB_LINK_NAME) != 0)
TEST_ERROR;
- if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0)
+ if (strcmp((const char *)udata, UD_CB_TARGET) != 0)
TEST_ERROR;
if (udata_size != UD_CB_TARGET_LEN)
TEST_ERROR;
@@ -14481,9 +14489,9 @@ UD_cb_query(const char *link_name, const void *udata, size_t udata_size, void *b
if (udata_size > 0 && !udata)
TEST_ERROR;
- if (HDstrcmp(link_name, UD_CB_LINK_NAME) != 0)
+ if (strcmp(link_name, UD_CB_LINK_NAME) != 0)
TEST_ERROR;
- if (HDstrcmp((const char *)udata, UD_CB_TARGET) != 0)
+ if (strcmp((const char *)udata, UD_CB_TARGET) != 0)
TEST_ERROR;
if (udata_size != UD_CB_TARGET_LEN)
TEST_ERROR;
@@ -14491,7 +14499,7 @@ UD_cb_query(const char *link_name, const void *udata, size_t udata_size, void *b
if (buf) {
if (buf_size < 16)
TEST_ERROR;
- HDstrcpy((char *)buf, "query succeeded");
+ strcpy((char *)buf, "query succeeded");
} /* end if */
/* There are 15 characters and a NULL in "query succeeded" */
@@ -14502,11 +14510,11 @@ error:
} /* end UD_cb_query() */
static int
-ud_callbacks(hid_t fapl, hbool_t new_format)
+ud_callbacks(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group ID */
- hid_t lcpl = -1; /* Link Creation PL */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
+ hid_t lcpl = H5I_INVALID_HID; /* Link Creation PL */
H5L_info2_t li; /* Link information */
char ud_target_name[] = UD_CB_TARGET; /* Link target name */
char filename[NAME_BUF_SIZE];
@@ -14524,11 +14532,11 @@ ud_callbacks(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* Check that registered link classes are, and unregistered ones aren't */
- if (H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE)
+ if (H5Lis_registered(H5L_TYPE_EXTERNAL) != true)
TEST_ERROR;
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != FALSE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != false)
TEST_ERROR;
- if (H5Lis_registered((H5L_type_t)UD_CB_TYPE) != FALSE)
+ if (H5Lis_registered((H5L_type_t)UD_CB_TYPE) != false)
TEST_ERROR;
/* Hit two birds with one stone: register UD hard links from previous
@@ -14542,11 +14550,11 @@ ud_callbacks(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* Check that registered link classes are, and unregistered ones aren't */
- if (H5Lis_registered(H5L_TYPE_EXTERNAL) != TRUE)
+ if (H5Lis_registered(H5L_TYPE_EXTERNAL) != true)
TEST_ERROR;
- if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != TRUE)
+ if (H5Lis_registered((H5L_type_t)UD_HARD_TYPE) != true)
TEST_ERROR;
- if (H5Lis_registered((H5L_type_t)UD_CB_TYPE) != TRUE)
+ if (H5Lis_registered((H5L_type_t)UD_CB_TYPE) != true)
TEST_ERROR;
/* Create a group for the UD link to point to */
@@ -14573,14 +14581,14 @@ ud_callbacks(hid_t fapl, hbool_t new_format)
TEST_ERROR;
if (UD_CB_TYPE != li.type) {
H5_FAILED();
- HDputs(" Unexpected link class - should have been a UD hard link");
+ puts(" Unexpected link class - should have been a UD hard link");
goto error;
}
/* Fill the query buffer */
if (H5Lget_val(fid, UD_CB_LINK_NAME, query_buf, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- if (HDstrcmp(query_buf, "query succeeded") != 0)
+ if (strcmp(query_buf, "query succeeded") != 0)
TEST_ERROR;
/* Move the link */
@@ -14702,11 +14710,11 @@ error:
} /* end UD_plist_traverse() */
static int
-lapl_udata(hid_t fapl, hbool_t new_format)
+lapl_udata(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
- hid_t plist_id = -1; /* Property List ID */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ hid_t plist_id = H5I_INVALID_HID; /* Property List ID */
char group_a_name[NAME_BUF_SIZE];
char group_b_name[NAME_BUF_SIZE];
char filename[NAME_BUF_SIZE];
@@ -14758,7 +14766,7 @@ lapl_udata(hid_t fapl, hbool_t new_format)
/* Create a non-default lapl with a new property pointing to group a*/
if ((plist_id = H5Pcreate(H5P_LINK_ACCESS)) < 0)
TEST_ERROR;
- HDstrcpy(group_a_name, "group_a");
+ strcpy(group_a_name, "group_a");
if (H5Pinsert2(plist_id, DEST_PROP_NAME, (size_t)NAME_BUF_SIZE, group_a_name, NULL, NULL, NULL, NULL,
NULL, NULL) < 0)
TEST_ERROR;
@@ -14780,7 +14788,7 @@ lapl_udata(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* Now use the same ud link to access group_b */
- HDstrcpy(group_b_name, "group_b");
+ strcpy(group_b_name, "group_b");
if (H5Pset(plist_id, DEST_PROP_NAME, group_b_name) < 0)
TEST_ERROR;
@@ -14936,7 +14944,7 @@ UD_cbsucc_query(const char H5_ATTR_UNUSED *link_name, const void H5_ATTR_UNUSED
*/
if (buf != NULL && buf_size >= 8)
- HDstrcpy((char *)buf, "succeed");
+ strcpy((char *)buf, "succeed");
return 8;
} /* end UD_cbsucc_query() */
@@ -15027,10 +15035,10 @@ const H5L_class_t UD_error4_class[1] = {{
}};
static int
-ud_link_errors(hid_t fapl, hbool_t new_format)
+ud_link_errors(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group IDs */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group IDs */
char group_name[NAME_BUF_SIZE];
char filename[NAME_BUF_SIZE];
char query_buf[NAME_BUF_SIZE];
@@ -15094,8 +15102,8 @@ ud_link_errors(hid_t fapl, hbool_t new_format)
H5E_END_TRY
/* Create a user-defined link to the group. */
- HDstrcpy(group_name, "/group");
- if (H5Lcreate_ud(fid, "/ud_link", (H5L_type_t)UD_CBFAIL_TYPE, &group_name, HDstrlen(group_name) + 1,
+ strcpy(group_name, "/group");
+ if (H5Lcreate_ud(fid, "/ud_link", (H5L_type_t)UD_CBFAIL_TYPE, &group_name, strlen(group_name) + 1,
H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
@@ -15173,7 +15181,7 @@ ud_link_errors(hid_t fapl, hbool_t new_format)
TEST_ERROR;
if (H5Lget_val(fid, "ud_link", query_buf, (size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- if (HDstrcmp(query_buf, "succeed") != 0)
+ if (strcmp(query_buf, "succeed") != 0)
TEST_ERROR;
/* Moving and copying should both succeed */
@@ -15214,14 +15222,14 @@ error:
*-------------------------------------------------------------------------
*/
static int
-lapl_nlinks(hid_t fapl, hbool_t new_format)
+lapl_nlinks(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
- hid_t plist = -1; /* lapl ID */
- hid_t tid = -1, sid = -1, did = -1; /* Other IDs */
- hid_t gapl = -1, dapl = -1, tapl = -1; /* Other property lists */
- char objname[NAME_BUF_SIZE]; /* Object name */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ hid_t plist = H5I_INVALID_HID; /* lapl ID */
+ hid_t tid = H5I_INVALID_HID, sid = H5I_INVALID_HID, did = H5I_INVALID_HID; /* Other IDs */
+ hid_t gapl = H5I_INVALID_HID, dapl = H5I_INVALID_HID, tapl = H5I_INVALID_HID; /* Other property lists */
+ char objname[NAME_BUF_SIZE]; /* Object name */
char filename[NAME_BUF_SIZE];
size_t nlinks; /* nlinks for H5Pset_nlinks */
hsize_t dims[2];
@@ -15315,7 +15323,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/soft17") != 0)
+ if (strcmp(objname, "/soft17") != 0)
TEST_ERROR;
/* Create group using soft link */
@@ -15348,7 +15356,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
H5E_END_TRY
if (gid >= 0) {
H5_FAILED();
- HDputs(" Should have failed for sequence of too many nested links.");
+ puts(" Should have failed for sequence of too many nested links.");
goto error;
}
@@ -15359,7 +15367,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
/* Check name */
if (H5Iget_name(gid, objname, (size_t)NAME_BUF_SIZE) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, "/soft4") != 0)
+ if (strcmp(objname, "/soft4") != 0)
TEST_ERROR;
/* Test other functions that should use a LAPL */
@@ -15521,13 +15529,13 @@ error:
*-------------------------------------------------------------------------
*/
static int
-linkinfo(hid_t fapl, hbool_t new_format)
+linkinfo(hid_t fapl, bool new_format)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group ID */
- hid_t tid = -1; /* Type ID */
- hid_t sid = -1, did = -1; /* Dataspace and dataset IDs */
- H5L_info2_t li; /* Link information */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
+ hid_t tid = H5I_INVALID_HID; /* Type ID */
+ hid_t sid = H5I_INVALID_HID, did = H5I_INVALID_HID; /* Dataspace and dataset IDs */
+ H5L_info2_t li; /* Link information */
char filename[NAME_BUF_SIZE];
if (new_format)
@@ -15638,9 +15646,9 @@ error:
*-------------------------------------------------------------------------
*/
static int
-check_all_closed(hid_t fapl, hbool_t new_format, int stopat)
+check_all_closed(hid_t fapl, bool new_format, int stopat)
{
- hid_t fid = -1;
+ hid_t fid = H5I_INVALID_HID;
char filename[NAME_BUF_SIZE];
int x;
@@ -15687,11 +15695,11 @@ error:
static hid_t
build_visit_file(hid_t fapl)
{
- hid_t fid = -1; /* File ID */
- hid_t gid = -1, gid2 = -1; /* Group IDs */
- hid_t sid = -1; /* Dataspace ID */
- hid_t did = -1; /* Dataset ID */
- hid_t tid = -1; /* Datatype ID */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID, gid2 = H5I_INVALID_HID; /* Group IDs */
+ hid_t sid = H5I_INVALID_HID; /* Dataspace ID */
+ hid_t did = H5I_INVALID_HID; /* Dataset ID */
+ hid_t tid = H5I_INVALID_HID; /* Datatype ID */
char filename[NAME_BUF_SIZE];
const char *pathname = H5_get_srcdir_filename(LINKED_FILE); /* Corrected test file name */
@@ -15819,7 +15827,7 @@ visit_link_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5L_info2_t
lvisit_ud_t *op_data = (lvisit_ud_t *)_op_data;
/* Check for correct link information */
- if (HDstrcmp(op_data->info[op_data->idx].path, name) != 0)
+ if (strcmp(op_data->info[op_data->idx].path, name) != 0)
return (H5_ITER_ERROR);
if (op_data->info[op_data->idx].type != linfo->type)
return (H5_ITER_ERROR);
@@ -15840,11 +15848,11 @@ visit_link_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5L_info2_t
*-------------------------------------------------------------------------
*/
static int
-link_visit(hid_t fapl, hbool_t new_format)
+link_visit(hid_t fapl, bool new_format)
{
lvisit_ud_t udata; /* User-data for visiting */
- hid_t fid = -1;
- hid_t gid = -1; /* Group ID */
+ hid_t fid = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
if (new_format)
TESTING("link visiting (w/new group format)");
@@ -15917,11 +15925,11 @@ error:
*-------------------------------------------------------------------------
*/
static int
-link_visit_by_name(hid_t fapl, hbool_t new_format)
+link_visit_by_name(hid_t fapl, bool new_format)
{
lvisit_ud_t udata; /* User-data for visiting */
- hid_t fid = -1;
- hid_t gid = -1; /* Group ID */
+ hid_t fid = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
if (new_format)
TESTING("link visiting by name (w/new group format)");
@@ -16010,7 +16018,7 @@ visit_obj_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5O_info2_t
ovisit_ud_t *op_data = (ovisit_ud_t *)_op_data;
/* Check for correct object information */
- if (HDstrcmp(op_data->info[op_data->idx].path, name) != 0)
+ if (strcmp(op_data->info[op_data->idx].path, name) != 0)
return (H5_ITER_ERROR);
if (op_data->info[op_data->idx].type != oinfo->type)
return (H5_ITER_ERROR);
@@ -16031,11 +16039,11 @@ visit_obj_cb(hid_t H5_ATTR_UNUSED group_id, const char *name, const H5O_info2_t
*-------------------------------------------------------------------------
*/
static int
-obj_visit(hid_t fapl, hbool_t new_format)
+obj_visit(hid_t fapl, bool new_format)
{
ovisit_ud_t udata; /* User-data for visiting */
- hid_t fid = -1;
- hid_t gid = -1; /* Group ID */
+ hid_t fid = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
if (new_format)
TESTING("object visiting (w/new group format)");
@@ -16112,11 +16120,11 @@ error:
*-------------------------------------------------------------------------
*/
static int
-obj_visit_by_name(hid_t fapl, hbool_t new_format)
+obj_visit_by_name(hid_t fapl, bool new_format)
{
ovisit_ud_t udata; /* User-data for visiting */
- hid_t fid = -1;
- hid_t gid = -1; /* Group ID */
+ hid_t fid = H5I_INVALID_HID;
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
if (new_format)
TESTING("object visiting by name (w/new group format)");
@@ -16230,10 +16238,10 @@ visit_obj_stop_cb(hid_t H5_ATTR_UNUSED group_id, const char H5_ATTR_UNUSED *name
*-------------------------------------------------------------------------
*/
static int
-obj_visit_stop(hid_t fapl, hbool_t new_format)
+obj_visit_stop(hid_t fapl, bool new_format)
{
unsigned nvisited; /* User-data for visiting */
- hid_t fid = -1;
+ hid_t fid = H5I_INVALID_HID;
herr_t ret; /* Return value */
if (new_format)
@@ -16359,17 +16367,17 @@ link_filter_filter(unsigned int flags, size_t cd_nelmts, const unsigned int cd_v
} /* end link_filter_filter */
static int
-link_filters(hid_t fapl, hbool_t new_format)
+link_filters(hid_t fapl, bool new_format)
{
- hid_t fid = -1, fcpl = -1;
- hid_t gid1 = -1, gid2 = -1, gcpl1 = -1, gcpl2 = -1;
- hid_t lcpl = -1;
- size_t cd_nelmts = 1;
- unsigned cd_value = 2112;
- unsigned cd_value_out;
- unsigned flags_out;
- unsigned filter_config_out;
- int nfilters = 0;
+ hid_t fid = H5I_INVALID_HID, fcpl = H5I_INVALID_HID;
+ hid_t gid1 = H5I_INVALID_HID, gid2 = H5I_INVALID_HID, gcpl1 = H5I_INVALID_HID, gcpl2 = H5I_INVALID_HID;
+ hid_t lcpl = H5I_INVALID_HID;
+ size_t cd_nelmts = 1;
+ unsigned cd_value = 2112;
+ unsigned cd_value_out;
+ unsigned flags_out;
+ unsigned filter_config_out;
+ int nfilters = 0;
H5Z_class2_t filter_class;
char name_out[24];
char filename[NAME_BUF_SIZE];
@@ -16418,8 +16426,8 @@ link_filters(hid_t fapl, hbool_t new_format)
/* Register and add custom filter */
filter_class.version = H5Z_CLASS_T_VERS;
filter_class.id = H5Z_FILTER_RESERVED + 42;
- filter_class.encoder_present = TRUE;
- filter_class.decoder_present = TRUE;
+ filter_class.encoder_present = true;
+ filter_class.decoder_present = true;
filter_class.name = "custom_link_filter";
filter_class.can_apply = link_filter_can_apply;
filter_class.set_local = link_filter_set_local;
@@ -16433,7 +16441,7 @@ link_filters(hid_t fapl, hbool_t new_format)
/* Test various other filter functions for use on gcpl's */
if (H5Pget_nfilters(gcpl1) != nfilters)
TEST_ERROR;
- if (H5Pall_filters_avail(gcpl1) != TRUE)
+ if (H5Pall_filters_avail(gcpl1) != true)
TEST_ERROR;
/* Create a group using this filter, add some soft links to it */
@@ -16489,13 +16497,13 @@ link_filters(hid_t fapl, hbool_t new_format)
TEST_ERROR;
/* Verify that all links have been copied */
- if (H5Lexists(gid2, "link1", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(gid2, "link1", H5P_DEFAULT) != true)
TEST_ERROR;
- if (H5Lexists(gid2, "link2", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(gid2, "link2", H5P_DEFAULT) != true)
TEST_ERROR;
- if (H5Lexists(gid2, "link3", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(gid2, "link3", H5P_DEFAULT) != true)
TEST_ERROR;
- if (H5Lexists(gid2, "link4", H5P_DEFAULT) != TRUE)
+ if (H5Lexists(gid2, "link4", H5P_DEFAULT) != true)
TEST_ERROR;
/* Retrieve gcpl, verify number of filters */
@@ -16547,13 +16555,13 @@ link_filters(hid_t fapl, hbool_t new_format)
if (H5Pget_filter_by_id2(gcpl2, H5Z_FILTER_RESERVED + 42, &flags_out, &cd_nelmts, &cd_value_out,
(size_t)24, name_out, &filter_config_out) < 0)
TEST_ERROR;
- if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) != 0 ||
+ if (flags_out != 0 || cd_value_out != cd_value || strcmp(filter_class.name, name_out) != 0 ||
filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED))
TEST_ERROR;
if (H5Pget_filter2(gcpl2, (unsigned)(nfilters - 1), &flags_out, &cd_nelmts, &cd_value_out, (size_t)24,
name_out, &filter_config_out) < 0)
TEST_ERROR;
- if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) != 0 ||
+ if (flags_out != 0 || cd_value_out != cd_value || strcmp(filter_class.name, name_out) != 0 ||
filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED))
TEST_ERROR;
@@ -16564,7 +16572,7 @@ link_filters(hid_t fapl, hbool_t new_format)
if (H5Pget_filter_by_id2(gcpl2, H5Z_FILTER_RESERVED + 42, &flags_out, &cd_nelmts, &cd_value_out,
(size_t)24, name_out, &filter_config_out) < 0)
TEST_ERROR;
- if (flags_out != 0 || cd_value_out != cd_value || HDstrcmp(filter_class.name, name_out) != 0 ||
+ if (flags_out != 0 || cd_value_out != cd_value || strcmp(filter_class.name, name_out) != 0 ||
filter_config_out != (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED))
TEST_ERROR;
@@ -16596,7 +16604,7 @@ link_filters(hid_t fapl, hbool_t new_format)
/* Create lcpl, setting the "create intermediate groups" flag */
if ((lcpl = H5Pcreate(H5P_LINK_CREATE)) < 0)
TEST_ERROR;
- if (H5Pset_create_intermediate_group(lcpl, (unsigned)TRUE) < 0)
+ if (H5Pset_create_intermediate_group(lcpl, (unsigned)true) < 0)
TEST_ERROR;
/* Create new group, with missing intermediate groups, in compressed group */
@@ -16770,11 +16778,11 @@ error:
*-------------------------------------------------------------------------
*/
static int
-obj_exists(hid_t fapl, hbool_t new_format)
+obj_exists(hid_t fapl, bool new_format)
{
char filename[NAME_BUF_SIZE]; /* Buffer for file name */
- hid_t fid = -1; /* File ID */
- hid_t gid = -1; /* Group ID */
+ hid_t fid = H5I_INVALID_HID; /* File ID */
+ hid_t gid = H5I_INVALID_HID; /* Group ID */
herr_t status; /* Generic return value */
if (new_format)
@@ -16805,7 +16813,7 @@ obj_exists(hid_t fapl, hbool_t new_format)
FAIL_STACK_ERROR;
/* Verify that H5Oexists_by_name() succeeds for hard linked object */
- if (TRUE != H5Oexists_by_name(fid, "group", H5P_DEFAULT))
+ if (true != H5Oexists_by_name(fid, "group", H5P_DEFAULT))
TEST_ERROR;
/* Verify that H5Oexists_by_name() returns false for non-existent object in non-root group */
@@ -16822,32 +16830,32 @@ obj_exists(hid_t fapl, hbool_t new_format)
if (H5Lcreate_soft("dangle", fid, "soft1", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE for dangling soft-link in root group */
- if (FALSE != H5Oexists_by_name(fid, "soft1", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns false for dangling soft-link in root group */
+ if (false != H5Oexists_by_name(fid, "soft1", H5P_DEFAULT))
TEST_ERROR;
/* Create soft-link in root group that points to object */
if (H5Lcreate_soft("/group", fid, "soft2", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- /* Verify that H5Oexists_by_name() returns TRUE for soft-link in root group that points to object */
- if (TRUE != H5Oexists_by_name(fid, "soft2", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns true for soft-link in root group that points to object */
+ if (true != H5Oexists_by_name(fid, "soft2", H5P_DEFAULT))
TEST_ERROR;
/* Create dangling soft-link in non-root group */
if (H5Lcreate_soft("dangle", fid, "group/soft1", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE for dangling soft-link in non-root group */
- if (FALSE != H5Oexists_by_name(fid, "group/soft1", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns false for dangling soft-link in non-root group */
+ if (false != H5Oexists_by_name(fid, "group/soft1", H5P_DEFAULT))
TEST_ERROR;
/* Create soft-link in non-root group that points to object */
if (H5Lcreate_soft("/group", fid, "group/soft2", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- /* Verify that H5Oexists_by_name() returns TRUE for soft-link in non-root group that points to object */
- if (TRUE != H5Oexists_by_name(fid, "group/soft2", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns true for soft-link in non-root group that points to object */
+ if (true != H5Oexists_by_name(fid, "group/soft2", H5P_DEFAULT))
TEST_ERROR;
/* External links */
@@ -16855,53 +16863,53 @@ obj_exists(hid_t fapl, hbool_t new_format)
if (H5Lcreate_external("nofile", "dangle", fid, "external1", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE for dangling (file doesn't exist) external link in root
+ /* Verify that H5Oexists_by_name() returns false for dangling (file doesn't exist) external link in root
* group */
- if (FALSE != H5Oexists_by_name(fid, "external1", H5P_DEFAULT))
+ if (false != H5Oexists_by_name(fid, "external1", H5P_DEFAULT))
TEST_ERROR;
/* Create dangling (object doesn't exist) external link in root group */
if (H5Lcreate_external(filename, "dangle", fid, "external2", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE for dangling (object doesn't exist) external link in root
+ /* Verify that H5Oexists_by_name() returns false for dangling (object doesn't exist) external link in root
* group */
- if (FALSE != H5Oexists_by_name(fid, "external2", H5P_DEFAULT))
+ if (false != H5Oexists_by_name(fid, "external2", H5P_DEFAULT))
TEST_ERROR;
/* Create external link in root group that points to object */
if (H5Lcreate_external(filename, "group", fid, "external3", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- /* Verify that H5Oexists_by_name() returns TRUE for external link in root group that points to object */
- if (TRUE != H5Oexists_by_name(fid, "external3", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns true for external link in root group that points to object */
+ if (true != H5Oexists_by_name(fid, "external3", H5P_DEFAULT))
TEST_ERROR;
/* Create dangling (file doesn't exist) external link in non-root group */
if (H5Lcreate_external("nofile", "dangle", fid, "group/external1", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE for dangling (file doesn't exist) external link in
+ /* Verify that H5Oexists_by_name() returns false for dangling (file doesn't exist) external link in
* non-root group */
- if (FALSE != H5Oexists_by_name(fid, "group/external1", H5P_DEFAULT))
+ if (false != H5Oexists_by_name(fid, "group/external1", H5P_DEFAULT))
TEST_ERROR;
/* Create dangling (object doesn't exist) external link in non-root group */
if (H5Lcreate_external(filename, "dangle", fid, "group/external2", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE for dangling (object doesn't exist) external link in
+ /* Verify that H5Oexists_by_name() returns false for dangling (object doesn't exist) external link in
* non-root group */
- if (FALSE != H5Oexists_by_name(fid, "group/external2", H5P_DEFAULT))
+ if (false != H5Oexists_by_name(fid, "group/external2", H5P_DEFAULT))
TEST_ERROR;
/* Create external link in non-root group that points to object */
if (H5Lcreate_external(filename, "group", fid, "group/external3", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- /* Verify that H5Oexists_by_name() returns TRUE for external link in non-root group that points to object
+ /* Verify that H5Oexists_by_name() returns true for external link in non-root group that points to object
*/
- if (TRUE != H5Oexists_by_name(fid, "group/external3", H5P_DEFAULT))
+ if (true != H5Oexists_by_name(fid, "group/external3", H5P_DEFAULT))
TEST_ERROR;
/* Soft->External links */
@@ -16909,24 +16917,24 @@ obj_exists(hid_t fapl, hbool_t new_format)
if (H5Lcreate_soft("external1", fid, "soft-elink1", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE */
- if (FALSE != H5Oexists_by_name(fid, "soft-elink1", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns false */
+ if (false != H5Oexists_by_name(fid, "soft-elink1", H5P_DEFAULT))
TEST_ERROR;
/* Create soft-link in root group that points to dangling (object doesn't exist) external link */
if (H5Lcreate_soft("external2", fid, "soft-elink2", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE */
- if (FALSE != H5Oexists_by_name(fid, "soft-elink2", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns false */
+ if (false != H5Oexists_by_name(fid, "soft-elink2", H5P_DEFAULT))
TEST_ERROR;
/* Create soft-link in root group that points to external link that points to object */
if (H5Lcreate_soft("external3", fid, "soft-elink3", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- /* Verify that H5Oexists_by_name() returns TRUE */
- if (TRUE != H5Oexists_by_name(fid, "soft-elink3", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns true */
+ if (true != H5Oexists_by_name(fid, "soft-elink3", H5P_DEFAULT))
TEST_ERROR;
/* Create soft-link in root group that points to dangling (file doesn't exist) external link in non-root
@@ -16934,8 +16942,8 @@ obj_exists(hid_t fapl, hbool_t new_format)
if (H5Lcreate_soft("group/external1", fid, "soft-elink4", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE */
- if (FALSE != H5Oexists_by_name(fid, "soft-elink4", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns false */
+ if (false != H5Oexists_by_name(fid, "soft-elink4", H5P_DEFAULT))
TEST_ERROR;
/* Create soft-link in root group that points to dangling (object doesn't exist) external link in non-root
@@ -16943,40 +16951,40 @@ obj_exists(hid_t fapl, hbool_t new_format)
if (H5Lcreate_soft("group/external2", fid, "soft-elink5", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE */
- if (FALSE != H5Oexists_by_name(fid, "soft-elink5", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns false */
+ if (false != H5Oexists_by_name(fid, "soft-elink5", H5P_DEFAULT))
TEST_ERROR;
/* Create soft-link in root group that points to external link in non-root group that points to object */
if (H5Lcreate_soft("group/external3", fid, "soft-elink6", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- /* Verify that H5Oexists_by_name() returns TRUE */
- if (TRUE != H5Oexists_by_name(fid, "soft-elink6", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns true */
+ if (true != H5Oexists_by_name(fid, "soft-elink6", H5P_DEFAULT))
TEST_ERROR;
/* Create soft-link in non-root group that points to dangling (file doesn't exist) external link */
if (H5Lcreate_soft("/external1", fid, "group/soft-elink1", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE */
- if (FALSE != H5Oexists_by_name(fid, "group/soft-elink1", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns false */
+ if (false != H5Oexists_by_name(fid, "group/soft-elink1", H5P_DEFAULT))
TEST_ERROR;
/* Create soft-link in non-root group that points to dangling (object doesn't exist) external link */
if (H5Lcreate_soft("/external2", fid, "group/soft-elink2", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE */
- if (FALSE != H5Oexists_by_name(fid, "group/soft-elink2", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns false */
+ if (false != H5Oexists_by_name(fid, "group/soft-elink2", H5P_DEFAULT))
TEST_ERROR;
/* Create soft-link in non-root group that points to external link that points to object */
if (H5Lcreate_soft("/external3", fid, "group/soft-elink3", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- /* Verify that H5Oexists_by_name() returns TRUE */
- if (TRUE != H5Oexists_by_name(fid, "group/soft-elink3", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns true */
+ if (true != H5Oexists_by_name(fid, "group/soft-elink3", H5P_DEFAULT))
TEST_ERROR;
/* Create soft-link in non-root group that points to dangling (file doesn't exist) external link in
@@ -16984,8 +16992,8 @@ obj_exists(hid_t fapl, hbool_t new_format)
if (H5Lcreate_soft("/group/external1", fid, "group/soft-elink4", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE */
- if (FALSE != H5Oexists_by_name(fid, "group/soft-elink4", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns false */
+ if (false != H5Oexists_by_name(fid, "group/soft-elink4", H5P_DEFAULT))
TEST_ERROR;
/* Create soft-link in non-root group that points to dangling (object doesn't exist) external link in
@@ -16993,8 +17001,8 @@ obj_exists(hid_t fapl, hbool_t new_format)
if (H5Lcreate_soft("/group/external2", fid, "group/soft-elink5", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE */
- if (FALSE != H5Oexists_by_name(fid, "group/soft-elink5", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns false */
+ if (false != H5Oexists_by_name(fid, "group/soft-elink5", H5P_DEFAULT))
TEST_ERROR;
/* Create soft-link in non-root group that points to external link in non-root group that points to object
@@ -17002,8 +17010,8 @@ obj_exists(hid_t fapl, hbool_t new_format)
if (H5Lcreate_soft("/group/external3", fid, "group/soft-elink6", H5P_DEFAULT, H5P_DEFAULT) < 0)
FAIL_STACK_ERROR;
- /* Verify that H5Oexists_by_name() returns TRUE */
- if (TRUE != H5Oexists_by_name(fid, "group/soft-elink6", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns true */
+ if (true != H5Oexists_by_name(fid, "group/soft-elink6", H5P_DEFAULT))
TEST_ERROR;
/* External->Soft links */
@@ -17011,56 +17019,56 @@ obj_exists(hid_t fapl, hbool_t new_format)
if (H5Lcreate_external(filename, "soft1", fid, "elink-soft1", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE */
- if (FALSE != H5Oexists_by_name(fid, "elink-soft1", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns false */
+ if (false != H5Oexists_by_name(fid, "elink-soft1", H5P_DEFAULT))
TEST_ERROR;
/* Create external link in root group that points to soft link in root group that points to object */
if (H5Lcreate_external(filename, "soft2", fid, "elink-soft2", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- /* Verify that H5Oexists_by_name() returns TRUE */
- if (TRUE != H5Oexists_by_name(fid, "elink-soft2", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns true */
+ if (true != H5Oexists_by_name(fid, "elink-soft2", H5P_DEFAULT))
TEST_ERROR;
/* Create external link in root group that points to dangling soft link in non-root group */
if (H5Lcreate_external(filename, "group/soft1", fid, "elink-soft3", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE */
- if (FALSE != H5Oexists_by_name(fid, "elink-soft3", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns false */
+ if (false != H5Oexists_by_name(fid, "elink-soft3", H5P_DEFAULT))
TEST_ERROR;
/* Create external link in root group that points to soft link in root group that points to object */
if (H5Lcreate_external(filename, "group/soft2", fid, "elink-soft4", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- /* Verify that H5Oexists_by_name() returns TRUE */
- if (TRUE != H5Oexists_by_name(fid, "elink-soft4", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns true */
+ if (true != H5Oexists_by_name(fid, "elink-soft4", H5P_DEFAULT))
TEST_ERROR;
/* Create external link in non-root group that points to dangling soft link in root group */
if (H5Lcreate_external(filename, "soft1", fid, "group/elink-soft1", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE */
- if (FALSE != H5Oexists_by_name(fid, "group/elink-soft1", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns false */
+ if (false != H5Oexists_by_name(fid, "group/elink-soft1", H5P_DEFAULT))
TEST_ERROR;
/* Create external link in non-root group that points to soft link in root group that points to object */
if (H5Lcreate_external(filename, "soft2", fid, "group/elink-soft2", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- /* Verify that H5Oexists_by_name() returns TRUE */
- if (TRUE != H5Oexists_by_name(fid, "group/elink-soft2", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns true */
+ if (true != H5Oexists_by_name(fid, "group/elink-soft2", H5P_DEFAULT))
TEST_ERROR;
/* Create external link in non-root group that points to dangling soft link in non-root group */
if (H5Lcreate_external(filename, "group/soft1", fid, "group/elink-soft3", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- /* Verify that H5Oexists_by_name() returns FALSE */
- if (FALSE != H5Oexists_by_name(fid, "group/elink-soft3", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns false */
+ if (false != H5Oexists_by_name(fid, "group/elink-soft3", H5P_DEFAULT))
TEST_ERROR;
/* Create external link in non-root group that points to soft link in non-root group that points to object
@@ -17068,8 +17076,8 @@ obj_exists(hid_t fapl, hbool_t new_format)
if (H5Lcreate_external(filename, "group/soft2", fid, "group/elink-soft4", H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
- /* Verify that H5Oexists_by_name() returns TRUE */
- if (TRUE != H5Oexists_by_name(fid, "group/elink-soft4", H5P_DEFAULT))
+ /* Verify that H5Oexists_by_name() returns true */
+ if (true != H5Oexists_by_name(fid, "group/elink-soft4", H5P_DEFAULT))
TEST_ERROR;
/* Close file created */
@@ -17101,12 +17109,12 @@ error:
static int
corder_create_empty(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1; /* Group ID */
- hid_t gcpl_id = -1; /* Group creation property list ID */
- unsigned crt_order_flags; /* Status of creation order info for GCPL */
- herr_t ret; /* Generic return value */
- char filename[NAME_BUF_SIZE]; /* File name */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID; /* Group ID */
+ hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */
+ unsigned crt_order_flags; /* Status of creation order info for GCPL */
+ herr_t ret; /* Generic return value */
+ char filename[NAME_BUF_SIZE]; /* File name */
TESTING("creating empty group with creation order indexing");
@@ -17133,7 +17141,7 @@ corder_create_empty(hid_t fapl)
H5E_END_TRY
if (ret > 0) {
H5_FAILED();
- HDputs(
+ puts(
" H5Pset_link_create_order() should have failed for a creation order index with no tracking.");
TEST_ERROR;
} /* end if */
@@ -17155,7 +17163,7 @@ corder_create_empty(hid_t fapl)
TEST_ERROR;
/* Check on group's status */
- if (H5G__is_empty_test(group_id) != TRUE)
+ if (H5G__is_empty_test(group_id) != true)
TEST_ERROR;
/* Close the group */
@@ -17179,7 +17187,7 @@ corder_create_empty(hid_t fapl)
FAIL_STACK_ERROR;
/* Check on group's status */
- if (H5G__is_empty_test(group_id) != TRUE)
+ if (H5G__is_empty_test(group_id) != true)
TEST_ERROR;
/* Retrieve group creation property list for group */
@@ -17231,15 +17239,15 @@ error:
static int
corder_create_compact(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1, group_id2 = -1; /* Group IDs */
- hid_t gcpl_id = -1; /* Group creation property list ID */
- unsigned max_compact; /* Maximum # of links to store in group compactly */
- unsigned min_dense; /* Minimum # of links to store in group "densely" */
- unsigned nlinks; /* Number of link messages in group's header */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE]; /* File name */
- unsigned u; /* Local index variable */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */
+ hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */
+ unsigned max_compact; /* Maximum # of links to store in group compactly */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ unsigned nlinks; /* Number of link messages in group's header */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ unsigned u; /* Local index variable */
TESTING("creating compact group with creation order indexing");
@@ -17261,11 +17269,11 @@ corder_create_compact(hid_t fapl)
TEST_ERROR;
/* Check on group's initial status */
- if (H5G__is_empty_test(group_id) != TRUE)
+ if (H5G__is_empty_test(group_id) != true)
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) == TRUE)
+ if (H5G__is_new_dense_test(group_id) == true)
TEST_ERROR;
/* Query the group creation properties */
@@ -17274,20 +17282,20 @@ corder_create_compact(hid_t fapl)
/* Create several links, but keep group in compact form */
for (u = 0; u < max_compact; u++) {
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
if (H5Gclose(group_id2) < 0)
TEST_ERROR;
/* Verify state of group */
- if (H5G__has_links_test(group_id, &nlinks) != TRUE)
+ if (H5G__has_links_test(group_id, &nlinks) != true)
TEST_ERROR;
if (nlinks != (u + 1))
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) == TRUE)
+ if (H5G__is_new_dense_test(group_id) == true)
TEST_ERROR;
} /* end for */
@@ -17312,13 +17320,13 @@ corder_create_compact(hid_t fapl)
FAIL_STACK_ERROR;
/* Verify state of group */
- if (H5G__has_links_test(group_id, &nlinks) != TRUE)
+ if (H5G__has_links_test(group_id, &nlinks) != true)
TEST_ERROR;
if (nlinks != max_compact)
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) == TRUE)
+ if (H5G__is_new_dense_test(group_id) == true)
TEST_ERROR;
/* Loop through links, checking their creation order values */
@@ -17327,12 +17335,12 @@ corder_create_compact(hid_t fapl)
H5L_info2_t linfo; /* Link information */
/* Retrieve information for link */
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if (H5Lget_info2(group_id, objname, &linfo, H5P_DEFAULT) < 0)
TEST_ERROR;
/* Verify creation order of link */
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (linfo.corder != u)
TEST_ERROR;
@@ -17373,17 +17381,17 @@ error:
static int
corder_create_dense(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1, group_id2 = -1; /* Group IDs */
- hid_t gcpl_id = -1; /* Group creation property list ID */
- unsigned max_compact; /* Maximum # of links to store in group compactly */
- unsigned min_dense; /* Minimum # of links to store in group "densely" */
- unsigned nlinks; /* Number of link messages in group's header */
- hsize_t name_count; /* # of records in name index */
- hsize_t corder_count; /* # of records in creation order index */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE]; /* File name */
- unsigned u; /* Local index variable */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */
+ hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */
+ unsigned max_compact; /* Maximum # of links to store in group compactly */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ unsigned nlinks; /* Number of link messages in group's header */
+ hsize_t name_count; /* # of records in name index */
+ hsize_t corder_count; /* # of records in creation order index */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ unsigned u; /* Local index variable */
TESTING("creating dense group with creation order indexing");
@@ -17405,11 +17413,11 @@ corder_create_dense(hid_t fapl)
TEST_ERROR;
/* Check on group's initial status */
- if (H5G__is_empty_test(group_id) != TRUE)
+ if (H5G__is_empty_test(group_id) != true)
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) == TRUE)
+ if (H5G__is_new_dense_test(group_id) == true)
TEST_ERROR;
/* Query the group creation properties */
@@ -17418,36 +17426,36 @@ corder_create_dense(hid_t fapl)
/* Create several links, up to limit of compact form */
for (u = 0; u < max_compact; u++) {
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
if (H5Gclose(group_id2) < 0)
TEST_ERROR;
/* Verify state of group */
- if (H5G__has_links_test(group_id, &nlinks) != TRUE)
+ if (H5G__has_links_test(group_id, &nlinks) != true)
TEST_ERROR;
if (nlinks != (u + 1))
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) == TRUE)
+ if (H5G__is_new_dense_test(group_id) == true)
TEST_ERROR;
} /* end for */
/* Create another link, to push group into dense form */
- HDsnprintf(objname, sizeof(objname), "filler %u", max_compact);
+ snprintf(objname, sizeof(objname), "filler %u", max_compact);
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
if (H5Gclose(group_id2) < 0)
TEST_ERROR;
/* Verify state of group */
- if (H5G__has_links_test(group_id, NULL) == TRUE)
+ if (H5G__has_links_test(group_id, NULL) == true)
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Retrieve & verify # of records in the name & creation order indices */
@@ -17477,11 +17485,11 @@ corder_create_dense(hid_t fapl)
FAIL_STACK_ERROR;
/* Verify state of group */
- if (H5G__has_links_test(group_id, NULL) == TRUE)
+ if (H5G__has_links_test(group_id, NULL) == true)
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Loop through links, checking their creation order values */
@@ -17490,12 +17498,12 @@ corder_create_dense(hid_t fapl)
H5L_info2_t linfo; /* Link information */
/* Retrieve information for link */
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if (H5Lget_info2(group_id, objname, &linfo, H5P_DEFAULT) < 0)
TEST_ERROR;
/* Verify creation order of link */
- if (linfo.corder_valid != TRUE)
+ if (linfo.corder_valid != true)
TEST_ERROR;
if (linfo.corder != u)
TEST_ERROR;
@@ -17536,19 +17544,19 @@ error:
static int
corder_transition(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1, group_id2 = -1; /* Group IDs */
- hid_t gcpl_id = -1; /* Group creation property list ID */
- unsigned max_compact; /* Maximum # of links to store in group compactly */
- unsigned min_dense; /* Minimum # of links to store in group "densely" */
- unsigned nlinks; /* Number of link messages in group's header */
- hsize_t name_count; /* # of records in name index */
- hsize_t corder_count; /* # of records in creation order index */
- h5_stat_size_t empty_size; /* Size of empty file */
- h5_stat_size_t file_size; /* Size of file after operating on it */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE]; /* File name */
- unsigned u; /* Local index variable */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */
+ hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */
+ unsigned max_compact; /* Maximum # of links to store in group compactly */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ unsigned nlinks; /* Number of link messages in group's header */
+ hsize_t name_count; /* # of records in name index */
+ hsize_t corder_count; /* # of records in creation order index */
+ h5_stat_size_t empty_size; /* Size of empty file */
+ h5_stat_size_t file_size; /* Size of file after operating on it */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ unsigned u; /* Local index variable */
TESTING("transitioning group with creation order indexing between dense & compact forms");
@@ -17605,7 +17613,7 @@ corder_transition(hid_t fapl)
/* Create several links, up to limit of compact form */
for (u = 0; u < max_compact; u++) {
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
if (H5Gclose(group_id2) < 0)
@@ -17613,18 +17621,18 @@ corder_transition(hid_t fapl)
} /* end for */
/* Create another link, to push group into dense form */
- HDsnprintf(objname, sizeof(objname), "filler %u", max_compact);
+ snprintf(objname, sizeof(objname), "filler %u", max_compact);
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
if (H5Gclose(group_id2) < 0)
TEST_ERROR;
/* Verify state of group */
- if (H5G__has_links_test(group_id, NULL) == TRUE)
+ if (H5G__has_links_test(group_id, NULL) == true)
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Retrieve & verify # of records in the name & creation order indices */
@@ -17635,16 +17643,16 @@ corder_transition(hid_t fapl)
/* Delete several links from group, until it resumes compact form */
for (u = max_compact; u >= min_dense; u--) {
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if (H5Ldelete(group_id, objname, H5P_DEFAULT) < 0)
TEST_ERROR;
/* Verify state of group */
- if (H5G__has_links_test(group_id, NULL) == TRUE)
+ if (H5G__has_links_test(group_id, NULL) == true)
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Retrieve & verify # of records in the name & creation order indices */
@@ -17655,23 +17663,23 @@ corder_transition(hid_t fapl)
} /* end for */
/* Delete another link, to push group into compact form */
- HDsnprintf(objname, sizeof(objname), "filler %u", (min_dense - 1));
+ snprintf(objname, sizeof(objname), "filler %u", (min_dense - 1));
if (H5Ldelete(group_id, objname, H5P_DEFAULT) < 0)
TEST_ERROR;
/* Verify state of group */
- if (H5G__has_links_test(group_id, &nlinks) != TRUE)
+ if (H5G__has_links_test(group_id, &nlinks) != true)
TEST_ERROR;
if (nlinks != (min_dense - 1))
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) == TRUE)
+ if (H5G__is_new_dense_test(group_id) == true)
TEST_ERROR;
/* Re-add links to get back into dense form */
for (u = (min_dense - 1); u < (max_compact + 1); u++) {
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
if (H5Gclose(group_id2) < 0)
@@ -17679,11 +17687,11 @@ corder_transition(hid_t fapl)
} /* end for */
/* Verify state of group */
- if (H5G__has_links_test(group_id, NULL) == TRUE)
+ if (H5G__has_links_test(group_id, NULL) == true)
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Retrieve & verify # of records in the name & creation order indices */
@@ -17709,11 +17717,11 @@ corder_transition(hid_t fapl)
FAIL_STACK_ERROR;
/* Verify state of group */
- if (H5G__has_links_test(group_id, NULL) == TRUE)
+ if (H5G__has_links_test(group_id, NULL) == true)
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Retrieve & verify # of records in the name & creation order indices */
@@ -17724,16 +17732,16 @@ corder_transition(hid_t fapl)
/* Delete several links from group, until it resumes compact form */
for (u = max_compact; u >= min_dense; u--) {
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if (H5Ldelete(group_id, objname, H5P_DEFAULT) < 0)
TEST_ERROR;
/* Verify state of group */
- if (H5G__has_links_test(group_id, NULL) == TRUE)
+ if (H5G__has_links_test(group_id, NULL) == true)
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Retrieve & verify # of records in the name & creation order indices */
@@ -17744,23 +17752,23 @@ corder_transition(hid_t fapl)
} /* end for */
/* Delete another link, to push group into compact form */
- HDsnprintf(objname, sizeof(objname), "filler %u", (min_dense - 1));
+ snprintf(objname, sizeof(objname), "filler %u", (min_dense - 1));
if (H5Ldelete(group_id, objname, H5P_DEFAULT) < 0)
TEST_ERROR;
/* Verify state of group */
- if (H5G__has_links_test(group_id, &nlinks) != TRUE)
+ if (H5G__has_links_test(group_id, &nlinks) != true)
TEST_ERROR;
if (nlinks != (min_dense - 1))
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) == TRUE)
+ if (H5G__is_new_dense_test(group_id) == true)
TEST_ERROR;
/* Re-add links to get back into dense form */
for (u = (min_dense - 1); u < (max_compact + 1); u++) {
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
if (H5Gclose(group_id2) < 0)
@@ -17768,11 +17776,11 @@ corder_transition(hid_t fapl)
} /* end for */
/* Verify state of group */
- if (H5G__has_links_test(group_id, NULL) == TRUE)
+ if (H5G__has_links_test(group_id, NULL) == true)
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Retrieve & verify # of records in the name & creation order indices */
@@ -17783,11 +17791,11 @@ corder_transition(hid_t fapl)
/* Delete all the links */
for (u = max_compact; u > 0; u--) {
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if (H5Ldelete(group_id, objname, H5P_DEFAULT) < 0)
TEST_ERROR;
} /* end for */
- HDsnprintf(objname, sizeof(objname), "filler %u", (unsigned)0);
+ snprintf(objname, sizeof(objname), "filler %u", (unsigned)0);
if (H5Ldelete(group_id, objname, H5P_DEFAULT) < 0)
TEST_ERROR;
@@ -17833,25 +17841,25 @@ error:
static int
corder_delete(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1, group_id2 = -1; /* Group IDs */
- hid_t gcpl_id = -1; /* Group creation property list ID */
- unsigned max_compact; /* Maximum # of links to store in group compactly */
- unsigned min_dense; /* Minimum # of links to store in group "densely" */
- hsize_t name_count; /* # of records in name index */
- hsize_t corder_count; /* # of records in creation order index */
- unsigned reopen_file; /* Whether to re-open the file before deleting group */
- h5_stat_size_t empty_size; /* Size of empty file */
- h5_stat_size_t file_size; /* Size of file after operating on it */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE]; /* File name */
- unsigned u; /* Local index variable */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */
+ hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */
+ unsigned max_compact; /* Maximum # of links to store in group compactly */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ hsize_t name_count; /* # of records in name index */
+ hsize_t corder_count; /* # of records in creation order index */
+ unsigned reopen_file; /* Whether to re-open the file before deleting group */
+ h5_stat_size_t empty_size; /* Size of empty file */
+ h5_stat_size_t file_size; /* Size of file after operating on it */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ unsigned u; /* Local index variable */
TESTING("deleting group with creation order indexing in dense form");
/* Loop to leave file open when deleting group, or to close & re-open file
* before deleting group */
- for (reopen_file = FALSE; reopen_file <= TRUE; reopen_file++) {
+ for (reopen_file = false; reopen_file <= true; reopen_file++) {
/* Create file */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
@@ -17899,7 +17907,7 @@ corder_delete(hid_t fapl)
/* Create links until the group is in dense form */
for (u = 0; u < max_compact * 2; u++) {
- HDsnprintf(objname, sizeof(objname), "filler %u", u);
+ snprintf(objname, sizeof(objname), "filler %u", u);
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR;
if (H5Gclose(group_id2) < 0)
@@ -17907,11 +17915,11 @@ corder_delete(hid_t fapl)
} /* end for */
/* Verify state of group */
- if (H5G__has_links_test(group_id, NULL) == TRUE)
+ if (H5G__has_links_test(group_id, NULL) == true)
TEST_ERROR;
- if (H5G__has_stab_test(group_id) == TRUE)
+ if (H5G__has_stab_test(group_id) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Retrieve & verify # of records in the name & creation order indices */
@@ -17984,7 +17992,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t hard_link, hbool_t use_index)
+link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, bool hard_link, bool use_index)
{
char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
char valname[NAME_BUF_SIZE]; /* Link value name */
@@ -17992,7 +18000,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
H5L_info2_t linfo; /* Link info struct */
/* Make link value for increasing/native order queries */
- HDsnprintf(valname, sizeof(valname), "value %02u", (unsigned)n);
+ snprintf(valname, sizeof(valname), "value %02u", (unsigned)n);
/* Verify the link information for first link, in increasing creation order */
memset(&linfo, 0, sizeof(linfo));
@@ -18015,7 +18023,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(valname, tmpval) != 0)
+ if (strcmp(valname, tmpval) != 0)
TEST_ERROR;
} /* end if */
@@ -18024,7 +18032,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE,
H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(linkname, tmpname) != 0)
+ if (strcmp(linkname, tmpname) != 0)
TEST_ERROR;
/* Don't test "native" order if there is no creation order index, since
@@ -18054,7 +18062,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(valname, tmpval) != 0)
+ if (strcmp(valname, tmpval) != 0)
TEST_ERROR;
} /* end if */
@@ -18063,7 +18071,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, n, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(linkname, tmpname) != 0)
+ if (strcmp(linkname, tmpname) != 0)
TEST_ERROR;
} /* end if */
@@ -18088,7 +18096,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(valname, tmpval) != 0)
+ if (strcmp(valname, tmpval) != 0)
TEST_ERROR;
} /* end if */
@@ -18097,7 +18105,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_DEC, (hsize_t)0, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(linkname, tmpname) != 0)
+ if (strcmp(linkname, tmpname) != 0)
TEST_ERROR;
/* Verify the link information for first link, in increasing link name order */
@@ -18120,7 +18128,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpval, (size_t)NAME_BUF_SIZE,
H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(valname, tmpval) != 0)
+ if (strcmp(valname, tmpval) != 0)
TEST_ERROR;
} /* end if */
@@ -18129,7 +18137,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, n, tmpname, (size_t)NAME_BUF_SIZE,
H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(linkname, tmpname) != 0)
+ if (strcmp(linkname, tmpname) != 0)
TEST_ERROR;
/* Don't test "native" order queries on link name order, since there's not
@@ -18156,7 +18164,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(valname, tmpval) != 0)
+ if (strcmp(valname, tmpval) != 0)
TEST_ERROR;
} /* end if */
@@ -18165,7 +18173,7 @@ link_info_by_idx_check(hid_t group_id, const char *linkname, hsize_t n, hbool_t
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)0, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(linkname, tmpname) != 0)
+ if (strcmp(linkname, tmpname) != 0)
TEST_ERROR;
/* Success */
@@ -18189,26 +18197,26 @@ error:
static int
link_info_by_idx(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1; /* Group ID */
- hid_t gcpl_id = -1; /* Group creation property list ID */
- unsigned hard_link; /* Create hard or soft link? */
- unsigned use_index; /* Use index on creation order values */
- unsigned max_compact; /* Maximum # of links to store in group compactly */
- unsigned min_dense; /* Minimum # of links to store in group "densely" */
- H5L_info2_t linfo; /* Link info struct */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char valname[NAME_BUF_SIZE]; /* Link value name */
- char filename[NAME_BUF_SIZE]; /* File name */
- char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
- unsigned u; /* Local index variable */
- ssize_t name_len; /* Length of name */
- herr_t ret; /* Generic return value */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID; /* Group ID */
+ hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */
+ unsigned hard_link; /* Create hard or soft link? */
+ unsigned use_index; /* Use index on creation order values */
+ unsigned max_compact; /* Maximum # of links to store in group compactly */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ H5L_info2_t linfo; /* Link info struct */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char valname[NAME_BUF_SIZE]; /* Link value name */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
+ unsigned u; /* Local index variable */
+ ssize_t name_len; /* Length of name */
+ herr_t ret; /* Generic return value */
/* Loop over creating hard or soft links */
- for (hard_link = FALSE; hard_link <= TRUE; hard_link++) {
+ for (hard_link = false; hard_link <= true; hard_link++) {
/* Loop over using index for creation order value */
- for (use_index = FALSE; use_index <= TRUE; use_index++) {
+ for (use_index = false; use_index <= true; use_index++) {
if (hard_link) {
if (use_index)
TESTING("querying info by index w/creation order index, using hard links");
@@ -18265,7 +18273,7 @@ link_info_by_idx(hid_t fapl)
/* Create several links, up to limit of compact form */
for (u = 0; u < max_compact; u++) {
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Check for creating hard or soft link */
if (hard_link) {
@@ -18280,7 +18288,7 @@ link_info_by_idx(hid_t fapl)
} /* end if */
else {
/* Make value for link */
- HDsnprintf(valname, sizeof(valname), "value %02u", u);
+ snprintf(valname, sizeof(valname), "value %02u", u);
/* Create soft link */
if (H5Lcreate_soft(valname, group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0)
@@ -18293,7 +18301,7 @@ link_info_by_idx(hid_t fapl)
} /* end for */
/* Verify state of group */
- if (H5G__has_links_test(group_id, NULL) != TRUE)
+ if (H5G__has_links_test(group_id, NULL) != true)
TEST_ERROR;
/* Check for out of bound offset queries */
@@ -18325,7 +18333,7 @@ link_info_by_idx(hid_t fapl)
/* Create more links, to push group into dense form */
for (; u < (max_compact * 2); u++) {
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Check for creating hard or soft link */
if (hard_link) {
@@ -18340,7 +18348,7 @@ link_info_by_idx(hid_t fapl)
} /* end if */
else {
/* Make value for link */
- HDsnprintf(valname, sizeof(valname), "value %02u", u);
+ snprintf(valname, sizeof(valname), "value %02u", u);
/* Create soft link */
if (H5Lcreate_soft(valname, group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0)
@@ -18348,7 +18356,7 @@ link_info_by_idx(hid_t fapl)
} /* end else */
/* Verify state of group */
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Verify link information for new link */
@@ -18424,8 +18432,8 @@ error:
static int
link_info_by_idx_old(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1, group_id2 = -1; /* Group IDs */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */
H5F_t *f = NULL;
unsigned hard_link; /* Create hard or soft link? */
H5L_info2_t linfo; /* Link info struct */
@@ -18442,7 +18450,7 @@ link_info_by_idx_old(hid_t fapl)
herr_t ret; /* Generic return value */
/* Loop over creating hard or soft links */
- for (hard_link = FALSE; hard_link <= TRUE; hard_link++) {
+ for (hard_link = false; hard_link <= true; hard_link++) {
if (hard_link)
TESTING("querying info by index in old-style group, using hard links");
else
@@ -18468,7 +18476,7 @@ link_info_by_idx_old(hid_t fapl)
/* Create several links */
for (u = 0; u < CORDER_NLINKS; u++) {
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Check for creating hard or soft link */
if (hard_link) {
@@ -18490,7 +18498,7 @@ link_info_by_idx_old(hid_t fapl)
} /* end if */
else {
/* Make value for link */
- HDsnprintf(valname, sizeof(valname), "value %02u", u);
+ snprintf(valname, sizeof(valname), "value %02u", u);
/* Create soft link */
if (H5Lcreate_soft(valname, group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0)
@@ -18503,10 +18511,10 @@ link_info_by_idx_old(hid_t fapl)
unsigned dec_u = CORDER_NLINKS - (u + 1); /* Decreasing mapped index */
/* Make link name for increasing/native order queries */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Make link value for increasing/native order queries */
- HDsnprintf(valname, sizeof(valname), "value %02u", u);
+ snprintf(valname, sizeof(valname), "value %02u", u);
/* Verify link information (in increasing order) */
if (hard_link) {
@@ -18522,7 +18530,7 @@ link_info_by_idx_old(hid_t fapl)
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(valname, tmpval) != 0)
+ if (strcmp(valname, tmpval) != 0)
TEST_ERROR;
} /* end else */
@@ -18530,7 +18538,7 @@ link_info_by_idx_old(hid_t fapl)
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)u, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, tmpname) != 0)
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
/* Verify link information (in native order - native is increasing) */
@@ -18547,7 +18555,7 @@ link_info_by_idx_old(hid_t fapl)
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(valname, tmpval) != 0)
+ if (strcmp(valname, tmpval) != 0)
TEST_ERROR;
} /* end else */
@@ -18555,14 +18563,14 @@ link_info_by_idx_old(hid_t fapl)
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_NATIVE, (hsize_t)u, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, tmpname) != 0)
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
/* Make link name for decreasing order queries */
- HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
+ snprintf(objname, sizeof(objname), "filler %02u", dec_u);
/* Make link value for decreasing order queries */
- HDsnprintf(valname, sizeof(valname), "value %02u", dec_u);
+ snprintf(valname, sizeof(valname), "value %02u", dec_u);
/* Verify link information (in decreasing order) */
if (hard_link) {
@@ -18578,7 +18586,7 @@ link_info_by_idx_old(hid_t fapl)
if (H5Lget_val_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpval,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(valname, tmpval) != 0)
+ if (strcmp(valname, tmpval) != 0)
TEST_ERROR;
} /* end else */
@@ -18586,7 +18594,7 @@ link_info_by_idx_old(hid_t fapl)
if (H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_DEC, (hsize_t)u, tmpname,
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
- if (HDstrcmp(objname, tmpname) != 0)
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
} /* end for */
@@ -18609,7 +18617,7 @@ link_info_by_idx_old(hid_t fapl)
TEST_ERROR;
/* Verify state of group */
- if (H5G__has_stab_test(group_id) != TRUE)
+ if (H5G__has_stab_test(group_id) != true)
TEST_ERROR;
/* Close the group */
@@ -18648,27 +18656,27 @@ error:
static int
delete_by_idx(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1; /* Group ID */
- hid_t gcpl_id = -1; /* Group creation property list ID */
- H5_index_t idx_type; /* Type of index to operate on */
- H5_iter_order_t order; /* Order within in the index */
- unsigned use_index; /* Use index on creation order values */
- unsigned max_compact; /* Maximum # of links to store in group compactly */
- unsigned min_dense; /* Minimum # of links to store in group "densely" */
- H5L_info2_t linfo; /* Link info struct */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE]; /* File name */
- char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
- unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID; /* Group ID */
+ hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */
+ H5_index_t idx_type; /* Type of index to operate on */
+ H5_iter_order_t order; /* Order within in the index */
+ unsigned use_index; /* Use index on creation order values */
+ unsigned max_compact; /* Maximum # of links to store in group compactly */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ H5L_info2_t linfo; /* Link info struct */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ char tmpname[NAME_BUF_SIZE]; /* Temporary link name */
+ unsigned u; /* Local index variable */
+ herr_t ret; /* Generic return value */
/* Loop over operating on different indices on link fields */
for (idx_type = H5_INDEX_NAME; idx_type <= H5_INDEX_CRT_ORDER; idx_type++) {
/* Loop over operating in different orders */
for (order = H5_ITER_INC; order <= H5_ITER_DEC; order++) {
/* Loop over using index for creation order value */
- for (use_index = FALSE; use_index <= TRUE; use_index++) {
+ for (use_index = false; use_index <= true; use_index++) {
/* Print appropriate test message */
if (idx_type == H5_INDEX_CRT_ORDER) {
if (order == H5_ITER_INC) {
@@ -18756,7 +18764,7 @@ delete_by_idx(hid_t fapl)
hid_t group_id2; /* Group ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
@@ -18766,12 +18774,12 @@ delete_by_idx(hid_t fapl)
TEST_ERROR;
/* Verify link information for new link */
- if (link_info_by_idx_check(group_id, objname, (hsize_t)u, TRUE, use_index) < 0)
+ if (link_info_by_idx_check(group_id, objname, (hsize_t)u, true, use_index) < 0)
TEST_ERROR;
} /* end for */
/* Verify state of group (compact) */
- if (H5G__has_links_test(group_id, NULL) != TRUE)
+ if (H5G__has_links_test(group_id, NULL) != true)
TEST_ERROR;
/* Check for out of bound deletion */
@@ -18809,10 +18817,10 @@ delete_by_idx(hid_t fapl)
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
if (order == H5_ITER_INC)
- HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
+ snprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
- HDsnprintf(objname, sizeof(objname), "filler %02u", (max_compact - (u + 2)));
- if (HDstrcmp(objname, tmpname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u", (max_compact - (u + 2)));
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
} /* end for */
@@ -18821,7 +18829,7 @@ delete_by_idx(hid_t fapl)
TEST_ERROR;
/* Verify state of group (empty) */
- if (H5G__has_links_test(group_id, NULL) == TRUE)
+ if (H5G__has_links_test(group_id, NULL) == true)
TEST_ERROR;
/* Create more links, to push group into dense form */
@@ -18829,7 +18837,7 @@ delete_by_idx(hid_t fapl)
hid_t group_id2; /* Group ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
@@ -18840,11 +18848,11 @@ delete_by_idx(hid_t fapl)
/* Verify state of group (dense) */
if (u >= max_compact)
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Verify link information for new link */
- if (link_info_by_idx_check(group_id, objname, (hsize_t)u, TRUE, use_index) < 0)
+ if (link_info_by_idx_check(group_id, objname, (hsize_t)u, true, use_index) < 0)
TEST_ERROR;
} /* end for */
@@ -18883,10 +18891,10 @@ delete_by_idx(hid_t fapl)
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
if (order == H5_ITER_INC)
- HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
+ snprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
- HDsnprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - (u + 2)));
- if (HDstrcmp(objname, tmpname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u", ((max_compact * 2) - (u + 2)));
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
} /* end for */
@@ -18895,9 +18903,9 @@ delete_by_idx(hid_t fapl)
TEST_ERROR;
/* Verify state of group (empty) */
- if (H5G__has_links_test(group_id, NULL) == TRUE)
+ if (H5G__has_links_test(group_id, NULL) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) == TRUE)
+ if (H5G__is_new_dense_test(group_id) == true)
TEST_ERROR;
/* Check for deletion on empty group again */
@@ -18916,7 +18924,7 @@ delete_by_idx(hid_t fapl)
hid_t group_id2; /* Group ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
@@ -18927,11 +18935,11 @@ delete_by_idx(hid_t fapl)
/* Verify state of group (dense) */
if (u >= max_compact)
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Verify link information for new link */
- if (link_info_by_idx_check(group_id, objname, (hsize_t)u, TRUE, use_index) < 0)
+ if (link_info_by_idx_check(group_id, objname, (hsize_t)u, true, use_index) < 0)
TEST_ERROR;
} /* end for */
@@ -18961,11 +18969,11 @@ delete_by_idx(hid_t fapl)
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
if (order == H5_ITER_INC)
- HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1));
+ snprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1));
else
- HDsnprintf(objname, sizeof(objname), "filler %02u",
- ((max_compact * 2) - ((u * 2) + 2)));
- if (HDstrcmp(objname, tmpname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u",
+ ((max_compact * 2) - ((u * 2) + 2)));
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
} /* end for */
@@ -18995,11 +19003,11 @@ delete_by_idx(hid_t fapl)
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
if (order == H5_ITER_INC)
- HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3));
+ snprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3));
else
- HDsnprintf(objname, sizeof(objname), "filler %02u",
- ((max_compact * 2) - ((u * 2) + 4)));
- if (HDstrcmp(objname, tmpname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u",
+ ((max_compact * 2) - ((u * 2) + 4)));
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
} /* end for */
@@ -19008,9 +19016,9 @@ delete_by_idx(hid_t fapl)
TEST_ERROR;
/* Verify state of group (empty) */
- if (H5G__has_links_test(group_id, NULL) == TRUE)
+ if (H5G__has_links_test(group_id, NULL) == true)
TEST_ERROR;
- if (H5G__is_new_dense_test(group_id) == TRUE)
+ if (H5G__is_new_dense_test(group_id) == true)
TEST_ERROR;
/* Close the group */
@@ -19056,8 +19064,8 @@ error:
static int
delete_by_idx_old(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1, group_id2 = -1; /* Group IDs */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID, group_id2 = H5I_INVALID_HID; /* Group IDs */
H5F_t *f = NULL;
H5L_info2_t linfo; /* Link info struct */
H5_iter_order_t order; /* Order within in the index */
@@ -19111,7 +19119,7 @@ delete_by_idx_old(hid_t fapl)
H5O_info2_t oi; /* Buffer for querying object's info */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create group */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -19177,10 +19185,10 @@ delete_by_idx_old(hid_t fapl)
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
if (order == H5_ITER_INC)
- HDsnprintf(objname, sizeof(objname), "filler %02u", (u + 1));
+ snprintf(objname, sizeof(objname), "filler %02u", (u + 1));
else
- HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
- if (HDstrcmp(objname, tmpname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u", dec_u);
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
} /* end for */
@@ -19198,7 +19206,7 @@ delete_by_idx_old(hid_t fapl)
TEST_ERROR;
/* Verify state of group */
- if (H5G__has_stab_test(group_id) != TRUE)
+ if (H5G__has_stab_test(group_id) != true)
TEST_ERROR;
/* Delete links in middle */
@@ -19208,7 +19216,7 @@ delete_by_idx_old(hid_t fapl)
H5O_info2_t oi; /* Buffer for querying object's info */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create group */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -19256,10 +19264,10 @@ delete_by_idx_old(hid_t fapl)
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
if (order == H5_ITER_INC)
- HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1));
+ snprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 1));
else
- HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
- if (HDstrcmp(objname, tmpname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u", dec_u);
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
} /* end for */
@@ -19294,10 +19302,10 @@ delete_by_idx_old(hid_t fapl)
(size_t)NAME_BUF_SIZE, H5P_DEFAULT) < 0)
TEST_ERROR;
if (order == H5_ITER_INC)
- HDsnprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3));
+ snprintf(objname, sizeof(objname), "filler %02u", ((u * 2) + 3));
else
- HDsnprintf(objname, sizeof(objname), "filler %02u", dec_u);
- if (HDstrcmp(objname, tmpname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u", dec_u);
+ if (strcmp(objname, tmpname) != 0)
TEST_ERROR;
} /* end for */
@@ -19306,7 +19314,7 @@ delete_by_idx_old(hid_t fapl)
TEST_ERROR;
/* Verify state of group */
- if (H5G__has_stab_test(group_id) != TRUE)
+ if (H5G__has_stab_test(group_id) != true)
TEST_ERROR;
/* Close the group */
@@ -19382,8 +19390,8 @@ link_iterate_cb(hid_t group_id, const char *link_name, const H5L_info2_t *info,
} /* end if */
/* Verify name of link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", (unsigned)my_info.corder);
- if (HDstrcmp(link_name, objname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u", (unsigned)my_info.corder);
+ if (strcmp(link_name, objname) != 0)
return H5_ITER_ERROR;
/* Check if we've visited this link before */
@@ -19391,7 +19399,7 @@ link_iterate_cb(hid_t group_id, const char *link_name, const H5L_info2_t *info,
return H5_ITER_ERROR;
if (op_data->visited[op_data->curr])
return H5_ITER_ERROR;
- op_data->visited[op_data->curr] = TRUE;
+ op_data->visited[op_data->curr] = true;
/* Advance to next value, in correct direction */
if (op_data->order != H5_ITER_DEC)
@@ -19469,7 +19477,7 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u
iter_info->stop = -1;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if (H5Literate2(group_id, idx_type, order, &skip, link_iterate_cb, iter_info) < 0)
TEST_ERROR;
@@ -19477,7 +19485,7 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u
if (skip != max_links)
TEST_ERROR;
for (v = 0; v < max_links; v++)
- if (iter_info->visited[v] == FALSE)
+ if (iter_info->visited[v] == false)
TEST_ERROR;
#ifndef H5_NO_DEPRECATED_SYMBOLS
@@ -19487,7 +19495,7 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u
iter_info->stop = -1;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if (H5Giterate(group_id, ".", &gskip, group_iterate_cb, iter_info) < 0)
TEST_ERROR;
@@ -19495,7 +19503,7 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u
if (gskip != (int)max_links)
TEST_ERROR;
for (v = 0; v < max_links; v++)
- if (iter_info->visited[v] == FALSE)
+ if (iter_info->visited[v] == false)
TEST_ERROR;
#endif /* H5_NO_DEPRECATED_SYMBOLS */
@@ -19505,7 +19513,7 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u
iter_info->stop = -1;
iter_info->ncalled = 0;
iter_info->curr = (int64_t)(order != H5_ITER_DEC ? skip : ((max_links - 1) - skip));
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if (H5Literate2(group_id, idx_type, order, &skip, link_iterate_cb, iter_info) < 0)
TEST_ERROR;
@@ -19514,12 +19522,12 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u
TEST_ERROR;
if (order == H5_ITER_INC) {
for (v = 0; v < (max_links / 2); v++)
- if (iter_info->visited[v + (max_links / 2)] == FALSE)
+ if (iter_info->visited[v + (max_links / 2)] == false)
TEST_ERROR;
} /* end if */
else if (order == H5_ITER_DEC) {
for (v = 0; v < (max_links / 2); v++)
- if (iter_info->visited[v] == FALSE)
+ if (iter_info->visited[v] == false)
TEST_ERROR;
} /* end if */
else {
@@ -19527,7 +19535,7 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u
assert(order == H5_ITER_NATIVE);
for (v = 0; v < max_links; v++)
- if (iter_info->visited[v] == TRUE)
+ if (iter_info->visited[v] == true)
nvisit++;
if (nvisit != (max_links / 2))
@@ -19541,7 +19549,7 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u
iter_info->stop = -1;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? (unsigned)gskip : ((max_links - 1) - (unsigned)gskip);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if (H5Giterate(group_id, ".", &gskip, group_iterate_cb, iter_info) < 0)
TEST_ERROR;
@@ -19550,12 +19558,12 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u
TEST_ERROR;
if (order == H5_ITER_INC) {
for (v = 0; v < (max_links / 2); v++)
- if (iter_info->visited[v + (max_links / 2)] == FALSE)
+ if (iter_info->visited[v + (max_links / 2)] == false)
TEST_ERROR;
} /* end if */
else if (order == H5_ITER_DEC) {
for (v = 0; v < (max_links / 2); v++)
- if (iter_info->visited[v] == FALSE)
+ if (iter_info->visited[v] == false)
TEST_ERROR;
} /* end if */
else {
@@ -19563,7 +19571,7 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u
assert(order == H5_ITER_NATIVE);
for (v = 0; v < max_links; v++)
- if (iter_info->visited[v] == TRUE)
+ if (iter_info->visited[v] == true)
nvisit++;
if (nvisit != (max_links / 2))
@@ -19577,7 +19585,7 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u
iter_info->stop = 3;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if ((ret = H5Literate2(group_id, idx_type, order, &skip, link_iterate_cb, iter_info)) < 0)
TEST_ERROR;
if (ret != CORDER_ITER_STOP)
@@ -19592,7 +19600,7 @@ link_iterate_check(hid_t group_id, H5_index_t idx_type, H5_iter_order_t order, u
iter_info->stop = 3;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if ((ret = H5Giterate(group_id, ".", &gskip, group_iterate_cb, iter_info)) < 0)
TEST_ERROR;
if (ret != CORDER_ITER_STOP)
@@ -19632,21 +19640,21 @@ error:
static int
link_iterate(hid_t fapl)
{
- hid_t file_id = (-1); /* File ID */
- hid_t group_id = (-1); /* Group ID */
- hid_t gcpl_id = (-1); /* Group creation property list ID */
- H5_index_t idx_type; /* Type of index to operate on */
- H5_iter_order_t order; /* Order within in the index */
- unsigned use_index; /* Use index on creation order values */
- unsigned max_compact; /* Maximum # of links to store in group compactly */
- unsigned min_dense; /* Minimum # of links to store in group "densely" */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE]; /* File name */
- link_iter_info_t iter_info; /* Iterator info */
- hbool_t *visited = NULL; /* Array of flags for visiting links */
- hsize_t skip; /* # of links to skip in group */
- unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ hid_t file_id = (H5I_INVALID_HID); /* File ID */
+ hid_t group_id = (H5I_INVALID_HID); /* Group ID */
+ hid_t gcpl_id = (H5I_INVALID_HID); /* Group creation property list ID */
+ H5_index_t idx_type; /* Type of index to operate on */
+ H5_iter_order_t order; /* Order within in the index */
+ unsigned use_index; /* Use index on creation order values */
+ unsigned max_compact; /* Maximum # of links to store in group compactly */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ link_iter_info_t iter_info; /* Iterator info */
+ bool *visited = NULL; /* Array of flags for visiting links */
+ hsize_t skip; /* # of links to skip in group */
+ unsigned u; /* Local index variable */
+ herr_t ret; /* Generic return value */
/* Create group creation property list */
if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0)
@@ -19658,7 +19666,7 @@ link_iterate(hid_t fapl)
/* Allocate the "visited link" array */
iter_info.max_visit = max_compact * 2;
- if (NULL == (visited = (hbool_t *)malloc(sizeof(hbool_t) * iter_info.max_visit)))
+ if (NULL == (visited = (bool *)malloc(sizeof(bool) * iter_info.max_visit)))
TEST_ERROR;
iter_info.visited = visited;
@@ -19667,7 +19675,7 @@ link_iterate(hid_t fapl)
/* Loop over operating in different orders */
for (order = H5_ITER_INC; order <= H5_ITER_NATIVE; order++) {
/* Loop over using index for creation order value */
- for (use_index = FALSE; use_index <= TRUE; use_index++) {
+ for (use_index = false; use_index <= true; use_index++) {
/* Print appropriate test message */
if (idx_type == H5_INDEX_CRT_ORDER) {
if (order == H5_ITER_INC) {
@@ -19750,7 +19758,7 @@ link_iterate(hid_t fapl)
hid_t group_id2; /* Group ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
@@ -19761,7 +19769,7 @@ link_iterate(hid_t fapl)
} /* end for */
/* Verify state of group (compact) */
- if (H5G__has_links_test(group_id, NULL) != TRUE)
+ if (H5G__has_links_test(group_id, NULL) != true)
TEST_ERROR;
/* Check for out of bound iteration on compact group */
@@ -19783,7 +19791,7 @@ link_iterate(hid_t fapl)
hid_t group_id2; /* Group ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
@@ -19794,7 +19802,7 @@ link_iterate(hid_t fapl)
} /* end for */
/* Verify state of group (dense) */
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Check for out of bound iteration on dense group */
@@ -19893,9 +19901,9 @@ link_iterate_old_cb(hid_t group_id, const char *link_name, const H5L_info2_t *in
} /* end if */
/* Verify name of link */
- HDsnprintf(objname, sizeof(objname), "filler %02u",
- (info ? (unsigned)op_data->curr : (unsigned)((op_data->ncalled - 1) + op_data->nskipped)));
- if (HDstrcmp(link_name, objname) != 0)
+ snprintf(objname, sizeof(objname), "filler %02u",
+ (info ? (unsigned)op_data->curr : (unsigned)((op_data->ncalled - 1) + op_data->nskipped)));
+ if (strcmp(link_name, objname) != 0)
return H5_ITER_ERROR;
/* Check if we've visited this link before */
@@ -19903,7 +19911,7 @@ link_iterate_old_cb(hid_t group_id, const char *link_name, const H5L_info2_t *in
return H5_ITER_ERROR;
if (op_data->visited[op_data->curr])
return H5_ITER_ERROR;
- op_data->visited[op_data->curr] = TRUE;
+ op_data->visited[op_data->curr] = true;
/* Advance to next value, in correct direction */
if (op_data->order != H5_ITER_DEC)
@@ -19963,7 +19971,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links
iter_info->stop = -1;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if (H5Literate2(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_cb, iter_info) < 0)
TEST_ERROR;
@@ -19971,7 +19979,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links
if (skip != max_links)
TEST_ERROR;
for (v = 0; v < max_links; v++)
- if (iter_info->visited[v] == FALSE)
+ if (iter_info->visited[v] == false)
TEST_ERROR;
#ifndef H5_NO_DEPRECATED_SYMBOLS
@@ -19981,7 +19989,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links
iter_info->stop = -1;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if (H5Giterate(group_id, ".", &gskip, group_iterate_old_cb, iter_info) < 0)
TEST_ERROR;
@@ -19989,7 +19997,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links
if (gskip != (int)max_links)
TEST_ERROR;
for (v = 0; v < max_links; v++)
- if (iter_info->visited[v] == FALSE)
+ if (iter_info->visited[v] == false)
TEST_ERROR;
#endif /* H5_NO_DEPRECATED_SYMBOLS */
@@ -19999,7 +20007,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links
iter_info->stop = -1;
iter_info->ncalled = 0;
iter_info->curr = (int64_t)(order != H5_ITER_DEC ? skip : ((max_links - 1) - skip));
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if (H5Literate2(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_cb, iter_info) < 0)
TEST_ERROR;
@@ -20008,12 +20016,12 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links
TEST_ERROR;
if (order == H5_ITER_INC) {
for (v = 0; v < (max_links / 2); v++)
- if (iter_info->visited[v + (max_links / 2)] == FALSE)
+ if (iter_info->visited[v + (max_links / 2)] == false)
TEST_ERROR;
} /* end if */
else if (order == H5_ITER_DEC) {
for (v = 0; v < (max_links / 2); v++)
- if (iter_info->visited[v] == FALSE)
+ if (iter_info->visited[v] == false)
TEST_ERROR;
} /* end if */
else {
@@ -20021,7 +20029,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links
assert(order == H5_ITER_NATIVE);
for (v = 0; v < max_links; v++)
- if (iter_info->visited[v] == TRUE)
+ if (iter_info->visited[v] == true)
nvisit++;
if (nvisit != (max_links / 2))
@@ -20035,7 +20043,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links
iter_info->stop = -1;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? (unsigned)gskip : ((max_links - 1) - (unsigned)gskip);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if (H5Giterate(group_id, ".", &gskip, group_iterate_old_cb, iter_info) < 0)
TEST_ERROR;
@@ -20044,12 +20052,12 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links
TEST_ERROR;
if (order == H5_ITER_INC) {
for (v = 0; v < (max_links / 2); v++)
- if (iter_info->visited[v + (max_links / 2)] == FALSE)
+ if (iter_info->visited[v + (max_links / 2)] == false)
TEST_ERROR;
} /* end if */
else if (order == H5_ITER_DEC) {
for (v = 0; v < (max_links / 2); v++)
- if (iter_info->visited[v] == FALSE)
+ if (iter_info->visited[v] == false)
TEST_ERROR;
} /* end if */
else {
@@ -20057,7 +20065,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links
assert(order == H5_ITER_NATIVE);
for (v = 0; v < max_links; v++)
- if (iter_info->visited[v] == TRUE)
+ if (iter_info->visited[v] == true)
nvisit++;
if (nvisit != (max_links / 2))
@@ -20071,7 +20079,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links
iter_info->stop = 3;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if ((ret = H5Literate2(group_id, H5_INDEX_NAME, order, &skip, link_iterate_old_cb, iter_info)) < 0)
TEST_ERROR;
if (ret != CORDER_ITER_STOP)
@@ -20086,7 +20094,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links
iter_info->stop = 3;
iter_info->ncalled = 0;
iter_info->curr = order != H5_ITER_DEC ? 0 : (max_links - 1);
- memset(iter_info->visited, 0, sizeof(hbool_t) * iter_info->max_visit);
+ memset(iter_info->visited, 0, sizeof(bool) * iter_info->max_visit);
if ((ret = H5Giterate(group_id, ".", &gskip, group_iterate_old_cb, iter_info)) < 0)
TEST_ERROR;
if (ret != CORDER_ITER_STOP)
@@ -20109,7 +20117,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links
skip = 0;
H5E_BEGIN_TRY
{
- ret = H5Literate2((hid_t)(-1), H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL);
+ ret = H5Literate2((hid_t)(H5I_INVALID_HID), H5_INDEX_NAME, order, &skip, link_iterate_fail_cb, NULL);
}
H5E_END_TRY
if (ret >= 0)
@@ -20118,7 +20126,7 @@ link_iterate_old_check(hid_t group_id, H5_iter_order_t order, unsigned max_links
#ifndef H5_NO_DEPRECATED_SYMBOLS
H5E_BEGIN_TRY
{
- ret = H5Giterate((hid_t)(-1), ".", &gskip, group_iterate_old_cb, iter_info);
+ ret = H5Giterate((hid_t)(H5I_INVALID_HID), ".", &gskip, group_iterate_old_cb, iter_info);
}
H5E_END_TRY
if (ret >= 0)
@@ -20144,20 +20152,20 @@ error:
static int
link_iterate_old(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1; /* Group ID */
- H5_iter_order_t order; /* Order within in the index */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char filename[NAME_BUF_SIZE]; /* File name */
- link_iter_info_t iter_info; /* Iterator info */
- hbool_t *visited = NULL; /* Array of flags for visiting links */
- hsize_t skip; /* # of links to skip in group */
- unsigned u; /* Local index variable */
- herr_t ret; /* Generic return value */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID; /* Group ID */
+ H5_iter_order_t order; /* Order within in the index */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ link_iter_info_t iter_info; /* Iterator info */
+ bool *visited = NULL; /* Array of flags for visiting links */
+ hsize_t skip; /* # of links to skip in group */
+ unsigned u; /* Local index variable */
+ herr_t ret; /* Generic return value */
/* Allocate the "visited link" array */
iter_info.max_visit = CORDER_NLINKS;
- if (NULL == (visited = (hbool_t *)malloc(sizeof(hbool_t) * iter_info.max_visit)))
+ if (NULL == (visited = (bool *)malloc(sizeof(bool) * iter_info.max_visit)))
TEST_ERROR;
iter_info.visited = visited;
@@ -20194,7 +20202,7 @@ link_iterate_old(hid_t fapl)
hid_t group_id2; /* Group ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -20204,7 +20212,7 @@ link_iterate_old(hid_t fapl)
} /* end for */
/* Verify state of group (symbol table) */
- if (H5G__has_stab_test(group_id) != TRUE)
+ if (H5G__has_stab_test(group_id) != true)
TEST_ERROR;
/* Check for out of bound iteration on old-style group */
@@ -20277,13 +20285,13 @@ static int
open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id, H5_index_t idx_type,
H5_iter_order_t order, unsigned max_links, H5O_token_t *objno)
{
- char mntname[NAME_BUF_SIZE]; /* Link value */
- hid_t group_id = -1; /* ID of group to test */
- H5O_info2_t oi; /* Buffer for querying object's info */
- H5O_token_t mnt_root_token; /* Token (address) of root group in file to mount */
- hid_t obj_id; /* ID of object opened */
- unsigned mnt_idx; /* Index to mount group on */
- unsigned u, v; /* Local index variables */
+ char mntname[NAME_BUF_SIZE]; /* Link value */
+ hid_t group_id = H5I_INVALID_HID; /* ID of group to test */
+ H5O_info2_t oi; /* Buffer for querying object's info */
+ H5O_token_t mnt_root_token; /* Token (address) of root group in file to mount */
+ hid_t obj_id; /* ID of object opened */
+ unsigned mnt_idx; /* Index to mount group on */
+ unsigned u, v; /* Local index variables */
int token_cmp;
/* Work through main & soft link groups */
@@ -20338,7 +20346,7 @@ open_by_idx_check(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id,
/* Mount a file over a group in main group */
mnt_idx = 2;
- HDsnprintf(mntname, sizeof(mntname), "/%s/filler %02u", CORDER_GROUP_NAME, mnt_idx);
+ snprintf(mntname, sizeof(mntname), "/%s/filler %02u", CORDER_GROUP_NAME, mnt_idx);
if (H5Fmount(main_group_id, mntname, mount_file_id, H5P_DEFAULT) < 0)
TEST_ERROR;
@@ -20389,23 +20397,23 @@ error:
static int
open_by_idx(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t mount_file_id = -1; /* File ID for file to mount */
- hid_t group_id = -1; /* Group ID */
- hid_t soft_group_id = -1; /* Group ID for soft links */
- hid_t gcpl_id = -1; /* Group creation property list ID */
- H5_index_t idx_type; /* Type of index to operate on */
- H5_iter_order_t order; /* Order within in the index */
- unsigned use_index; /* Use index on creation order values */
- unsigned max_compact; /* Maximum # of links to store in group compactly */
- unsigned min_dense; /* Minimum # of links to store in group "densely" */
- H5O_info2_t oi; /* Buffer for querying object's info */
- char filename[NAME_BUF_SIZE]; /* File name */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char valname[2 * NAME_BUF_SIZE]; /* Link value */
- H5O_token_t *objno = NULL; /* Tokens (addresses) of the objects created */
- unsigned u; /* Local index variable */
- hid_t ret; /* Generic return value */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t mount_file_id = H5I_INVALID_HID; /* File ID for file to mount */
+ hid_t group_id = H5I_INVALID_HID; /* Group ID */
+ hid_t soft_group_id = H5I_INVALID_HID; /* Group ID for soft links */
+ hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */
+ H5_index_t idx_type; /* Type of index to operate on */
+ H5_iter_order_t order; /* Order within in the index */
+ unsigned use_index; /* Use index on creation order values */
+ unsigned max_compact; /* Maximum # of links to store in group compactly */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ H5O_info2_t oi; /* Buffer for querying object's info */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
+ H5O_token_t *objno = NULL; /* Tokens (addresses) of the objects created */
+ unsigned u; /* Local index variable */
+ hid_t ret; /* Generic return value */
/* Create group creation property list */
if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0)
@@ -20429,7 +20437,7 @@ open_by_idx(hid_t fapl)
/* Loop over operating in different orders */
for (order = H5_ITER_INC; order <= H5_ITER_NATIVE; order++) {
/* Loop over using index for creation order value */
- for (use_index = FALSE; use_index <= TRUE; use_index++) {
+ for (use_index = false; use_index <= true; use_index++) {
/* Print appropriate test message */
if (idx_type == H5_INDEX_CRT_ORDER) {
if (order == H5_ITER_INC) {
@@ -20515,7 +20523,7 @@ open_by_idx(hid_t fapl)
hid_t group_id2; /* Group ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
@@ -20532,13 +20540,13 @@ open_by_idx(hid_t fapl)
TEST_ERROR;
/* Create soft link in another group, to objects in main group */
- HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
+ snprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if (H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
}
/* Verify state of group (compact) */
- if (H5G__has_links_test(group_id, NULL) != TRUE)
+ if (H5G__has_links_test(group_id, NULL) != true)
TEST_ERROR;
/* Check for out of bound open by index on compact group */
@@ -20559,7 +20567,7 @@ open_by_idx(hid_t fapl)
hid_t group_id2; /* Group ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
@@ -20576,13 +20584,13 @@ open_by_idx(hid_t fapl)
TEST_ERROR;
/* Create soft link in another group, to objects in main group */
- HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
+ snprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if (H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
} /* end for */
/* Verify state of group (dense) */
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Check for out of bound open by index on compact group */
@@ -20658,14 +20666,14 @@ static int
open_by_idx_check_old(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file_id, H5_index_t idx_type,
H5_iter_order_t order, unsigned max_links, H5O_token_t *objno)
{
- char mntname[NAME_BUF_SIZE]; /* Link value */
- hid_t group_id = -1; /* ID of group to test */
- H5O_info2_t oi; /* Buffer for querying object's info */
- H5O_token_t mnt_root_token; /* Token of root group in file to mount */
- hid_t obj_id; /* ID of object opened */
- unsigned mnt_idx; /* Index to mount group on */
- unsigned u, v; /* Local index variables */
- int cmp_value; /* Token comparison value */
+ char mntname[NAME_BUF_SIZE]; /* Link value */
+ hid_t group_id = H5I_INVALID_HID; /* ID of group to test */
+ H5O_info2_t oi; /* Buffer for querying object's info */
+ H5O_token_t mnt_root_token; /* Token of root group in file to mount */
+ hid_t obj_id; /* ID of object opened */
+ unsigned mnt_idx; /* Index to mount group on */
+ unsigned u, v; /* Local index variables */
+ int cmp_value; /* Token comparison value */
/* Work through main & soft link groups */
for (v = 0; v < 2; v++) {
@@ -20719,7 +20727,7 @@ open_by_idx_check_old(hid_t main_group_id, hid_t soft_group_id, hid_t mount_file
/* Mount a file over a group in main group */
mnt_idx = 2;
- HDsnprintf(mntname, sizeof(mntname), "/%s/filler %02u", CORDER_GROUP_NAME, mnt_idx);
+ snprintf(mntname, sizeof(mntname), "/%s/filler %02u", CORDER_GROUP_NAME, mnt_idx);
if (H5Fmount(main_group_id, mntname, mount_file_id, H5P_DEFAULT) < 0)
TEST_ERROR;
@@ -20770,18 +20778,18 @@ error:
static int
open_by_idx_old(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t mount_file_id = -1; /* File ID for file to mount */
- hid_t group_id = -1; /* Group ID */
- hid_t soft_group_id = -1; /* Group ID for soft links */
- H5_iter_order_t order; /* Order within in the index */
- H5O_info2_t oi; /* Buffer for querying object's info */
- char filename[NAME_BUF_SIZE]; /* File name */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char valname[2 * NAME_BUF_SIZE]; /* Link value */
- H5O_token_t objno[CORDER_NLINKS]; /* Tokens for the objects created */
- unsigned u; /* Local index variable */
- hid_t ret; /* Generic return value */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t mount_file_id = H5I_INVALID_HID; /* File ID for file to mount */
+ hid_t group_id = H5I_INVALID_HID; /* Group ID */
+ hid_t soft_group_id = H5I_INVALID_HID; /* Group ID for soft links */
+ H5_iter_order_t order; /* Order within in the index */
+ H5O_info2_t oi; /* Buffer for querying object's info */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
+ H5O_token_t objno[CORDER_NLINKS]; /* Tokens for the objects created */
+ unsigned u; /* Local index variable */
+ hid_t ret; /* Generic return value */
/* Create file to mount */
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
@@ -20830,7 +20838,7 @@ open_by_idx_old(hid_t fapl)
hid_t group_id2; /* Group ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -20846,13 +20854,13 @@ open_by_idx_old(hid_t fapl)
TEST_ERROR;
/* Create soft link in another group, to objects in main group */
- HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
+ snprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if (H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
} /* end for */
/* Verify state of group (symbol table) */
- if (H5G__has_stab_test(group_id) != TRUE)
+ if (H5G__has_stab_test(group_id) != true)
TEST_ERROR;
/* Check for out of bound open by index */
@@ -20923,10 +20931,10 @@ static int
object_info_check(hid_t main_group_id, hid_t soft_group_id, H5_index_t idx_type, H5_iter_order_t order,
unsigned max_links, H5O_token_t *objno)
{
- char objname[NAME_BUF_SIZE]; /* Object name */
- hid_t group_id = -1; /* ID of group to test */
- H5O_info2_t oinfo; /* Buffer for querying object's info */
- unsigned u, v; /* Local index variables */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ hid_t group_id = H5I_INVALID_HID; /* ID of group to test */
+ H5O_info2_t oinfo; /* Buffer for querying object's info */
+ unsigned u, v; /* Local index variables */
int token_cmp;
/* Work through main & soft link groups */
@@ -20940,7 +20948,7 @@ object_info_check(hid_t main_group_id, hid_t soft_group_id, H5_index_t idx_type,
/* Open each object in group by name and check that it's the correct one */
for (u = 0; u < max_links; u++) {
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Query the object's information, by name */
if (H5Oget_info_by_name3(group_id, objname, &oinfo, H5O_INFO_BASIC | H5O_INFO_NUM_ATTRS,
@@ -21006,24 +21014,24 @@ error:
static int
object_info(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1; /* Group ID */
- hid_t soft_group_id = -1; /* Group ID for soft links */
- hid_t gcpl_id = -1; /* Group creation property list ID */
- hid_t space_id = -1; /* Dataspace ID (for attributes) */
- H5_index_t idx_type; /* Type of index to operate on */
- H5_iter_order_t order; /* Order within in the index */
- unsigned use_index; /* Use index on creation order values */
- unsigned max_compact; /* Maximum # of links to store in group compactly */
- unsigned min_dense; /* Minimum # of links to store in group "densely" */
- H5O_info2_t oinfo; /* Buffer for querying object's info */
- char filename[NAME_BUF_SIZE]; /* File name */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char valname[2 * NAME_BUF_SIZE]; /* Link value */
- char attrname[NAME_BUF_SIZE]; /* Attribute name */
- H5O_token_t *objno = NULL; /* Tokens (addresses) of the objects created */
- herr_t ret; /* Generic return value */
- unsigned u, v; /* Local index variables */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID; /* Group ID */
+ hid_t soft_group_id = H5I_INVALID_HID; /* Group ID for soft links */
+ hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */
+ hid_t space_id = H5I_INVALID_HID; /* Dataspace ID (for attributes) */
+ H5_index_t idx_type; /* Type of index to operate on */
+ H5_iter_order_t order; /* Order within in the index */
+ unsigned use_index; /* Use index on creation order values */
+ unsigned max_compact; /* Maximum # of links to store in group compactly */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ H5O_info2_t oinfo; /* Buffer for querying object's info */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
+ char attrname[NAME_BUF_SIZE]; /* Attribute name */
+ H5O_token_t *objno = NULL; /* Tokens (addresses) of the objects created */
+ herr_t ret; /* Generic return value */
+ unsigned u, v; /* Local index variables */
/* Create group creation property list */
if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0)
@@ -21046,7 +21054,7 @@ object_info(hid_t fapl)
/* Loop over operating in different orders */
for (order = H5_ITER_INC; order <= H5_ITER_NATIVE; order++) {
/* Loop over using index for creation order value */
- for (use_index = FALSE; use_index <= TRUE; use_index++) {
+ for (use_index = false; use_index <= true; use_index++) {
/* Print appropriate test message */
if (idx_type == H5_INDEX_CRT_ORDER) {
if (order == H5_ITER_INC) {
@@ -21139,7 +21147,7 @@ object_info(hid_t fapl)
hid_t attr_id; /* Attribute ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
@@ -21154,7 +21162,7 @@ object_info(hid_t fapl)
/* Create attributes on new object */
for (v = 0; v < u; v++) {
/* Make name for attribute */
- HDsnprintf(attrname, sizeof(attrname), "attr %02u", v);
+ snprintf(attrname, sizeof(attrname), "attr %02u", v);
/* Create attribute */
if ((attr_id = H5Acreate2(group_id2, attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT,
@@ -21171,13 +21179,13 @@ object_info(hid_t fapl)
TEST_ERROR;
/* Create soft link in another group, to objects in main group */
- HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
+ snprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if (H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
} /* end for */
/* Verify state of group (compact) */
- if (H5G__has_links_test(group_id, NULL) != TRUE)
+ if (H5G__has_links_test(group_id, NULL) != true)
TEST_ERROR;
/* Check for out of bound query by index */
@@ -21200,7 +21208,7 @@ object_info(hid_t fapl)
hid_t attr_id; /* Attribute ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) <
@@ -21215,7 +21223,7 @@ object_info(hid_t fapl)
/* Create attributes on new object */
for (v = 0; v < u; v++) {
/* Make name for attribute */
- HDsnprintf(attrname, sizeof(attrname), "attr %02u", v);
+ snprintf(attrname, sizeof(attrname), "attr %02u", v);
/* Create attribute */
if ((attr_id = H5Acreate2(group_id2, attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT,
@@ -21232,13 +21240,13 @@ object_info(hid_t fapl)
TEST_ERROR;
/* Create soft link in another group, to objects in main group */
- HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
+ snprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if (H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
} /* end for */
/* Verify state of group (dense) */
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Check for out of bound query by index */
@@ -21311,10 +21319,10 @@ static int
object_info_check_old(hid_t main_group_id, hid_t soft_group_id, H5_index_t idx_type, H5_iter_order_t order,
unsigned max_links, H5O_token_t *objno)
{
- char objname[NAME_BUF_SIZE]; /* Object name */
- hid_t group_id = -1; /* ID of group to test */
- H5O_info2_t oinfo; /* Buffer for querying object's info */
- unsigned u, v; /* Local index variables */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ hid_t group_id = H5I_INVALID_HID; /* ID of group to test */
+ H5O_info2_t oinfo; /* Buffer for querying object's info */
+ unsigned u, v; /* Local index variables */
/* Work through main & soft link groups */
for (v = 0; v < 2; v++) {
@@ -21329,7 +21337,7 @@ object_info_check_old(hid_t main_group_id, hid_t soft_group_id, H5_index_t idx_t
int cmp_value; /* Token comparison value */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Query the object's information, by name */
if (H5Oget_info_by_name3(group_id, objname, &oinfo, H5O_INFO_BASIC | H5O_INFO_NUM_ATTRS,
@@ -21394,19 +21402,19 @@ error:
static int
object_info_old(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1; /* Group ID */
- hid_t soft_group_id = -1; /* Group ID for soft links */
- hid_t space_id = -1; /* Dataspace ID (for attributes) */
- H5_iter_order_t order; /* Order within in the index */
- H5O_info2_t oinfo; /* Buffer for querying object's info */
- char filename[NAME_BUF_SIZE]; /* File name */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char valname[2 * NAME_BUF_SIZE]; /* Link value */
- char attrname[NAME_BUF_SIZE]; /* Attribute name */
- H5O_token_t objno[CORDER_NLINKS]; /* Tokens for the objects created */
- herr_t ret; /* Generic return value */
- unsigned u, v; /* Local index variables */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID; /* Group ID */
+ hid_t soft_group_id = H5I_INVALID_HID; /* Group ID for soft links */
+ hid_t space_id = H5I_INVALID_HID; /* Dataspace ID (for attributes) */
+ H5_iter_order_t order; /* Order within in the index */
+ H5O_info2_t oinfo; /* Buffer for querying object's info */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
+ char attrname[NAME_BUF_SIZE]; /* Attribute name */
+ H5O_token_t objno[CORDER_NLINKS]; /* Tokens for the objects created */
+ herr_t ret; /* Generic return value */
+ unsigned u, v; /* Local index variables */
/* Create dataspace for attributes */
if ((space_id = H5Screate(H5S_SCALAR)) < 0)
@@ -21457,7 +21465,7 @@ object_info_old(hid_t fapl)
hid_t attr_id; /* Attribute ID */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -21471,7 +21479,7 @@ object_info_old(hid_t fapl)
/* Create attributes on new object */
for (v = 0; v < u; v++) {
/* Make name for attribute */
- HDsnprintf(attrname, sizeof(attrname), "attr %02u", v);
+ snprintf(attrname, sizeof(attrname), "attr %02u", v);
/* Create attribute */
if ((attr_id = H5Acreate2(group_id2, attrname, H5T_NATIVE_INT, space_id, H5P_DEFAULT,
@@ -21488,13 +21496,13 @@ object_info_old(hid_t fapl)
TEST_ERROR;
/* Create soft link in another group, to objects in main group */
- HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
+ snprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if (H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
} /* end for */
/* Verify state of group (symbol table) */
- if (H5G__has_stab_test(group_id) != TRUE)
+ if (H5G__has_stab_test(group_id) != true)
TEST_ERROR;
/* Check for out of bound query by index */
@@ -21567,22 +21575,22 @@ error:
static int
group_info(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1; /* Group ID */
- hid_t soft_group_id = -1; /* Group ID for soft links */
- hid_t gcpl_id = -1; /* Group creation property list ID */
- H5_index_t idx_type; /* Type of index to operate on */
- H5_iter_order_t order; /* Order within in the index */
- unsigned use_index; /* Use index on creation order values */
- unsigned max_compact; /* Maximum # of links to store in group compactly */
- unsigned min_dense; /* Minimum # of links to store in group "densely" */
- H5G_info_t grp_info; /* Buffer for querying object's info */
- char filename[NAME_BUF_SIZE]; /* File name */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char objname2[NAME_BUF_SIZE]; /* Object name */
- char valname[2 * NAME_BUF_SIZE]; /* Link value */
- herr_t ret; /* Generic return value */
- unsigned u, v; /* Local index variables */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID; /* Group ID */
+ hid_t soft_group_id = H5I_INVALID_HID; /* Group ID for soft links */
+ hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */
+ H5_index_t idx_type; /* Type of index to operate on */
+ H5_iter_order_t order; /* Order within in the index */
+ unsigned use_index; /* Use index on creation order values */
+ unsigned max_compact; /* Maximum # of links to store in group compactly */
+ unsigned min_dense; /* Minimum # of links to store in group "densely" */
+ H5G_info_t grp_info; /* Buffer for querying object's info */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char objname2[NAME_BUF_SIZE]; /* Object name */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
+ herr_t ret; /* Generic return value */
+ unsigned u, v; /* Local index variables */
/* Create group creation property list */
if ((gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0)
@@ -21597,7 +21605,7 @@ group_info(hid_t fapl)
/* Loop over operating in different orders */
for (order = H5_ITER_INC; order <= H5_ITER_NATIVE; order++) {
/* Loop over using index for creation order value */
- for (use_index = FALSE; use_index <= TRUE; use_index++) {
+ for (use_index = false; use_index <= true; use_index++) {
/* Print appropriate test message */
if (idx_type == H5_INDEX_CRT_ORDER) {
if (order == H5_ITER_INC) {
@@ -21689,7 +21697,7 @@ group_info(hid_t fapl)
hid_t group_id2, group_id3; /* Group IDs */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
@@ -21734,7 +21742,7 @@ group_info(hid_t fapl)
/* Create objects in new group created */
for (v = 0; v <= u; v++) {
/* Make name for link */
- HDsnprintf(objname2, sizeof(objname2), "filler %02u", v);
+ snprintf(objname2, sizeof(objname2), "filler %02u", v);
/* Create hard link, with group object */
if ((group_id3 =
@@ -21845,7 +21853,7 @@ group_info(hid_t fapl)
TEST_ERROR;
/* Create soft link in another group, to objects in main group */
- HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
+ snprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if (H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
@@ -21863,7 +21871,7 @@ group_info(hid_t fapl)
} /* end for */
/* Verify state of group (compact) */
- if (H5G__has_links_test(group_id, NULL) != TRUE)
+ if (H5G__has_links_test(group_id, NULL) != true)
TEST_ERROR;
/* Check for out of bound query by index */
@@ -21881,7 +21889,7 @@ group_info(hid_t fapl)
hid_t group_id2, group_id3; /* Group IDs */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
@@ -21926,7 +21934,7 @@ group_info(hid_t fapl)
/* Create objects in new group created */
for (v = 0; v <= u; v++) {
/* Make name for link */
- HDsnprintf(objname2, sizeof(objname2), "filler %02u", v);
+ snprintf(objname2, sizeof(objname2), "filler %02u", v);
/* Create hard link, with group object */
if ((group_id3 =
@@ -22037,7 +22045,7 @@ group_info(hid_t fapl)
TEST_ERROR;
/* Create soft link in another group, to objects in main group */
- HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
+ snprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if (H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
@@ -22055,7 +22063,7 @@ group_info(hid_t fapl)
} /* end for */
/* Verify state of group (dense) */
- if (H5G__is_new_dense_test(group_id) != TRUE)
+ if (H5G__is_new_dense_test(group_id) != true)
TEST_ERROR;
/* Check for out of bound query by index */
@@ -22116,17 +22124,17 @@ error:
static int
group_info_old(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1; /* Group ID */
- hid_t soft_group_id = -1; /* Group ID for soft links */
- H5_iter_order_t order; /* Order within in the index */
- H5G_info_t grp_info; /* Buffer for querying object's info */
- char filename[NAME_BUF_SIZE]; /* File name */
- char objname[NAME_BUF_SIZE]; /* Object name */
- char objname2[NAME_BUF_SIZE]; /* Object name */
- char valname[2 * NAME_BUF_SIZE]; /* Link value */
- herr_t ret; /* Generic return value */
- unsigned u, v; /* Local index variables */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID; /* Group ID */
+ hid_t soft_group_id = H5I_INVALID_HID; /* Group ID for soft links */
+ H5_iter_order_t order; /* Order within in the index */
+ H5G_info_t grp_info; /* Buffer for querying object's info */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ char objname[NAME_BUF_SIZE]; /* Object name */
+ char objname2[NAME_BUF_SIZE]; /* Object name */
+ char valname[2 * NAME_BUF_SIZE]; /* Link value */
+ herr_t ret; /* Generic return value */
+ unsigned u, v; /* Local index variables */
/* Loop over operating in different orders */
for (order = H5_ITER_INC; order <= H5_ITER_NATIVE; order++) {
@@ -22169,7 +22177,7 @@ group_info_old(hid_t fapl)
hid_t group_id2, group_id3; /* Group IDs */
/* Make name for link */
- HDsnprintf(objname, sizeof(objname), "filler %02u", u);
+ snprintf(objname, sizeof(objname), "filler %02u", u);
/* Create hard link, with group object */
if ((group_id2 = H5Gcreate2(group_id, objname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -22214,7 +22222,7 @@ group_info_old(hid_t fapl)
/* Create objects in new group created */
for (v = 0; v <= u; v++) {
/* Make name for link */
- HDsnprintf(objname2, sizeof(objname2), "filler %02u", v);
+ snprintf(objname2, sizeof(objname2), "filler %02u", v);
/* Create hard link, with group object */
if ((group_id3 = H5Gcreate2(group_id2, objname2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -22324,7 +22332,7 @@ group_info_old(hid_t fapl)
TEST_ERROR;
/* Create soft link in another group, to objects in main group */
- HDsnprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
+ snprintf(valname, sizeof(valname), "/%s/%s", CORDER_GROUP_NAME, objname);
if (H5Lcreate_soft(valname, soft_group_id, objname, H5P_DEFAULT, H5P_DEFAULT) < 0)
TEST_ERROR;
@@ -22342,7 +22350,7 @@ group_info_old(hid_t fapl)
} /* end for */
/* Verify state of group (old-style) */
- if (H5G__has_stab_test(group_id) != TRUE)
+ if (H5G__has_stab_test(group_id) != true)
TEST_ERROR;
/* Check for out of bound query by index */
@@ -22405,15 +22413,15 @@ error:
static int
timestamps(hid_t fapl)
{
- hid_t file_id = -1; /* File ID */
- hid_t group_id = -1; /* Group ID */
- hid_t group_id2 = -1; /* Group ID */
- hid_t gcpl_id = -1; /* Group creation property list ID */
- hid_t gcpl_id2 = -1; /* Group creation property list ID */
- H5O_info2_t oinfo, oinfo2; /* Object info for groups created */
- H5O_native_info_t ninfo, ninfo2; /* Native info for groups created */
- char filename[NAME_BUF_SIZE]; /* File name */
- hbool_t track_times; /* The object timestamp setting */
+ hid_t file_id = H5I_INVALID_HID; /* File ID */
+ hid_t group_id = H5I_INVALID_HID; /* Group ID */
+ hid_t group_id2 = H5I_INVALID_HID; /* Group ID */
+ hid_t gcpl_id = H5I_INVALID_HID; /* Group creation property list ID */
+ hid_t gcpl_id2 = H5I_INVALID_HID; /* Group creation property list ID */
+ H5O_info2_t oinfo, oinfo2; /* Object info for groups created */
+ H5O_native_info_t ninfo, ninfo2; /* Native info for groups created */
+ char filename[NAME_BUF_SIZE]; /* File name */
+ bool track_times; /* The object timestamp setting */
/* Print test message */
TESTING("timestamps on objects");
@@ -22427,11 +22435,11 @@ timestamps(hid_t fapl)
TEST_ERROR;
/* Check default timestamp information */
- if (track_times != TRUE)
+ if (track_times != true)
TEST_ERROR;
/* Set a non-default object timestamp setting */
- if (H5Pset_obj_track_times(gcpl_id, FALSE) < 0)
+ if (H5Pset_obj_track_times(gcpl_id, false) < 0)
TEST_ERROR;
/* Query the object timestamp setting */
@@ -22439,7 +22447,7 @@ timestamps(hid_t fapl)
TEST_ERROR;
/* Check default timestamp information */
- if (track_times != FALSE)
+ if (track_times != false)
TEST_ERROR;
/* Create file */
@@ -22468,11 +22476,11 @@ timestamps(hid_t fapl)
/* Query & verify the object timestamp settings */
if (H5Pget_obj_track_times(gcpl_id, &track_times) < 0)
TEST_ERROR;
- if (track_times != FALSE)
+ if (track_times != false)
TEST_ERROR;
if (H5Pget_obj_track_times(gcpl_id2, &track_times) < 0)
TEST_ERROR;
- if (track_times != TRUE)
+ if (track_times != true)
TEST_ERROR;
/* Query the object information for each group */
@@ -22550,11 +22558,11 @@ timestamps(hid_t fapl)
/* Query & verify the object timestamp settings */
if (H5Pget_obj_track_times(gcpl_id, &track_times) < 0)
TEST_ERROR;
- if (track_times != FALSE)
+ if (track_times != false)
TEST_ERROR;
if (H5Pget_obj_track_times(gcpl_id2, &track_times) < 0)
TEST_ERROR;
- if (track_times != TRUE)
+ if (track_times != true)
TEST_ERROR;
/* Query the object information for each group */
@@ -22640,15 +22648,15 @@ error:
int
main(void)
{
- hid_t fapl = -1, fapl2 = -1; /* File access property lists */
+ hid_t fapl = H5I_INVALID_HID, fapl2 = H5I_INVALID_HID; /* File access property lists */
int nerrors = 0;
unsigned new_format; /* Whether to use the new format or not */
unsigned minimize_dset_oh;
unsigned efc; /* Whether to use the external file cache */
const char *env_h5_drvr; /* File Driver value from environment */
- hbool_t driver_is_default_compatible;
+ bool driver_is_default_compatible;
- env_h5_drvr = HDgetenv(HDF5_DRIVER);
+ env_h5_drvr = getenv(HDF5_DRIVER);
if (env_h5_drvr == NULL)
env_h5_drvr = "nomatch";
@@ -22676,7 +22684,7 @@ main(void)
dcpl_g = H5P_DEFAULT;
}
- for (new_format = FALSE; new_format <= TRUE; new_format++) {
+ for (new_format = false; new_format <= true; new_format++) {
hid_t my_fapl;
/* Check for FAPL to use */
@@ -22718,7 +22726,7 @@ main(void)
#endif /* H5_NO_DEPRECATED_SYMBOLS */
/* Skip external link tests for splitter VFD, which has external link-related bugs */
- if (HDstrcmp(env_h5_drvr, "splitter")) {
+ if (strcmp(env_h5_drvr, "splitter")) {
/* tests for external link */
/* Test external file cache first, so it sees the default efc setting on the fapl
@@ -22736,7 +22744,7 @@ main(void)
nerrors += external_set_elink_acc_flags(env_h5_drvr, my_fapl, new_format) < 0 ? 1 : 0;
/* Try external link tests both with and without the external file cache */
- for (efc = FALSE; efc <= TRUE; efc++) {
+ for (efc = false; efc <= true; efc++) {
if (efc) {
if (H5Pset_elink_file_cache_size(my_fapl, 8) < 0)
TEST_ERROR;
@@ -22817,7 +22825,7 @@ main(void)
* so assume that everything that passed for external links
* above has already been tested for UD links.
*/
- if (new_format == TRUE) {
+ if (new_format == true) {
nerrors += ud_hard_links(fapl2) < 0 ? 1 : 0; /* requires new format groups */
#ifndef H5_NO_DEPRECATED_SYMBOLS
nerrors += ud_hard_links_deprec(fapl2) < 0 ? 1 : 0; /* requires new format groups */
@@ -22945,6 +22953,6 @@ main(void)
exit(EXIT_SUCCESS);
error:
- HDputs("*** TESTS FAILED ***");
+ puts("*** TESTS FAILED ***");
exit(EXIT_FAILURE);
} /* end main() */