diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2021-02-08 16:56:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-08 16:56:16 (GMT) |
commit | 22c67ff6570f16050f0a5654cf1c84df917bb598 (patch) | |
tree | 38fb63aa498b250c2543fe7e22a511706de96a42 /test/trefer.c | |
parent | 551f15f8ae02ca9c995619b216121081eb07633e (diff) | |
download | hdf5-22c67ff6570f16050f0a5654cf1c84df917bb598.zip hdf5-22c67ff6570f16050f0a5654cf1c84df917bb598.tar.gz hdf5-22c67ff6570f16050f0a5654cf1c84df917bb598.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/trefer.c')
-rw-r--r-- | test/trefer.c | 642 |
1 files changed, 336 insertions, 306 deletions
diff --git a/test/trefer.c b/test/trefer.c index d5a1bb8..d7f5f88 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -6,39 +6,37 @@ * 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: trefer -* -* Test the Reference functionality -* -*************************************************************/ + * + * Test program: trefer + * + * Test the Reference functionality + * + *************************************************************/ #include "testhdf5.h" -#include "hdf5.h" - -#define FILE1 "trefer1.h5" -#define FILE2 "trefer2.h5" -#define FILE3 "trefer3.h5" +#define FILE1 "trefer1.h5" +#define FILE2 "trefer2.h5" +#define FILE3 "trefer3.h5" /* 1-D dataset with fixed dimensions */ -#define SPACE1_RANK 1 -#define SPACE1_DIM1 4 +#define SPACE1_RANK 1 +#define SPACE1_DIM1 4 /* 2-D dataset with fixed dimensions */ -#define SPACE2_RANK 2 -#define SPACE2_DIM1 10 -#define SPACE2_DIM2 10 +#define SPACE2_RANK 2 +#define SPACE2_DIM1 10 +#define SPACE2_DIM2 10 /* Larger 1-D dataset with fixed dimensions */ -#define SPACE3_RANK 1 -#define SPACE3_DIM1 100 +#define SPACE3_RANK 1 +#define SPACE3_DIM1 100 /* Element selection information */ #define POINT1_NPOINTS 10 @@ -47,16 +45,15 @@ typedef struct s1_t { unsigned int a; unsigned int b; - float c; + float c; } s1_t; -#define GROUPNAME "/group" -#define GROUPNAME2 "group2" -#define GROUPNAME3 "group3" -#define DSETNAME "/dset" -#define DSETNAME2 "dset2" -#define NAME_SIZE 16 - +#define GROUPNAME "/group" +#define GROUPNAME2 "group2" +#define GROUPNAME3 "group3" +#define DSETNAME "/dset" +#define DSETNAME2 "dset2" +#define NAME_SIZE 16 /**************************************************************** ** @@ -67,21 +64,22 @@ typedef struct s1_t { static void test_reference_params(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset, /* Dataset ID */ - dset2; /* Dereferenced dataset ID */ - hid_t group; /* Group ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Datatype ID */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, /* Dataset ID */ + dset2; /* Dereferenced dataset ID */ + hid_t group; /* Group ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ hsize_t dims1[] = {SPACE1_DIM1}; - hobj_ref_t *wbuf, /* buffer to write to disk */ - *rbuf, /* buffer read from disk */ - *tbuf; /* temp. buffer read from disk */ - unsigned *tu32; /* Temporary pointer to uint32 data */ - int i; /* counting variables */ + hobj_ref_t *wbuf, /* buffer to write to disk */ + *rbuf, /* buffer read from disk */ + *tbuf; /* temp. buffer read from disk */ + unsigned * tu32; /* Temporary pointer to uint32 data */ + int i; /* counting variables */ const char *write_comment = "Foo!"; /* Comments for group */ - herr_t ret; /* Generic return value */ - size_t name_size; /* Size of reference name */ + hid_t ret_id; /* Generic hid_t return value */ + ssize_t name_size; /* Size of reference name */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Reference Parameters\n")); @@ -111,8 +109,8 @@ test_reference_params(void) dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(dataset, FAIL, "H5Dcreate2"); - for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++) - *tu32++=i*3; + for (tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++) + *tu32++ = (unsigned)i * 3; /* Write selection to disk */ ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf); @@ -135,13 +133,13 @@ test_reference_params(void) CHECK(tid1, FAIL, "H5Tcreate"); /* Insert fields */ - ret = H5Tinsert(tid1, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT); + ret = H5Tinsert(tid1, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT); CHECK(ret, FAIL, "H5Tinsert"); - ret = H5Tinsert(tid1, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT); + ret = H5Tinsert(tid1, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT); CHECK(ret, FAIL, "H5Tinsert"); - ret = H5Tinsert(tid1, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT); + ret = H5Tinsert(tid1, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT); CHECK(ret, FAIL, "H5Tinsert"); /* Save datatype for later */ @@ -201,12 +199,12 @@ test_reference_params(void) VERIFY(name_size, FAIL, "H5Rget_name type"); /* Test parameters to H5Rget_region */ - ret = H5Rget_region((hid_t)-1, H5R_OBJECT, &rbuf[0]); - VERIFY(ret, FAIL, "H5Rget_region loc_id"); - ret = H5Rget_region(fid1, H5R_OBJECT, NULL); - VERIFY(ret, FAIL, "H5Rget_region ref"); - ret = H5Rget_region(fid1, H5R_OBJECT, &rbuf[0]); - VERIFY(ret, FAIL, "H5Rget_region type"); + ret_id = H5Rget_region((hid_t)-1, H5R_OBJECT, &rbuf[0]); + VERIFY(ret_id, FAIL, "H5Rget_region loc_id"); + ret_id = H5Rget_region(fid1, H5R_OBJECT, NULL); + VERIFY(ret_id, FAIL, "H5Rget_region ref"); + ret_id = H5Rget_region(fid1, H5R_OBJECT, &rbuf[0]); + VERIFY(ret_id, FAIL, "H5Rget_region type"); /* Close disk dataspace */ ret = H5Sclose(sid1); @@ -224,7 +222,7 @@ test_reference_params(void) HDfree(wbuf); HDfree(rbuf); HDfree(tbuf); -} /* test_reference_obj() */ +} /* test_reference_obj() */ /**************************************************************** ** @@ -235,23 +233,25 @@ test_reference_params(void) static void test_reference_obj(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset, /* Dataset ID */ - dset2; /* Dereferenced dataset ID */ - hid_t group; /* Group ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Datatype ID */ - hsize_t dims1[] = {SPACE1_DIM1}; - hobj_ref_t *wbuf, /* buffer to write to disk */ - *rbuf, /* buffer read from disk */ - *tbuf; /* temp. buffer read from disk */ - hobj_ref_t nvrbuf[3]={0,101,1000000000}; /* buffer with non-valid refs */ - unsigned *tu32; /* Temporary pointer to uint32 data */ - int i, j; /* counting variables */ - const char *write_comment="Foo!"; /* Comments for group */ - char read_comment[10]; - H5O_type_t obj_type; /* Object type */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, /* Dataset ID */ + dset2; /* Dereferenced dataset ID */ + hid_t group; /* Group ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ + hsize_t dims1[] = {SPACE1_DIM1}; + hid_t dapl_id; /* Dataset access property list */ + hobj_ref_t *wbuf, /* buffer to write to disk */ + *rbuf, /* buffer read from disk */ + *tbuf; /* temp. buffer read from disk */ + hobj_ref_t nvrbuf[3] = {0, 101, 1000000000}; /* buffer with non-valid refs */ + unsigned * tu32; /* Temporary pointer to uint32 data */ + int i, j; /* counting variables */ + const char *write_comment = "Foo!"; /* Comments for group */ + char read_comment[10]; + H5O_type_t obj_type; /* Object type */ + ssize_t size; /* Comment length */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Object Reference Functions\n")); @@ -281,8 +281,8 @@ test_reference_obj(void) dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(dataset, FAIL, "H5Dcreate2"); - for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++) - *tu32++=i*3; + for (tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++) + *tu32++ = (unsigned)i * 3; /* Write selection to disk */ ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf); @@ -305,13 +305,13 @@ test_reference_obj(void) CHECK(tid1, FAIL, "H5Tcreate"); /* Insert fields */ - ret = H5Tinsert(tid1, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT); + ret = H5Tinsert(tid1, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT); CHECK(ret, FAIL, "H5Tinsert"); - ret = H5Tinsert(tid1, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT); + ret = H5Tinsert(tid1, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT); CHECK(ret, FAIL, "H5Tinsert"); - ret = H5Tinsert(tid1, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT); + ret = H5Tinsert(tid1, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT); CHECK(ret, FAIL, "H5Tinsert"); /* Save datatype for later */ @@ -401,8 +401,8 @@ test_reference_obj(void) ret = H5Dread(dset2, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, tbuf); CHECK(ret, FAIL, "H5Dread"); - for(tu32 = (unsigned *)tbuf, i = 0; i < SPACE1_DIM1; i++, tu32++) - VERIFY(*tu32, (uint32_t)(i*3), "Data"); + for (tu32 = (unsigned *)tbuf, i = 0; i < SPACE1_DIM1; i++, tu32++) + VERIFY(*tu32, (uint32_t)(i * 3), "Data"); /* Close dereferenced Dataset */ ret = H5Dclose(dset2); @@ -413,12 +413,12 @@ test_reference_obj(void) CHECK(group, FAIL, "H5Rdereference"); /* Get group's comment */ - ret = H5Oget_comment(group, read_comment, (size_t)10); - CHECK(ret, FAIL, "H5Oget_comment"); + size = H5Oget_comment(group, read_comment, (size_t)10); + CHECK(size, FAIL, "H5Oget_comment"); /* Check for correct comment value */ - if(HDstrcmp(write_comment, read_comment) != 0) - TestErrPrintf("Error! Incorrect group comment, wanted: %s, got: %s\n",write_comment,read_comment); + if (HDstrcmp(write_comment, read_comment) != 0) + TestErrPrintf("Error! Incorrect group comment, wanted: %s, got: %s\n", write_comment, read_comment); /* Close group */ ret = H5Gclose(group); @@ -435,15 +435,14 @@ test_reference_obj(void) tclass = H5Tget_class(tid1); VERIFY(tclass, H5T_COMPOUND, "H5Tget_class"); - ret= H5Tget_nmembers(tid1); + ret = H5Tget_nmembers(tid1); VERIFY(ret, 3, "H5Tget_nmembers"); } /* Attempting to retrieve type of object using non-valid refs */ - for(j = 0; j < 3; j++) { - H5E_BEGIN_TRY { - ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &nvrbuf[j], &obj_type); - } H5E_END_TRY; + for (j = 0; j < 3; j++) { + H5E_BEGIN_TRY { ret = H5Rget_obj_type2(dataset, H5R_OBJECT, &nvrbuf[j], &obj_type); } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rget_obj_type2"); } /* end for */ @@ -463,7 +462,7 @@ test_reference_obj(void) HDfree(wbuf); HDfree(rbuf); HDfree(tbuf); -} /* test_reference_obj() */ +} /* test_reference_obj() */ /**************************************************************** ** @@ -474,43 +473,54 @@ test_reference_obj(void) static void test_reference_region(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dset1, /* Dataset ID */ - dset2; /* Dereferenced dataset ID */ - hid_t sid1, /* Dataspace ID #1 */ - sid2; /* Dataspace ID #2 */ - hsize_t dims1[] = {SPACE1_DIM1}, - dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ - hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ - hsize_t * coords; /* Coordinate buffer */ - hsize_t low[SPACE2_RANK]; /* Selection bounds */ - hsize_t high[SPACE2_RANK]; /* Selection bounds */ - hdset_reg_ref_t *wbuf, /* buffer to write to disk */ - *rbuf; /* buffer read from disk */ - hdset_reg_ref_t nvrbuf[3]={{0},{101},{255}}; /* buffer with non-valid refs */ - uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ - *drbuf; /* Buffer for reading numeric data from disk */ - uint8_t *tu8; /* Temporary pointer to uint8 data */ - H5O_type_t obj_type; /* Type of object */ - int i, j; /* counting variables */ - herr_t ret; /* Generic return value */ - haddr_t addr = HADDR_UNDEF; /* test for undefined reference */ - hid_t dset_NA; /* Dataset id for undefined reference */ - hid_t space_NA; /* Dataspace id for undefined reference */ - hsize_t dims_NA[1] = {1}; /* Dims array for undefined reference */ - hdset_reg_ref_t wdata_NA[1], /* Write buffer */ - rdata_NA[1]; /* Read buffer */ + hid_t fid1; /* HDF5 File IDs */ + hid_t fapl = -1; /* File access property list */ + hid_t dset1, /* Dataset ID */ + dset2, /* Dereferenced dataset ID */ + dset3; /* Dereferenced dataset ID */ + hid_t sid1, /* Dataspace ID #1 */ + sid2, /* Dataspace ID #2 */ + sid3; /* Dataspace ID #3 */ + hid_t dapl_id; /* Dataset access property list */ + hsize_t dims1[] = {SPACE1_DIM1}, dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ + hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ + hsize_t * coords; /* Coordinate buffer */ + hsize_t low[SPACE2_RANK]; /* Selection bounds */ + hsize_t high[SPACE2_RANK]; /* Selection bounds */ + hdset_reg_ref_t *wbuf, /* buffer to write to disk */ + *rbuf; /* buffer read from disk */ + hdset_reg_ref_t nvrbuf[3] = {{0}, {101}, {255}}; /* buffer with non-valid refs */ + uint8_t * dwbuf, /* Buffer for writing numeric data to disk */ + *drbuf; /* Buffer for reading numeric data from disk */ + uint8_t * tu8; /* Temporary pointer to uint8 data */ + H5O_type_t obj_type; /* Type of object */ + int i, j; /* counting variables */ + hssize_t hssize_ret; /* hssize_t return value */ + htri_t tri_ret; /* htri_t return value */ + herr_t ret; /* Generic return value */ + haddr_t addr = HADDR_UNDEF; /* test for undefined reference */ + hid_t dset_NA; /* Dataset id for undefined reference */ + hid_t space_NA; /* Dataspace id for undefined reference */ + hsize_t dims_NA[1] = {1}; /* Dims array for undefined reference */ + hdset_reg_ref_t wdata_NA[1], /* Write buffer */ + rdata_NA[1]; /* Read buffer */ + hsize_t numparticles = 8388608; + hsize_t ret_particles; + unsigned num_dsets = 513; + hsize_t total_particles = numparticles * num_dsets; + hsize_t vdsdims[1] = {total_particles}; + hsize_t start3, count3, block3; /* Output message about test being performed */ MESSAGE(5, ("Testing Dataset Region Reference Functions\n")); /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); - rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); + rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)(SPACE2_DIM1 * SPACE2_DIM2)); @@ -526,8 +536,8 @@ test_reference_region(void) dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(dset2, FAIL, "H5Dcreate2"); - for(tu8 = dwbuf, i = 0; i < (SPACE2_DIM1 * SPACE2_DIM2); i++) - *tu8++ = i * 3; + for (tu8 = dwbuf, i = 0; i < (SPACE2_DIM1 * SPACE2_DIM2); i++) + *tu8++ = (uint8_t)(i * 3); /* Write selection to disk */ ret = H5Dwrite(dset2, H5T_STD_U8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf); @@ -548,11 +558,15 @@ test_reference_region(void) /* Create references */ /* Select 6x6 hyperslab for first reference */ - start[0] = 2; start[1] = 2; - stride[0] = 1; stride[1] = 1; - count[0] = 1; count[1] = 1; - block[0] = 6; block[1] = 6; - ret = H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block); + start[0] = 2; + start[1] = 2; + stride[0] = 1; + stride[1] = 1; + count[0] = 1; + count[1] = 1; + block[0] = 6; + block[1] = 6; + ret = H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); ret = (int)H5Sget_select_npoints(sid2); @@ -566,17 +580,27 @@ test_reference_region(void) VERIFY(obj_type, H5O_TYPE_DATASET, "H5Rget_obj_type2"); /* Select sequence of ten points for second reference */ - coord1[0][0] = 6; coord1[0][1] = 9; - coord1[1][0] = 2; coord1[1][1] = 2; - coord1[2][0] = 8; coord1[2][1] = 4; - coord1[3][0] = 1; coord1[3][1] = 6; - coord1[4][0] = 2; coord1[4][1] = 8; - coord1[5][0] = 3; coord1[5][1] = 2; - coord1[6][0] = 0; coord1[6][1] = 4; - coord1[7][0] = 9; coord1[7][1] = 0; - coord1[8][0] = 7; coord1[8][1] = 1; - coord1[9][0] = 3; coord1[9][1] = 3; - ret = H5Sselect_elements(sid2, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1); + coord1[0][0] = 6; + coord1[0][1] = 9; + coord1[1][0] = 2; + coord1[1][1] = 2; + coord1[2][0] = 8; + coord1[2][1] = 4; + coord1[3][0] = 1; + coord1[3][1] = 6; + coord1[4][0] = 2; + coord1[4][1] = 8; + coord1[5][0] = 3; + coord1[5][1] = 2; + coord1[6][0] = 0; + coord1[6][1] = 4; + coord1[7][0] = 9; + coord1[7][1] = 0; + coord1[8][0] = 7; + coord1[8][1] = 1; + coord1[9][0] = 3; + coord1[9][1] = 3; + ret = H5Sselect_elements(sid2, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1); CHECK(ret, FAIL, "H5Sselect_elements"); ret = (int)H5Sget_select_npoints(sid2); @@ -605,14 +629,13 @@ test_reference_region(void) CHECK(space_NA, FAIL, "H5Screate_simple"); /* Create the dataset and write the region references to it */ - dset_NA = H5Dcreate2(fid1, "DS_NA", H5T_STD_REF_DSETREG, space_NA, H5P_DEFAULT, - H5P_DEFAULT, H5P_DEFAULT); + dset_NA = H5Dcreate2(fid1, "DS_NA", H5T_STD_REF_DSETREG, space_NA, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(dset_NA, FAIL, "H5Dcreate"); /* Close and release resources for undefined region reference tests */ ret = H5Dclose(dset_NA); CHECK(ret, FAIL, "H5Dclose"); - ret = H5Sclose(space_NA); + ret = H5Sclose(space_NA); CHECK(ret, FAIL, "H5Sclose"); /* Close disk dataspace */ @@ -635,10 +658,10 @@ test_reference_region(void) fid1 = H5Fopen(FILE2, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid1, FAIL, "H5Fopen"); - /* - * Start the test of an undefined reference + /* + * Start the test of an undefined reference */ - + /* Open the dataset of the undefined references */ dset_NA = H5Dopen2(fid1, "DS_NA", H5P_DEFAULT); CHECK(dset_NA, FAIL, "H5Dopen2"); @@ -646,28 +669,26 @@ test_reference_region(void) /* Read the data */ ret = H5Dread(dset_NA, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata_NA); CHECK(ret, FAIL, "H5Dread"); - + /* * Dereference an undefined reference (should fail) */ - H5E_BEGIN_TRY { - dset2 = H5Rdereference(dset_NA, H5R_DATASET_REGION, &rdata_NA[0]); - } H5E_END_TRY; - VERIFY(dset2, FAIL, "H5Rdereference"); + H5E_BEGIN_TRY { dset2 = H5Rdereference(dset_NA, H5R_DATASET_REGION, &rdata_NA[0]); } + H5E_END_TRY; + VERIFY(dset2, FAIL, "H5Rdereference"); /* Close and release resources. */ ret = H5Dclose(dset_NA); CHECK(ret, FAIL, "H5Dclose"); - /* This close should fail since H5Rdereference never created + /* This close should fail since H5Rdereference never created * the id of the referenced object. */ - H5E_BEGIN_TRY { - ret = H5Dclose(dset2); - } H5E_END_TRY; - VERIFY(ret, FAIL, "H5Dclose"); + H5E_BEGIN_TRY { ret = H5Dclose(dset2); } + H5E_END_TRY; + VERIFY(ret, FAIL, "H5Dclose"); - /* - * End the test of an undefined reference + /* + * End the test of an undefined reference */ /* Open the dataset */ @@ -702,7 +723,7 @@ test_reference_region(void) ret = H5Dread(dset2, H5T_STD_U8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, drbuf); CHECK(ret, FAIL, "H5Dread"); - for(tu8 = (uint8_t *)drbuf, i = 0; i < (SPACE2_DIM1 * SPACE2_DIM2); i++, tu8++) + for (tu8 = (uint8_t *)drbuf, i = 0; i < (SPACE2_DIM1 * SPACE2_DIM2); i++, tu8++) VERIFY(*tu8, (uint8_t)(i * 3), "Data"); /* Get the hyperslab selection */ @@ -714,8 +735,9 @@ test_reference_region(void) VERIFY(ret, 36, "H5Sget_select_npoints"); ret = (int)H5Sget_select_hyper_nblocks(sid2); VERIFY(ret, 1, "H5Sget_select_hyper_nblocks"); - coords = (hsize_t *)HDmalloc(ret * SPACE2_RANK * sizeof(hsize_t) * 2); /* allocate space for the hyperslab blocks */ - ret = H5Sget_select_hyper_blocklist(sid2, (hsize_t)0, (hsize_t)ret, coords); + coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * sizeof(hsize_t) * + 2); /* allocate space for the hyperslab blocks */ + ret = H5Sget_select_hyper_blocklist(sid2, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist"); VERIFY(coords[0], 2, "Hyperslab Coordinates"); VERIFY(coords[1], 2, "Hyperslab Coordinates"); @@ -742,8 +764,9 @@ test_reference_region(void) VERIFY(ret, 10, "H5Sget_select_npoints"); ret = (int)H5Sget_select_elem_npoints(sid2); VERIFY(ret, 10, "H5Sget_select_elem_npoints"); - coords = (hsize_t *)HDmalloc(ret * SPACE2_RANK * sizeof(hsize_t)); /* allocate space for the element points */ - ret = H5Sget_select_elem_pointlist(sid2, (hsize_t)0, (hsize_t)ret, coords); + coords = (hsize_t *)HDmalloc((size_t)ret * SPACE2_RANK * + sizeof(hsize_t)); /* allocate space for the element points */ + ret = H5Sget_select_elem_pointlist(sid2, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_elem_pointlist"); VERIFY(coords[0], coord1[0][0], "Element Coordinates"); VERIFY(coords[1], coord1[0][1], "Element Coordinates"); @@ -786,10 +809,9 @@ test_reference_region(void) CHECK(ret, FAIL, "H5Dclose"); /* Attempting to retrieve type of object using non-valid refs */ - for(j = 0; j < 3; j++) { - H5E_BEGIN_TRY { - ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &nvrbuf[j], &obj_type); - } H5E_END_TRY; + for (j = 0; j < 3; j++) { + H5E_BEGIN_TRY { ret = H5Rget_obj_type2(dset1, H5R_DATASET_REGION, &nvrbuf[j], &obj_type); } + H5E_END_TRY; VERIFY(ret, FAIL, "H5Rget_obj_type2"); } /* end for */ @@ -806,7 +828,7 @@ test_reference_region(void) HDfree(rbuf); HDfree(dwbuf); HDfree(drbuf); -} /* test_reference_region() */ +} /* test_reference_region() */ /**************************************************************** ** @@ -817,36 +839,35 @@ test_reference_region(void) static void test_reference_region_1D(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dset1, /* Dataset ID */ - dset3; /* Dereferenced dataset ID */ - hid_t sid1, /* Dataspace ID #1 */ - sid3; /* Dataspace ID #3 */ - hsize_t dims1[] = {SPACE1_DIM1}, - dims3[] = {SPACE3_DIM1}; - hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */ - hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ - hsize_t * coords; /* Coordinate buffer */ - hsize_t low[SPACE3_RANK]; /* Selection bounds */ - hsize_t high[SPACE3_RANK]; /* Selection bounds */ - hdset_reg_ref_t *wbuf, /* buffer to write to disk */ - *rbuf; /* buffer read from disk */ - uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ - *drbuf; /* Buffer for reading numeric data from disk */ - uint8_t *tu8; /* Temporary pointer to uint8 data */ - H5O_type_t obj_type; /* Object type */ - int i; /* counting variables */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dset1, /* Dataset ID */ + dset3; /* Dereferenced dataset ID */ + hid_t sid1, /* Dataspace ID #1 */ + sid3; /* Dataspace ID #3 */ + hsize_t dims1[] = {SPACE1_DIM1}, dims3[] = {SPACE3_DIM1}; + hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */ + hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ + hsize_t * coords; /* Coordinate buffer */ + hsize_t low[SPACE3_RANK]; /* Selection bounds */ + hsize_t high[SPACE3_RANK]; /* Selection bounds */ + hdset_reg_ref_t *wbuf, /* buffer to write to disk */ + *rbuf; /* buffer read from disk */ + uint8_t *dwbuf, /* Buffer for writing numeric data to disk */ + *drbuf; /* Buffer for reading numeric data from disk */ + uint8_t * tu8; /* Temporary pointer to uint8 data */ + H5O_type_t obj_type; /* Object type */ + int i; /* counting variables */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n")); /* Allocate write & read buffers */ - wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); - rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + wbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); + rbuf = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); dwbuf = (uint8_t *)HDmalloc(sizeof(uint8_t) * SPACE3_DIM1); drbuf = (uint8_t *)HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); @@ -862,8 +883,8 @@ test_reference_region_1D(void) dset3 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(dset3, FAIL, "H5Dcreate2"); - for(tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++) - *tu8++ = i * 3; + for (tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++) + *tu8++ = (uint8_t)(i * 3); /* Write selection to disk */ ret = H5Dwrite(dset3, H5T_STD_U8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf); @@ -884,11 +905,11 @@ test_reference_region_1D(void) /* Create references */ /* Select 15 2x1 hyperslabs for first reference */ - start[0] = 2; + start[0] = 2; stride[0] = 5; - count[0] = 15; - block[0] = 2; - ret = H5Sselect_hyperslab(sid3, H5S_SELECT_SET, start, stride, count, block); + count[0] = 15; + block[0] = 2; + ret = H5Sselect_hyperslab(sid3, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); ret = (int)H5Sget_select_npoints(sid3); @@ -912,7 +933,7 @@ test_reference_region_1D(void) coord1[7][0] = 89; coord1[8][0] = 97; coord1[9][0] = 03; - ret = H5Sselect_elements(sid3, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1); + ret = H5Sselect_elements(sid3, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1); CHECK(ret, FAIL, "H5Sselect_elements"); ret = (int)H5Sget_select_npoints(sid3); @@ -974,7 +995,7 @@ test_reference_region_1D(void) ret = H5Dread(dset3, H5T_STD_U8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, drbuf); CHECK(ret, FAIL, "H5Dread"); - for(tu8 = (uint8_t *)drbuf, i = 0; i < SPACE3_DIM1; i++, tu8++) + for (tu8 = (uint8_t *)drbuf, i = 0; i < SPACE3_DIM1; i++, tu8++) VERIFY(*tu8, (uint8_t)(i * 3), "Data"); /* Get the hyperslab selection */ @@ -986,19 +1007,20 @@ test_reference_region_1D(void) VERIFY(ret, 30, "H5Sget_select_npoints"); ret = (int)H5Sget_select_hyper_nblocks(sid3); VERIFY(ret, 15, "H5Sget_select_hyper_nblocks"); - coords = (hsize_t *)HDmalloc(ret * SPACE3_RANK * sizeof(hsize_t) * 2); /* allocate space for the hyperslab blocks */ - ret = H5Sget_select_hyper_blocklist(sid3, (hsize_t)0, (hsize_t)ret, coords); + coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * sizeof(hsize_t) * + 2); /* allocate space for the hyperslab blocks */ + ret = H5Sget_select_hyper_blocklist(sid3, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_hyper_blocklist"); - VERIFY(coords[0], 2, "Hyperslab Coordinates"); - VERIFY(coords[1], 3, "Hyperslab Coordinates"); - VERIFY(coords[2], 7, "Hyperslab Coordinates"); - VERIFY(coords[3], 8, "Hyperslab Coordinates"); - VERIFY(coords[4], 12, "Hyperslab Coordinates"); - VERIFY(coords[5], 13, "Hyperslab Coordinates"); - VERIFY(coords[6], 17, "Hyperslab Coordinates"); - VERIFY(coords[7], 18, "Hyperslab Coordinates"); - VERIFY(coords[8], 22, "Hyperslab Coordinates"); - VERIFY(coords[9], 23, "Hyperslab Coordinates"); + VERIFY(coords[0], 2, "Hyperslab Coordinates"); + VERIFY(coords[1], 3, "Hyperslab Coordinates"); + VERIFY(coords[2], 7, "Hyperslab Coordinates"); + VERIFY(coords[3], 8, "Hyperslab Coordinates"); + VERIFY(coords[4], 12, "Hyperslab Coordinates"); + VERIFY(coords[5], 13, "Hyperslab Coordinates"); + VERIFY(coords[6], 17, "Hyperslab Coordinates"); + VERIFY(coords[7], 18, "Hyperslab Coordinates"); + VERIFY(coords[8], 22, "Hyperslab Coordinates"); + VERIFY(coords[9], 23, "Hyperslab Coordinates"); VERIFY(coords[10], 27, "Hyperslab Coordinates"); VERIFY(coords[11], 28, "Hyperslab Coordinates"); VERIFY(coords[12], 32, "Hyperslab Coordinates"); @@ -1038,8 +1060,9 @@ test_reference_region_1D(void) VERIFY(ret, 10, "H5Sget_select_npoints"); ret = (int)H5Sget_select_elem_npoints(sid3); VERIFY(ret, 10, "H5Sget_select_elem_npoints"); - coords = (hsize_t *)HDmalloc(ret * SPACE3_RANK * sizeof(hsize_t)); /* allocate space for the element points */ - ret = H5Sget_select_elem_pointlist(sid3, (hsize_t)0, (hsize_t)ret, coords); + coords = (hsize_t *)HDmalloc((size_t)ret * SPACE3_RANK * + sizeof(hsize_t)); /* allocate space for the element points */ + ret = H5Sget_select_elem_pointlist(sid3, (hsize_t)0, (hsize_t)ret, coords); CHECK(ret, FAIL, "H5Sget_select_elem_pointlist"); VERIFY(coords[0], coord1[0][0], "Element Coordinates"); VERIFY(coords[1], coord1[1][0], "Element Coordinates"); @@ -1082,7 +1105,7 @@ test_reference_region_1D(void) HDfree(rbuf); HDfree(dwbuf); HDfree(drbuf); -} /* test_reference_region_1D() */ +} /* test_reference_region_1D() */ /**************************************************************** ** @@ -1093,14 +1116,14 @@ test_reference_region_1D(void) static void test_reference_obj_deleted(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset, /* Dataset ID */ - dset2; /* Dereferenced dataset ID */ - hid_t sid1; /* Dataspace ID */ - hobj_ref_t oref; /* Object Reference to test */ - H5O_type_t obj_type; /* Object type */ - haddr_t addr = HADDR_UNDEF; /* test for undefined reference */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset, /* Dataset ID */ + dset2; /* Dereferenced dataset ID */ + hid_t sid1; /* Dataspace ID */ + hobj_ref_t oref; /* Object Reference to test */ + H5O_type_t obj_type; /* Object type */ + haddr_t addr = HADDR_UNDEF; /* test for undefined reference */ + herr_t ret; /* Generic return value */ /* Create file */ fid1 = H5Fcreate(FILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1182,7 +1205,7 @@ test_reference_obj_deleted(void) /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); -} /* test_reference_obj_deleted() */ +} /* test_reference_obj_deleted() */ /**************************************************************** ** @@ -1192,26 +1215,26 @@ test_reference_obj_deleted(void) ****************************************************************/ static herr_t test_deref_iter_op(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_t H5_ATTR_UNUSED *info, - void *op_data) + void *op_data) { - int *count = (int *)op_data; /* Pointer to name counter */ + int * count = (int *)op_data; /* Pointer to name counter */ herr_t ret_value; /* Simple check for correct names */ - if(*count == 0) { - if(HDstrcmp(name, DSETNAME2) == 0) + if (*count == 0) { + if (HDstrcmp(name, DSETNAME2) == 0) ret_value = 0; else ret_value = -1; } /* end if */ - else if(*count == 1) { - if(HDstrcmp(name, GROUPNAME2) == 0) + else if (*count == 1) { + if (HDstrcmp(name, GROUPNAME2) == 0) ret_value = 0; else ret_value = -1; } /* end if */ - else if(*count == 2) { - if(HDstrcmp(name, GROUPNAME3) == 0) + else if (*count == 2) { + if (HDstrcmp(name, GROUPNAME3) == 0) ret_value = 0; else ret_value = -1; @@ -1221,7 +1244,7 @@ test_deref_iter_op(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_ (*count)++; - return(ret_value); + return (ret_value); } /* end test_deref_iter_op() */ /**************************************************************** @@ -1233,17 +1256,18 @@ test_deref_iter_op(hid_t H5_ATTR_UNUSED group, const char *name, const H5L_info_ static void test_reference_group(void) { - hid_t fid = -1; /* File ID */ - hid_t gid = -1, gid2 = -1; /* Group IDs */ - hid_t did; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hobj_ref_t wref; /* Reference to write */ - hobj_ref_t rref; /* Reference to read */ - H5G_info_t ginfo; /* Group info struct */ - char objname[NAME_SIZE]; /* Buffer to store name */ - H5O_info_t oinfo; /* Object info struct */ - int count = 0; /* Count within iterated group */ - herr_t ret; + hid_t fid = -1; /* File ID */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ + hid_t did; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hobj_ref_t wref; /* Reference to write */ + hobj_ref_t rref; /* Reference to read */ + H5G_info_t ginfo; /* Group info struct */ + char objname[NAME_SIZE]; /* Buffer to store name */ + H5O_info_t oinfo; /* Object info struct */ + int count = 0; /* Count within iterated group */ + ssize_t size; /* Name length */ + herr_t ret; /* Create file with a group and a dataset containing an object reference to the group */ fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -1254,16 +1278,16 @@ test_reference_group(void) CHECK(sid, FAIL, "H5Screate"); /* Create group to refer to */ - gid = H5Gcreate2(fid, GROUPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + gid = H5Gcreate2(fid, GROUPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(gid, FAIL, "H5Gcreate2"); /* Create nested groups */ - gid2 = H5Gcreate2(gid, GROUPNAME2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + gid2 = H5Gcreate2(gid, GROUPNAME2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(gid2, FAIL, "H5Gcreate2"); ret = H5Gclose(gid2); CHECK(ret, FAIL, "H5Gclose"); - gid2 = H5Gcreate2(gid, GROUPNAME3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + gid2 = H5Gcreate2(gid, GROUPNAME3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(gid2, FAIL, "H5Gcreate2"); ret = H5Gclose(gid2); CHECK(ret, FAIL, "H5Gclose"); @@ -1297,7 +1321,6 @@ test_reference_group(void) ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); - /* Re-open file */ fid = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fopen"); @@ -1323,8 +1346,9 @@ test_reference_group(void) CHECK(ret, FAIL, "H5Gget_info"); VERIFY(ginfo.nlinks, 3, "H5Gget_info"); - ret = H5Lget_name_by_idx(gid, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, objname, (size_t)NAME_SIZE, H5P_DEFAULT); - CHECK(ret, FAIL, "H5Lget_name_by_idx"); + size = H5Lget_name_by_idx(gid, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, objname, (size_t)NAME_SIZE, + H5P_DEFAULT); + CHECK(size, FAIL, "H5Lget_name_by_idx"); VERIFY_STR(objname, DSETNAME2, "H5Lget_name_by_idx"); ret = H5Oget_info_by_idx(gid, ".", H5_INDEX_NAME, H5_ITER_INC, (hsize_t)0, &oinfo, H5P_DEFAULT); @@ -1346,7 +1370,7 @@ test_reference_group(void) CHECK(ret, FAIL, "H5Gclose"); ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); -} /* test_reference_group() */ +} /* test_reference_group() */ #ifndef H5_NO_DEPRECATED_SYMBOLS /**************************************************************** @@ -1358,25 +1382,24 @@ test_reference_group(void) static void test_reference_compat(void) { - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t group; /* Group ID */ - hid_t sid1, /* Dataspace IDs */ - sid2; - hid_t tid1; /* Datatype ID */ - hsize_t dims1[] = {SPACE1_DIM1}, - dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; - hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ - hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ - hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ - hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ - hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ - hobj_ref_t *wbuf_obj, /* Buffer to write to disk */ - *rbuf_obj; /* Buffer read from disk */ - hdset_reg_ref_t *wbuf_reg, /* Buffer to write to disk */ - *rbuf_reg; /* Buffer read from disk */ - H5G_obj_t obj_type; /* Object type */ - herr_t ret; /* Generic return value */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t group; /* Group ID */ + hid_t sid1, /* Dataspace IDs */ + sid2; + hid_t tid1; /* Datatype ID */ + hsize_t dims1[] = {SPACE1_DIM1}, dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; + hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ + hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ + hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ + hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ + hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ + hobj_ref_t *wbuf_obj, /* Buffer to write to disk */ + *rbuf_obj; /* Buffer read from disk */ + hdset_reg_ref_t *wbuf_reg, /* Buffer to write to disk */ + *rbuf_reg; /* Buffer read from disk */ + H5G_obj_t obj_type; /* Object type */ + herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Deprecated Object Reference Functions\n")); @@ -1424,13 +1447,13 @@ test_reference_compat(void) CHECK(tid1, FAIL, "H5Tcreate"); /* Insert fields */ - ret = H5Tinsert(tid1, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT); + ret = H5Tinsert(tid1, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT); CHECK(ret, FAIL, "H5Tinsert"); - ret = H5Tinsert(tid1, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT); + ret = H5Tinsert(tid1, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT); CHECK(ret, FAIL, "H5Tinsert"); - ret = H5Tinsert(tid1, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT); + ret = H5Tinsert(tid1, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT); CHECK(ret, FAIL, "H5Tinsert"); /* Save datatype for later */ @@ -1445,7 +1468,6 @@ test_reference_compat(void) ret = H5Gclose(group); CHECK(ret, FAIL, "H5Gclose"); - /* Create a dataset with object reference datatype */ dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(ret, FAIL, "H5Dcreate2"); @@ -1474,17 +1496,20 @@ test_reference_compat(void) ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); - /* Create a dataset with region reference datatype */ dataset = H5Dcreate2(fid1, "Dataset4", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(ret, FAIL, "H5Dcreate2"); /* Select 6x6 hyperslab for first reference */ - start[0] = 2; start[1] = 2; - stride[0] = 1; stride[1] = 1; - count[0] = 1; count[1] = 1; - block[0] = 6; block[1] = 6; - ret = H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block); + start[0] = 2; + start[1] = 2; + stride[0] = 1; + stride[1] = 1; + count[0] = 1; + count[1] = 1; + block[0] = 6; + block[1] = 6; + ret = H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block); CHECK(ret, FAIL, "H5Sselect_hyperslab"); /* Create first dataset region */ @@ -1492,17 +1517,27 @@ test_reference_compat(void) CHECK(ret, FAIL, "H5Rcreate"); /* Select sequence of ten points for second reference */ - coord1[0][0] = 6; coord1[0][1] = 9; - coord1[1][0] = 2; coord1[1][1] = 2; - coord1[2][0] = 8; coord1[2][1] = 4; - coord1[3][0] = 1; coord1[3][1] = 6; - coord1[4][0] = 2; coord1[4][1] = 8; - coord1[5][0] = 3; coord1[5][1] = 2; - coord1[6][0] = 0; coord1[6][1] = 4; - coord1[7][0] = 9; coord1[7][1] = 0; - coord1[8][0] = 7; coord1[8][1] = 1; - coord1[9][0] = 3; coord1[9][1] = 3; - ret = H5Sselect_elements(sid2, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1); + coord1[0][0] = 6; + coord1[0][1] = 9; + coord1[1][0] = 2; + coord1[1][1] = 2; + coord1[2][0] = 8; + coord1[2][1] = 4; + coord1[3][0] = 1; + coord1[3][1] = 6; + coord1[4][0] = 2; + coord1[4][1] = 8; + coord1[5][0] = 3; + coord1[5][1] = 2; + coord1[6][0] = 0; + coord1[6][1] = 4; + coord1[7][0] = 9; + coord1[7][1] = 0; + coord1[8][0] = 7; + coord1[8][1] = 1; + coord1[9][0] = 3; + coord1[9][1] = 3; + ret = H5Sselect_elements(sid2, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t *)coord1); CHECK(ret, FAIL, "H5Sselect_elements"); /* Create second dataset region */ @@ -1517,7 +1552,6 @@ test_reference_compat(void) ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); - /* Close disk dataspaces */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); @@ -1528,7 +1562,6 @@ test_reference_compat(void) ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); - /* Re-open the file */ fid1 = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(fid1, FAIL, "H5Fopen"); @@ -1562,7 +1595,6 @@ test_reference_compat(void) ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); - /* Open the dataset region reference dataset */ dataset = H5Dopen2(fid1, "/Dataset4", H5P_DEFAULT); CHECK(ret, FAIL, "H5Dopen2"); @@ -1599,7 +1631,7 @@ test_reference_compat(void) HDfree(rbuf_obj); HDfree(wbuf_reg); HDfree(rbuf_reg); -} /* test_reference_compat() */ +} /* test_reference_compat() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ /**************************************************************** @@ -1613,27 +1645,26 @@ test_reference(void) /* Output message about test being performed */ MESSAGE(5, ("Testing References\n")); - test_reference_params(); /* Test for correct parameter checking */ - test_reference_obj(); /* Test basic H5R object reference code */ - test_reference_region(); /* Test basic H5R dataset region reference code */ - test_reference_region_1D(); /* Test H5R dataset region reference code for 1-D datasets */ + test_reference_params(); /* Test for correct parameter checking */ + test_reference_obj(); /* Test basic H5R object reference code */ + test_reference_region(); /* Test basic H5R dataset region reference code */ + test_reference_region_1D(); /* Test H5R dataset region reference code for 1-D datasets */ test_reference_obj_deleted(); /* Test H5R object reference code for deleted objects */ - test_reference_group(); /* Test operations on dereferenced groups */ + test_reference_group(); /* Test operations on dereferenced groups */ #ifndef H5_NO_DEPRECATED_SYMBOLS - test_reference_compat(); /* Test operations with old API routines */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ + test_reference_compat(); /* Test operations with old API routines */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ -} /* test_reference() */ +} /* test_reference() */ - /*------------------------------------------------------------------------- - * Function: cleanup_reference + * Function: cleanup_reference * - * Purpose: Cleanup temporary test files + * Purpose: Cleanup temporary test files * - * Return: none + * Return: none * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * September 8, 1998 * * Modifications: @@ -1647,4 +1678,3 @@ cleanup_reference(void) remove(FILE2); remove(FILE3); } - |