summaryrefslogtreecommitdiffstats
path: root/test/tgenprop.c
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2021-02-08 16:56:16 (GMT)
committerGitHub <noreply@github.com>2021-02-08 16:56:16 (GMT)
commit22c67ff6570f16050f0a5654cf1c84df917bb598 (patch)
tree38fb63aa498b250c2543fe7e22a511706de96a42 /test/tgenprop.c
parent551f15f8ae02ca9c995619b216121081eb07633e (diff)
downloadhdf5-hdf5-1_8_22.zip
hdf5-hdf5-1_8_22.tar.gz
hdf5-hdf5-1_8_22.tar.bz2
1.8/master (#317)hdf5-1_8_22
* Revert incorrect bool type * Correct grep text for filter test * Check sizeof type to use correct ref_type * h5dump reg ref chnages has no error file * Fix comment * Remove unneeded files * Verify the decoded version for "all" and "none" selection. * Remove double entry * Add missing include * Snapshot version 1.8 release 22 (snap4) Update version to 1.8-snap5 * Fixes for test failures with --disable-tests --disable-tools options. Don't test ph5diff if tests are disabled. * Correct conditions for parallel builds with and without tests. * Snapshot version 1.8 release 22 (snap5) Update version to 1.8.22-snap6 * TRILAB-192 merging warnings changes from develop * Autotools reconfigure update * Restore page ejects. * Restore page eject chars * Fix orphaned token * Update LT files * Correct extra flags and merge TRILAB-24 * Update release note for CMake warnings * H5repack bug fixes from develop * TRILAB-192 - merge changes from develop Single source, config files, for warnings for both autotools and CMake. Update CMake libraries, tools, tests to use correct flags. * Add missing m4 file * Remove 128bit config check fo 1.8 * TRILAB-192 update LTparse files * A fix in the cleaning up code for datatype when datatype initialization via H5D__init_type() fails. The code to fix the problem is the same as what is done in H5D__open_oid(). * Add missing " and update function calls incorrectly named load_gcc_arguments. Commit changes to gnu-cxxflags to remove unmatched " and to gnu-fflags to not add C warnings flags to H5_FCFLAGS. * TRILAB-192 - cleanup edits and match CMake CXX to autotools * Fix shadowed type * TRILAB-192 correct fortran commands * TRILAB-192 version of std=f2008 special check * Fix shadow variable * Add prefix_relto_examplesdir function to set relative path to h5c++. * TRILAB-192 - parser files cannot handle this warning * Parallel Fortran tests now use the MPI module instead of including mpif.h. * Don't add general warnings flags for unsupported old versions of gcc and g++ (older than gcc/g++ 4.2). Correct gnu-cxxflags to determine warnings flags to be added based on C++ compiler version instead of C compiler version. * Snapshot version 1.8 release 22 (snap6) Update version to 1.8.22-snap7 * TRILAB-244 separate CXX warnings and errors from C * Fix NoFilter build * Move ADD_H5_FLAGS macro from *CompilerFlags.cmake files to config/cmake_ext_mod/HDFMacros.cmake for common use. * Restrict errors to gcc 4.8 and above. * OESS-65 replace szip with aec szip * Correct CMake version * Correct -Werror=unused-variable * Add -Werror= flags to lists displayed in libhdf5.settings. * Fix -Werror=unused-variable * More fixes for unused variable * Resolve warning errors from -Werror= flags: -Werror=bad-function-cast -Werror=bad-function-cast -Werror=implicit-function-declaration -Werror=nested-externs * Remove verbose assignments in smoke_check 3 and 5 functions. * Update to use optimization flags, C++ error flags, and correct libhdf5.settings.in to remove unworkable changes. * Update config/gnu-cxxflags. * Add missing headers * Fix ifort warning flag. Restore AC_DEFUN([PAC_PROG_FC_DEFAULT_REALisDBLE] in m4/aclocal_fc.m4. Add --enable-symbols, --enable-profiling, and --enable-optimization options to autotools configure; all configure flags for --enable-production and --disable-production should match HDF5 1.10 and 1.12 production and debug default flags. * Add github actions file * Correct path * OESS-65 Fix packaging * Update reference name * Correct filename * disable pr action and enable fail fast * Snapshot 1.8.22-snap7 Update version to 1.8.22-snap8. * Correct mingw path * Correct mingw paths * Revise gnu-*flags and cmake/HDF*CompilerFlags.cmake files to add warning flags for GCC compilers version 4.8 and above. Removed files from gnu-warnings that only apply to versions < 4.8. Consolidated warnings from versions < 4.8 that apply to versions >= 4.8 into the 4.8 warnings files. * Update MANIFEST for removal of older warnings files. * Yanked all MPI-1 calls Added batch scripts in bin/batch. * Snapshot 1.8.22-snap8. Update version to 1.8.22-snap9. * Squashed commit of the following: commit 45b0cbc71929930a874e1c09e0770aa64d0ae697 Author: Larry Knox <lrknox@hdfgroup.org> Date: Thu Apr 23 13:14:56 2020 -0500 Add C++ warnings treated as error for autotools builds. commit 6debcddcc766601799d5bd661bd60946f951a07e Author: Larry Knox <lrknox@hdfgroup.org> Date: Fri Jun 19 16:50:03 2020 -0500 Remove tests for develop branch from testh5cc.sh.in. Add @H5_ECXXFLAGS@ to AM_CXXFLAGS. commit fed497e7f207313b2a133d3b68c942b7d7104b90 Author: Larry Knox <lrknox@hdfgroup.org> Date: Fri Jun 12 15:06:39 2020 -0500 Merge pull request #2646 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit '998c6470d78e14228695419c3b514c35ecf3d69e': Remove unnecessary version conditions for Clang compilers. commit 92e52ce5c211bd1d3991a3b8bb67287ac7b652aa Author: Larry Knox <lrknox@hdfgroup.org> Date: Wed Jun 10 18:53:45 2020 -0500 Merge pull request #2639 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit 'a33667faf226f5d8c9633bf537893e8fce1bf1f6': Add c++ to --enable-sanitize-checks option. commit 2e802534fb997b81fa98fdd1c7d97d4310898e0d Author: Larry Knox <lrknox@hdfgroup.org> Date: Wed Jun 10 15:18:36 2020 -0500 Merge pull request #2633 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit '20eab963899841c9a003baebead8e3bc07d9e127': Remove duplicate entries in MANIFEST. Make changes to CMake CompilerFlags.cmake files so extra flags are loaded for non-GNU compilers. Update new clang files to not pick up clang as vendor for pgCC. Add new files to MANIFEST Temporary demotion of 2 -Werror warning flags that fail on macos 10.12 Remove Production flag unknown to Apple clang. commit 96ef60a58a23847a7da89a891f2415055ec2ab60 Author: Larry Knox <lrknox@hdfgroup.org> Date: Mon Jun 8 16:24:49 2020 -0500 Merge pull request #2631 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit 'b942a4d8a3e27317cac50ce37ff5302d477664d8': Clean up code to get clang version in config/linux-gnulibc1 commit 8a7c687da568e8b50b38fa53da1ca63759be6ec4 Author: Larry Knox <lrknox@hdfgroup.org> Date: Mon Jun 8 11:42:37 2020 -0500 Merge pull request #2623 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit 'c7626f79fdee4eee13925e240ef41e61f3367eab': Add flags from config/clang-warnings/*general files to H5 C and CXX flags for all versions of Clang and Clang++ compilers. Switched from cut to awk in testcheck_version.sh.in to avoid dependence on tab vs. " " in version definitions in H5public.h. Add files for adding warning flags for clang compilers in autotools configure. commit db3ef7ff3c1ed79167cecef831501411cff8291f Merge: 5a0f8d7 f9f1310 Author: Larry Knox <lrknox@hdfgroup.org> Date: Fri Jun 19 14:46:22 2020 -0500 Merge branch 'hdf5_1_12' of https://bitbucket.hdfgroup.org/scm/~lrknox/hdf5_lrk into hdf5_1_12 commit 5a0f8d7940ae57b445f545a0abd7e303ce6924ee Author: Larry Knox <lrknox@hdfgroup.org> Date: Wed Jun 10 20:15:41 2020 -0500 Merge pull request #2636 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:HDFFV-11000-update-testh5cc.sh.in-for-version to develop * commit '5c0bd670d6e9919c463fbc05de99e2ba55b0761e': Add tests for all version to H5_NO_DEPRECATED_SYMBOLS section and to section for current version, with and without default API version flags. HDFFV-11000: update-testh5cc.sh.in to test sample versioned functions in HDF5 1.10, 1.12 and develop. * Update configure and Makefile.ins after bin/reconfigure. * Fix MANIFEST * Fix HDFFV-10591 Description: h52gif produced a segfault when a buffer overflow occurred because the data size was corrupted and became very large. This commit added a check on the data size against the buffer size to prevent the segfault. It also added error reporting to h52gif to display an error message instead of silently exiting when the failure occurred. Platforms tested: Linux/64 (jelly) * Snapshot 1.8.22-snap9. Update version to 1.8.22-snap10. * Merge pull request #2686 in HDFFV/hdf5 from ~LRKNOX/hdf5_lrk:develop to develop * commit '800f93f7c994f88dfa716746153ded4b1e690e3a': Remove path to szip header file from AM_CPPFLAGS when configure check of libsz fails. Fix for HDFFV-10830. * Regenerate configure. * Merge from 1.10-1.12-dev - LT parse needs update * Incorporate pull request #2693 from develop for the fix to HDFFV-11080: (1) Patch up the file pointer when reading attribute of variable length datatype (2) Test to verify the fix when doing multiple threads (3) Update MANIFEST (4) Add new test to Cmake * Switch bison and flex update of LT files from bin/genltanalyse to bin/genparser, and from automatically updating the LT files whenever reconfigure is run to running only on man<F12>ual command. * Update hl/sr/H5LT files. Add bin/genparser to MANIFEST; remove bin/genltanalyze. * Fix to the merge of PR #2708 for HDFFV-11080 to the 1.8 branch. Need to checkin test/Makefile.in for the new file added. * Fix HDFFV-11120 and HDFFV-11121 (CVE-2018-13870 and CVE-2018-13869) Description: When a buffer overflow occurred because a name length was corrupted and became very large, h5dump produced a segfault on one file and a memcpy parameter overlap on another file. This commit added checks that detect a read pass the end of the buffer to prevent these error conditions. Platforms tested: Linux/64 (jelly) * Fixed typo * Check for header szlib.h only when libsz passes AC_CHECK_LIB, so that H5_HAVE_SALIB_H is not defined when szip is not enabled, to prevent compile failures for incompatible szlib. * HDFFV-11127 - force RTLD_LOCAL in dlopen * spelling * Remove extra parens * Remove unnecessary assignment freom configure.ac. * Add hypen to subrelease regex * Add special case when H5_VERS_SUBRELEASE is 0 * Revert H5_VERS_SUBRELEASE check * The version string has a second use for packaging * MinGW uses "MinGW Makefiles" * Snapshot 1.8.22-snap10. Update version to 1.8.22-snap11. * Merge clang-format changes from develop * remove stray file * Source formatted * Add options to github actions. * Add back file, remove py file * HDFFV-11096 Correct h5dump usage text * Update formating * remove autogen for 1.8 branch * Fix comment whitespace * Change '==' to 'eq' in test script * Merge from develop github updates bin scripts parser updates * Snapshot 1.8.22-snap11. Update version to 1.8.22-snap12. * Merge from 1.10 Comments, whitespace Simple init and if block brackets. Minimal code changes limited to return value and spelling * Update autotools files * Update FD source * More merges from 1.10 comments and inits * Comment fixes * Fix macro argument * Remove autogen file and cache dir * Revert autotools files to previous version * Correct boolean value and missing define * URL and options corrections * revert autoconf files * Fix compile issues with vfd drivers. * Fix HDFS test * Remove extra #endif * Move init above execution * Multiple changes to bring branch up-to-date (#87) Correct TARGET variable and CMake config file location. Add option to allow filter plugins to be built inline. Update CMake tools macros. * hdf5 1 8 release text (#113) * Multiple changes to bring branch up-to-date Correct TARGET variable and CMake config file location. Add option to allow filter plugins to be built inline. Update CMake tools macros. * release text updates - mostly whitespace * Fixed HDFFV-10480 and HDFFV-11159 (#145) * Fixed HDFFV-10480 and HDFFV-11159 Description Checked against buffer size to prevent segfault, in case of data corruption. + HDFFV-11159 CVE-2018-14033 Buffer over-read in H5O_layout_decode + HDFFV-10480 CVE-2018-11206 Buffer over-read in H5O_fill_new[/old]_decode and A user's patch was applied to this previously, but it is redone for a more correct fix, that is the check now accounted for the previous advance of the buffer pointer. Platforms tested: Linux/64 (jelly) * Fixed typo * Update HDF5 1.8 copyright headers with updated copyright URL (#148) * Update URL for COPYING file in copyright headers. * Make fortran copyright headers uniformly spaced. * Update url for Copyright file in c++/src/footer.html. * OESS-98 Update plugin build option (#171) * 1.8 has extra fortran CMake option (#176) * 1.8 has extra fortran CMake option * Update license URL * OESS-98 fix tools test for plugins (#180) * Hdf5 1 8 (#169) * Fixed HDFFV-10480 and HDFFV-11159 Description Checked against buffer size to prevent segfault, in case of data corruption. + HDFFV-11159 CVE-2018-14033 Buffer over-read in H5O_layout_decode + HDFFV-10480 CVE-2018-11206 Buffer over-read in H5O_fill_new[/old]_decode and A user's patch was applied to this previously, but it is redone for a more correct fix, that is the check now accounted for the previous advance of the buffer pointer. Platforms tested: Linux/64 (jelly) * Fixed typo * Fixed HDFFV-11150 Description Replaced an HDassert with a check for null pointer in H5O_dec_rc() to catch null pointer in corrupted data situation. Reversed the fix in svn-r24463 in which a check for null pointer prior to calling H5O_dec_rc() Platforms tested: Linux/64 (jelly) * HDF5 1 8 fix fortran build on macs (#186) * Correct fortran and shared libs option * Fix for no shared fortran build * OESS-98 fix hdf5 link target (#191) * Partial changes to RELEASE.txt for release. (#185) * Partial changes to RELEASE.txt for release. * Update supported and tested platforms. * Update version to 1.8.22-12. * close #195. (#196) * Update HDF5PluginMacros.cmake * Update HDF5PluginMacros.cmake * Update directory for SZ filter in HDF5PluginMacros.cmake. Updates for release: Switch configure default to production mode. Set HDF5_GENERATE_HEADERS to OFF. * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Restores maintainer mode in the autotools (#200) (#203) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> * Hdf5 1 8 22 (#212) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Brings ttsafe_attr_vlen.c changes from develop (#214) Fixes exposed pthread problem on Windows. * Update SO numbers for Hdf5 1 8 22 (#215) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Hdf5 1 8 22 (#224) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> * Update CMake/HDF5Examples version in bin/release * Update CMake/HDF5Examples version number in bin/release (#225) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> * Fixed typo in an error message. (#228) * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * Bring 3 small changes from Hdf5 1.8 to 1.8.22 (#241) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Stat st blocks fix 1822 (#251) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * Fixes Autotools detection of the st_blocks field in stat (#246) * Fixes Autotools detection of the st_blocks field in stat The Autotools and CMake will now both correctly determine if the stat struct has the st_blocks field and set H5_HAVE_STAT_ST_BLOCKS appropriately. * Fixes a typo in configure.ac * Restore lines in RELEASE.txt. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Stat st blocks fix 1822 (#256) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * Fixes Autotools detection of the st_blocks field in stat (#246) * Fixes Autotools detection of the st_blocks field in stat The Autotools and CMake will now both correctly determine if the stat struct has the st_blocks field and set H5_HAVE_STAT_ST_BLOCKS appropriately. * Fixes a typo in configure.ac * Restore lines in RELEASE.txt. * Updated configure with reconfigure. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * RELEASE.txt cleanup. * Hdf5 1 8 22 (#261) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Hdf5 1 8 22 (#266) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. * Hdf5 1 8 22 - Reverts lock/unlock callback signature to 1.8.21 version (#267) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Update version in H5public.h * Hdf5 1 8 22 (#269) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. * Update version in H5public.h Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Set version 1.8.22 for release. * dd RELEASE.txt entry for HDFFV-10741. * Hdf5 1 8 22 (#279) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. * Update version in H5public.h * Set version 1.8.22 for release. * dd RELEASE.txt entry for HDFFV-10741. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> * Improve performance of multiple calls to H5Sget_select_elem_pointlist (#270) (#277) * Cache the pointer to the next point to process after the last call to H5S__get_select_elem_pointlist. This allows the normal process of iterating over the points in batches to be much more efficient, as the library does not need to traverse the entirety of the preceding points every time the funciton is re-entered. * Update RELEASE.txt for point selection iteration performance fix. * Hdf5 1 8 22 (#281) * Restores maintainer mode in the autotools (#200) Maintainer mode should be enabled in development branches. Also adds helpful commenting. Add bin/switch_maint_mode Disable maintainer mode for release. Fix incomplete merge for stub functions in H5Fdhdfs.c * Update configure for Restores maintainer mode in the autotools (#200). * Update MANIFEST for switch_maint_mode script. * Update so numbers for 1.8.22 release. * Add so numbers changes in Makefile.ins for 1.8.22 release. * Update pkgconfig settings with version - #218 (#223) * Add notice of final HDFF5 1.8 release. Add solaris 64bit alignment issue to "Known Problems". * Update 1.8 final release notice. * Update CMake/HDF5Examples version in bin/release * Fixed typo in an error message. (#227) * Remove duplicate setting (#239) * RELEASE.txt cleanup. * Add macOS Big Sur to tested machines, also missing entries for macOS 10.13 and 10.14. * )Update version. * Reverts lock/unlock callback signature to 1.8.21 version (#254) * Reverts lock/unlock callback signature to 1.8.21 version This callback is unused in 1.8. The ros3 and hdfs VFDs are the only VFDs that have the lock callback implemented and that is just as no-op stubs. These stubs were removed so the callbacks are now NULL pointers, like the other VFDs in 1.8. * Trivial whitespace fix * Update version to 1.8.22-14. * Update version in H5public.h * Set version 1.8.22 for release. * dd RELEASE.txt entry for HDFFV-10741. * Improve performance of multiple calls to H5Sget_select_elem_pointlist (#270) (#277) * Cache the pointer to the next point to process after the last call to H5S__get_select_elem_pointlist. This allows the normal process of iterating over the points in batches to be much more efficient, as the library does not need to traverse the entirety of the preceding points every time the funciton is re-entered. * Update RELEASE.txt for point selection iteration performance fix. Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> Co-authored-by: Neil Fortner <nfortne2@hdfgroup.org> * Hdf5 1 8 22 (#284) * Fixed typo in an error message. * Updated for HDFFV-11150, HDFFV-10480, and HDFFV-11159 * Update "Support for New Platforms and Compilers" section in RELEASE.txt; add check_version workaround for binary compatibility to "Known Problems". * Add SUSE Linux to tested platforms. * Update numbers in config/lt_vers.am and run bin/reconfigure for so numbers. * Update version in 3 files missed by merge. Co-authored-by: Allen Byrne <byrn@hdfgroup.org> Co-authored-by: Vailin Choi <vchoi@hdfgroup.org> Co-authored-by: vchoi <vchoi@jelly.ad.hdfgroup.org> Co-authored-by: hdftest <hdftest@hdfgroup.org> Co-authored-by: Jordan Henderson <jhenderson@hdfgroup.org> Co-authored-by: Dana Robinson <derobins@hdfgroup.org> Co-authored-by: Binh-Minh Ribler <bmribler@hdfgroup.org> Co-authored-by: Allen Byrne <50328838+byrnHDF@users.noreply.github.com> Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com> Co-authored-by: H. Joe Lee <hyoklee@hdfgroup.org> Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com> Co-authored-by: Neil Fortner <nfortne2@hdfgroup.org>
Diffstat (limited to 'test/tgenprop.c')
-rw-r--r--test/tgenprop.c826
1 files changed, 426 insertions, 400 deletions
diff --git a/test/tgenprop.c b/test/tgenprop.c
index d6f4ac7..2996174 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -6,56 +6,56 @@
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the COPYING file, which can be found at the root of the source code *
- * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * distribution tree, or in https://www.hdfgroup.org/licenses. *
* If you do not have access to either file, you may request a copy from *
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/***********************************************************
-*
-* Test program: tgenprop
-*
-* Test the Generic Property functionality
-*
-*************************************************************/
+ *
+ * Test program: tgenprop
+ *
+ * Test the Generic Property functionality
+ *
+ *************************************************************/
-#define H5P_PACKAGE /*suppress error about including H5Ppkg */
+#define H5P_PACKAGE /*suppress error about including H5Ppkg */
/* Define this macro to indicate that the testing APIs should be available */
#define H5P_TESTING
#include "testhdf5.h"
#include "hdf5.h"
-#include "H5Dprivate.h" /* For Dataset creation property list names */
-#include "H5Ppkg.h" /* Generic Properties */
+#include "H5Dprivate.h" /* For Dataset creation property list names */
+#include "H5Ppkg.h" /* Generic Properties */
-#define FILENAME "tgenprop.h5"
+#define FILENAME "tgenprop.h5"
/* Property definitions */
-#define CLASS1_NAME "Class 1"
-#define CLASS1_PATH "root/Class 1"
+#define CLASS1_NAME "Class 1"
+#define CLASS1_PATH "root/Class 1"
-#define CLASS2_NAME "Class 2"
-#define CLASS2_PATH "root/Class 1/Class 2"
+#define CLASS2_NAME "Class 2"
+#define CLASS2_PATH "root/Class 1/Class 2"
/* Property definitions */
-#define PROP1_NAME "Property 1"
-int prop1_def=10; /* Property 1 default value */
+#define PROP1_NAME "Property 1"
+int prop1_def = 10; /* Property 1 default value */
#define PROP1_SIZE sizeof(prop1_def)
#define PROP1_DEF_VALUE (&prop1_def)
-#define PROP2_NAME "Property 2"
-float prop2_def=3.14F; /* Property 2 default value */
+#define PROP2_NAME "Property 2"
+float prop2_def = 3.14F; /* Property 2 default value */
#define PROP2_SIZE sizeof(prop2_def)
#define PROP2_DEF_VALUE (&prop2_def)
-#define PROP3_NAME "Property 3"
-char prop3_def[10]="Ten chars"; /* Property 3 default value */
+#define PROP3_NAME "Property 3"
+char prop3_def[10] = "Ten chars"; /* Property 3 default value */
#define PROP3_SIZE sizeof(prop3_def)
#define PROP3_DEF_VALUE (&prop3_def)
-#define PROP4_NAME "Property 4"
-double prop4_def=1.41F; /* Property 4 default value */
+#define PROP4_NAME "Property 4"
+double prop4_def = 1.41F; /* Property 4 default value */
#define PROP4_SIZE sizeof(prop4_def)
#define PROP4_DEF_VALUE (&prop4_def)
@@ -68,24 +68,24 @@ double prop4_def=1.41F; /* Property 4 default value */
static void
test_genprop_basic_class(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t cid2; /* Generic Property class ID */
- hid_t cid3; /* Generic Property class ID */
- char *name; /* Name of class */
- herr_t ret; /* Generic return value */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t cid2; /* Generic Property class ID */
+ hid_t cid3; /* Generic Property class ID */
+ char * name; /* Name of class */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Class Creation Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
- cid1 = H5Pcreate_class(H5P_ROOT,CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
+ cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Check class name */
name = H5Pget_class_name(cid1);
CHECK_PTR(name, "H5Pget_class_name");
- if(HDstrcmp(name,CLASS1_NAME)!=0)
- TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n",name,CLASS1_NAME);
+ if (HDstrcmp(name, CLASS1_NAME) != 0)
+ TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n", name, CLASS1_NAME);
H5free_memory(name);
/* Check class parent */
@@ -93,11 +93,11 @@ test_genprop_basic_class(void)
CHECK_I(cid2, "H5Pget_class_parent");
/* Verify class parent correct */
- ret = H5Pequal(cid2,H5P_ROOT);
+ ret = H5Pequal(cid2, H5P_ROOT);
VERIFY(ret, 1, "H5Pequal");
/* Make certain false postives aren't being returned */
- ret = H5Pequal(cid2,H5P_FILE_CREATE);
+ ret = H5Pequal(cid2, H5P_FILE_CREATE);
VERIFY(ret, 0, "H5Pequal");
/* Close parent class */
@@ -109,14 +109,14 @@ test_genprop_basic_class(void)
CHECK_I(ret, "H5Pclose_class");
/* Create another new generic class, derived from file creation class */
- cid1 = H5Pcreate_class(H5P_FILE_CREATE,CLASS2_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
+ cid1 = H5Pcreate_class(H5P_FILE_CREATE, CLASS2_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Check class name */
name = H5Pget_class_name(cid1);
CHECK_PTR(name, "H5Pget_class_name");
- if(HDstrcmp(name,CLASS2_NAME)!=0)
- TestErrPrintf("Class names don't match!, name=%s, CLASS2_NAME=%s\n",name,CLASS2_NAME);
+ if (HDstrcmp(name, CLASS2_NAME) != 0)
+ TestErrPrintf("Class names don't match!, name=%s, CLASS2_NAME=%s\n", name, CLASS2_NAME);
H5free_memory(name);
/* Check class parent */
@@ -124,7 +124,7 @@ test_genprop_basic_class(void)
CHECK_I(cid2, "H5Pget_class_parent");
/* Verify class parent correct */
- ret = H5Pequal(cid2,H5P_FILE_CREATE);
+ ret = H5Pequal(cid2, H5P_FILE_CREATE);
VERIFY(ret, 1, "H5Pequal");
/* Check class parent's parent */
@@ -132,7 +132,7 @@ test_genprop_basic_class(void)
CHECK_I(cid3, "H5Pget_class_parent");
/* Verify class parent's parent correct */
- ret = H5Pequal(cid3,H5P_GROUP_CREATE);
+ ret = H5Pequal(cid3, H5P_GROUP_CREATE);
VERIFY(ret, 1, "H5Pequal");
/* Close parent class's parent */
@@ -157,10 +157,10 @@ test_genprop_basic_class(void)
static void
test_genprop_basic_class_prop(void)
{
- hid_t cid1; /* Generic Property class ID */
- size_t size; /* Size of property */
- size_t nprops; /* Number of properties in class */
- herr_t ret; /* Generic return value */
+ hid_t cid1; /* Generic Property class ID */
+ size_t size; /* Size of property */
+ size_t nprops; /* Number of properties in class */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Class Properties Functionality\n"));
@@ -179,11 +179,13 @@ test_genprop_basic_class_prop(void)
VERIFY(ret, 0, "H5Pexist");
/* Insert first property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Try to insert the first property again (should fail) */
- ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
VERIFY(ret, FAIL, "H5Pregister2");
/* Check the existance of the first property */
@@ -201,11 +203,13 @@ test_genprop_basic_class_prop(void)
VERIFY(nprops, 1, "H5Pget_nprops");
/* Insert second property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Try to insert the second property again (should fail) */
- ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
VERIFY(ret, FAIL, "H5Pregister2");
/* Check the existance of the second property */
@@ -223,7 +227,8 @@ test_genprop_basic_class_prop(void)
VERIFY(nprops, 2, "H5Pget_nprops");
/* Insert third property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Check the existance of the third property */
@@ -284,15 +289,15 @@ test_genprop_basic_class_prop(void)
static int
test_genprop_iter1(hid_t id, const char *name, void *iter_data)
{
- struct { /* Struct for iterations */
- int iter_count;
+ struct { /* Struct for iterations */
+ int iter_count;
const char **names;
} *iter_struct = iter_data;
/* Shut compiler up */
id = id;
- return(HDstrcmp(name,iter_struct->names[iter_struct->iter_count++]));
+ return (HDstrcmp(name, iter_struct->names[iter_struct->iter_count++]));
}
/****************************************************************
@@ -304,19 +309,16 @@ test_genprop_iter1(hid_t id, const char *name, void *iter_data)
static void
test_genprop_class_iter(void)
{
- hid_t cid1; /* Generic Property class ID */
- size_t nprops; /* Number of properties in class */
- int idx; /* Index to start iteration at */
- struct { /* Struct for iterations */
- int iter_count;
+ hid_t cid1; /* Generic Property class ID */
+ size_t nprops; /* Number of properties in class */
+ int idx; /* Index to start iteration at */
+ struct { /* Struct for iterations */
+ int iter_count;
const char **names;
} iter_struct;
- const char *pnames[4]={ /* Names of properties for iterator */
- PROP1_NAME,
- PROP2_NAME,
- PROP3_NAME,
- PROP4_NAME};
- herr_t ret; /* Generic return value */
+ const char *pnames[4] = {/* Names of properties for iterator */
+ PROP1_NAME, PROP2_NAME, PROP3_NAME, PROP4_NAME};
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Class Property Iteration Functionality\n"));
@@ -326,35 +328,39 @@ test_genprop_class_iter(void)
CHECK_I(cid1, "H5Pcreate_class");
/* Insert first property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Insert second property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Insert third property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Insert third property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP4_NAME, PROP4_SIZE, PROP4_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP4_NAME, PROP4_SIZE, PROP4_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Check the number of properties in class */
- ret = H5Pget_nprops(cid1,&nprops);
+ ret = H5Pget_nprops(cid1, &nprops);
CHECK_I(ret, "H5Pget_nprops");
VERIFY(nprops, 4, "H5Pget_nprops");
/* Iterate over all properties in class */
- iter_struct.iter_count=0;
- iter_struct.names=pnames;
- ret = H5Piterate(cid1,NULL,test_genprop_iter1,&iter_struct);
+ iter_struct.iter_count = 0;
+ iter_struct.names = pnames;
+ ret = H5Piterate(cid1, NULL, test_genprop_iter1, &iter_struct);
VERIFY(ret, 0, "H5Piterate");
/* Iterate over last three properties in class */
- idx=iter_struct.iter_count=1;
- ret = H5Piterate(cid1,&idx,test_genprop_iter1,&iter_struct);
+ idx = iter_struct.iter_count = 1;
+ ret = H5Piterate(cid1, &idx, test_genprop_iter1, &iter_struct);
VERIFY(ret, 0, "H5Piterate");
VERIFY(idx, (int)nprops, "H5Piterate");
@@ -371,43 +377,43 @@ test_genprop_class_iter(void)
static herr_t
test_genprop_cls_crt_cb1(hid_t list_id, void *create_data)
{
- struct { /* Struct for iterations */
- int count;
+ struct { /* Struct for iterations */
+ int count;
hid_t id;
- } *count_struct=create_data;
+ } *count_struct = create_data;
count_struct->count++;
- count_struct->id=list_id;
+ count_struct->id = list_id;
- return(SUCCEED);
+ return (SUCCEED);
}
static herr_t
test_genprop_cls_cpy_cb1(hid_t new_list_id, hid_t H5_ATTR_UNUSED old_list_id, void *copy_data)
{
- struct { /* Struct for iterations */
- int count;
+ struct { /* Struct for iterations */
+ int count;
hid_t id;
- } *count_struct=copy_data;
+ } *count_struct = copy_data;
count_struct->count++;
- count_struct->id=new_list_id;
+ count_struct->id = new_list_id;
- return(SUCCEED);
+ return (SUCCEED);
}
static herr_t
test_genprop_cls_cls_cb1(hid_t list_id, void *create_data)
{
- struct { /* Struct for iterations */
- int count;
+ struct { /* Struct for iterations */
+ int count;
hid_t id;
- } *count_struct=create_data;
+ } *count_struct = create_data;
count_struct->count++;
- count_struct->id=list_id;
+ count_struct->id = list_id;
- return(SUCCEED);
+ return (SUCCEED);
}
/****************************************************************
@@ -419,49 +425,54 @@ test_genprop_cls_cls_cb1(hid_t list_id, void *create_data)
static void
test_genprop_class_callback(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t cid2; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- hid_t lid2; /* Generic Property list ID */
- hid_t lid3; /* Generic Property list ID */
- size_t nprops; /* Number of properties in class */
- struct { /* Struct for callbacks */
- int count;
+ hid_t cid1; /* Generic Property class ID */
+ hid_t cid2; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ hid_t lid2; /* Generic Property list ID */
+ hid_t lid3; /* Generic Property list ID */
+ size_t nprops; /* Number of properties in class */
+ struct { /* Struct for callbacks */
+ int count;
hid_t id;
} crt_cb_struct, cpy_cb_struct, cls_cb_struct;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Class Callback Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
- cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, test_genprop_cls_crt_cb1, &crt_cb_struct, test_genprop_cls_cpy_cb1, &cpy_cb_struct, test_genprop_cls_cls_cb1, &cls_cb_struct);
+ cid1 =
+ H5Pcreate_class(H5P_ROOT, CLASS1_NAME, test_genprop_cls_crt_cb1, &crt_cb_struct,
+ test_genprop_cls_cpy_cb1, &cpy_cb_struct, test_genprop_cls_cls_cb1, &cls_cb_struct);
CHECK_I(cid1, "H5Pcreate_class");
/* Insert first property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Insert second property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Insert third property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Check the number of properties in class */
- ret = H5Pget_nprops(cid1,&nprops);
+ ret = H5Pget_nprops(cid1, &nprops);
CHECK_I(ret, "H5Pget_nprops");
VERIFY(nprops, 3, "H5Pget_nprops");
/* Initialize class callback structs */
- crt_cb_struct.count=0;
- crt_cb_struct.id=(-1);
- cpy_cb_struct.count=0;
- cpy_cb_struct.id=(-1);
- cls_cb_struct.count=0;
- cls_cb_struct.id=(-1);
+ crt_cb_struct.count = 0;
+ crt_cb_struct.id = (-1);
+ cpy_cb_struct.count = 0;
+ cpy_cb_struct.id = (-1);
+ cls_cb_struct.count = 0;
+ cls_cb_struct.id = (-1);
/* Create a property list from the class */
lid1 = H5Pcreate(cid1);
@@ -472,7 +483,7 @@ test_genprop_class_callback(void)
VERIFY(crt_cb_struct.id, lid1, "H5Pcreate");
/* Check the number of properties in list */
- ret = H5Pget_nprops(lid1,&nprops);
+ ret = H5Pget_nprops(lid1, &nprops);
CHECK_I(ret, "H5Pget_nprops");
VERIFY(nprops, 3, "H5Pget_nprops");
@@ -485,7 +496,7 @@ test_genprop_class_callback(void)
VERIFY(crt_cb_struct.id, lid2, "H5Pcreate");
/* Check the number of properties in list */
- ret = H5Pget_nprops(lid2,&nprops);
+ ret = H5Pget_nprops(lid2, &nprops);
CHECK_I(ret, "H5Pget_nprops");
VERIFY(nprops, 3, "H5Pget_nprops");
@@ -527,11 +538,14 @@ test_genprop_class_callback(void)
VERIFY(cls_cb_struct.id, lid3, "H5Pclose");
/* Create another new generic class, derived from first class */
- cid2 = H5Pcreate_class(cid1, CLASS2_NAME, test_genprop_cls_crt_cb1, &crt_cb_struct, test_genprop_cls_cpy_cb1, &cpy_cb_struct, test_genprop_cls_cls_cb1, &cls_cb_struct);
+ cid2 =
+ H5Pcreate_class(cid1, CLASS2_NAME, test_genprop_cls_crt_cb1, &crt_cb_struct, test_genprop_cls_cpy_cb1,
+ &cpy_cb_struct, test_genprop_cls_cls_cb1, &cls_cb_struct);
CHECK_I(cid2, "H5Pcreate_class");
/* Insert fourth property into class (with no callbacks) */
- ret = H5Pregister2(cid2, PROP4_NAME, PROP4_SIZE, PROP4_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid2, PROP4_NAME, PROP4_SIZE, PROP4_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Check the number of properties in class */
@@ -598,34 +612,36 @@ test_genprop_class_callback(void)
static void
test_genprop_basic_list(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t cid2; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- size_t nprops; /* Number of properties */
- size_t size; /* Size of property */
- int prop1_value; /* Value for property #1 */
- float prop2_value; /* Value for property #2 */
- herr_t ret; /* Generic return value */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t cid2; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ size_t nprops; /* Number of properties */
+ size_t size; /* Size of property */
+ int prop1_value; /* Value for property #1 */
+ float prop2_value; /* Value for property #2 */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Creation Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
- cid1 = H5Pcreate_class(H5P_ROOT,CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
+ cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Add several properties (w/default values) */
/* Insert first property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Insert second property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Check the number of properties in class */
- ret = H5Pget_nprops(cid1,&nprops);
+ ret = H5Pget_nprops(cid1, &nprops);
CHECK_I(ret, "H5Pget_nprops");
VERIFY(nprops, 2, "H5Pget_nprops");
@@ -638,15 +654,15 @@ test_genprop_basic_list(void)
CHECK_I(cid2, "H5Pget_class");
/* Check that the list's class is correct */
- ret = H5Pequal(cid1,cid2);
+ ret = H5Pequal(cid1, cid2);
VERIFY(ret, 1, "H5Pequal");
/* Check correct "is a" class/list relationship */
- ret = H5Pisa_class(lid1,cid1);
+ ret = H5Pisa_class(lid1, cid1);
VERIFY(ret, 1, "H5Pisa_class");
/* Check "is a" class/list relationship another way */
- ret = H5Pisa_class(lid1,cid2);
+ ret = H5Pisa_class(lid1, cid2);
VERIFY(ret, 1, "H5Pisa_class");
/* Close class */
@@ -654,7 +670,7 @@ test_genprop_basic_list(void)
CHECK_I(ret, "H5Pclose_class");
/* Check the number of properties in list */
- ret = H5Pget_nprops(lid1,&nprops);
+ ret = H5Pget_nprops(lid1, &nprops);
CHECK_I(ret, "H5Pget_nprops");
VERIFY(nprops, 2, "H5Pget_nprops");
@@ -665,24 +681,23 @@ test_genprop_basic_list(void)
VERIFY(ret, 1, "H5Pexist");
/* Check the sizes of the properties */
- ret = H5Pget_size(lid1, PROP1_NAME,&size);
+ ret = H5Pget_size(lid1, PROP1_NAME, &size);
CHECK_I(ret, "H5Pget_size");
VERIFY(size, PROP1_SIZE, "H5Pget_size");
- ret = H5Pget_size(lid1, PROP2_NAME,&size);
+ ret = H5Pget_size(lid1, PROP2_NAME, &size);
CHECK_I(ret, "H5Pget_size");
VERIFY(size, PROP2_SIZE, "H5Pget_size");
/* Check values of properties (set with default values) */
- ret = H5Pget(lid1, PROP1_NAME,&prop1_value);
+ ret = H5Pget(lid1, PROP1_NAME, &prop1_value);
CHECK_I(ret, "H5Pget");
VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget");
- ret = H5Pget(lid1, PROP2_NAME,&prop2_value);
+ ret = H5Pget(lid1, PROP2_NAME, &prop2_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
- if(!FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
- "H5Pget", *PROP2_DEF_VALUE, prop2_value, (int)__LINE__, __FILE__);
-
+ if (!FLT_ABS_EQUAL(prop2_value, *PROP2_DEF_VALUE))
+ HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget",
+ *PROP2_DEF_VALUE, prop2_value, (int)__LINE__, __FILE__);
/* Close list */
ret = H5Pclose(lid1);
@@ -704,30 +719,32 @@ test_genprop_basic_list(void)
static void
test_genprop_basic_list_prop(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- size_t nprops; /* Number of properties */
- int prop1_value; /* Value for property #1 */
- float prop2_value; /* Value for property #2 */
- char prop3_value[10];/* Property #3 value */
- double prop4_value; /* Property #4 value */
- herr_t ret; /* Generic return value */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ size_t nprops; /* Number of properties */
+ int prop1_value; /* Value for property #1 */
+ float prop2_value; /* Value for property #2 */
+ char prop3_value[10]; /* Property #3 value */
+ double prop4_value; /* Property #4 value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Property Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
- cid1 = H5Pcreate_class(H5P_ROOT,CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
+ cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Add several properties (several w/default values) */
/* Insert first property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Insert second property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Create a property list from the class */
@@ -735,7 +752,7 @@ test_genprop_basic_list_prop(void)
CHECK_I(lid1, "H5Pcreate");
/* Check the number of properties in list */
- ret = H5Pget_nprops(lid1,&nprops);
+ ret = H5Pget_nprops(lid1, &nprops);
CHECK_I(ret, "H5Pget_nprops");
VERIFY(nprops, 2, "H5Pget_nprops");
@@ -750,7 +767,7 @@ test_genprop_basic_list_prop(void)
CHECK_I(ret, "H5Pinsert2");
/* Check the number of properties in list */
- ret = H5Pget_nprops(lid1,&nprops);
+ ret = H5Pget_nprops(lid1, &nprops);
CHECK_I(ret, "H5Pget_nprops");
VERIFY(nprops, 4, "H5Pget_nprops");
@@ -765,35 +782,34 @@ test_genprop_basic_list_prop(void)
VERIFY(ret, 1, "H5Pexist");
/* Check values of permanent properties (set with default values) */
- ret = H5Pget(lid1, PROP1_NAME,&prop1_value);
+ ret = H5Pget(lid1, PROP1_NAME, &prop1_value);
CHECK_I(ret, "H5Pget");
VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget");
- ret = H5Pget(lid1, PROP2_NAME,&prop2_value);
+ ret = H5Pget(lid1, PROP2_NAME, &prop2_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
- if(!FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
- "H5Pget", *PROP2_DEF_VALUE, prop2_value, (int)__LINE__, __FILE__);
-
+ if (!FLT_ABS_EQUAL(prop2_value, *PROP2_DEF_VALUE))
+ HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget",
+ *PROP2_DEF_VALUE, prop2_value, (int)__LINE__, __FILE__);
/* Check values of temporary properties (set with regular values) */
- ret = H5Pget(lid1, PROP3_NAME,&prop3_value);
+ ret = H5Pget(lid1, PROP3_NAME, &prop3_value);
CHECK_I(ret, "H5Pget");
- if(HDmemcmp(&prop3_value, PROP3_DEF_VALUE, PROP3_SIZE)!=0)
- TestErrPrintf("Property #3 doesn't match!, line=%d\n",__LINE__);
- ret = H5Pget(lid1, PROP4_NAME,&prop4_value);
+ if (HDmemcmp(&prop3_value, PROP3_DEF_VALUE, PROP3_SIZE) != 0)
+ TestErrPrintf("Property #3 doesn't match!, line=%d\n", __LINE__);
+ ret = H5Pget(lid1, PROP4_NAME, &prop4_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
- if(!FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
- "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
+ if (!FLT_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE))
+ HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget",
+ *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
/* Delete permanent property */
ret = H5Premove(lid1, PROP2_NAME);
CHECK_I(ret, "H5Premove");
/* Check number of properties */
- ret = H5Pget_nprops(lid1,&nprops);
+ ret = H5Pget_nprops(lid1, &nprops);
CHECK_I(ret, "H5Pget_nprops");
VERIFY(nprops, 3, "H5Pget_nprops");
@@ -802,7 +818,7 @@ test_genprop_basic_list_prop(void)
CHECK_I(ret, "H5Premove");
/* Check number of properties */
- ret = H5Pget_nprops(lid1,&nprops);
+ ret = H5Pget_nprops(lid1, &nprops);
CHECK_I(ret, "H5Pget_nprops");
VERIFY(nprops, 2, "H5Pget_nprops");
@@ -813,17 +829,17 @@ test_genprop_basic_list_prop(void)
VERIFY(ret, 1, "H5Pexist");
/* Check values of permanent properties (set with default values) */
- ret = H5Pget(lid1, PROP1_NAME,&prop1_value);
+ ret = H5Pget(lid1, PROP1_NAME, &prop1_value);
CHECK_I(ret, "H5Pget");
VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget");
/* Check values of temporary properties (set with regular values) */
- ret = H5Pget(lid1, PROP4_NAME,&prop4_value);
+ ret = H5Pget(lid1, PROP4_NAME, &prop4_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
- if(!FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
- "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
+ if (!FLT_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE))
+ HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget",
+ *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
/* Close list */
ret = H5Pclose(lid1);
@@ -843,15 +859,15 @@ test_genprop_basic_list_prop(void)
static int
test_genprop_iter2(hid_t id, const char *name, void *iter_data)
{
- struct { /* Struct for iterations */
- int iter_count;
+ struct { /* Struct for iterations */
+ int iter_count;
const char **names;
- } *iter_struct=iter_data;
+ } *iter_struct = iter_data;
/* Shut compiler up */
- id=id;
+ id = id;
- return(HDstrcmp(name,iter_struct->names[iter_struct->iter_count++]));
+ return (HDstrcmp(name, iter_struct->names[iter_struct->iter_count++]));
}
/****************************************************************
@@ -863,37 +879,35 @@ test_genprop_iter2(hid_t id, const char *name, void *iter_data)
static void
test_genprop_list_iter(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- size_t nprops; /* Number of properties */
- int idx; /* Index to start iteration at */
- struct { /* Struct for iterations */
- int iter_count;
+ hid_t cid1; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ size_t nprops; /* Number of properties */
+ int idx; /* Index to start iteration at */
+ struct { /* Struct for iterations */
+ int iter_count;
const char **names;
} iter_struct;
- const char *pnames[4]={ /* Names of properties for iterator */
- PROP3_NAME,
- PROP4_NAME,
- PROP1_NAME,
- PROP2_NAME
- };
- herr_t ret; /* Generic return value */
+ const char *pnames[4] = {/* Names of properties for iterator */
+ PROP3_NAME, PROP4_NAME, PROP1_NAME, PROP2_NAME};
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Generic Property List Iteration Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
- cid1 = H5Pcreate_class(H5P_ROOT,CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
+ cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Add several properties (several w/default values) */
/* Insert first property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Insert second property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Create a property list from the class */
@@ -901,7 +915,7 @@ test_genprop_list_iter(void)
CHECK_I(lid1, "H5Pcreate");
/* Check the number of properties in list */
- ret = H5Pget_nprops(lid1,&nprops);
+ ret = H5Pget_nprops(lid1, &nprops);
CHECK_I(ret, "H5Pget_nprops");
VERIFY(nprops, 2, "H5Pget_nprops");
@@ -916,19 +930,19 @@ test_genprop_list_iter(void)
CHECK_I(ret, "H5Pinsert2");
/* Check the number of properties in list */
- ret = H5Pget_nprops(lid1,&nprops);
+ ret = H5Pget_nprops(lid1, &nprops);
CHECK_I(ret, "H5Pget_nprops");
VERIFY(nprops, 4, "H5Pget_nprops");
/* Iterate over all properties in list */
- iter_struct.iter_count=0;
- iter_struct.names=pnames;
- ret = H5Piterate(lid1,NULL,test_genprop_iter2,&iter_struct);
+ iter_struct.iter_count = 0;
+ iter_struct.names = pnames;
+ ret = H5Piterate(lid1, NULL, test_genprop_iter2, &iter_struct);
VERIFY(ret, 0, "H5Piterate");
/* Iterate over last three properties in list */
- idx=iter_struct.iter_count=1;
- ret = H5Piterate(lid1,&idx,test_genprop_iter2,&iter_struct);
+ idx = iter_struct.iter_count = 1;
+ ret = H5Piterate(lid1, &idx, test_genprop_iter2, &iter_struct);
VERIFY(ret, 0, "H5Piterate");
VERIFY(idx, (int)nprops, "H5Piterate");
@@ -944,30 +958,30 @@ test_genprop_list_iter(void)
typedef struct {
/* Creation information */
- int crt_count;
+ int crt_count;
char *crt_name;
void *crt_value;
/* Set information */
- int set_count;
+ int set_count;
hid_t set_plist_id;
char *set_name;
void *set_value;
/* Get information */
- int get_count;
+ int get_count;
hid_t get_plist_id;
char *get_name;
void *get_value;
/* Delete information */
- int del_count;
+ int del_count;
hid_t del_plist_id;
char *del_name;
void *del_value;
/* Copy information */
- int cop_count;
+ int cop_count;
char *cop_name;
void *cop_value;
@@ -975,15 +989,15 @@ typedef struct {
int cmp_count;
/* Close information */
- int cls_count;
+ int cls_count;
char *cls_name;
void *cls_value;
} prop_cb_info;
/* Global variables for Callback information */
-prop_cb_info prop1_cb_info; /* Callback statistics for property #1 */
-prop_cb_info prop2_cb_info; /* Callback statistics for property #2 */
-prop_cb_info prop3_cb_info; /* Callback statistics for property #3 */
+prop_cb_info prop1_cb_info; /* Callback statistics for property #1 */
+prop_cb_info prop2_cb_info; /* Callback statistics for property #2 */
+prop_cb_info prop3_cb_info; /* Callback statistics for property #3 */
/****************************************************************
**
@@ -993,15 +1007,15 @@ prop_cb_info prop3_cb_info; /* Callback statistics for property #3 */
static herr_t
test_genprop_cls_cpy_cb2(hid_t new_list_id, hid_t H5_ATTR_UNUSED old_list_id, void *create_data)
{
- struct { /* Struct for iterations */
- int count;
+ struct { /* Struct for iterations */
+ int count;
hid_t id;
- } *count_struct=create_data;
+ } *count_struct = create_data;
count_struct->count++;
- count_struct->id=new_list_id;
+ count_struct->id = new_list_id;
- return(SUCCEED);
+ return (SUCCEED);
}
/****************************************************************
@@ -1014,11 +1028,11 @@ test_genprop_prop_crt_cb1(const char *name, size_t size, void *def_value)
{
/* Set the information from the creation call */
prop1_cb_info.crt_count++;
- prop1_cb_info.crt_name=HDstrdup(name);
- prop1_cb_info.crt_value=HDmalloc(size);
- HDmemcpy(prop1_cb_info.crt_value,def_value,size);
+ prop1_cb_info.crt_name = HDstrdup(name);
+ prop1_cb_info.crt_value = HDmalloc(size);
+ HDmemcpy(prop1_cb_info.crt_value, def_value, size);
- return(SUCCEED);
+ return (SUCCEED);
}
/****************************************************************
@@ -1031,14 +1045,14 @@ test_genprop_prop_set_cb1(hid_t plist_id, const char *name, size_t size, void *v
{
/* Set the information from the set call */
prop1_cb_info.set_count++;
- prop1_cb_info.set_plist_id=plist_id;
- if(prop1_cb_info.set_name==NULL)
- prop1_cb_info.set_name=HDstrdup(name);
- if(prop1_cb_info.set_value==NULL)
- prop1_cb_info.set_value=HDmalloc(size);
- HDmemcpy(prop1_cb_info.set_value,value,size);
-
- return(SUCCEED);
+ prop1_cb_info.set_plist_id = plist_id;
+ if (prop1_cb_info.set_name == NULL)
+ prop1_cb_info.set_name = HDstrdup(name);
+ if (prop1_cb_info.set_value == NULL)
+ prop1_cb_info.set_value = HDmalloc(size);
+ HDmemcpy(prop1_cb_info.set_value, value, size);
+
+ return (SUCCEED);
}
/****************************************************************
@@ -1051,14 +1065,14 @@ test_genprop_prop_get_cb1(hid_t plist_id, const char *name, size_t size, void *v
{
/* Set the information from the get call */
prop1_cb_info.get_count++;
- prop1_cb_info.get_plist_id=plist_id;
- if(prop1_cb_info.get_name==NULL)
- prop1_cb_info.get_name=HDstrdup(name);
- if(prop1_cb_info.get_value==NULL)
- prop1_cb_info.get_value=HDmalloc(size);
- HDmemcpy(prop1_cb_info.get_value,value,size);
-
- return(SUCCEED);
+ prop1_cb_info.get_plist_id = plist_id;
+ if (prop1_cb_info.get_name == NULL)
+ prop1_cb_info.get_name = HDstrdup(name);
+ if (prop1_cb_info.get_value == NULL)
+ prop1_cb_info.get_value = HDmalloc(size);
+ HDmemcpy(prop1_cb_info.get_value, value, size);
+
+ return (SUCCEED);
}
/****************************************************************
@@ -1071,13 +1085,13 @@ test_genprop_prop_cop_cb1(const char *name, size_t size, void *value)
{
/* Set the information from the get call */
prop1_cb_info.cop_count++;
- if(prop1_cb_info.cop_name==NULL)
- prop1_cb_info.cop_name=HDstrdup(name);
- if(prop1_cb_info.cop_value==NULL)
- prop1_cb_info.cop_value=HDmalloc(size);
- HDmemcpy(prop1_cb_info.cop_value,value,size);
+ if (prop1_cb_info.cop_name == NULL)
+ prop1_cb_info.cop_name = HDstrdup(name);
+ if (prop1_cb_info.cop_value == NULL)
+ prop1_cb_info.cop_value = HDmalloc(size);
+ HDmemcpy(prop1_cb_info.cop_value, value, size);
- return(SUCCEED);
+ return (SUCCEED);
}
/****************************************************************
@@ -1091,7 +1105,7 @@ test_genprop_prop_cmp_cb1(const void *value1, const void *value2, size_t size)
/* Set the information from the comparison call */
prop1_cb_info.cmp_count++;
- return(HDmemcmp(value1, value2, size));
+ return (HDmemcmp(value1, value2, size));
}
/****************************************************************
@@ -1105,7 +1119,7 @@ test_genprop_prop_cmp_cb3(const void *value1, const void *value2, size_t size)
/* Set the information from the comparison call */
prop3_cb_info.cmp_count++;
- return(HDmemcmp(value1, value2, size));
+ return (HDmemcmp(value1, value2, size));
}
/****************************************************************
@@ -1118,13 +1132,13 @@ test_genprop_prop_cls_cb1(const char *name, size_t size, void *value)
{
/* Set the information from the close call */
prop1_cb_info.cls_count++;
- if(prop1_cb_info.cls_name==NULL)
- prop1_cb_info.cls_name=HDstrdup(name);
- if(prop1_cb_info.cls_value==NULL)
- prop1_cb_info.cls_value=HDmalloc(size);
- HDmemcpy(prop1_cb_info.cls_value,value,size);
+ if (prop1_cb_info.cls_name == NULL)
+ prop1_cb_info.cls_name = HDstrdup(name);
+ if (prop1_cb_info.cls_value == NULL)
+ prop1_cb_info.cls_value = HDmalloc(size);
+ HDmemcpy(prop1_cb_info.cls_value, value, size);
- return(SUCCEED);
+ return (SUCCEED);
}
/****************************************************************
@@ -1137,12 +1151,12 @@ test_genprop_prop_del_cb2(hid_t plist_id, const char *name, size_t size, void *v
{
/* Set the information from the delete call */
prop2_cb_info.del_count++;
- prop2_cb_info.del_plist_id=plist_id;
- prop2_cb_info.del_name=HDstrdup(name);
- prop2_cb_info.del_value=HDmalloc(size);
- HDmemcpy(prop2_cb_info.del_value,value,size);
+ prop2_cb_info.del_plist_id = plist_id;
+ prop2_cb_info.del_name = HDstrdup(name);
+ prop2_cb_info.del_value = HDmalloc(size);
+ HDmemcpy(prop2_cb_info.del_value, value, size);
- return(SUCCEED);
+ return (SUCCEED);
}
/****************************************************************
@@ -1154,58 +1168,64 @@ test_genprop_prop_del_cb2(hid_t plist_id, const char *name, size_t size, void *v
static void
test_genprop_list_callback(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- hid_t lid2; /* 2nd Generic Property list ID */
- size_t nprops; /* Number of properties in class */
- int prop1_value; /* Value for property #1 */
- int prop1_new_value=20; /* Property #1 new value */
- float prop2_value; /* Value for property #2 */
- char prop3_value[10];/* Property #3 value */
- char prop3_new_value[10]="10 chairs"; /* Property #3 new value */
- double prop4_value; /* Property #4 value */
- struct { /* Struct for callbacks */
- int count;
+ hid_t cid1; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ hid_t lid2; /* 2nd Generic Property list ID */
+ size_t nprops; /* Number of properties in class */
+ int prop1_value; /* Value for property #1 */
+ int prop1_new_value = 20; /* Property #1 new value */
+ float prop2_value; /* Value for property #2 */
+ char prop3_value[10]; /* Property #3 value */
+ char prop3_new_value[10] = "10 chairs"; /* Property #3 new value */
+ double prop4_value; /* Property #4 value */
+ struct { /* Struct for callbacks */
+ int count;
hid_t id;
} cop_cb_struct;
- herr_t ret; /* Generic return value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Property Callback Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
- cid1 = H5Pcreate_class(H5P_ROOT,CLASS1_NAME, NULL, NULL,test_genprop_cls_cpy_cb2,&cop_cb_struct,NULL, NULL);
+ cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, NULL, NULL, test_genprop_cls_cpy_cb2, &cop_cb_struct, NULL,
+ NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Insert first property into class (with callbacks) */
- ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE,test_genprop_prop_crt_cb1,test_genprop_prop_set_cb1,test_genprop_prop_get_cb1,NULL,test_genprop_prop_cop_cb1,test_genprop_prop_cmp_cb1,test_genprop_prop_cls_cb1);
+ ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, test_genprop_prop_crt_cb1,
+ test_genprop_prop_set_cb1, test_genprop_prop_get_cb1, NULL, test_genprop_prop_cop_cb1,
+ test_genprop_prop_cmp_cb1, test_genprop_prop_cls_cb1);
CHECK_I(ret, "H5Pregister2");
/* Insert second property into class (with only delete callback) */
- ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL,test_genprop_prop_del_cb2,NULL, NULL, NULL);
+ ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL,
+ test_genprop_prop_del_cb2, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Insert third property into class (with only compare callback) */
- ret = H5Pregister2(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, test_genprop_prop_cmp_cb3, NULL);
+ ret = H5Pregister2(cid1, PROP3_NAME, PROP3_SIZE, PROP3_DEF_VALUE, NULL, NULL, NULL, NULL, NULL,
+ test_genprop_prop_cmp_cb3, NULL);
CHECK_I(ret, "H5Pregister2");
/* Insert fourth property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP4_NAME, PROP4_SIZE, PROP4_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP4_NAME, PROP4_SIZE, PROP4_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Check the number of properties in class */
- ret = H5Pget_nprops(cid1,&nprops);
+ ret = H5Pget_nprops(cid1, &nprops);
CHECK_I(ret, "H5Pget_nprops");
VERIFY(nprops, 4, "H5Pget_nprops");
/* Initialize class callback structs */
- cop_cb_struct.count=0;
- cop_cb_struct.id=(-1);
+ cop_cb_struct.count = 0;
+ cop_cb_struct.id = (-1);
/* Initialize callback information for properties tracked */
- HDmemset(&prop1_cb_info,0,sizeof(prop_cb_info));
- HDmemset(&prop2_cb_info,0,sizeof(prop_cb_info));
- HDmemset(&prop3_cb_info,0,sizeof(prop_cb_info));
+ HDmemset(&prop1_cb_info, 0, sizeof(prop_cb_info));
+ HDmemset(&prop2_cb_info, 0, sizeof(prop_cb_info));
+ HDmemset(&prop3_cb_info, 0, sizeof(prop_cb_info));
/* Create a property list from the class */
lid1 = H5Pcreate(cid1);
@@ -1220,66 +1240,66 @@ test_genprop_list_callback(void)
/* Verify creation callback information for properties tracked */
VERIFY(prop1_cb_info.crt_count, 1, "H5Pcreate");
- if(HDstrcmp(prop1_cb_info.crt_name, PROP1_NAME)!=0)
- TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__);
- if(HDmemcmp(prop1_cb_info.crt_value, PROP1_DEF_VALUE, PROP1_SIZE)!=0)
- TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__);
+ if (HDstrcmp(prop1_cb_info.crt_name, PROP1_NAME) != 0)
+ TestErrPrintf("Property #1 name doesn't match!, line=%d\n", __LINE__);
+ if (HDmemcmp(prop1_cb_info.crt_value, PROP1_DEF_VALUE, PROP1_SIZE) != 0)
+ TestErrPrintf("Property #1 value doesn't match!, line=%d\n", __LINE__);
/* Check values of permanent properties (set with default values) */
- ret = H5Pget(lid1, PROP1_NAME,&prop1_value);
+ ret = H5Pget(lid1, PROP1_NAME, &prop1_value);
CHECK_I(ret, "H5Pget");
VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget");
/* The compare callback should have been called once (to check if the get
* callback modified the value) */
VERIFY(prop1_cb_info.cmp_count, 2, "H5Pget");
- ret = H5Pget(lid1, PROP2_NAME,&prop2_value);
+ ret = H5Pget(lid1, PROP2_NAME, &prop2_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
- if(!FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
- "H5Pget", *PROP2_DEF_VALUE, prop2_value, (int)__LINE__, __FILE__);
+ if (!FLT_ABS_EQUAL(prop2_value, *PROP2_DEF_VALUE))
+ HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget",
+ *PROP2_DEF_VALUE, prop2_value, (int)__LINE__, __FILE__);
/* Check values of temporary properties (set with regular values) */
- ret = H5Pget(lid1, PROP3_NAME,&prop3_value);
+ ret = H5Pget(lid1, PROP3_NAME, &prop3_value);
CHECK_I(ret, "H5Pget");
- if(HDmemcmp(&prop3_value, PROP3_DEF_VALUE, PROP3_SIZE)!=0)
- TestErrPrintf("Property #3 doesn't match!, line=%d\n",__LINE__);
+ if (HDmemcmp(&prop3_value, PROP3_DEF_VALUE, PROP3_SIZE) != 0)
+ TestErrPrintf("Property #3 doesn't match!, line=%d\n", __LINE__);
/* The compare callback should not have been called, as there is no get
* callback for this property */
VERIFY(prop3_cb_info.cmp_count, 0, "H5Pget");
- ret = H5Pget(lid1, PROP4_NAME,&prop4_value);
+ ret = H5Pget(lid1, PROP4_NAME, &prop4_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
- if(!FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE))
- printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
- "H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
+ if (!FLT_ABS_EQUAL(prop4_value, *PROP4_DEF_VALUE))
+ HDprintf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n", "H5Pget",
+ *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
/* Verify get callback information for properties tracked */
VERIFY(prop1_cb_info.get_count, 1, "H5Pget");
VERIFY(prop1_cb_info.get_plist_id, lid1, "H5Pget");
- if(HDstrcmp(prop1_cb_info.get_name, PROP1_NAME)!=0)
- TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__);
- if(HDmemcmp(prop1_cb_info.get_value, PROP1_DEF_VALUE, PROP1_SIZE)!=0)
- TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__);
+ if (HDstrcmp(prop1_cb_info.get_name, PROP1_NAME) != 0)
+ TestErrPrintf("Property #1 name doesn't match!, line=%d\n", __LINE__);
+ if (HDmemcmp(prop1_cb_info.get_value, PROP1_DEF_VALUE, PROP1_SIZE) != 0)
+ TestErrPrintf("Property #1 value doesn't match!, line=%d\n", __LINE__);
/* Set value of property #1 to different value */
- ret = H5Pset(lid1, PROP1_NAME,&prop1_new_value);
+ ret = H5Pset(lid1, PROP1_NAME, &prop1_new_value);
CHECK_I(ret, "H5Pset");
/* Verify set callback information for properties tracked */
VERIFY(prop1_cb_info.set_count, 1, "H5Pset");
VERIFY(prop1_cb_info.set_plist_id, lid1, "H5Pset");
- if(HDstrcmp(prop1_cb_info.set_name, PROP1_NAME)!=0)
- TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__);
- if(HDmemcmp(prop1_cb_info.set_value,&prop1_new_value, PROP1_SIZE)!=0)
- TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__);
+ if (HDstrcmp(prop1_cb_info.set_name, PROP1_NAME) != 0)
+ TestErrPrintf("Property #1 name doesn't match!, line=%d\n", __LINE__);
+ if (HDmemcmp(prop1_cb_info.set_value, &prop1_new_value, PROP1_SIZE) != 0)
+ TestErrPrintf("Property #1 value doesn't match!, line=%d\n", __LINE__);
/* The compare callback should have been called once (to check if the new
* value needed to be copied onto the property list) */
VERIFY(prop1_cb_info.cmp_count, 3, "H5Pset");
/* Set value of property #3 to different value */
- ret = H5Pset(lid1, PROP3_NAME,prop3_new_value);
+ ret = H5Pset(lid1, PROP3_NAME, prop3_new_value);
CHECK_I(ret, "H5Pset");
/* The compare callback should have been called once (to check if the new
@@ -1287,17 +1307,17 @@ test_genprop_list_callback(void)
VERIFY(prop3_cb_info.cmp_count, 1, "H5Pset");
/* Check new value of tracked properties */
- ret = H5Pget(lid1, PROP1_NAME,&prop1_value);
+ ret = H5Pget(lid1, PROP1_NAME, &prop1_value);
CHECK_I(ret, "H5Pget");
VERIFY(prop1_value, prop1_new_value, "H5Pget");
/* Verify get callback information again for properties tracked */
VERIFY(prop1_cb_info.get_count, 2, "H5Pget");
VERIFY(prop1_cb_info.get_plist_id, lid1, "H5Pget");
- if(HDstrcmp(prop1_cb_info.get_name, PROP1_NAME)!=0)
- TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__);
- if(HDmemcmp(prop1_cb_info.get_value,&prop1_new_value, PROP1_SIZE)!=0)
- TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__);
+ if (HDstrcmp(prop1_cb_info.get_name, PROP1_NAME) != 0)
+ TestErrPrintf("Property #1 name doesn't match!, line=%d\n", __LINE__);
+ if (HDmemcmp(prop1_cb_info.get_value, &prop1_new_value, PROP1_SIZE) != 0)
+ TestErrPrintf("Property #1 value doesn't match!, line=%d\n", __LINE__);
/* Delete property #2 */
ret = H5Premove(lid1, PROP2_NAME);
@@ -1306,10 +1326,10 @@ test_genprop_list_callback(void)
/* Verify delete callback information for properties tracked */
VERIFY(prop2_cb_info.del_count, 1, "H5Premove");
VERIFY(prop2_cb_info.del_plist_id, lid1, "H5Premove");
- if(HDstrcmp(prop2_cb_info.del_name, PROP2_NAME)!=0)
- TestErrPrintf("Property #2 name doesn't match!, line=%d\n",__LINE__);
- if(HDmemcmp(prop2_cb_info.del_value, PROP2_DEF_VALUE, PROP2_SIZE)!=0)
- TestErrPrintf("Property #2 value doesn't match!, line=%d\n",__LINE__);
+ if (HDstrcmp(prop2_cb_info.del_name, PROP2_NAME) != 0)
+ TestErrPrintf("Property #2 name doesn't match!, line=%d\n", __LINE__);
+ if (HDmemcmp(prop2_cb_info.del_value, PROP2_DEF_VALUE, PROP2_SIZE) != 0)
+ TestErrPrintf("Property #2 value doesn't match!, line=%d\n", __LINE__);
/* Copy first list */
lid2 = H5Pcopy(lid1);
@@ -1317,17 +1337,17 @@ test_genprop_list_callback(void)
/* Verify copy callback information for properties tracked */
VERIFY(prop1_cb_info.cop_count, 1, "H5Pcopy");
- if(HDstrcmp(prop1_cb_info.cop_name, PROP1_NAME)!=0)
- TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__);
- if(HDmemcmp(prop1_cb_info.cop_value,&prop1_new_value, PROP1_SIZE)!=0)
- TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__);
+ if (HDstrcmp(prop1_cb_info.cop_name, PROP1_NAME) != 0)
+ TestErrPrintf("Property #1 name doesn't match!, line=%d\n", __LINE__);
+ if (HDmemcmp(prop1_cb_info.cop_value, &prop1_new_value, PROP1_SIZE) != 0)
+ TestErrPrintf("Property #1 value doesn't match!, line=%d\n", __LINE__);
/* Verify that the class creation callback occurred */
VERIFY(cop_cb_struct.count, 1, "H5Pcopy");
VERIFY(cop_cb_struct.id, lid2, "H5Pcopy");
/* Compare the two lists */
- ret = H5Pequal(lid1,lid2);
+ ret = H5Pequal(lid1, lid2);
VERIFY(ret, 1, "H5Pequal");
/* Verify compare callback information for properties tracked */
@@ -1340,10 +1360,10 @@ test_genprop_list_callback(void)
/* Verify close callback information for properties tracked */
VERIFY(prop1_cb_info.cls_count, 1, "H5Pclose");
- if(HDstrcmp(prop1_cb_info.cls_name, PROP1_NAME)!=0)
- TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__);
- if(HDmemcmp(prop1_cb_info.cls_value,&prop1_new_value, PROP1_SIZE)!=0)
- TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__);
+ if (HDstrcmp(prop1_cb_info.cls_name, PROP1_NAME) != 0)
+ TestErrPrintf("Property #1 name doesn't match!, line=%d\n", __LINE__);
+ if (HDmemcmp(prop1_cb_info.cls_value, &prop1_new_value, PROP1_SIZE) != 0)
+ TestErrPrintf("Property #1 value doesn't match!, line=%d\n", __LINE__);
/* Close second list */
ret = H5Pclose(lid2);
@@ -1381,12 +1401,12 @@ test_genprop_list_callback(void)
static void
test_genprop_list_addprop(void)
{
- hid_t fid; /* File ID */
- hid_t did; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t pid; /* Property List ID */
- int prop1_value; /* Value for property #1 */
- herr_t ret; /* Generic return value */
+ hid_t fid; /* File ID */
+ hid_t did; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t pid; /* Property List ID */
+ int prop1_value; /* Value for property #1 */
+ herr_t ret; /* Generic return value */
/* Create file */
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -1409,7 +1429,7 @@ test_genprop_list_addprop(void)
VERIFY(ret, 1, "H5Pexist");
/* Check values of property (set with default value) */
- ret = H5Pget(pid, PROP1_NAME,&prop1_value);
+ ret = H5Pget(pid, PROP1_NAME, &prop1_value);
CHECK_I(ret, "H5Pget");
VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget");
@@ -1455,13 +1475,13 @@ test_genprop_list_addprop(void)
static void
test_genprop_class_addprop(void)
{
- hid_t fid; /* File ID */
- hid_t did; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t cid; /* Property Class ID */
- hid_t pid; /* Property List ID */
- int prop1_value; /* Value for property #1 */
- herr_t ret; /* Generic return value */
+ hid_t fid; /* File ID */
+ hid_t did; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t cid; /* Property Class ID */
+ hid_t pid; /* Property List ID */
+ int prop1_value; /* Value for property #1 */
+ herr_t ret; /* Generic return value */
/* Create file */
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -1480,7 +1500,8 @@ test_genprop_class_addprop(void)
VERIFY(ret, 1, "H5Pexist");
/* Insert first property into class (with no callbacks) */
- ret = H5Pregister2(cid, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Check existence of an original property */
@@ -1509,7 +1530,8 @@ test_genprop_class_addprop(void)
VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget");
/* Insert second property into class (with no callbacks) */
- ret = H5Pregister2(cid, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Check existence of an original property (in class) */
@@ -1582,8 +1604,8 @@ test_genprop_class_addprop(void)
static void
test_genprop_list_add_remove_prop(void)
{
- hid_t pid; /* Property List ID */
- herr_t ret; /* Generic return value */
+ hid_t pid; /* Property List ID */
+ herr_t ret; /* Generic return value */
/* Create a dataset creation property list */
pid = H5Pcreate(H5P_DATASET_CREATE);
@@ -1620,25 +1642,27 @@ test_genprop_list_add_remove_prop(void)
static void
test_genprop_equal(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t lid1; /* Generic Property list ID */
- hid_t lid2; /* Generic Property list ID */
- int prop1_new_value = 20; /* Property #1 new value */
- herr_t ret; /* Generic return value */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property list ID */
+ hid_t lid2; /* Generic Property list ID */
+ int prop1_new_value = 20; /* Property #1 new value */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Generic Property List Equal Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
- cid1 = H5Pcreate_class(H5P_ROOT,CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
+ cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Insert first property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Insert second property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Create a property list from the class */
@@ -1769,50 +1793,52 @@ test_genprop_equal(void)
static void
test_genprop_path(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t cid2; /* Generic Property class ID */
- hid_t cid3; /* Generic Property class ID */
- char *path; /* Class path */
- herr_t ret; /* Generic return value */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t cid2; /* Generic Property class ID */
+ hid_t cid3; /* Generic Property class ID */
+ char * path; /* Class path */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Generic Property List Class Path Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
- cid1 = H5Pcreate_class(H5P_ROOT,CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
+ cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Insert first property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Get full path for first class */
- path=H5P_get_class_path_test(cid1);
+ path = H5P_get_class_path_test(cid1);
CHECK_PTR(path, "H5P_get_class_path_test");
- if(HDstrcmp(path,CLASS1_PATH)!=0)
- TestErrPrintf("Class names don't match!, path=%s, CLASS1_PATH=%s\n",path,CLASS1_PATH);
+ if (HDstrcmp(path, CLASS1_PATH) != 0)
+ TestErrPrintf("Class names don't match!, path=%s, CLASS1_PATH=%s\n", path, CLASS1_PATH);
HDfree(path);
/* Create another new generic class, derived from first class */
- cid2 = H5Pcreate_class(cid1,CLASS2_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
+ cid2 = H5Pcreate_class(cid1, CLASS2_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(cid2, "H5Pcreate_class");
/* Insert second property into class (with no callbacks) */
- ret = H5Pregister2(cid2, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid2, PROP2_NAME, PROP2_SIZE, PROP2_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Get full path for second class */
- path=H5P_get_class_path_test(cid2);
+ path = H5P_get_class_path_test(cid2);
CHECK_PTR(path, "H5P_get_class_path_test");
- if(HDstrcmp(path,CLASS2_PATH)!=0)
- TestErrPrintf("Class names don't match!, path=%s, CLASS2_PATH=%s\n",path,CLASS2_PATH);
+ if (HDstrcmp(path, CLASS2_PATH) != 0)
+ TestErrPrintf("Class names don't match!, path=%s, CLASS2_PATH=%s\n", path, CLASS2_PATH);
/* Open a copy of the class with the path name */
cid3 = H5P_open_class_path_test(path);
CHECK_I(cid3, "H5Popen_class_path");
/* Check that the classes are equal */
- ret = H5Pequal(cid2,cid3);
+ ret = H5Pequal(cid2, cid3);
VERIFY(ret, 1, "H5Pequal");
/* Release the path string */
@@ -1841,20 +1867,21 @@ test_genprop_path(void)
static void
test_genprop_refcount(void)
{
- hid_t cid1; /* Generic Property class ID */
- hid_t lid1; /* Generic Property class ID */
- char *name; /* Name of class */
- herr_t ret; /* Generic return value */
+ hid_t cid1; /* Generic Property class ID */
+ hid_t lid1; /* Generic Property class ID */
+ char * name; /* Name of class */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Generic Property List Reference Count Functionality\n"));
/* Create a new generic class, derived from the root of the class hierarchy */
- cid1 = H5Pcreate_class(H5P_ROOT,CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
+ cid1 = H5Pcreate_class(H5P_ROOT, CLASS1_NAME, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(cid1, "H5Pcreate_class");
/* Insert first property into class (with no callbacks) */
- ret = H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ ret =
+ H5Pregister2(cid1, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
CHECK_I(ret, "H5Pregister2");
/* Create a new generic list, derived from the root of the class hierarchy */
@@ -1864,8 +1891,8 @@ test_genprop_refcount(void)
/* Check class name */
name = H5Pget_class_name(cid1);
CHECK_PTR(name, "H5Pget_class_name");
- if(HDstrcmp(name,CLASS1_NAME)!=0)
- TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n",name,CLASS1_NAME);
+ if (HDstrcmp(name, CLASS1_NAME) != 0)
+ TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n", name, CLASS1_NAME);
H5free_memory(name);
/* Close class */
@@ -1877,14 +1904,14 @@ test_genprop_refcount(void)
CHECK_I(cid1, "H5Pget_class");
/* Check correct "is a" class/list relationship */
- ret = H5Pisa_class(lid1,cid1);
+ ret = H5Pisa_class(lid1, cid1);
VERIFY(ret, 1, "H5Pisa_class");
/* Check class name */
name = H5Pget_class_name(cid1);
CHECK_PTR(name, "H5Pget_class_name");
- if(HDstrcmp(name,CLASS1_NAME)!=0)
- TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n",name,CLASS1_NAME);
+ if (HDstrcmp(name, CLASS1_NAME) != 0)
+ TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n", name, CLASS1_NAME);
H5free_memory(name);
/* Close list */
@@ -1894,8 +1921,8 @@ test_genprop_refcount(void)
/* Check class name */
name = H5Pget_class_name(cid1);
CHECK_PTR(name, "H5Pget_class_name");
- if(HDstrcmp(name,CLASS1_NAME)!=0)
- TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n",name,CLASS1_NAME);
+ if (HDstrcmp(name, CLASS1_NAME) != 0)
+ TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n", name, CLASS1_NAME);
H5free_memory(name);
/* Close class */
@@ -1914,10 +1941,10 @@ test_genprop_refcount(void)
static void
test_genprop_deprec_class(void)
{
- hid_t cid1; /* Generic Property class ID */
- size_t size; /* Size of property */
- size_t nprops; /* Number of properties in class */
- herr_t ret; /* Generic return value */
+ hid_t cid1; /* Generic Property class ID */
+ size_t size; /* Size of property */
+ size_t nprops; /* Number of properties in class */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Deprecated Generic Property List Functions\n"));
@@ -2042,12 +2069,12 @@ test_genprop_deprec_class(void)
static void
test_genprop_deprec_list(void)
{
- hid_t fid; /* File ID */
- hid_t did; /* Dataset ID */
- hid_t sid; /* Dataspace ID */
- hid_t pid; /* Property List ID */
- int prop1_value; /* Value for property #1 */
- herr_t ret; /* Generic return value */
+ hid_t fid; /* File ID */
+ hid_t did; /* Dataset ID */
+ hid_t sid; /* Dataspace ID */
+ hid_t pid; /* Property List ID */
+ int prop1_value; /* Value for property #1 */
+ herr_t ret; /* Generic return value */
/* Create file */
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -2070,7 +2097,7 @@ test_genprop_deprec_list(void)
VERIFY(ret, 1, "H5Pexist");
/* Check values of property (set with default value) */
- ret = H5Pget(pid, PROP1_NAME,&prop1_value);
+ ret = H5Pget(pid, PROP1_NAME, &prop1_value);
CHECK_I(ret, "H5Pget");
VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget");
@@ -2117,33 +2144,33 @@ test_genprop(void)
MESSAGE(5, ("Testing Generic Properties\n"));
/* These tests use the same file... */
- test_genprop_basic_class(); /* Test basic code for creating a generic class */
+ test_genprop_basic_class(); /* Test basic code for creating a generic class */
test_genprop_basic_class_prop(); /* Test basic code for adding properties to a generic class */
- test_genprop_class_iter(); /* Test code for iterating over properties in a generic class */
- test_genprop_class_callback(); /* Test code for property class callbacks */
+ test_genprop_class_iter(); /* Test code for iterating over properties in a generic class */
+ test_genprop_class_callback(); /* Test code for property class callbacks */
- test_genprop_basic_list(); /* Test basic code for creating a generic property list */
+ test_genprop_basic_list(); /* Test basic code for creating a generic property list */
test_genprop_basic_list_prop(); /* Test basic code for adding properties to a generic property list */
- test_genprop_list_iter(); /* Test basic code for iterating over properties in a generic property list */
- test_genprop_list_callback(); /* Test code for property list callbacks */
+ test_genprop_list_iter(); /* Test basic code for iterating over properties in a generic property list */
+ test_genprop_list_callback(); /* Test code for property list callbacks */
- test_genprop_list_addprop(); /* Test adding properties to HDF5 property list */
- test_genprop_class_addprop(); /* Test adding properties to HDF5 property class */
+ test_genprop_list_addprop(); /* Test adding properties to HDF5 property list */
+ test_genprop_class_addprop(); /* Test adding properties to HDF5 property class */
- test_genprop_list_add_remove_prop(); /* Test adding and removing the same property several times to HDF5 property list */
+ test_genprop_list_add_remove_prop(); /* Test adding and removing the same property several times to HDF5
+ property list */
- test_genprop_equal(); /* Tests for more H5Pequal verification */
- test_genprop_path(); /* Tests for class path verification */
- test_genprop_refcount(); /* Tests for class reference counting */
+ test_genprop_equal(); /* Tests for more H5Pequal verification */
+ test_genprop_path(); /* Tests for class path verification */
+ test_genprop_refcount(); /* Tests for class reference counting */
#ifndef H5_NO_DEPRECATED_SYMBOLS
- test_genprop_deprec_class(); /* Tests for deprecated routines */
- test_genprop_deprec_list(); /* Tests for deprecated routines */
-#endif /* H5_NO_DEPRECATED_SYMBOLS */
+ test_genprop_deprec_class(); /* Tests for deprecated routines */
+ test_genprop_deprec_list(); /* Tests for deprecated routines */
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
-} /* test_genprop() */
+} /* test_genprop() */
-
/*-------------------------------------------------------------------------
* Function: cleanup_genprop
*
@@ -2163,4 +2190,3 @@ cleanup_genprop(void)
{
remove(FILENAME);
}
-