diff options
author | Larry Knox <lrknox@hdfgroup.org> | 2021-07-16 15:57:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-16 15:57:51 (GMT) |
commit | e2578640fedf671cf11535cf22313dd477da1165 (patch) | |
tree | 566b7a32bdd39ddc7120d426979af641343746f6 /test | |
parent | 14794490ec522fbd3ac2faa6efa0920979490fbc (diff) | |
download | hdf5-e2578640fedf671cf11535cf22313dd477da1165.zip hdf5-e2578640fedf671cf11535cf22313dd477da1165.tar.gz hdf5-e2578640fedf671cf11535cf22313dd477da1165.tar.bz2 |
Merge issue 839 changes to hdf5 1 10 (#841)
* Revert addition of & to 2 parameters in DSetCreatPropList::setVirtual to
maintain binary compatibility.
* Fix H5Eget_auto2/H5Eauto_is_v2 to not clear error stack (#625)
* Removes gratuitous (double)x.yF casts (#632)
* Committing clang-format changes
* Removes gratuitous (double)x.yF casts
* Committing clang-format changes
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Cleans up a const warning left over from previous constification (#633)
* Committing clang-format changes
* Adds consts to a few global variables
* Cleans up a const warning left over from previous constification
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Purges UFAIL from the library (#637)
* Committing clang-format changes
* Purges UFAIL from the library
* H5HL_insert change requested in PR
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Bmr dev hdffv 11223 (#640)
* Fixed HDFFV-11223 (CVE-2018-14460)
Description
- Added checks against buffer size to prevent segfault, in case of data
corruption, for sdim->size and sdim->max.
- Renamed data files in an existing test to shorten their length
as agreed with other developers previously.
Platforms tested:
Linux/64 (jelly)
* Committing clang-format changes
* Updated for test files
* Updated for HDFFV-11223
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Committing clang-format changes
* Restore "error:" in line 2666.
* Revert "Fix H5Eget_auto2/H5Eauto_is_v2 to not clear error stack (#625)"
This reverts commit 426b50484841118cf633fd6147302a63a30fd746.
* Snapshot version 1.10 release 8-1. Update version to 1.10.8-2.
Squashed commit of the following:
commit 60734e63fe077238f10de3d6ca8f037f9a42af89
Author: Allen Byrne <50328838+byrnHDF@users.noreply.github.com>
Date: Thu Jun 24 14:20:39 2021 -0500
Hdf5 1 10 Fix tools test (#796)
* HDFFV-10865 - merge from dev, HDFArray perf fix.
* Remove duplicate setting
* Whitespace changes after clang format
* Undo version 11 clang format changes
* Merge CMake changes from develop
* test testing script merge from develop
* Update supported platforms
* PR#3 merge from develop
* Merge gcc 10 diagnostics option from develop
* Merge #318 OSX changes from develop
* Merge small changes from develop
* Minor non-space formatting changes
* #386 copyright corrections for java folder
* Merges from develop
#358 patches from vtk
#361 fix header guard spelling
* Merge updates
#358 patches from vtk
#361 fix header guard spelling
* format fix
* Fix missing underscore and make H5public.h closer to dev
* Merges from develop
#340 clang -Wformat-security warnings
#360 Fixed uninitialized warnings
header guard underscore cleanup
JNI cleanup
* format alignment
* Add missing test ref file
* Merge #380 from develop
* Finish java merges from develop
* Fix java issues with tests and javadoc
* Correct use of attribute access plist
* Remove debug code
* Remove unused variable
* Change file access to read only for java tests
* Split clang format operations.
* More javadoc comments
* Remove pre-split setting
* format source
* Change windows TS to use older VS.
* Mostly all javadoc fixes, one argument rename.
* synch file
* Merge of long double fix and compiler flags
* HDFFV-11229 merge changes from develop
* HDFFV-11229 correct test script
* HDFFV-11229 update autotools test script for two ref files
* HDFFV-11229 merge dev changes for long double display in tools
* Committing clang-format changes
* minor whitespace
* remove unneeded macro
* Committing clang-format changes
* Add "option" command for clang options
* Rework CMake add_custom to use the BYPRODUCTS argument
Update pkgconfig scripts for parallel builds.
Fix install COPYING file reference.
Remove unused round defines.
Change CMake default setting of BUILD_CPP to off.
* Fortran target depends
* Remove incorrect source attribute
* Revert define removal
* printf specifiers and VS2015 min changes
* Committing clang-format changes
* Add time struct
* TRILAB-227 and tools debug merges from develop
* Merge various changes from dev
* Issue #669 remove version from pkgcfg filename
* remove version from h5cc script
* doxygen changes merged from develop
* Committing clang-format changes
* Merge CMake fortran ninja changes from dev
* Enable fortran to gcc yaml
* Refactor Fortran CMake config tests and CMake test args
* Merge warnings files fixes from develop
* Fix cmake configure path
* Update missing release note info.
* Update code owners
* Add known problem
* Use only core library for testing dynamic plugins.
CMake uses H5_HAVE_DIRECT instead of DIRECT_VFD
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
commit bfb780a4441e4ef43dd23708d415e5e3b84800f4
Author: Allen Byrne <50328838+byrnHDF@users.noreply.github.com>
Date: Wed Jun 23 14:11:46 2021 -0500
Hdf5 1 10 Release Note (#786)
* HDFFV-10865 - merge from dev, HDFArray perf fix.
* Remove duplicate setting
* Whitespace changes after clang format
* Undo version 11 clang format changes
* Merge CMake changes from develop
* test testing script merge from develop
* Update supported platforms
* PR#3 merge from develop
* Merge gcc 10 diagnostics option from develop
* Merge #318 OSX changes from develop
* Merge small changes from develop
* Minor non-space formatting changes
* #386 copyright corrections for java folder
* Merges from develop
#358 patches from vtk
#361 fix header guard spelling
* Merge updates
#358 patches from vtk
#361 fix header guard spelling
* format fix
* Fix missing underscore and make H5public.h closer to dev
* Merges from develop
#340 clang -Wformat-security warnings
#360 Fixed uninitialized warnings
header guard underscore cleanup
JNI cleanup
* format alignment
* Add missing test ref file
* Merge #380 from develop
* Finish java merges from develop
* Fix java issues with tests and javadoc
* Correct use of attribute access plist
* Remove debug code
* Remove unused variable
* Change file access to read only for java tests
* Split clang format operations.
* More javadoc comments
* Remove pre-split setting
* format source
* Change windows TS to use older VS.
* Mostly all javadoc fixes, one argument rename.
* synch file
* Merge of long double fix and compiler flags
* HDFFV-11229 merge changes from develop
* HDFFV-11229 correct test script
* HDFFV-11229 update autotools test script for two ref files
* HDFFV-11229 merge dev changes for long double display in tools
* Committing clang-format changes
* minor whitespace
* remove unneeded macro
* Committing clang-format changes
* Add "option" command for clang options
* Rework CMake add_custom to use the BYPRODUCTS argument
Update pkgconfig scripts for parallel builds.
Fix install COPYING file reference.
Remove unused round defines.
Change CMake default setting of BUILD_CPP to off.
* Fortran target depends
* Remove incorrect source attribute
* Revert define removal
* printf specifiers and VS2015 min changes
* Committing clang-format changes
* Add time struct
* TRILAB-227 and tools debug merges from develop
* Merge various changes from dev
* Issue #669 remove version from pkgcfg filename
* remove version from h5cc script
* doxygen changes merged from develop
* Committing clang-format changes
* Merge CMake fortran ninja changes from dev
* Enable fortran to gcc yaml
* Refactor Fortran CMake config tests and CMake test args
* Merge warnings files fixes from develop
* Fix cmake configure path
* Update missing release note info.
* Update code owners
* Add known problem
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
commit 9f5040736868f8eec584ab5af6d2a77e4d45ae30
Author: Allen Byrne <50328838+byrnHDF@users.noreply.github.com>
Date: Tue Jun 22 07:03:26 2021 -0500
Hdf5 1 10 Update missing release note info. (#778)
* HDFFV-10865 - merge from dev, HDFArray perf fix.
* Remove duplicate setting
* Whitespace changes after clang format
* Undo version 11 clang format changes
* Merge CMake changes from develop
* test testing script merge from develop
* Update supported platforms
* PR#3 merge from develop
* Merge gcc 10 diagnostics option from develop
* Merge #318 OSX changes from develop
* Merge small changes from develop
* Minor non-space formatting changes
* #386 copyright corrections for java folder
* Merges from develop
#358 patches from vtk
#361 fix header guard spelling
* Merge updates
#358 patches from vtk
#361 fix header guard spelling
* format fix
* Fix missing underscore and make H5public.h closer to dev
* Merges from develop
#340 clang -Wformat-security warnings
#360 Fixed uninitialized warnings
header guard underscore cleanup
JNI cleanup
* format alignment
* Add missing test ref file
* Merge #380 from develop
* Finish java merges from develop
* Fix java issues with tests and javadoc
* Correct use of attribute access plist
* Remove debug code
* Remove unused variable
* Change file access to read only for java tests
* Split clang format operations.
* More javadoc comments
* Remove pre-split setting
* format source
* Change windows TS to use older VS.
* Mostly all javadoc fixes, one argument rename.
* synch file
* Merge of long double fix and compiler flags
* HDFFV-11229 merge changes from develop
* HDFFV-11229 correct test script
* HDFFV-11229 update autotools test script for two ref files
* HDFFV-11229 merge dev changes for long double display in tools
* Committing clang-format changes
* minor whitespace
* remove unneeded macro
* Committing clang-format changes
* Add "option" command for clang options
* Rework CMake add_custom to use the BYPRODUCTS argument
Update pkgconfig scripts for parallel builds.
Fix install COPYING file reference.
Remove unused round defines.
Change CMake default setting of BUILD_CPP to off.
* Fortran target depends
* Remove incorrect source attribute
* Revert define removal
* printf specifiers and VS2015 min changes
* Committing clang-format changes
* Add time struct
* TRILAB-227 and tools debug merges from develop
* Merge various changes from dev
* Issue #669 remove version from pkgcfg filename
* remove version from h5cc script
* doxygen changes merged from develop
* Committing clang-format changes
* Merge CMake fortran ninja changes from dev
* Enable fortran to gcc yaml
* Refactor Fortran CMake config tests and CMake test args
* Merge warnings files fixes from develop
* Fix cmake configure path
* Update missing release note info.
* Update code owners
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
commit 2e80c9cdec98d6cee5b4609643839a4ad2a848fb
Author: Dana Robinson <43805+derobins@users.noreply.github.com>
Date: Fri Jun 18 06:42:23 2021 -0700
Brings hash table IDs feature from develop/1.12 (#768)
* Brings updated tid test from develop
* Adds empty H5Iint.c and H5Idbg.c files
* H5I renaming to match 1.12/develop
* Splits off H5I debug code to H5Idbg.c
* Splits internal H5I.c functionality to H5Iint.c
* Header cleanup
* More renaming cleanup to match develop/1.12
* Adds "save last ID" optimization
* Adds uthash.h
* Adds hash table IDs from develop/1.12
* Committing clang-format changes
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
commit 1e29bcbfe24956f0158b3363a3fbb8a42c8e7e0f
Author: Allen Byrne <50328838+byrnHDF@users.noreply.github.com>
Date: Thu Jun 17 11:21:43 2021 -0500
Hdf5 1 10 Fix cmake configure path (#762)
* HDFFV-10865 - merge from dev, HDFArray perf fix.
* Remove duplicate setting
* Whitespace changes after clang format
* Undo version 11 clang format changes
* Merge CMake changes from develop
* test testing script merge from develop
* Update supported platforms
* PR#3 merge from develop
* Merge gcc 10 diagnostics option from develop
* Merge #318 OSX changes from develop
* Merge small changes from develop
* Minor non-space formatting changes
* #386 copyright corrections for java folder
* Merges from develop
#358 patches from vtk
#361 fix header guard spelling
* Merge updates
#358 patches from vtk
#361 fix header guard spelling
* format fix
* Fix missing underscore and make H5public.h closer to dev
* Merges from develop
#340 clang -Wformat-security warnings
#360 Fixed uninitialized warnings
header guard underscore cleanup
JNI cleanup
* format alignment
* Add missing test ref file
* Merge #380 from develop
* Finish java merges from develop
* Fix java issues with tests and javadoc
* Correct use of attribute access plist
* Remove debug code
* Remove unused variable
* Change file access to read only for java tests
* Split clang format operations.
* More javadoc comments
* Remove pre-split setting
* format source
* Change windows TS to use older VS.
* Mostly all javadoc fixes, one argument rename.
* synch file
* Merge of long double fix and compiler flags
* HDFFV-11229 merge changes from develop
* HDFFV-11229 correct test script
* HDFFV-11229 update autotools test script for two ref files
* HDFFV-11229 merge dev changes for long double display in tools
* Committing clang-format changes
* minor whitespace
* remove unneeded macro
* Committing clang-format changes
* Add "option" command for clang options
* Rework CMake add_custom to use the BYPRODUCTS argument
Update pkgconfig scripts for parallel builds.
Fix install COPYING file reference.
Remove unused round defines.
Change CMake default setting of BUILD_CPP to off.
* Fortran target depends
* Remove incorrect source attribute
* Revert define removal
* printf specifiers and VS2015 min changes
* Committing clang-format changes
* Add time struct
* TRILAB-227 and tools debug merges from develop
* Merge various changes from dev
* Issue #669 remove version from pkgcfg filename
* remove version from h5cc script
* doxygen changes merged from develop
* Committing clang-format changes
* Merge CMake fortran ninja changes from dev
* Enable fortran to gcc yaml
* Refactor Fortran CMake config tests and CMake test args
* Merge warnings files fixes from develop
* Fix cmake configure path
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
commit 475cdaf431c9ef5bfef6243dbc26d0005d08c49d
Author: Allen Byrne <50328838+byrnHDF@users.noreply.github.com>
Date: Wed Jun 16 15:45:58 2021 -0500
Hdf5 1 10 merge warnings changes (#756)
* HDFFV-10865 - merge from dev, HDFArray perf fix.
* Remove duplicate setting
* Whitespace changes after clang format
* Undo version 11 clang format changes
* Merge CMake changes from develop
* test testing script merge from develop
* Update supported platforms
* PR#3 merge from develop
* Merge gcc 10 diagnostics option from develop
* Merge #318 OSX changes from develop
* Merge small changes from develop
* Minor non-space formatting changes
* #386 copyright corrections for java folder
* Merges from develop
#358 patches from vtk
#361 fix header guard spelling
* Merge updates
#358 patches from vtk
#361 fix header guard spelling
* format fix
* Fix missing underscore and make H5public.h closer to dev
* Merges from develop
#340 clang -Wformat-security warnings
#360 Fixed uninitialized warnings
header guard underscore cleanup
JNI cleanup
* format alignment
* Add missing test ref file
* Merge #380 from develop
* Finish java merges from develop
* Fix java issues with tests and javadoc
* Correct use of attribute access plist
* Remove debug code
* Remove unused variable
* Change file access to read only for java tests
* Split clang format operations.
* More javadoc comments
* Remove pre-split setting
* format source
* Change windows TS to use older VS.
* Mostly all javadoc fixes, one argument rename.
* synch file
* Merge of long double fix and compiler flags
* HDFFV-11229 merge changes from develop
* HDFFV-11229 correct test script
* HDFFV-11229 update autotools test script for two ref files
* HDFFV-11229 merge dev changes for long double display in tools
* Committing clang-format changes
* minor whitespace
* remove unneeded macro
* Committing clang-format changes
* Add "option" command for clang options
* Rework CMake add_custom to use the BYPRODUCTS argument
Update pkgconfig scripts for parallel builds.
Fix install COPYING file reference.
Remove unused round defines.
Change CMake default setting of BUILD_CPP to off.
* Fortran target depends
* Remove incorrect source attribute
* Revert define removal
* printf specifiers and VS2015 min changes
* Committing clang-format changes
* Add time struct
* TRILAB-227 and tools debug merges from develop
* Merge various changes from dev
* Issue #669 remove version from pkgcfg filename
* remove version from h5cc script
* doxygen changes merged from develop
* Committing clang-format changes
* Merge CMake fortran ninja changes from dev
* Enable fortran to gcc yaml
* Refactor Fortran CMake config tests and CMake test args
* Merge warnings files fixes from develop
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
commit e25980e7f35b8508db90648409ba80ee36d61c9e
Author: Allen Byrne <50328838+byrnHDF@users.noreply.github.com>
Date: Tue Jun 8 14:37:13 2021 -0500
Hdf5 1 10 merges of CMake changes (#738)
* HDFFV-10865 - merge from dev, HDFArray perf fix.
* Remove duplicate setting
* Whitespace changes after clang format
* Undo version 11 clang format changes
* Merge CMake changes from develop
* test testing script merge from develop
* Update supported platforms
* PR#3 merge from develop
* Merge gcc 10 diagnostics option from develop
* Merge #318 OSX changes from develop
* Merge small changes from develop
* Minor non-space formatting changes
* #386 copyright corrections for java folder
* Merges from develop
#358 patches from vtk
#361 fix header guard spelling
* Merge updates
#358 patches from vtk
#361 fix header guard spelling
* format fix
* Fix missing underscore and make H5public.h closer to dev
* Merges from develop
#340 clang -Wformat-security warnings
#360 Fixed uninitialized warnings
header guard underscore cleanup
JNI cleanup
* format alignment
* Add missing test ref file
* Merge #380 from develop
* Finish java merges from develop
* Fix java issues with tests and javadoc
* Correct use of attribute access plist
* Remove debug code
* Remove unused variable
* Change file access to read only for java tests
* Split clang format operations.
* More javadoc comments
* Remove pre-split setting
* format source
* Change windows TS to use older VS.
* Mostly all javadoc fixes, one argument rename.
* synch file
* Merge of long double fix and compiler flags
* HDFFV-11229 merge changes from develop
* HDFFV-11229 correct test script
* HDFFV-11229 update autotools test script for two ref files
* HDFFV-11229 merge dev changes for long double display in tools
* Committing clang-format changes
* minor whitespace
* remove unneeded macro
* Committing clang-format changes
* Add "option" command for clang options
* Rework CMake add_custom to use the BYPRODUCTS argument
Update pkgconfig scripts for parallel builds.
Fix install COPYING file reference.
Remove unused round defines.
Change CMake default setting of BUILD_CPP to off.
* Fortran target depends
* Remove incorrect source attribute
* Revert define removal
* printf specifiers and VS2015 min changes
* Committing clang-format changes
* Add time struct
* TRILAB-227 and tools debug merges from develop
* Merge various changes from dev
* Issue #669 remove version from pkgcfg filename
* remove version from h5cc script
* doxygen changes merged from develop
* Committing clang-format changes
* Merge CMake fortran ninja changes from dev
* Enable fortran to gcc yaml
* Refactor Fortran CMake config tests and CMake test args
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
commit 061b23ac0011d3a26f660a7f4d07c40f41d63f10
Author: Larry Knox <lrknox@hdfgroup.org>
Date: Thu Jun 3 16:07:23 2021 -0500
Partial merge issue #642 develop branch PRs to Hdf5 1 10 (#718)
* Revert addition of & to 2 parameters in DSetCreatPropList::setVirtual to
maintain binary compatibility.
* Fix H5Eget_auto2/H5Eauto_is_v2 to not clear error stack (#625)
* Removes gratuitous (double)x.yF casts (#632)
* Committing clang-format changes
* Removes gratuitous (double)x.yF casts
* Committing clang-format changes
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Cleans up a const warning left over from previous constification (#633)
* Committing clang-format changes
* Adds consts to a few global variables
* Cleans up a const warning left over from previous constification
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Purges UFAIL from the library (#637)
* Committing clang-format changes
* Purges UFAIL from the library
* H5HL_insert change requested in PR
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Bmr dev hdffv 11223 (#640)
* Fixed HDFFV-11223 (CVE-2018-14460)
Description
- Added checks against buffer size to prevent segfault, in case of data
corruption, for sdim->size and sdim->max.
- Renamed data files in an existing test to shorten their length
as agreed with other developers previously.
Platforms tested:
Linux/64 (jelly)
* Committing clang-format changes
* Updated for test files
* Updated for HDFFV-11223
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Committing clang-format changes
* Restore "error:" in line 2666.
* Revert "Fix H5Eget_auto2/H5Eauto_is_v2 to not clear error stack (#625)"
This reverts commit 426b50484841118cf633fd6147302a63a30fd746.
Co-authored-by: jhendersonHDF <jhenderson@hdfgroup.org>
Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com>
* (fix) Segmentation fault when using a compound type. (#143)
* (fix) Segmentation fault when using a compound type.
In the case when a compounded attribute is written to dataset
followed by writing the data with a data transform function
to the dataset will result in a segmentation fault. It turns out
the data is classified as compounded while it is not. Now, the
state is always reset first to not compounded followed by the
existing check if the variable is compounded.
* (fix) Removed undesired comment lines.
* (fix) Segmentation fault when using a compound type: added test.
* (fix) Added the missing cmpd_transform.c file to MANIFEST.
* (fix) cmpd_dtransform test: autotools and source header.
Added the cmp_dtransform test to the autotools configuration and
updated the HDF Group copyright header.
Co-authored-by: Jan-Willem Blokland <Jan-Willem.Blokland@Shell.com>
* (fix) H5Z_xform_create function and scientific notation (#144)
* (fix) H5Z_xform_create function and scientific notation
Implemented a more sophisticated check to support scientific notation
in the expression of the H5Zset_data_transform function.
* (fix) H5Z_xform_create and scientific notation: Added test.
Added a test to demonstrate that the parsing of expression
which includes scientific notation works correctly. Improved
inline comment.
Co-authored-by: Jan-Willem Blokland <Jan-Willem.Blokland@Shell.com>
* Adds const to a few global variables (#623)
* Committing clang-format changes
* Adds consts to a few global variables
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Made private my_yyinput function static (#618)
This prevents it being exported as a public symbol.
* Reduces overly-pedantic casting in the public headers (#644)
* Committing clang-format changes
* Fixes overly pedantic casting in public headers
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Use internal version of H5Eprint2 to avoid possible stack overflow (#661)
* Fixes for a couple of trivial warnings (#676)
* Committing clang-format changes
* Trivial warning fixes:
* Removes an unused done target in H5Tbit.c
* Add (void) to quiet "ignored return value" warnings in the generators
(which generally ignore errors)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Removes alternative function enter/leave macro scheme (#678)
* Committing clang-format changes
* Converted BEGIN_FUNC, etc. macros to FUNC_ENTER
* Rips out the BEGIN_FUNC, etc. macros
* Removes 'end if', etc. comments from H5HL package
* Committing clang-format changes
* Fixes an H5EA iterate issue
* Fixes an issue in the H5FA iterator code
* Further cleanup in bin/trace after macro removal
* Iterator changes in H5EA and H5FA
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Various CMake changes (#679)
* Committing clang-format changes
* Several CMake updates:
* Removes unused HDF5_ENABLE_HSIZET
* Switches TEST_SHELL_SCRIPTS to ON
* Sets SH_PROGRAM to bash instead of sh
* Set default build type back to RelWithDebInfo
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Revert "Removes alternative function enter/leave macro scheme (#678)"
This reverts commit edddb11b791adbdcaafed3ba718c95dd349a4e9a.
* err_compat test cleanup (#681)
* Committing clang-format changes
* Cleans up err_compat test and output
* Formatted source
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Sets the memory alloc sanity check option to disabled in autotools (#686)
* Revert "Sets the memory alloc sanity check option to disabled in autotools (#686)"
This reverts commit 652ffca58699388fff960c6a92c8ecfd1fc5d19b.
(Only for release branch).
* Removes alternative function enter/leave macro scheme (#678)
* Committing clang-format changes
* Converted BEGIN_FUNC, etc. macros to FUNC_ENTER
* Rips out the BEGIN_FUNC, etc. macros
* Removes 'end if', etc. comments from H5HL package
* Committing clang-format changes
* Fixes an H5EA iterate issue
* Fixes an issue in the H5FA iterator code
* Further cleanup in bin/trace after macro removal
* Iterator changes in H5EA and H5FA
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
* Committing clang-format changes
Co-authored-by: jhendersonHDF <jhenderson@hdfgroup.org>
Co-authored-by: Dana Robinson <43805+derobins@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bmribler <39579120+bmribler@users.noreply.github.com>
Co-authored-by: Jan-Willem Blokland <J.W.S.Blokland@XS4All.nl>
Co-authored-by: Jan-Willem Blokland <Jan-Willem.Blokland@Shell.com>
Co-authored-by: Sean McBride <sean@rogue-research.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 1 | ||||
-rw-r--r-- | test/CMakeTests.cmake | 2 | ||||
-rw-r--r-- | test/Makefile.am | 2 | ||||
-rw-r--r-- | test/ShellTests.cmake | 2 | ||||
-rw-r--r-- | test/cmpd_dtransform.c | 136 | ||||
-rw-r--r-- | test/dtransform.c | 24 | ||||
-rw-r--r-- | test/err_compat.c | 273 | ||||
-rw-r--r-- | test/error_test.c | 2 | ||||
-rw-r--r-- | test/testfiles/err_compat_1 | 12 |
9 files changed, 318 insertions, 136 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 09ee97b..ecfef57 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -285,6 +285,7 @@ set (H5_TESTS swmr thread_id # special link timer + cmpd_dtransform version_bounds_1_10 ) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 1461648..4cf11f5 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -919,7 +919,7 @@ if (BUILD_SHARED_LIBS) ############################################################################## endif () -option (TEST_SHELL_SCRIPTS "Enable shell script tests" OFF) +option (TEST_SHELL_SCRIPTS "Enable shell script tests" ON) if (TEST_SHELL_SCRIPTS) include (ShellTests.cmake) endif() diff --git a/test/Makefile.am b/test/Makefile.am index d78cbe3..b677927 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -60,7 +60,7 @@ TEST_PROG= testhdf5 \ cache cache_api cache_image cache_tagging lheap ohdr \ stab gheap evict_on_close farray earray btree2 fheap \ pool accum hyperslab istore bittests dt_arith page_buffer \ - dtypes dsets chunk_info cmpd_dset filter_fail extend direct_chunk \ + dtypes dsets chunk_info cmpd_dset cmpd_dtransform filter_fail extend direct_chunk \ external efc objcopy links unlink twriteorder big mtime fillval mount \ flush1 flush2 app_ref enum set_extent ttsafe enc_dec_plist \ enc_dec_plist_cross_platform getname vfd ros3 s3comms hdfs ntypes \ diff --git a/test/ShellTests.cmake b/test/ShellTests.cmake index b28bbd6..812121e 100644 --- a/test/ShellTests.cmake +++ b/test/ShellTests.cmake @@ -17,7 +17,7 @@ if (UNIX) - find_program (SH_PROGRAM sh) + find_program (SH_PROGRAM bash) if (SH_PROGRAM) ############################################################################## diff --git a/test/cmpd_dtransform.c b/test/cmpd_dtransform.c new file mode 100644 index 0000000..ef5ad75 --- /dev/null +++ b/test/cmpd_dtransform.c @@ -0,0 +1,136 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * All rights reserved. * + * * + * 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://www.hdfgroup.org/licenses. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Jan-Willem Blokland + * December 1, 2020 + * + * Purpose: Test writing compounded attribute followed by + * writing data with a data transform function. + */ + +#include "h5test.h" + +#define FILENAME "cmpd_dtransform.h5" +#define LENGTH 11 + +typedef struct { + char name[64]; + char unit[64]; +} att_t; + +int +main(void) +{ + hsize_t dima[] = {1}; + hsize_t dims[] = {LENGTH}; + hid_t str_dtyp_id, att_dtyp_id, file_id, fspace_id, dset_id, att_dspc_id, att_attr_id, dxpl_id; + + /* Compound datatype */ + att_t *atts = HDmalloc(sizeof(att_t)); + HDstrcpy(atts[0].name, "Name"); + HDstrcpy(atts[0].unit, "Unit"); + + /* String type */ + if ((str_dtyp_id = H5Tcopy(H5T_C_S1)) < 0) + TEST_ERROR; + H5Tset_size(str_dtyp_id, 64); + + /* Attribute type */ + if ((att_dtyp_id = H5Tcreate(H5T_COMPOUND, sizeof(att_t))) < 0) + TEST_ERROR; + H5Tinsert(att_dtyp_id, "NAME", HOFFSET(att_t, name), str_dtyp_id); + H5Tinsert(att_dtyp_id, "UNIT", HOFFSET(att_t, unit), str_dtyp_id); + + /* Create file. */ + if ((file_id = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR; + + /* Create file dataspace. */ + if ((fspace_id = H5Screate_simple(1, dims, NULL)) < 0) + TEST_ERROR; + + /* Create dataset. */ + if ((dset_id = H5Dcreate2(file_id, "test_dset", H5T_NATIVE_INT, fspace_id, H5P_DEFAULT, H5P_DEFAULT, + H5P_DEFAULT)) < 0) + TEST_ERROR; + + /* Write the attribute (compound) to the dataset */ + if ((att_dspc_id = H5Screate_simple(1, dima, NULL)) < 0) + TEST_ERROR; + if ((att_attr_id = + H5Acreate2(dset_id, "ATTRIBUTES", att_dtyp_id, att_dspc_id, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR; + if (H5Awrite(att_attr_id, att_dtyp_id, atts) < 0) + TEST_ERROR; + + /* Create dataset transfer property list */ + const char *expr = "2*x"; + if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) + TEST_ERROR; + if (H5Pset_data_transform(dxpl_id, expr) < 0) { + HDprintf("**** ERROR: H5Pset_data_transform (expression: %s) ****\n", expr); + TEST_ERROR; + } + + int *data = HDmalloc(LENGTH * sizeof(int)); + int *data_res = HDmalloc(LENGTH * sizeof(int)); + for (unsigned i = 0; i < LENGTH; i++) { + data[i] = 10; + data_res[i] = 2 * data[i]; + } + + /* Write the data */ + if (H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, data) < 0) + TEST_ERROR; + + /* Read attribute */ + att_t *atts_res = HDmalloc(sizeof(att_t)); + if (H5Aread(att_attr_id, att_dtyp_id, atts_res) < 0) + TEST_ERROR; + + /* Verify attribute */ + if (HDstrcmp(atts_res[0].name, atts[0].name) != 0) + TEST_ERROR; + if (HDstrcmp(atts_res[0].unit, atts[0].unit) != 0) + TEST_ERROR; + + /* Read the data */ + if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) + TEST_ERROR; + + /* Verify data */ + for (unsigned idx = 0; idx < LENGTH; idx++) { + if (data[idx] != data_res[idx]) + TEST_ERROR; + } + + HDfree(atts); + HDfree(atts_res); + HDfree(data); + HDfree(data_res); + + /* Close all identifiers. */ + H5Pclose(dxpl_id); + H5Aclose(att_attr_id); + H5Sclose(att_dspc_id); + H5Dclose(dset_id); + H5Sclose(fspace_id); + H5Fclose(file_id); + H5Tclose(att_dtyp_id); + H5Tclose(str_dtyp_id); + + return 0; + +error: + return 1; +} diff --git a/test/dtransform.c b/test/dtransform.c index c679d30..9445d83 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -581,6 +581,7 @@ test_specials(hid_t file) const char *special3 = "1000/x"; const char *special4 = "-x"; const char *special5 = "+x"; + const char *special6 = "2e+1*x"; TESTING("data transform of some special cases") @@ -705,6 +706,29 @@ test_specials(hid_t file) if (H5Dclose(dset_id) < 0) TEST_ERROR + /*----------------------------- + * Operation 6: 2e+1*x + *----------------------------*/ + if (H5Pset_data_transform(dxpl_id, special6) < 0) + TEST_ERROR; + + for (row = 0; row < ROWS; row++) + for (col = 0; col < COLS; col++) + data_res[row][col] = transformData[row][col] * 20; + + if ((dset_id = H5Dcreate2(file, "/special6", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, + H5P_DEFAULT)) < 0) + TEST_ERROR + if (H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id, transformData) < 0) + TEST_ERROR + if (H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf) < 0) + TEST_ERROR + + COMPARE_INT(read_buf, data_res) + + if (H5Dclose(dset_id) < 0) + TEST_ERROR + if (H5Pclose(dxpl_id) < 0) TEST_ERROR if (H5Sclose(dataspace) < 0) diff --git a/test/err_compat.c b/test/err_compat.c index 53c8667..6ad69d8 100644 --- a/test/err_compat.c +++ b/test/err_compat.c @@ -39,7 +39,6 @@ int * ipoints2_data = NULL; int * icheck2_data = NULL; #define DSET_NAME "a_dataset" -#define FAKE_ID (hid_t) - 1 herr_t custom_print_cb1(int n, H5E_error1_t *err_desc, void *client_data); herr_t custom_print_cb2(int n, H5E_error2_t *err_desc, void *client_data); @@ -47,13 +46,13 @@ herr_t custom_print_cb2(int n, H5E_error2_t *err_desc, void *client_data); /*------------------------------------------------------------------------- * Function: user_print1 * - * Purpose: This function is a user-defined old-style printing function. + * Purpose: This function is a user-defined old-style printing function. * This is just a convenience function for H5Ewalk1() with a * function that prints error messages. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 4 October 2010 * *------------------------------------------------------------------------- @@ -66,22 +65,22 @@ user_print1(FILE *stream) if (H5Ewalk1(H5E_WALK_UPWARD, (H5E_walk1_t)custom_print_cb1, stream) < 0) TEST_ERROR; - return 0; + return SUCCEED; error: - return -1; + return FAIL; } /*------------------------------------------------------------------------- * Function: user_print2 * - * Purpose: This function is a user-defined new-style printing function. + * Purpose: This function is a user-defined new-style printing function. * This is just a convenience function for H5Ewalk2() with a * function that prints error messages. * - * Return: Non-negative on success/Negative on failure + * Return: SUCCEED/FAIL * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 4 October 2010 * *------------------------------------------------------------------------- @@ -94,27 +93,23 @@ user_print2(hid_t err_stack, FILE *stream) if (H5Ewalk2(err_stack, H5E_WALK_UPWARD, (H5E_walk2_t)custom_print_cb2, stream) < 0) TEST_ERROR; - return 0; + return SUCCEED; error: - return -1; + return FAIL; } /*------------------------------------------------------------------------- * Function: custom_print_cb1 * - * Purpose: Callback function to print error stack in customized way - * for H5Ewalk1. + * Purpose: Callback function to print error stack in customized way + * for H5Ewalk1 * - * Return: Success: 0 + * Return: SUCCEED/FAIL * - * Failure: -1 - * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 4 October 2010 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -140,7 +135,7 @@ custom_print_cb1(int n, H5E_error1_t *err_desc, void *client_data) H5free_memory(maj); H5free_memory(min); - return 0; + return SUCCEED; error: if (maj) @@ -148,24 +143,20 @@ error: if (min) H5free_memory(min); - return -1; + return FAIL; } /*------------------------------------------------------------------------- * Function: custom_print_cb2 * - * Purpose: Callback function to print error stack in customized way - * for H5Ewalk1. - * - * Return: Success: 0 + * Purpose: Callback function to print error stack in customized way + * for H5Ewalk1 * - * Failure: -1 + * Return: SUCCEED/FAIL * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * 4 October 2010 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -191,7 +182,7 @@ custom_print_cb2(int n, H5E_error2_t *err_desc, void *client_data) H5free_memory(maj); H5free_memory(min); - return 0; + return SUCCEED; error: if (maj) @@ -199,62 +190,59 @@ error: if (min) H5free_memory(min); - return -1; + return FAIL; } /*------------------------------------------------------------------------- - * Function: test_error1 - * - * Purpose: Test the backward compatibility of H5Eset/get_auto. - * - * Return: Success: 0 + * Function: test_error_compat * - * Failure: -1 - * - * Programmer: Raymond Lu - * 17 September 2010 + * Purpose: Test the backward compatibility of H5Eset/get_auto * + * Return: SUCCEED/FAIL * - * Modifications: + * Programmer: Raymond Lu + * 17 September 2010 * *------------------------------------------------------------------------- */ static herr_t -test_error1(void) +test_error_compat(void) { - hid_t dataset, space; + hid_t did = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; hsize_t dims[2]; H5E_auto1_t old_func1; H5E_auto2_t old_func2; - void * old_data; + void * old_data = NULL; herr_t ret; TESTING("error API H5Eset/get_auto"); - HDfprintf(stderr, "\n"); - /* Create the data space */ + /* Add a newline and flush so the output file looks nicer */ + HDprintf("\n"); + HDfflush(stdout); + + /* Create the dataspace */ dims[0] = DIM0; dims[1] = DIM1; - if ((space = H5Screate_simple(2, dims, NULL)) < 0) + if ((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR; - /* Use H5Eget_auto2 to query the default printing function. The library - *should indicate H5Eprint2 as the default. */ + /* Use H5Eget_auto2 to query the default printing function. */ if (H5Eget_auto2(H5E_DEFAULT, &old_func2, &old_data) < 0) TEST_ERROR; if (old_data != NULL) TEST_ERROR; - if (!old_func2 || (H5E_auto2_t)H5Eprint2 != old_func2) + if (old_func2 == NULL) TEST_ERROR; - /* This function sets the default printing function to be H5Eprint2. */ if (H5Eset_auto2(H5E_DEFAULT, old_func2, old_data) < 0) TEST_ERROR; /* Try the printing function. Dataset creation should fail because the file * doesn't exist. */ - dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (dataset >= 0) + did = H5Dcreate2(H5I_INVALID_HID, DSET_NAME, H5T_STD_I32BE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (did >= 0) TEST_ERROR; /* This call should work. It simply returns H5Eprint1. */ @@ -271,8 +259,8 @@ test_error1(void) /* Try the printing function. Dataset creation should fail because the file * doesn't exist. */ - dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (dataset >= 0) + did = H5Dcreate2(H5I_INVALID_HID, DSET_NAME, H5T_STD_I32BE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (did >= 0) TEST_ERROR; /* This call should fail because the test mixes H5Eget_auto2 with H5Eset_auto1. @@ -288,16 +276,16 @@ test_error1(void) /* Try the printing function. Dataset creation should fail because the file * doesn't exist. */ - dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (dataset >= 0) + did = H5Dcreate2(H5I_INVALID_HID, DSET_NAME, H5T_STD_I32BE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (did >= 0) TEST_ERROR; - /* This function changes the new-style printing function back to the default H5Eprint2. */ - if (H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)H5Eprint2, NULL) < 0) + /* This function changes the new-style printing function to the original. */ + if (H5Eset_auto2(H5E_DEFAULT, old_func2, NULL) < 0) TEST_ERROR; - /* This call should work because the H5Eset_auto2 above restored the default printing - * function H5Eprint2. It simply returns user_print1. */ + /* This call should work because the H5Eset_auto2 above set the default printing + * function to H5Eprint2. It simply returns user_print1. */ if ((ret = H5Eget_auto1(&old_func1, &old_data)) < 0) TEST_ERROR; if (old_data != NULL) @@ -315,69 +303,77 @@ test_error1(void) TEST_ERROR; if (old_data != NULL) TEST_ERROR; - if (!old_func2 || (H5E_auto2_t)H5Eprint2 != old_func2) + if (old_func2 == NULL) TEST_ERROR; /* Try the printing function. Dataset creation should fail because the file * doesn't exist. */ - dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (dataset >= 0) + did = H5Dcreate2(H5I_INVALID_HID, DSET_NAME, H5T_STD_I32BE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (did >= 0) TEST_ERROR; - return 0; + if (H5Sclose(sid) < 0) + TEST_ERROR; + + return SUCCEED; error: - return -1; + H5E_BEGIN_TRY + { + H5Dclose(did); + H5Sclose(sid); + } + H5E_END_TRY + + return FAIL; } /*------------------------------------------------------------------------- - * Function: test_error2 - * - * Purpose: Test error API functions, mainly on H5Epush1. + * Function: test_h5epush1 * - * Return: Success: 0 - * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 10, 2003 + * Purpose: Test error API functions, mainly H5Epush1 * + * Return: SUCCEED/FAIL * - * Modifications: + * Programmer: Raymond Lu + * July 10, 2003 * *------------------------------------------------------------------------- */ static herr_t -test_error2(hid_t file) +test_h5epush1(hid_t file) { - hid_t dataset, space; + hid_t did = H5I_INVALID_HID; + hid_t sid = H5I_INVALID_HID; + hid_t estack_id = H5I_INVALID_HID; hsize_t dims[2]; - const char *FUNC_test_error = "test_error2"; + const char *FUNC_test_error = "test_h5epush1"; TESTING("error API based on data I/O"); - HDfprintf(stderr, "\n"); - /* Create the data space */ + /* Add a newline and flush so the output file looks nicer */ + HDprintf("\n"); + HDfflush(stdout); + + /* Create the dataspace */ dims[0] = DIM0; dims[1] = DIM1; - if ((space = H5Screate_simple(2, dims, NULL)) < 0) + if ((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR; /* Test H5E_BEGIN_TRY */ H5E_BEGIN_TRY { - dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + did = + H5Dcreate2(H5I_INVALID_HID, DSET_NAME, H5T_STD_I32BE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; /* Create the dataset */ - if ((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < - 0) { - H5Epush1(__FILE__, FUNC_test_error, __LINE__, H5E_ERROR, H5E_CANTCREATE, "H5Dcreate2 failed"); - goto error; - } + if ((did = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR; - /* Disable the library's default printing function */ + /* Disable the library's default printing function */ #ifdef H5_USE_16_API_DEFAULT if (H5Eset_auto(NULL, NULL) < 0) #else @@ -386,36 +382,48 @@ test_error2(hid_t file) TEST_ERROR; /* Make H5Dwrite fail, verify default print is disabled */ - if (H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) < 0) { - H5Epush1(__FILE__, FUNC_test_error, __LINE__, H5E_ERROR, H5E_WRITEERROR, - "H5Dwrite shouldn't succeed"); - goto error; - } + if (H5Dwrite(H5I_INVALID_HID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) < 0) + H5Epush1(__FILE__, FUNC_test_error, __LINE__, H5E_ERROR, H5E_WRITEERROR, "expected H5Dwrite error"); + else + TEST_ERROR; + + /* Save the error stack so the close calls don't interfere with it */ + if ((estack_id = H5Eget_current_stack()) < 0) + TEST_ERROR; - /* In case program comes to this point, close dataset */ - if (H5Dclose(dataset) < 0) + /* Close open identifiers */ + if (H5Dclose(did) < 0) + TEST_ERROR; + if (H5Sclose(sid) < 0) + TEST_ERROR; + + /* Restore the stack containing errors */ + if (H5Eset_current_stack(estack_id) < 0) TEST_ERROR; - TEST_ERROR; + return SUCCEED; error: - return -1; + H5E_BEGIN_TRY + { + H5Dclose(did); + H5Sclose(sid); + H5Eclose_stack(estack_id); + } + H5E_END_TRY + + return FAIL; } /*------------------------------------------------------------------------- * Function: dump_error * - * Purpose: Prints error stack in default and customized ways. + * Purpose: Prints error stack in default and customized ways * - * Return: Success: 0 + * Return: SUCCEED/FAIL * - * Failure: -1 - * - * Programmer: Raymond Lu - * July 17, 2003 - * - * - * Modifications: + * Programmer: Raymond Lu + * July 17, 2003 * *------------------------------------------------------------------------- */ @@ -432,35 +440,34 @@ dump_error(void) if (H5Ewalk1(H5E_WALK_UPWARD, custom_print_cb1, stderr) < 0) TEST_ERROR; - return 0; + return SUCCEED; error: - return -1; + return FAIL; } /*------------------------------------------------------------------------- * Function: main * - * Purpose: Test error API. - * - * Programmer: Raymond Lu - * July 10, 2003 + * Purpose: Test error API * - * Modifications: + * Programmer: Raymond Lu + * July 10, 2003 * *------------------------------------------------------------------------- */ int main(void) { - hid_t file, fapl; + hid_t fid = H5I_INVALID_HID; + hid_t fapl_id = H5I_INVALID_HID; char filename[1024]; const char *FUNC_main = "main"; int i; HDfprintf(stderr, " This program tests the Error API compatible with HDF5 v1.6. There are supposed to " "be some error messages\n"); - fapl = h5_fileaccess(); + fapl_id = h5_fileaccess(); /* Set up data arrays */ if (NULL == (ipoints2_data = (int *)HDcalloc(DIM0 * DIM1, sizeof(int)))) @@ -477,14 +484,14 @@ main(void) for (i = 0; i < DIM0; i++) icheck2[i] = icheck2_data + (i * DIM1); - h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + h5_fixname(FILENAME[0], fapl_id, filename, sizeof(filename)); + if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id)) < 0) TEST_ERROR; /* Test error stack */ /* Push an error onto error stack */ - H5Epush1(__FILE__, FUNC_main, __LINE__, H5E_ERROR, H5E_BADVALUE, "Error test failed"); + H5Epush1(__FILE__, FUNC_main, __LINE__, H5E_ERROR, H5E_BADVALUE, "fake error message 1"); /* Print out the errors on stack */ dump_error(); @@ -493,17 +500,24 @@ main(void) H5Eclear1(); /* Test error API */ - if (test_error1() < 0) + if (test_error_compat() < 0) TEST_ERROR; - if (test_error2(file) < 0) { - H5Epush1(__FILE__, FUNC_main, __LINE__, H5E_ERROR, H5E_BADMESG, "Error test failed"); + /* Test H5Epush1 + * + * On success, there will be errors on the stack to print. + */ + if (test_h5epush1(fid) < 0) { + TEST_ERROR; + } + else { + H5Epush1(__FILE__, FUNC_main, __LINE__, H5E_ERROR, H5E_BADMESG, "fake error message 2"); H5Eprint1(stderr); } - if (H5Fclose(file) < 0) + if (H5Fclose(fid) < 0) TEST_ERROR; - h5_clean_files(FILENAME, fapl); + h5_clean_files(FILENAME, fapl_id); HDfree(ipoints2); HDfree(ipoints2_data); @@ -511,7 +525,7 @@ main(void) HDfree(icheck2_data); HDprintf("All error API tests passed.\n"); - return 0; + return EXIT_SUCCESS; error: HDfree(ipoints2); @@ -519,7 +533,14 @@ error: HDfree(icheck2); HDfree(icheck2_data); + H5E_BEGIN_TRY + { + H5Fclose(fid); + H5Pclose(fapl_id); + } + H5E_END_TRY + HDprintf("***** ERROR TEST FAILED! *****\n"); - return 1; + return EXIT_FAILURE; } #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/test/error_test.c b/test/error_test.c index c8205ff8..f470318 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -129,7 +129,7 @@ test_error(hid_t file) TEST_ERROR; if (old_data != NULL) TEST_ERROR; - if (old_func != (H5E_auto2_t)H5Eprint2) + if (old_func == NULL) TEST_ERROR; if (H5Eset_auto2(H5E_DEFAULT, NULL, NULL) < 0) diff --git a/test/testfiles/err_compat_1 b/test/testfiles/err_compat_1 index d81dba1..4c32d43 100644 --- a/test/testfiles/err_compat_1 +++ b/test/testfiles/err_compat_1 @@ -1,8 +1,10 @@ -Testing error API H5Eset/get_auto Testing error API based on data I/O All error API tests passed. +Testing error API H5Eset/get_auto +Testing error API based on data I/O +All error API tests passed. This program tests the Error API compatible with HDF5 version (number). There are supposed to be some error messages ********* Print error stack in HDF5 default way ********* HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in main(): Error test failed + #000: (file name) line (number) in main(): fake error message 1 major: Error API minor: Bad value @@ -10,7 +12,6 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): error #000: (file name) in main(): line (number) major: Error API minor: Bad value - HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Dcreate2(): not a location ID major: Invalid arguments to routine @@ -46,12 +47,11 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #001: (file name) line (number) in H5G_loc(): invalid location ID major: Invalid arguments to routine minor: Bad value - HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): - #000: (file name) line (number) in main(): Error test failed + #000: (file name) line (number) in main(): fake error message 2 major: Error API minor: Unrecognized message - #001: (file name) line (number) in test_error2(): H5Dwrite shouldn't succeed + #001: (file name) line (number) in test_h5epush1(): expected H5Dwrite error major: Error API minor: Write failed #002: (file name) line (number) in H5Dwrite(): dset_id is not a dataset ID |