From 6dc618cb011a54c8a10c5b9a57a0ea04273e782d Mon Sep 17 00:00:00 2001
From: Allen Byrne \c H5C_incr__off: Automatic cache size increase is
- * disabled. \c H5C_incr__threshold: Automatic cache size increase is enabled using the hit rate
- * threshold algorithm. \c H5C_incr__off: Automatic cache size increase
+ * is disabled. \c H5C_incr__threshold: Automatic cache size increase is enabled using the hit
+ * rate threshold algorithm. \c H5C_flash_incr__off: Flash cache size increase is
- * disabled. \c H5C_flash_incr__add_space: Flash cache size increase is enabled using the add space
- * algorithm. \c H5C_flash_incr__add_space: Flash cache size increase is enabled using the add
+ * space algorithm. H5C_decr__off: Automatic cache size decrease is disabled,
- * and the remaining decrement fields are ignored. H5C_decr__threshold: Automatic cache size
- * decrease is enabled using the hit rate threshold algorithm. H5C_decr__age_out: Automatic cache
- * size decrease is enabled using the ageout algorithm. H5C_decr__age_out_with_threshold:
- * Automatic cache size decrease is enabled using the ageout with hit rate threshold
- * algorithm H5C_decr__off: Automatic cache size decrease is
+ * disabled, and the remaining decrement fields are ignored. H5C_decr__threshold: Automatic
+ * cache size decrease is enabled using the hit rate threshold algorithm. H5C_decr__age_out:
+ * Automatic cache size decrease is enabled using the ageout algorithm. H5C_decr__age_out_with_threshold: Automatic cache size decrease is enabled using the ageout
+ * with hit rate threshold algorithm Synchronization occurs whenever the
- * number of bytes of dirty metadata created since the last synchronization exceeds this limit. The report function is not
- * supported code, and can be expected to change between versions of the library. Use it at your own
- * risk. The report
+ * function is not supported code, and can be expected to change between versions of the library. Use
+ * it at your own risk. The trace file is a debuging feature that allows the capture of top level
- * metadata cache requests for purposes of debugging and/or optimization. This field should normally be set
- * to This field should only be
- * set to The trace file feature is unsupported unless used at the direction of The HDF
- * Group. It is intended to allow The HDF Group to collect a trace of cache activity in cases of occult
- * failures and/or poor performance seen in the field, so as to aid in reproduction in the lab. If you use it
- * absent the direction of The HDF Group, you are on your
- * own. The trace file is a debuging feature that allows the capture of top
+ * level metadata cache requests for purposes of debugging and/or optimization. This field should
+ * This field should only normally be set to The trace file feature is
+ * unsupported unless used at the direction of The HDF Group. It is intended to allow The HDF Group to
+ * collect a trace of cache activity in cases of occult failures and/or poor performance seen in the
+ * field, so as to aid in reproduction in the lab. If you use it absent the direction of The HDF Group,
+ * you are on your own. See the
- * above comments on the The trace file feature is
- * unsupported unless used at the direction of The HDF Group. It is intended to allow The HDF Group to collect
- * a trace of cache activity in cases of occult failures and/or poor performance seen in the field, so as to
- * aid in reproduction in the lab. If you use it absent the direction of The HDF Group, you are on your
- * own. The
+ * trace file feature is unsupported unless used at the direction of The HDF Group. It is intended to
+ * allow The HDF Group to collect a trace of cache activity in cases of occult failures and/or poor
+ * performance seen in the field, so as to aid in reproduction in the lab. If you use it absent the
+ * direction of The HDF Group, you are on your own. In the parallel case, an ascii representation of the mpi rank of the process will be
- * appended to the file name to yield a unique trace file name for each process. The length of the path
- * must not exceed #H5AC__MAX_TRACE_FILE_NAME_LEN characters. The trace file feature is
- * unsupported unless used at the direction of The HDF Group. It is intended to allow The HDF Group to collect
- * a trace of cache activity in cases of occult failures and/or poor performance seen in the field, so as to
- * aid in reproduction in the lab. If you use it absent the direction of The HDF Group, you are on your
- * own. In the parallel case, an ascii representation of the mpi rank of the process
+ * will be appended to the file name to yield a unique trace file name for each process. The
+ * length of the path must not exceed #H5AC__MAX_TRACE_FILE_NAME_LEN characters. The trace file
+ * feature is unsupported unless used at the direction of The HDF Group. It is intended to allow The
+ * HDF Group to collect a trace of cache activity in cases of occult failures and/or poor performance
+ * seen in the field, so as to aid in reproduction in the lab. If you use it absent the direction of
+ * The HDF Group, you are on your own. In rare circumstances, the raw data throughput requirements
- * may be so high that the user wishes to postpone metadata writes so as to reserve I/O throughput for raw
- * data. The The When
- * this flag is set to disabled ( Evictions will be re-enabled when this field
- * is set back to In rare circumstances, the raw data throughput
+ * requirements may be so high that the user wishes to postpone metadata writes so as to reserve I/O
+ * throughput for raw data. The The
+ * When this flag is set to disabled ( Evictions will be re-enabled when this field is set back to The value must lie in the interval [0.0, 1.0]. 0.01 is a good place to start in the serial case.
- * In the parallel case, a larger value is needed --
- * see Metadata Caching in HDF5 in the collection
- * "Advanced Topics in HDF5." The value must lie in the interval [0.0, 1.0]. 0.01 is a good place to start in the serial
+ * case. In the parallel case, a larger value is needed -- see Metadata Caching in HDF5 in the collection
+ * "Advanced Topics in HDF5." \c H5C_incr__off: Automatic cache size increase is disabled, and the
- * remaining increment fields are ignored. \c H5C_incr__threshold: Automatic cache size increase is enabled
- * using the hit rate threshold
- * algorithm. \c H5C_incr__off: Automatic cache size increase is disabled,
+ * and the remaining increment fields are ignored. \c H5C_incr__threshold: Automatic cache size
+ * increase is enabled using the hit rate threshold algorithm. When the
- * hit rate over an epoch is below this threshold and the cache is full, the maximum size of the cache is
- * multiplied by increment (below), and then clipped as necessary to stay within max_size, and possibly
- * max_increment. This field must lie in the interval [0.0, 1.0]. 0.8 or 0.9 is a good starting
- * point. This field must lie in the interval [0.0, 1.0]. 0.8 or 0.9 is a good
+ * starting point. The actual cache size increase will be clipped
- * to satisfy the max_size specified in the general configuration, and possibly max_increment below. The
- * parameter must be greater than or equal to 1.0 -- 2.0 is a reasonable value. If you set it to 1.0,
- * you will effectively disable cache size
- * increases. The actual cache size increase will be
+ * clipped to satisfy the max_size specified in the general configuration, and possibly max_increment
+ * below. The parameter must be greater than or equal to 1.0 -- 2.0 is a reasonable
+ * value. If you set it to 1.0, you will effectively disable cache size increases. \c H5C_flash_incr__off: Flash cache size increase is
- * disabled. \c H5C_flash_incr__add_space: Flash cache size increase is enabled using the add space
- * algorithm. \c H5C_flash_incr__add_space: Flash cache size increase is enabled using the add
+ * space algorithm. At present, this value must
- * lie in the range [0.1, 1.0]. At present, this value
+ * must lie in the range [0.1, 1.0]. At present, this field must lie in the range [0.1,
- * 10.0]. At present, this field must lie in
+ * the range [0.1, 10.0]. \c H5C_decr__off: Automatic cache size decrease is
- * disabled. \c H5C_decr__threshold: Automatic cache size decrease is enabled using the hit rate threshold
- * algorithm. \c H5C_decr__age_out: Automatic cache size decrease is enabled using the ageout
- * algorithm. \c H5C_decr__age_out_with_threshold: Automatic cache size decrease is enabled using the
- * ageout with hit rate threshold
- * algorithm
*
* hbool_t
- * open_trace_file
OUT: Boolean field indicating whether the
+ * trace_file_name
field should be used to open
- * a trace file for the cache. This field will always be set to 0
in this context.OUT: Boolean field indicating whether the
* trace_file_name
field should be used to
+ * open a trace file for the cache. This field will always be set to 0
in this
+ * context.
*
* hbool_t
@@ -996,8 +998,8 @@ H5_DLL ssize_t H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len);
* will always be set to close_trace_file
0
in this context.
*
+ * char*
- * trace_file_name
OUT: Full path name of the trace file to be opened if the open_trace_file
field is set
- * to 1
. This field will always be set to the empty string in this context.OUT: Full path name of the trace file to be opened if the
* open_trace_file
field is
+ * set to 1
. This field will always be set to the empty string in this context.
*
* hbool_t
* evictions_enabled
OUT: Boolean flag indicating whether metadata cache entry evictions are
@@ -1041,10 +1043,10 @@ H5_DLL ssize_t H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len);
*
*
*
@@ -1094,13 +1096,13 @@ H5_DLL ssize_t H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len);
*
*
* enum H5C_cache_incr_mode
- * incr_mode
OUT: Enumerated value indicating the operational mode of the automatic cache size increase code. At
- * present, only the following values are legal:
+ * OUT: Enumerated value indicating the operational mode of the automatic cache size increase code.
+ * At present, only the following values are legal:
*
*
* double
@@ -1070,8 +1072,8 @@ H5_DLL ssize_t H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len);
* lower_hr_threshold
enum H5C_cache_flash_incr_mode
* flash_incr_mode
OUT: Enumerated value indicating the operational mode of the flash cache size increase code. At
* present, only the following values are legal:
+ * disabled.
* double
@@ -1082,8 +1084,8 @@ H5_DLL ssize_t H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len);
* flash_threshold
*
* double
* flash_multiple
OUT: The factor by which the size of the triggering entry / entry size increase is multiplied to
- * obtain the initial cache size increment. This increment may be reduced to reflect existing free space
- * in the cache and the
+ * obtain the initial cache size increment. This increment may be reduced to reflect existing free
+ * space in the cache and the max_size
field above.max_size
field above.
*
*
* enum H5C_cache_decr_mode
- * decr_mode
OUT: Enumerated value indicating the operational mode of the automatic cache size decrease code. At
- * present, the following values are legal:
+ * OUT: Enumerated value indicating the operational mode of the automatic cache size decrease code.
+ * At present, the following values are legal:
* double
* upper_hr_threshold
OUT: Upper hit rate threshold. This value is only used if the decr_mode is either
@@ -1143,7 +1145,8 @@ H5_DLL ssize_t H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len);
*
*
*
@@ -1179,59 +1182,59 @@ H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr);
* int
* dirty_bytes_threshold
OUT: Threshold number of bytes of dirty metadata generation for triggering synchronizations of the
* metadata caches serving the target file in the parallel case.
+ * number of bytes of dirty metadata created since the last synchronization exceeds this
+ * limit.
*
*
* hbool_t
* rpt_fcn_enabled
IN: Boolean flag indicating whether the adaptive cache resize report function is enabled. This
- * field should almost always be set to disabled (
+ * field should almost always be set to disabled (0
). Since resize algorithm activity is reported
- * via stdout, it MUST be set to disabled (0
) on Windows machines.0
). Since resize algorithm activity is
+ * reported via stdout, it MUST be set to disabled (0
) on Windows machines.
*
* hbool_t
* open_trace_File
IN: Boolean field indicating whether the
+ * a trace file for the cache.trace_file_name
field should be used to open
- * a trace file for the cache.0
, as trace file collection imposes considerable overhead.1
when the trace_file_name
contains the full path of the desired trace
- * file, and either there is no open trace file on the cache, or the close_trace_file
field is
- * also 1
.0
, as trace file collection imposes
+ * considerable overhead.1
when the trace_file_name
contains
+ * the full path of the desired trace file, and either there is no open trace file on the cache, or the
+ * close_trace_file
field is also 1
.
* hbool_t
* close_trace_file
IN: Boolean field indicating whether the current trace file (if any) should be closed.
+ * above comments on the open_trace_file
field. This field should be set to 0
unless
- * there is an open trace file on the cache that you wish to close.open_trace_file
field. This field should be set to
+ * 0
unless there is an open trace file on the cache that you wish to close.
*
* char
* trace_file_name[]
IN: Full path of the trace file to be opened if the
+ * to open_trace_file
field is set
- * to 1
.1
.
*
* hbool_t
* evictions_enabled
IN: A boolean flag indicating whether evictions from the metadata cache are enabled. This flag is
- * initially set to enabled (
+ * initially set to enabled (1
).evictions_enabled
field exists to allow this. However, this is an extreme step, and
- * you have no business doing it unless you have read the User Guide section on metadata caching, and have
- * considered all other options carefully.evictions_enabled
field may not be set to
- * disabled (0
) unless all adaptive cache resizing code is disabled via
- * the incr_mode
, flash_incr_mode
, and decr_mode
fields.0
), the metadata cache will not attempt to evict entries to make
- * space for new entries, and thus will grow without bound.1
. This should be done as soon as
- * possible.1
).evictions_enabled
field exists to allow this. However,
+ * this is an extreme step, and you have no business doing it unless you have read the User Guide
+ * section on metadata caching, and have considered all other options carefully.evictions_enabled
field may not be set to disabled (0
) unless all adaptive
+ * cache resizing code is disabled via the incr_mode
, flash_incr_mode
, and
+ * decr_mode
fields.0
), the
+ * metadata cache will not attempt to evict entries to make space for new entries, and thus will grow
+ * without bound.1
.
+ * This should be done as soon as possible.
* hbool_t
@@ -1241,24 +1244,24 @@ H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr);
* set_initial_size
*
* size_t
* initial_size
IN: If
+ * contain the desired initial size in bytes. This value must lie in the closed interval
+ * set_initial_size
is set to 1
, then initial_size
must
- * contain the desired initial size in bytes. This value must lie in the closed interval [min_size,
- * max_size]
. (see below)[min_size, max_size]
. (see below)
*
* double
* min_clean_fraction
IN: This field specifies the minimum fraction of the cache that must be kept either clean or
- * empty.
+ * empty.
* size_t
- * max_size
IN: Upper bound (in bytes) on the range of values that the adaptive cache resize code can select as
- * the maximum cache size.
+ * IN: Upper bound (in bytes) on the range of values that the adaptive cache resize code can select
+ * as the maximum cache size.
*
*
* size_t
- * min_size
IN: Lower bound (in bytes) on the range of values that the adaptive cache resize code can select as
- * the maximum cache size.
+ * IN: Lower bound (in bytes) on the range of values that the adaptive cache resize code can select
+ * as the maximum cache size.
* long int
* epoch_length
IN: Number of cache accesses between runs of the adaptive cache resize code. 50,000 is a good
@@ -1271,27 +1274,25 @@ H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr);
*
*
* enum H5C_cache_incr_mode
* incr_mode
IN: Enumerated value indicating the operational mode of the automatic cache size increase code. At
- * present, only two values are legal:
+ * present, only two values are legal:
*
* double
* lower_hr_threshold
IN: Hit rate threshold used by the hit rate threshold cache size increment algorithm.
+ * hit rate over an epoch is below this threshold and the cache is full, the maximum size of the
+ * cache is multiplied by increment (below), and then clipped as necessary to stay within max_size, and
+ * possibly max_increment.
*
* double
* increment
IN: Factor by which the hit rate threshold cache size increment algorithm multiplies the current
- * maximum cache size to obtain a tentative new cache size.
+ * maximum cache size to obtain a tentative new cache size.
*
* hbool_t
@@ -1307,21 +1308,21 @@ H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr);
* apply_max_increment
enum H5C_cache_flash_incr_mode
* flash_incr_mode
IN: Enumerated value indicating the operational mode of the flash cache size increase code. At
* present, only the following values are legal:
+ * disabled.
*
* double
* flash_threshold
IN: The factor by which the current maximum cache size is multiplied to obtain the minimum size
- * entry / entry size increase which may trigger a flash cache size increase.
+ * entry / entry size increase which may trigger a flash cache size increase.
*
*
*
@@ -1331,31 +1332,30 @@ H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t *config_ptr);
* double
* flash_multiple
IN: The factor by which the size of the triggering entry / entry size increase is multiplied to
- * obtain the initial cache size increment. This increment may be reduced to reflect existing free space in
- * the cache and the
+ * obtain the initial cache size increment. This increment may be reduced to reflect existing free
+ * space in the cache and the max_size
field above.max_size
field above.enum H5C_cache_decr_mode
* decr_mode
IN: Enumerated value indicating the operational mode of the automatic cache size decrease code. At
* present, the following values are legal:
+ * disabled.
\c H5C_decr__threshold: Automatic cache size decrease is enabled using the hit + * rate threshold algorithm.
\c H5C_decr__age_out: Automatic cache size decrease is enabled using + * the ageout algorithm.
\c H5C_decr__age_out_with_threshold: Automatic cache size decrease is + * enabled using the ageout with hit rate threshold algorithm
* *upper_hr_threshold
When \c decr_mode is \c H5C_decr__threshold, and the hit rate over a given epoch exceeds - * the supplied threshold, the current maximum cache size is multiplied by decrement to obtain a tentative new - * (and smaller) maximum cache size.
When \c decr_mode is \c H5C_decr__age_out_with_threshold, there is no - * attempt to find and evict aged out entries unless the hit rate in the previous epoch exceeded the supplied - * threshold.
This field must lie in the interval [0.0, 1.0].
For \c H5C_incr__threshold, .9995 or - * .99995 is a good place to start.
For \c H5C_decr__age_out_with_threshold, .999 might be more - * useful.
When \c decr_mode is \c H5C_decr__threshold, and the hit rate over a given + * epoch exceeds the supplied threshold, the current maximum cache size is multiplied by decrement to + * obtain a tentative new (and smaller) maximum cache size.
When \c decr_mode is \c + * H5C_decr__age_out_with_threshold, there is no attempt to find and evict aged out entries unless the + * hit rate in the previous epoch exceeded the supplied threshold.
This field must lie in the + * interval [0.0, 1.0].
For \c H5C_incr__threshold, .9995 or .99995 is a good place to + * start.
For \c H5C_decr__age_out_with_threshold, .999 might be more useful.
*decrement
The actual cache - * size decrease will be clipped to satisfy the min_size specified in the general configuration, and possibly - * max_decrement below.
The parameter must be be in the interval [0.0, 1.0].
If you set it to 1.0, - * you will effectively disable cache size decreases. 0.9 is a reasonable starting - * point.
The actual + * cache size decrease will be clipped to satisfy the min_size specified in the general configuration, + * and possibly max_decrement below.
The parameter must be be in the interval + * [0.0, 1.0].
If you set it to 1.0, you will effectively disable cache size decreases. 0.9 is a + * reasonable starting point.
*apply_max_decrement
epochs_before_eviction
apply_empty_reserve
empty_reserve
When so directed, the ageout - * based algorithms will not decrease the maximum cache size unless the empty reserve can be met.
The - * parameter must lie in the interval [0.0, 1.0]. 0.1 or 0.05 is a good place to - * start.
When so directed, the + * ageout based algorithms will not decrease the maximum cache size unless the empty reserve can be + * met.
The parameter must lie in the interval [0.0, 1.0]. 0.1 or 0.05 is a good place to + * start.
dirty_bytes_threshold
Synchronization occurs whenever the number - * of bytes of dirty metadata created since the last synchronization exceeds this limit.
This field only - * applies to the parallel case. While it is ignored elsewhere, it can still draw a value out of bounds - * error.
It must be consistant across all caches on any given file.
By default, this field is set - * to 256 KB. It shouldn't be more than half the current maximum cache size times the minimum clean - * fraction.
Synchronization occurs whenever the + * number of bytes of dirty metadata created since the last synchronization exceeds this + * limit.
This field only applies to the parallel case. While it is ignored elsewhere, it can + * still draw a value out of bounds error.
It must be consistant across all caches on any given + * file.
By default, this field is set to 256 KB. It shouldn't be more than half the current + * maximum cache size times the minimum clean fraction.
*- * The purpose is to allow the storage and retrieval of arbitrary array types - * containing scientific data. + * The purpose is to allow the storage and retrieval of arbitrary array types containing scientific data. *
- * The methods support the conversion of an array to and from Java to a - * one-dimensional array of bytes suitable for I/O by the C library. + * The methods support the conversion of an array to and from Java to a one-dimensional array of bytes suitable for I/O + * by the C library. *
- * This class heavily uses the HDFNativeData class to - * convert between Java and C representations. + * This class heavily uses the HDFNativeData class to convert between + * Java and C representations. */ public class HDFArray { - private Object _theArray = null; private ArrayDescriptor _desc = null; private byte[] _barray = null; @@ -41,31 +37,27 @@ public class HDFArray { // public HDFArray() {} /** - * The input must be a Java Array (possibly multidimensional) of primitive - * numbers or sub-classes of Number. + * The input must be a Java Array (possibly multidimensional) of primitive numbers or sub-classes of Number. *
- * The input is analysed to determine the number of dimensions and size of - * each dimension, as well as the type of the elements. + * The input is analysed to determine the number of dimensions and size of each dimension, as well as the type of + * the elements. *
* The description is saved in private variables, and used to convert data. * * @param anArray - * The array object. - * + * The array object. * @exception hdf.hdf5lib.exceptions.HDF5Exception - * object is not an array. + * object is not an array. */ - public HDFArray(Object anArray) throws HDF5Exception { - + public HDFArray(Object anArray) throws HDF5Exception + { if (anArray == null) { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: array is null?: "); + HDF5JavaException ex = new HDF5JavaException("HDFArray: array is null?: "); } Class tc = anArray.getClass(); if (tc.isArray() == false) { /* exception: not an array */ - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: not an array?: "); + HDF5JavaException ex = new HDF5JavaException("HDFArray: not an array?: "); throw (ex); } _theArray = anArray; @@ -73,8 +65,7 @@ public HDFArray(Object anArray) throws HDF5Exception { /* extra error checking -- probably not needed */ if (_desc == null) { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: internal error: array description failed?: "); + HDF5JavaException ex = new HDF5JavaException("HDFArray: internal error: array description failed?: "); throw (ex); } } @@ -82,49 +73,48 @@ public HDFArray(Object anArray) throws HDF5Exception { /** * Allocate a one-dimensional array of bytes sufficient to store the array. * - * @return A one-D array of bytes, filled with zeroes. The bytes are - * sufficient to hold the data of the Array passed to the - * constructor. + * @return A one-D array of bytes, filled with zeroes. The bytes are sufficient to hold the data of the Array passed + * to the constructor. * @exception hdf.hdf5lib.exceptions.HDF5JavaException - * Allocation failed. + * Allocation failed. */ - public byte[] emptyBytes() throws HDF5JavaException { + public byte[] emptyBytes() + throws HDF5JavaException + { byte[] b = null; - if ((ArrayDescriptor.dims == 1) && (ArrayDescriptor.NT == 'B')) { + if ((ArrayDescriptor.dims == 1) + && (ArrayDescriptor.NT == 'B')) { b = (byte[]) _theArray; } else { b = new byte[ArrayDescriptor.totalSize]; } if (b == null) { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: emptyBytes: allocation failed"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: emptyBytes: allocation failed"); throw (ex); } return (b); } /** - * Given a Java array of numbers, convert it to a one-dimensional array of - * bytes in correct native order. + * Given a Java array of numbers, convert it to a one-dimensional array of bytes in correct native order. * - * @return A one-D array of bytes, constructed from the Array passed to the - * constructor. + * @return A one-D array of bytes, constructed from the Array passed to the constructor. * @exception hdf.hdf5lib.exceptions.HDF5JavaException - * the object not an array or other internal error. + * the object not an array or other internal error. */ - public byte[] byteify() throws HDF5JavaException { - + public byte[] byteify() + throws HDF5JavaException + { if (_barray != null) { return _barray; } if (_theArray == null) { /* exception: not an array */ - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: byteify not an array?: "); + HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify not an array?: "); throw (ex); } @@ -141,73 +131,53 @@ public byte[] byteify() throws HDF5JavaException { byte[] therow; if (ArrayDescriptor.NT == 'I') { - therow = HDFNativeData.intToByte(0, - ArrayDescriptor.dimlen[1], (int[]) _theArray); + therow = HDFNativeData.intToByte(0, ArrayDescriptor.dimlen[1], (int[]) _theArray); } else if (ArrayDescriptor.NT == 'S') { - therow = HDFNativeData.shortToByte(0, - ArrayDescriptor.dimlen[1], (short[]) _theArray); + therow = HDFNativeData.shortToByte(0, ArrayDescriptor.dimlen[1], (short[]) _theArray); } else if (ArrayDescriptor.NT == 'F') { - therow = HDFNativeData.floatToByte(0, - ArrayDescriptor.dimlen[1], (float[]) _theArray); + therow = HDFNativeData.floatToByte(0, ArrayDescriptor.dimlen[1], (float[]) _theArray); } else if (ArrayDescriptor.NT == 'J') { - therow = HDFNativeData.longToByte(0, - ArrayDescriptor.dimlen[1], (long[]) _theArray); + therow = HDFNativeData.longToByte(0, ArrayDescriptor.dimlen[1], (long[]) _theArray); } else if (ArrayDescriptor.NT == 'D') { - therow = HDFNativeData - .doubleToByte(0, ArrayDescriptor.dimlen[1], - (double[]) _theArray); + therow = HDFNativeData.doubleToByte(0, ArrayDescriptor.dimlen[1], (double[]) _theArray); } else if (ArrayDescriptor.NT == 'L') { if (ArrayDescriptor.className.equals("java.lang.Byte")) { therow = ByteObjToByte((Byte[]) _theArray); } - else if (ArrayDescriptor.className - .equals("java.lang.Integer")) { + else if (ArrayDescriptor.className.equals("java.lang.Integer")) { therow = IntegerToByte((Integer[]) _theArray); } - else if (ArrayDescriptor.className - .equals("java.lang.Short")) { + else if (ArrayDescriptor.className.equals("java.lang.Short")) { therow = ShortToByte((Short[]) _theArray); } - else if (ArrayDescriptor.className - .equals("java.lang.Float")) { + else if (ArrayDescriptor.className.equals("java.lang.Float")) { therow = FloatObjToByte((Float[]) _theArray); } - else if (ArrayDescriptor.className - .equals("java.lang.Double")) { + else if (ArrayDescriptor.className.equals("java.lang.Double")) { therow = DoubleObjToByte((Double[]) _theArray); } - else if (ArrayDescriptor.className - .equals("java.lang.Long")) { + else if (ArrayDescriptor.className.equals("java.lang.Long")) { therow = LongObjToByte((Long[]) _theArray); } else { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: unknown type of Object?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: unknown type of Object?"); throw (ex); } } else { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: unknown type of data?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: unknown type of data?"); throw (ex); } - System - .arraycopy( - therow, - 0, - _barray, - 0, - (ArrayDescriptor.dimlen[1] * ArrayDescriptor.NTsize)); + System.arraycopy(therow, 0, _barray, 0, (ArrayDescriptor.dimlen[1] * ArrayDescriptor.NTsize)); return _barray; } catch (OutOfMemoryError err) { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: byteify array too big?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify array too big?"); throw (ex); } } @@ -217,8 +187,7 @@ else if (ArrayDescriptor.className _barray = new byte[ArrayDescriptor.totalSize]; } catch (OutOfMemoryError err) { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: byteify array too big?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify array too big?"); throw (ex); } @@ -241,8 +210,7 @@ else if (ArrayDescriptor.className else { /* check range of index */ if (index > (ArrayDescriptor.dimlen[i] - 1)) { - throw new java.lang.IndexOutOfBoundsException( - "HDFArray: byteify index OOB?"); + throw new java.lang.IndexOutOfBoundsException("HDFArray: byteify index OOB?"); } oo = java.lang.reflect.Array.get(oo, index); ArrayDescriptor.currentindex[i] = index; @@ -254,144 +222,107 @@ else if (ArrayDescriptor.className byte arow[]; try { if (ArrayDescriptor.NT == 'J') { - arow = HDFNativeData - .longToByte( - 0, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - (long[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); - arow = HDFNativeData - .longToByte( - 0, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - (long[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); + arow = HDFNativeData.longToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims], + (long[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); + arow = HDFNativeData.longToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims], + (long[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } else if (ArrayDescriptor.NT == 'I') { - arow = HDFNativeData - .intToByte( - 0, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - (int[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); + arow = HDFNativeData.intToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims], + (int[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } else if (ArrayDescriptor.NT == 'S') { - arow = HDFNativeData - .shortToByte( - 0, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - (short[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); + arow = HDFNativeData.shortToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims], + (short[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } else if (ArrayDescriptor.NT == 'B') { arow = (byte[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]; } else if (ArrayDescriptor.NT == 'F') { /* 32 bit float */ - arow = HDFNativeData - .floatToByte( - 0, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - (float[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); + arow = HDFNativeData.floatToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims], + (float[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } else if (ArrayDescriptor.NT == 'D') { /* 64 bit float */ - arow = HDFNativeData - .doubleToByte( - 0, - ArrayDescriptor.dimlen[ArrayDescriptor.dims], - (double[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); + arow = HDFNativeData.doubleToByte(0, ArrayDescriptor.dimlen[ArrayDescriptor.dims], + (double[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } else if (ArrayDescriptor.NT == 'L') { if (ArrayDescriptor.className.equals("java.lang.Byte")) { arow = ByteObjToByte((Byte[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } - else if (ArrayDescriptor.className - .equals("java.lang.Integer")) { + else if (ArrayDescriptor.className.equals("java.lang.Integer")) { arow = IntegerToByte((Integer[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } - else if (ArrayDescriptor.className - .equals("java.lang.Short")) { + else if (ArrayDescriptor.className.equals("java.lang.Short")) { arow = ShortToByte((Short[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } - else if (ArrayDescriptor.className - .equals("java.lang.Float")) { + else if (ArrayDescriptor.className.equals("java.lang.Float")) { arow = FloatObjToByte((Float[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } - else if (ArrayDescriptor.className - .equals("java.lang.Double")) { + else if (ArrayDescriptor.className.equals("java.lang.Double")) { arow = DoubleObjToByte((Double[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } else if (ArrayDescriptor.className.equals("java.lang.Long")) { arow = LongObjToByte((Long[]) ArrayDescriptor.objs[ArrayDescriptor.dims - 1]); } else { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: byteify Object type not implemented?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify Object type not implemented?"); throw (ex); } } else { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: byteify unknown type not implemented?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify unknown type not implemented?"); throw (ex); } - System - .arraycopy( - arow, - 0, - _barray, - n, - (ArrayDescriptor.dimlen[ArrayDescriptor.dims] * ArrayDescriptor.NTsize)); + System.arraycopy(arow, 0, _barray, n, + (ArrayDescriptor.dimlen[ArrayDescriptor.dims] * ArrayDescriptor.NTsize)); n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1]; } catch (OutOfMemoryError err) { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: byteify array too big?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: byteify array too big?"); throw (ex); } } /* assert: the whole array is completed--currentindex should == len - 1 */ - /* error checks */ - if (n < ArrayDescriptor.totalSize) { - throw new java.lang.InternalError(new String( - "HDFArray::byteify: Panic didn't complete all input data: n= " - + n + " size = " + ArrayDescriptor.totalSize)); + throw new java.lang.InternalError(new String("HDFArray::byteify: Panic didn't complete all input data: n= " + + n + " size = " + ArrayDescriptor.totalSize)); } for (i = 0; i < ArrayDescriptor.dims; i++) { if (ArrayDescriptor.currentindex[i] != ArrayDescriptor.dimlen[i] - 1) { throw new java.lang.InternalError(new String( - "Panic didn't complete all data: currentindex[" + i - + "] = " + ArrayDescriptor.currentindex[i] - + " (should be " - + (ArrayDescriptor.dimlen[i] - 1) + " ?)")); + "Panic didn't complete all data: currentindex[" + i + "] = " + ArrayDescriptor.currentindex[i] + + " (should be " + (ArrayDescriptor.dimlen[i] - 1) + " ?)")); } } return _barray; } /** - * Given a one-dimensional array of bytes representing numbers, convert it - * to a java array of the shape and size passed to the constructor. + * Given a one-dimensional array of bytes representing numbers, convert it to a java array of the shape and size + * passed to the constructor. * * @param bytes - * The bytes to construct the Array. - * @return An Array (possibly multidimensional) of primitive or number - * objects. - * @exception hdf.hdf5lib.exceptions.HDF5JavaException - * the object not an array or other internal error. + * The bytes to construct the Array. + * @return + * An Array (possibly multidimensional) of primitive or number objects. + * @exception + * hdf.hdf5lib.exceptions.HDF5JavaException the object not an array or other internal error. */ - public Object arrayify(byte[] bytes) throws HDF5JavaException { - + public Object arrayify(byte[] bytes) throws HDF5JavaException + { if (_theArray == null) { /* exception: not an array */ - HDF5JavaException ex = new HDF5JavaException( - "arrayify: not an array?: "); + HDF5JavaException ex = new HDF5JavaException("arrayify: not an array?: "); throw (ex); } if (java.lang.reflect.Array.getLength(bytes) != ArrayDescriptor.totalSize) { /* exception: array not right size */ - HDF5JavaException ex = new HDF5JavaException( - "arrayify: array is wrong size?: "); + HDF5JavaException ex = new HDF5JavaException("arrayify: array is wrong size?: "); throw (ex); } _barray = bytes; /* hope that the bytes are correct.... */ @@ -402,95 +333,76 @@ public Object arrayify(byte[] bytes) throws HDF5JavaException { try { if (ArrayDescriptor.NT == 'I') { int[] x = HDFNativeData.byteToInt(_barray); - System.arraycopy(x, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(x, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } else if (ArrayDescriptor.NT == 'S') { short[] x = HDFNativeData.byteToShort(_barray); - System.arraycopy(x, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(x, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } else if (ArrayDescriptor.NT == 'F') { float x[] = HDFNativeData.byteToFloat(_barray); - System.arraycopy(x, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(x, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } else if (ArrayDescriptor.NT == 'J') { long x[] = HDFNativeData.byteToLong(_barray); - System.arraycopy(x, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(x, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } else if (ArrayDescriptor.NT == 'D') { double x[] = HDFNativeData.byteToDouble(_barray); - System.arraycopy(x, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(x, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } else if (ArrayDescriptor.NT == 'B') { - System.arraycopy(_barray, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(_barray, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } else if (ArrayDescriptor.NT == 'L') { if (ArrayDescriptor.className.equals("java.lang.Byte")) { Byte I[] = ByteToByteObj(_barray); - System.arraycopy(I, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } - else if (ArrayDescriptor.className - .equals("java.lang.Integer")) { + else if (ArrayDescriptor.className.equals("java.lang.Integer")) { Integer I[] = ByteToInteger(_barray); - System.arraycopy(I, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } - else if (ArrayDescriptor.className - .equals("java.lang.Short")) { + else if (ArrayDescriptor.className.equals("java.lang.Short")) { Short I[] = ByteToShort(_barray); - System.arraycopy(I, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } - else if (ArrayDescriptor.className - .equals("java.lang.Float")) { + else if (ArrayDescriptor.className.equals("java.lang.Float")) { Float I[] = ByteToFloatObj(_barray); - System.arraycopy(I, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } - else if (ArrayDescriptor.className - .equals("java.lang.Double")) { + else if (ArrayDescriptor.className.equals("java.lang.Double")) { Double I[] = ByteToDoubleObj(_barray); - System.arraycopy(I, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } else if (ArrayDescriptor.className.equals("java.lang.Long")) { Long I[] = ByteToLongObj(_barray); - System.arraycopy(I, 0, _theArray, 0, - ArrayDescriptor.dimlen[1]); + System.arraycopy(I, 0, _theArray, 0, ArrayDescriptor.dimlen[1]); return _theArray; } else { - HDF5JavaException ex = new HDF5JavaException( - "arrayify: Object type not implemented yet..."); + HDF5JavaException ex = new HDF5JavaException("arrayify: Object type not implemented yet..."); throw (ex); } } else { - HDF5JavaException ex = new HDF5JavaException( - "arrayify: unknown type not implemented yet..."); + HDF5JavaException ex = new HDF5JavaException("arrayify: unknown type not implemented yet..."); throw (ex); } } catch (OutOfMemoryError err) { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: arrayify array too big?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: arrayify array too big?"); throw (ex); } } @@ -502,6 +414,7 @@ else if (ArrayDescriptor.className.equals("java.lang.Long")) { int index = 0; int i; Object flattenedArray = null; + switch (ArrayDescriptor.NT) { case 'J': flattenedArray = (Object) HDFNativeData.byteToLong(_barray); @@ -522,36 +435,27 @@ else if (ArrayDescriptor.className.equals("java.lang.Long")) { flattenedArray = (Object) _barray; break; case 'L': - switch (ArrayDescriptor.className) { - case "java.lang.Byte": - flattenedArray = (Object) ByteToByteObj(_barray); - break; - case "java.lang.Short": - flattenedArray = (Object) ByteToShort(_barray); - break; - case "java.lang.Integer": - flattenedArray = (Object) ByteToInteger(_barray); - break; - case "java.lang.Long": - flattenedArray = (Object) ByteToLongObj(_barray); - break; - case "java.lang.Float": - flattenedArray = (Object) ByteToFloatObj(_barray); - break; - case "java.lang.Double": - flattenedArray = (Object) ByteToDoubleObj(_barray); - break; - default: - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: unsupported Object type: " - + ArrayDescriptor.NT); - throw (ex); - } // end of switch statement for arrays of boxed objects - default: - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: unknown or unsupported type: " - + ArrayDescriptor.NT); - throw (ex); + { + if (ArrayDescriptor.className.equals("java.lang.Byte")) + flattenedArray = (Object) ByteToByteObj(_barray); + else if (ArrayDescriptor.className.equals("java.lang.Short")) + flattenedArray = (Object) ByteToShort(_barray); + else if (ArrayDescriptor.className.equals("java.lang.Integer")) + flattenedArray = (Object) ByteToInteger(_barray); + else if (ArrayDescriptor.className.equals("java.lang.Long")) + flattenedArray = (Object) ByteToLongObj(_barray); + else if (ArrayDescriptor.className.equals("java.lang.Float")) + flattenedArray = (Object) ByteToFloatObj(_barray); + else if (ArrayDescriptor.className.equals("java.lang.Double")) + flattenedArray = (Object) ByteToDoubleObj(_barray); + else { + HDF5JavaException ex = new HDF5JavaException("HDFArray: unsupported Object type: " + ArrayDescriptor.NT); + throw (ex); + } + } // end of statement for arrays of boxed objects + default: + HDF5JavaException ex = new HDF5JavaException("HDFArray: unknown or unsupported type: " + ArrayDescriptor.NT); + throw (ex); } // end of switch statement for arrays of primitives while (n < ArrayDescriptor.totalSize) { @@ -580,7 +484,6 @@ else if (ArrayDescriptor.className.equals("java.lang.Long")) { /* array-ify */ try { - Object arow = null; int mm = m + ArrayDescriptor.dimlen[ArrayDescriptor.dims]; switch (ArrayDescriptor.NT) { @@ -603,75 +506,64 @@ else if (ArrayDescriptor.className.equals("java.lang.Long")) { arow = (Object) Arrays.copyOfRange((double[]) flattenedArray, m, mm); break; case 'L': - switch (ArrayDescriptor.className) { - case "java.lang.Byte": - arow = (Object) Arrays.copyOfRange((Byte[])flattenedArray, m, mm); - break; - case "java.lang.Short": - arow = (Object) Arrays.copyOfRange((Short[])flattenedArray, m, mm); - break; - case "java.lang.Integer": - arow = (Object) Arrays.copyOfRange((Integer[])flattenedArray, m, mm); - break; - case "java.lang.Long": - arow = (Object) Arrays.copyOfRange((Long[])flattenedArray, m, mm); - break; - case "java.lang.Float": - arow = (Object) Arrays.copyOfRange((Float[])flattenedArray, m, mm); - break; - case "java.lang.Double": - arow = (Object) Arrays.copyOfRange((Double[])flattenedArray, m, mm); - break; - } // end of switch statement for arrays of boxed numerics + { + if (ArrayDescriptor.className.equals("java.lang.Byte")) + arow = (Object) Arrays.copyOfRange((Byte[]) flattenedArray, m, mm); + else if (ArrayDescriptor.className.equals("java.lang.Short")) + arow = (Object) Arrays.copyOfRange((Short[]) flattenedArray, m, mm); + else if (ArrayDescriptor.className.equals("java.lang.Integer")) + arow = (Object) Arrays.copyOfRange((Integer[]) flattenedArray, m, mm); + else if (ArrayDescriptor.className.equals("java.lang.Long")) + arow = (Object) Arrays.copyOfRange((Long[]) flattenedArray, m, mm); + else if (ArrayDescriptor.className.equals("java.lang.Float")) + arow = (Object) Arrays.copyOfRange((Float[]) flattenedArray, m, mm); + else if (ArrayDescriptor.className.equals("java.lang.Double")) + arow = (Object) Arrays.copyOfRange((Double[]) flattenedArray, m, mm); + else { + HDF5JavaException ex = new HDF5JavaException("HDFArray: unsupported Object type: " + ArrayDescriptor.NT); + throw (ex); + } + } // end of statement for arrays of boxed numerics } // end of switch statement for arrays of primitives - java.lang.reflect.Array.set( - ArrayDescriptor.objs[ArrayDescriptor.dims - 2], - (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]), - arow); + java.lang.reflect.Array.set(ArrayDescriptor.objs[ArrayDescriptor.dims - 2], + (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]), arow); n += ArrayDescriptor.bytetoindex[ArrayDescriptor.dims - 1]; ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1]++; m = mm; } catch (OutOfMemoryError err) { - HDF5JavaException ex = new HDF5JavaException( - "HDFArray: arrayify array too big?"); + HDF5JavaException ex = new HDF5JavaException("HDFArray: arrayify array too big?"); throw (ex); } - } /* assert: the whole array is completed--currentindex should == len - 1 */ - /* error checks */ - if (n < ArrayDescriptor.totalSize) { - throw new java.lang.InternalError(new String( - "HDFArray::arrayify Panic didn't complete all input data: n= " - + n + " size = " + ArrayDescriptor.totalSize)); + throw new java.lang.InternalError(new String("HDFArray::arrayify Panic didn't complete all input data: n= " + + n + " size = " + ArrayDescriptor.totalSize)); } for (i = 0; i <= ArrayDescriptor.dims - 2; i++) { if (ArrayDescriptor.currentindex[i] != ArrayDescriptor.dimlen[i] - 1) { - throw new java.lang.InternalError(new String( - "HDFArray::arrayify Panic didn't complete all data: currentindex[" - + i + "] = " + ArrayDescriptor.currentindex[i] - + " (should be " - + (ArrayDescriptor.dimlen[i] - 1) + "?")); + throw new java.lang.InternalError( + new String("HDFArray::arrayify Panic didn't complete all data: currentindex[" + i + "] = " + + ArrayDescriptor.currentindex[i] + " (should be " + (ArrayDescriptor.dimlen[i] - 1) + + "?")); } } - if (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1] != ArrayDescriptor.dimlen[ArrayDescriptor.dims - 1]) { - throw new java.lang.InternalError(new String( - "HDFArray::arrayify Panic didn't complete all data: currentindex[" - + i + "] = " + ArrayDescriptor.currentindex[i] - + " (should be " + (ArrayDescriptor.dimlen[i]) - + "?")); + if (ArrayDescriptor.currentindex[ArrayDescriptor.dims - 1] != ArrayDescriptor.dimlen[ArrayDescriptor.dims + - 1]) { + throw new java.lang.InternalError( + new String("HDFArray::arrayify Panic didn't complete all data: currentindex[" + i + "] = " + + ArrayDescriptor.currentindex[i] + " (should be " + (ArrayDescriptor.dimlen[i]) + "?")); } - return _theArray; } - private byte[] IntegerToByte(Integer in[]) { + private byte[] IntegerToByte(Integer in[]) + { int nelems = java.lang.reflect.Array.getLength(in); int[] out = new int[nelems]; @@ -681,7 +573,8 @@ private byte[] IntegerToByte(Integer in[]) { return HDFNativeData.intToByte(0, nelems, out); } - private Integer[] ByteToInteger(byte[] bin) { + private Integer[] ByteToInteger(byte[] bin) + { int in[] = HDFNativeData.byteToInt(bin); int nelems = java.lang.reflect.Array.getLength(in); Integer[] out = new Integer[nelems]; @@ -692,7 +585,8 @@ private Integer[] ByteToInteger(byte[] bin) { return out; } - private Integer[] ByteToInteger(int start, int len, byte[] bin) { + private Integer[] ByteToInteger(int start, int len, byte[] bin) + { int in[] = HDFNativeData.byteToInt(start, len, bin); int nelems = java.lang.reflect.Array.getLength(in); Integer[] out = new Integer[nelems]; @@ -703,7 +597,8 @@ private Integer[] ByteToInteger(int start, int len, byte[] bin) { return out; } - private byte[] ShortToByte(Short in[]) { + private byte[] ShortToByte(Short in[]) + { int nelems = java.lang.reflect.Array.getLength(in); short[] out = new short[nelems]; @@ -713,7 +608,8 @@ private byte[] ShortToByte(Short in[]) { return HDFNativeData.shortToByte(0, nelems, out); } - private Short[] ByteToShort(byte[] bin) { + private Short[] ByteToShort(byte[] bin) + { short in[] = HDFNativeData.byteToShort(bin); int nelems = java.lang.reflect.Array.getLength((Object) in); Short[] out = new Short[nelems]; @@ -724,7 +620,8 @@ private Short[] ByteToShort(byte[] bin) { return out; } - private Short[] ByteToShort(int start, int len, byte[] bin) { + private Short[] ByteToShort(int start, int len, byte[] bin) + { short in[] = (short[]) HDFNativeData.byteToShort(start, len, bin); int nelems = java.lang.reflect.Array.getLength((Object) in); Short[] out = new Short[nelems]; @@ -735,7 +632,8 @@ private Short[] ByteToShort(int start, int len, byte[] bin) { return out; } - private byte[] ByteObjToByte(Byte in[]) { + private byte[] ByteObjToByte(Byte in[]) + { int nelems = java.lang.reflect.Array.getLength((Object) in); byte[] out = new byte[nelems]; @@ -745,7 +643,8 @@ private byte[] ByteObjToByte(Byte in[]) { return out; } - private Byte[] ByteToByteObj(byte[] bin) { + private Byte[] ByteToByteObj(byte[] bin) + { int nelems = java.lang.reflect.Array.getLength((Object) bin); Byte[] out = new Byte[nelems]; @@ -755,7 +654,8 @@ private Byte[] ByteToByteObj(byte[] bin) { return out; } - private Byte[] ByteToByteObj(int start, int len, byte[] bin) { + private Byte[] ByteToByteObj(int start, int len, byte[] bin) + { Byte[] out = new Byte[len]; for (int i = 0; i < len; i++) { @@ -764,7 +664,8 @@ private Byte[] ByteToByteObj(int start, int len, byte[] bin) { return out; } - private byte[] FloatObjToByte(Float in[]) { + private byte[] FloatObjToByte(Float in[]) + { int nelems = java.lang.reflect.Array.getLength((Object) in); float[] out = new float[nelems]; @@ -774,7 +675,8 @@ private byte[] FloatObjToByte(Float in[]) { return HDFNativeData.floatToByte(0, nelems, out); } - private Float[] ByteToFloatObj(byte[] bin) { + private Float[] ByteToFloatObj(byte[] bin) + { float in[] = (float[]) HDFNativeData.byteToFloat(bin); int nelems = java.lang.reflect.Array.getLength((Object) in); Float[] out = new Float[nelems]; @@ -785,7 +687,8 @@ private Float[] ByteToFloatObj(byte[] bin) { return out; } - private Float[] ByteToFloatObj(int start, int len, byte[] bin) { + private Float[] ByteToFloatObj(int start, int len, byte[] bin) + { float in[] = (float[]) HDFNativeData.byteToFloat(start, len, bin); int nelems = java.lang.reflect.Array.getLength((Object) in); Float[] out = new Float[nelems]; @@ -796,7 +699,8 @@ private Float[] ByteToFloatObj(int start, int len, byte[] bin) { return out; } - private byte[] DoubleObjToByte(Double in[]) { + private byte[] DoubleObjToByte(Double in[]) + { int nelems = java.lang.reflect.Array.getLength((Object) in); double[] out = new double[nelems]; @@ -806,7 +710,8 @@ private byte[] DoubleObjToByte(Double in[]) { return HDFNativeData.doubleToByte(0, nelems, out); } - private Double[] ByteToDoubleObj(byte[] bin) { + private Double[] ByteToDoubleObj(byte[] bin) + { double in[] = (double[]) HDFNativeData.byteToDouble(bin); int nelems = java.lang.reflect.Array.getLength((Object) in); Double[] out = new Double[nelems]; @@ -817,7 +722,8 @@ private Double[] ByteToDoubleObj(byte[] bin) { return out; } - private Double[] ByteToDoubleObj(int start, int len, byte[] bin) { + private Double[] ByteToDoubleObj(int start, int len, byte[] bin) + { double in[] = (double[]) HDFNativeData.byteToDouble(start, len, bin); int nelems = java.lang.reflect.Array.getLength((Object) in); Double[] out = new Double[nelems]; @@ -828,7 +734,8 @@ private Double[] ByteToDoubleObj(int start, int len, byte[] bin) { return out; } - private byte[] LongObjToByte(Long in[]) { + private byte[] LongObjToByte(Long in[]) + { int nelems = java.lang.reflect.Array.getLength((Object) in); long[] out = new long[nelems]; @@ -838,7 +745,8 @@ private byte[] LongObjToByte(Long in[]) { return HDFNativeData.longToByte(0, nelems, out); } - private Long[] ByteToLongObj(byte[] bin) { + private Long[] ByteToLongObj(byte[] bin) + { long in[] = (long[]) HDFNativeData.byteToLong(bin); int nelems = java.lang.reflect.Array.getLength((Object) in); Long[] out = new Long[nelems]; @@ -849,7 +757,8 @@ private Long[] ByteToLongObj(byte[] bin) { return out; } - private Long[] ByteToLongObj(int start, int len, byte[] bin) { + private Long[] ByteToLongObj(int start, int len, byte[] bin) + { long in[] = (long[]) HDFNativeData.byteToLong(start, len, bin); int nelems = java.lang.reflect.Array.getLength((Object) in); Long[] out = new Long[nelems]; @@ -862,13 +771,11 @@ private Long[] ByteToLongObj(int start, int len, byte[] bin) { } /** - * This private class is used by HDFArray to discover the shape and type of an - * arbitrary array. + * This private class is used by HDFArray to discover the shape and type of an arbitrary array. *
* We use java.lang.reflection here.
*/
class ArrayDescriptor {
-
static String theType = "";
static Class theClass = null;
static int[] dimlen = null;
@@ -883,13 +790,12 @@ class ArrayDescriptor {
static int dims = 0;
static String className;
- public ArrayDescriptor(Object anArray) throws HDF5Exception {
-
+ public ArrayDescriptor(Object anArray) throws HDF5Exception
+ {
Class tc = anArray.getClass();
if (tc.isArray() == false) {
/* exception: not an array */
- HDF5Exception ex = new HDF5JavaException(
- "ArrayDescriptor: not an array?: ");
+ HDF5Exception ex = new HDF5JavaException("ArrayDescriptor: not an array?: ");
throw (ex);
}
@@ -921,10 +827,12 @@ public ArrayDescriptor(Object anArray) throws HDF5Exception {
else if (NT == 'S') {
NTsize = 2;
}
- else if ((NT == 'I') || (NT == 'F')) {
+ else if ((NT == 'I')
+ || (NT == 'F')) {
NTsize = 4;
}
- else if ((NT == 'J') || (NT == 'D')) {
+ else if ((NT == 'J')
+ || (NT == 'D')) {
NTsize = 8;
}
else if (css.startsWith("Ljava.lang.Byte")) {
@@ -961,16 +869,14 @@ else if (css.startsWith("Ljava.lang.String")) {
NT = 'L';
className = "java.lang.String";
NTsize = 1;
- throw new HDF5JavaException(new String(
- "ArrayDesciptor: Warning: String array not fully supported yet"));
+ throw new HDF5JavaException(new String("ArrayDesciptor: Warning: String array not fully supported yet"));
}
else {
/*
* exception: not a numeric type
*/
- throw new HDF5JavaException(new String(
- "ArrayDesciptor: Error: array is not numeric (type is "
- + css + ") ?"));
+ throw new HDF5JavaException(
+ new String("ArrayDesciptor: Error: array is not numeric (type is " + css + ") ?"));
}
/* fill in the table */
@@ -1014,20 +920,19 @@ else if (css.startsWith("Ljava.lang.String")) {
/**
* Debug dump
*/
- public void dumpInfo() {
+ public void dumpInfo()
+ {
System.out.println("Type: " + theType);
System.out.println("Class: " + theClass);
System.out.println("NT: " + NT + " NTsize: " + NTsize);
- System.out.println("Array has " + dims + " dimensions (" + totalSize
- + " bytes, " + totalElements + " elements)");
+ System.out
+ .println("Array has " + dims + " dimensions (" + totalSize + " bytes, " + totalElements + " elements)");
int i;
for (i = 0; i <= dims; i++) {
Class tc = objs[i].getClass();
String ss = tc.toString();
- System.out.println(i + ": start " + dimstart[i] + ": len "
- + dimlen[i] + " current " + currentindex[i]
- + " bytetoindex " + bytetoindex[i] + " object " + objs[i]
- + " otype " + ss);
+ System.out.println(i + ": start " + dimstart[i] + ": len " + dimlen[i] + " current " + currentindex[i]
+ + " bytetoindex " + bytetoindex[i] + " object " + objs[i] + " otype " + ss);
}
}
}
diff --git a/java/src/hdf/hdf5lib/callbacks/Callbacks.java b/java/src/hdf/hdf5lib/callbacks/Callbacks.java
index e2033fa9a02..11fa4652d1c 100644
--- a/java/src/hdf/hdf5lib/callbacks/Callbacks.java
+++ b/java/src/hdf/hdf5lib/callbacks/Callbacks.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java
index d02c8d115e6..6c68f364d17 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java
index fb5ca270172..d612db3a2e4 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5A_iterate_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java b/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java
index 1ec3a541fc7..cf7ada6b4a0 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5D_append_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java b/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java
index c4d88ceff24..7fdb454c038 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5D_append_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java
index d397b2f611d..54c12e300ba 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java
index a852d069ffb..305cf98d6d1 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5D_iterate_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java b/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java
index 69dce0e8290..57221954fdf 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5E_walk_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java b/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java
index ea115102284..5bf0c8b356e 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5E_walk_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java
index d0c07c09891..d89fd2ab5c0 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_opdata_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java
index a93e76d4b7e..53635bf9c89 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5L_iterate_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java
index 42d0db15e63..fd643b44a9f 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_opdata_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java
index 3a59c6b6cd8..ecf868cbf55 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5O_iterate_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java
index ad9682a7c3a..0a09a943d33 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java
index fd17222cd81..11e3a99f15f 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_close_func_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java
index 36a085b2f48..53f86bea3b8 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java
index 9e1d929b296..78e52822452 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_copy_func_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java
index cf51171ffa5..8f4e78202e3 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java
index b7e21a1c45f..d919d97e587 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_cls_create_func_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java
index f9cfd99ce3d..db98a672373 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java
index a591b1d5f14..0035619fdf1 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_iterate_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java
index b1552a72ef4..1aa7ce4395d 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_close_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java
index e1d7f21eacf..49cef7dc2f5 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_compare_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java
index a28e27ba0f0..f4924ee6160 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_copy_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java
index 3a396fc4eda..bce024b27de 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_create_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java
index db6487d8a67..8c5dcccfba9 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_delete_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java
index dacf4adbfef..0f3457f695c 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_get_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java b/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java
index 4440d82c5d1..a55ca3af6aa 100644
--- a/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java
+++ b/java/src/hdf/hdf5lib/callbacks/H5P_prp_set_func_cb.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java b/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java
index c6584897e94..9f04211a0b0 100644
--- a/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5AC_cache_config_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/structs/H5A_info_t.java b/java/src/hdf/hdf5lib/structs/H5A_info_t.java
index a2745514e6f..f2c10f038c9 100644
--- a/java/src/hdf/hdf5lib/structs/H5A_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5A_info_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -21,10 +20,14 @@
*/
public class H5A_info_t implements Serializable{
private static final long serialVersionUID = 2791443594041667613L;
- public boolean corder_valid; // Indicate if creation order is valid
- public long corder; // Creation order of attribute
- public int cset; // Character set of attribute name
- public long data_size; // Size of raw data
+ /** Indicate if creation order is valid */
+ public boolean corder_valid;
+ /** Creation order of attribute */
+ public long corder;
+ /** Character set of attribute name */
+ public int cset;
+ /** Size of raw data */
+ public long data_size;
H5A_info_t(boolean corder_valid, long corder, int cset, long data_size) {
this.corder_valid = corder_valid;
diff --git a/java/src/hdf/hdf5lib/structs/H5E_error2_t.java b/java/src/hdf/hdf5lib/structs/H5E_error2_t.java
index 16816eacc07..e0741565094 100644
--- a/java/src/hdf/hdf5lib/structs/H5E_error2_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5E_error2_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/structs/H5F_info2_t.java b/java/src/hdf/hdf5lib/structs/H5F_info2_t.java
index 8baaa43c123..bb87201dd1d 100644
--- a/java/src/hdf/hdf5lib/structs/H5F_info2_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5F_info2_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/structs/H5G_info_t.java b/java/src/hdf/hdf5lib/structs/H5G_info_t.java
index e6f42b70102..6d4f405aa53 100644
--- a/java/src/hdf/hdf5lib/structs/H5G_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5G_info_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/structs/H5L_info_t.java b/java/src/hdf/hdf5lib/structs/H5L_info_t.java
index 2c25f7c2f6a..eaf0da5828d 100644
--- a/java/src/hdf/hdf5lib/structs/H5L_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5L_info_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
index e4f20c6f966..9a1749dc14d 100644
--- a/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5O_hdr_info_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/structs/H5O_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_info_t.java
index bd076d60412..cc94247822c 100644
--- a/java/src/hdf/hdf5lib/structs/H5O_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5O_info_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java b/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java
index 0b19bcb0872..ff801e8584f 100644
--- a/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5O_native_info_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java b/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java
index 96082abf8db..0551469f3c5 100644
--- a/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java
+++ b/java/src/hdf/hdf5lib/structs/H5_ih_info_t.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/Makefile.am b/java/src/jni/Makefile.am
index 96973d41009..bf086d23aa2 100644
--- a/java/src/jni/Makefile.am
+++ b/java/src/jni/Makefile.am
@@ -1,6 +1,5 @@
#
# Copyright by The HDF Group.
-# Copyright by the Board of Trustees of the University of Illinois.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
diff --git a/java/src/jni/exceptionImp.h b/java/src/jni/exceptionImp.h
index 4b81605c03a..72edf4c5908 100644
--- a/java/src/jni/exceptionImp.h
+++ b/java/src/jni/exceptionImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c
index 06fc606ae82..ee1448b7552 100644
--- a/java/src/jni/h5Constants.c
+++ b/java/src/jni/h5Constants.c
@@ -1403,7 +1403,7 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1DIRECT(JNIEnv *env, jclass cls)
#ifdef H5_HAVE_DIRECT
return H5FD_DIRECT;
#else
- return -1;
+ return H5I_INVALID_HID;
#endif
}
JNIEXPORT jlong JNICALL
@@ -1417,7 +1417,7 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1HDFS(JNIEnv *env, jclass cls)
#ifdef H5_HAVE_LIBHDFS
return H5FD_HDFS;
#else
- return -1;
+ return H5I_INVALID_HID;
#endif
}
JNIEXPORT jlong JNICALL
@@ -1446,7 +1446,7 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1ROS3(JNIEnv *env, jclass cls)
#ifdef H5_HAVE_ROS3_VFD
return H5FD_ROS3;
#else
- return -1;
+ return H5I_INVALID_HID;
#endif
}
JNIEXPORT jlong JNICALL
@@ -1460,7 +1460,7 @@ Java_hdf_hdf5lib_HDF5Constants_H5FD_1WINDOWS(JNIEnv *env, jclass cls)
#ifdef H5_HAVE_WINDOWS
return H5FD_DIRECT;
#else
- return -1;
+ return H5I_INVALID_HID;
#endif
}
JNIEXPORT jint JNICALL
diff --git a/java/src/jni/h5Imp.h b/java/src/jni/h5Imp.h
index 226a2fe6f63..776f295a06b 100644
--- a/java/src/jni/h5Imp.h
+++ b/java/src/jni/h5Imp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5aImp.c b/java/src/jni/h5aImp.c
index c3651449d16..6bf86d00052 100644
--- a/java/src/jni/h5aImp.c
+++ b/java/src/jni/h5aImp.c
@@ -1133,7 +1133,7 @@ H5AreadVL_asstr(JNIEnv *env, hid_t aid, hid_t tid, jobjectArray buf)
for (i = 0; i < (size_t)n; i++) {
h5str.s[0] = '\0';
- if (!h5str_sprintf(ENVONLY, &h5str, aid, tid, &(((char *)readBuf)[i * typeSize]), typeSize, 0))
+ if (!h5str_sprintf(ENVONLY, &h5str, aid, tid, &(((char *)readBuf)[i * typeSize]), 0))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, h5str.s)))
@@ -1425,7 +1425,7 @@ Java_hdf_hdf5lib_H5_H5Aread_1reg_1ref(JNIEnv *env, jclass clss, jlong attr_id, j
for (i = 0; i < n; i++) {
h5str.s[0] = '\0';
- if (!h5str_sprintf(ENVONLY, &h5str, (hid_t)attr_id, (hid_t)mem_type_id, (void *)&ref_data[i], 0, 0))
+ if (!h5str_sprintf(ENVONLY, &h5str, (hid_t)attr_id, (hid_t)mem_type_id, (void *)&ref_data[i], 0))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, h5str.s)))
diff --git a/java/src/jni/h5aImp.h b/java/src/jni/h5aImp.h
index 7615946663b..3d9a230c992 100644
--- a/java/src/jni/h5aImp.h
+++ b/java/src/jni/h5aImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c
index f8f23252ded..73b252a17bd 100644
--- a/java/src/jni/h5dImp.c
+++ b/java/src/jni/h5dImp.c
@@ -1290,7 +1290,7 @@ H5DreadVL_asstr(JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid
for (i = 0; i < (size_t)n; i++) {
h5str.s[0] = '\0';
- if (!h5str_sprintf(ENVONLY, &h5str, did, tid, &(((char *)readBuf)[i * typeSize]), typeSize, 0))
+ if (!h5str_sprintf(ENVONLY, &h5str, did, tid, &(((char *)readBuf)[i * typeSize]), 0))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, h5str.s)))
@@ -1669,8 +1669,7 @@ Java_hdf_hdf5lib_H5_H5Dread_1reg_1ref(JNIEnv *env, jclass clss, jlong dataset_id
for (i = 0; i < n; i++) {
h5str.s[0] = '\0';
- if (!h5str_sprintf(ENVONLY, &h5str, (hid_t)dataset_id, (hid_t)mem_type_id, (void *)&ref_data[i], 0,
- 0))
+ if (!h5str_sprintf(ENVONLY, &h5str, (hid_t)dataset_id, (hid_t)mem_type_id, (void *)&ref_data[i], 0))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, h5str.s)))
diff --git a/java/src/jni/h5dImp.h b/java/src/jni/h5dImp.h
index c1ed0659aff..61dfeaa2414 100644
--- a/java/src/jni/h5dImp.h
+++ b/java/src/jni/h5dImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5eImp.c b/java/src/jni/h5eImp.c
index 7d7a2cf7b4a..5bdeae80016 100644
--- a/java/src/jni/h5eImp.c
+++ b/java/src/jni/h5eImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5eImp.h b/java/src/jni/h5eImp.h
index d849b929618..3133ca90715 100644
--- a/java/src/jni/h5eImp.h
+++ b/java/src/jni/h5eImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5fImp.h b/java/src/jni/h5fImp.h
index ed90ee9814f..d7e3ded7bf9 100644
--- a/java/src/jni/h5fImp.h
+++ b/java/src/jni/h5fImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5gImp.h b/java/src/jni/h5gImp.h
index 393d5d861c9..4b0cb4d0e59 100644
--- a/java/src/jni/h5gImp.h
+++ b/java/src/jni/h5gImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5iImp.h b/java/src/jni/h5iImp.h
index eff5048f5f0..ed543035b00 100644
--- a/java/src/jni/h5iImp.h
+++ b/java/src/jni/h5iImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5jni.h b/java/src/jni/h5jni.h
index fb6f22a7a68..aab54796096 100644
--- a/java/src/jni/h5jni.h
+++ b/java/src/jni/h5jni.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5lImp.c b/java/src/jni/h5lImp.c
index fabd92091b7..43db4e9dea6 100644
--- a/java/src/jni/h5lImp.c
+++ b/java/src/jni/h5lImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5lImp.h b/java/src/jni/h5lImp.h
index 2e949fe50c1..134ed1762f4 100644
--- a/java/src/jni/h5lImp.h
+++ b/java/src/jni/h5lImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c
index e06ad79febc..3037bc6aafa 100644
--- a/java/src/jni/h5oImp.c
+++ b/java/src/jni/h5oImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5oImp.h b/java/src/jni/h5oImp.h
index e6675be305c..2abb0d9e811 100644
--- a/java/src/jni/h5oImp.h
+++ b/java/src/jni/h5oImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pACPLImp.c b/java/src/jni/h5pACPLImp.c
index 611016f3487..6290e0ea155 100644
--- a/java/src/jni/h5pACPLImp.c
+++ b/java/src/jni/h5pACPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pACPLImp.h b/java/src/jni/h5pACPLImp.h
index 21c0cc6b15a..8d9bf7d29ab 100644
--- a/java/src/jni/h5pACPLImp.h
+++ b/java/src/jni/h5pACPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pDAPLImp.c b/java/src/jni/h5pDAPLImp.c
index 430fc791a38..82802b91531 100644
--- a/java/src/jni/h5pDAPLImp.c
+++ b/java/src/jni/h5pDAPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pDAPLImp.h b/java/src/jni/h5pDAPLImp.h
index a15e964d4dd..353f652426a 100644
--- a/java/src/jni/h5pDAPLImp.h
+++ b/java/src/jni/h5pDAPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pDCPLImp.c b/java/src/jni/h5pDCPLImp.c
index 9e8b2b6dcde..760a5a8ab7e 100644
--- a/java/src/jni/h5pDCPLImp.c
+++ b/java/src/jni/h5pDCPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pDCPLImp.h b/java/src/jni/h5pDCPLImp.h
index 6adcbe4e5b0..302019f2845 100644
--- a/java/src/jni/h5pDCPLImp.h
+++ b/java/src/jni/h5pDCPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pDXPLImp.c b/java/src/jni/h5pDXPLImp.c
index 8b930dc9c97..c555d539850 100644
--- a/java/src/jni/h5pDXPLImp.c
+++ b/java/src/jni/h5pDXPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pDXPLImp.h b/java/src/jni/h5pDXPLImp.h
index 8d2df6803df..250c3f898de 100644
--- a/java/src/jni/h5pDXPLImp.h
+++ b/java/src/jni/h5pDXPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pFAPLImp.c b/java/src/jni/h5pFAPLImp.c
index 23c84c4d873..ad85aaef88d 100644
--- a/java/src/jni/h5pFAPLImp.c
+++ b/java/src/jni/h5pFAPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pFAPLImp.h b/java/src/jni/h5pFAPLImp.h
index 166834f7ccd..4bb48e2e390 100644
--- a/java/src/jni/h5pFAPLImp.h
+++ b/java/src/jni/h5pFAPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pFCPLImp.c b/java/src/jni/h5pFCPLImp.c
index fe127608c28..ded324855ec 100644
--- a/java/src/jni/h5pFCPLImp.c
+++ b/java/src/jni/h5pFCPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pFCPLImp.h b/java/src/jni/h5pFCPLImp.h
index 7799e496fda..0fe3944bfba 100644
--- a/java/src/jni/h5pFCPLImp.h
+++ b/java/src/jni/h5pFCPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pGAPLImp.c b/java/src/jni/h5pGAPLImp.c
index c43609d77fa..b92e1809d15 100644
--- a/java/src/jni/h5pGAPLImp.c
+++ b/java/src/jni/h5pGAPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pGAPLImp.h b/java/src/jni/h5pGAPLImp.h
index db95f5d0d39..478402a9868 100644
--- a/java/src/jni/h5pGAPLImp.h
+++ b/java/src/jni/h5pGAPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pGCPLImp.c b/java/src/jni/h5pGCPLImp.c
index 46d102fbe50..2ba140d838b 100644
--- a/java/src/jni/h5pGCPLImp.c
+++ b/java/src/jni/h5pGCPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pGCPLImp.h b/java/src/jni/h5pGCPLImp.h
index a1b8b28f1a5..6a40908190a 100644
--- a/java/src/jni/h5pGCPLImp.h
+++ b/java/src/jni/h5pGCPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pImp.h b/java/src/jni/h5pImp.h
index 49d36a63916..b80ce468e92 100644
--- a/java/src/jni/h5pImp.h
+++ b/java/src/jni/h5pImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pLAPLImp.c b/java/src/jni/h5pLAPLImp.c
index 8b5afa22840..1db495ce565 100644
--- a/java/src/jni/h5pLAPLImp.c
+++ b/java/src/jni/h5pLAPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pLAPLImp.h b/java/src/jni/h5pLAPLImp.h
index 204901da134..46adc0c70ac 100644
--- a/java/src/jni/h5pLAPLImp.h
+++ b/java/src/jni/h5pLAPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pLCPLImp.c b/java/src/jni/h5pLCPLImp.c
index 455936b0646..b5eebd18e96 100644
--- a/java/src/jni/h5pLCPLImp.c
+++ b/java/src/jni/h5pLCPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pLCPLImp.h b/java/src/jni/h5pLCPLImp.h
index b7448151f02..7601adb6c55 100644
--- a/java/src/jni/h5pLCPLImp.h
+++ b/java/src/jni/h5pLCPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pOCPLImp.c b/java/src/jni/h5pOCPLImp.c
index 6cf62d77453..bdcba46c32f 100644
--- a/java/src/jni/h5pOCPLImp.c
+++ b/java/src/jni/h5pOCPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pOCPLImp.h b/java/src/jni/h5pOCPLImp.h
index ccc4c788c72..c16f1be0991 100644
--- a/java/src/jni/h5pOCPLImp.h
+++ b/java/src/jni/h5pOCPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pOCpyPLImp.c b/java/src/jni/h5pOCpyPLImp.c
index 9cf18fdc787..b525b680787 100644
--- a/java/src/jni/h5pOCpyPLImp.c
+++ b/java/src/jni/h5pOCpyPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pOCpyPLImp.h b/java/src/jni/h5pOCpyPLImp.h
index 82369b37b64..d8682cbad6d 100644
--- a/java/src/jni/h5pOCpyPLImp.h
+++ b/java/src/jni/h5pOCpyPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pStrCPLImp.c b/java/src/jni/h5pStrCPLImp.c
index 33dbdd7ba2d..a056e3a7599 100644
--- a/java/src/jni/h5pStrCPLImp.c
+++ b/java/src/jni/h5pStrCPLImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5pStrCPLImp.h b/java/src/jni/h5pStrCPLImp.h
index 01cde89a96c..8a564943af4 100644
--- a/java/src/jni/h5pStrCPLImp.h
+++ b/java/src/jni/h5pStrCPLImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5plImp.c b/java/src/jni/h5plImp.c
index bef12421cf5..91930286cd0 100644
--- a/java/src/jni/h5plImp.c
+++ b/java/src/jni/h5plImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5plImp.h b/java/src/jni/h5plImp.h
index 228d512aeda..b809efa2cd6 100644
--- a/java/src/jni/h5plImp.h
+++ b/java/src/jni/h5plImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5rImp.h b/java/src/jni/h5rImp.h
index 94e791194b4..582b837fa6e 100644
--- a/java/src/jni/h5rImp.h
+++ b/java/src/jni/h5rImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5sImp.h b/java/src/jni/h5sImp.h
index c4a18280e38..1ceaf3f9710 100644
--- a/java/src/jni/h5sImp.h
+++ b/java/src/jni/h5sImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5tImp.h b/java/src/jni/h5tImp.h
index 3769cf37d0d..3faeb00bc5b 100644
--- a/java/src/jni/h5tImp.h
+++ b/java/src/jni/h5tImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c
index 5b38daf489b..3e1962e3e49 100644
--- a/java/src/jni/h5util.c
+++ b/java/src/jni/h5util.c
@@ -28,8 +28,6 @@ extern "C" {
#include "hdf5.h"
#include "h5util.h"
-#define SKIP_UNUSED_DUMP_ROUTINES
-
/* size of hyperslab buffer when a dataset is bigger than H5TOOLS_MALLOCSIZE */
hsize_t H5TOOLS_BUFSIZE = (32 * 1024 * 1024); /* 32 MB */
int H5TOOLS_TEXT_BLOCK = 16; /* Number of elements on a line in a text export file */
@@ -54,18 +52,19 @@ void * edata;
/* Local Prototypes */
/********************/
-#ifndef SKIP_UNUSED_DUMP_ROUTINES
-static int h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj);
-static int h5str_dump_region_points(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj);
-#endif
+static int h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj,
+ int expand_data);
+static int h5str_dump_region_points(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj,
+ int expand_data);
+static int h5str_dump_region_attribute(JNIEnv *env, h5str_t *str, hid_t region_id);
static int h5str_is_zero(const void *_mem, size_t size);
static hid_t h5str_get_native_type(hid_t type);
static hid_t h5str_get_little_endian_type(hid_t type);
static hid_t h5str_get_big_endian_type(hid_t type);
static htri_t h5str_detect_vlen(hid_t tid);
static htri_t h5str_detect_vlen_str(hid_t tid);
-static int h5tools_dump_simple_data(JNIEnv *env, FILE *stream, hid_t container, hid_t type, void *_mem,
- hsize_t nelmts);
+static int h5str_dump_simple_data(JNIEnv *env, FILE *stream, hid_t container, hid_t type, void *_mem,
+ hsize_t nelmts);
static int h5str_render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem,
hsize_t block_nelmts);
static int render_bin_output_region_data_blocks(FILE *stream, hid_t region_id, hid_t container, int ndims,
@@ -185,13 +184,14 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
H5T_class_t tclass = H5T_NO_CLASS;
const char delimiter[] = " ," H5_COMPOUND_BEGIN_INDICATOR H5_COMPOUND_END_INDICATOR
H5_ARRAY_BEGIN_INDICATOR H5_ARRAY_END_INDICATOR H5_VLEN_BEGIN_INDICATOR H5_VLEN_END_INDICATOR;
- size_t typeSize = 0;
- hid_t mtid = H5I_INVALID_HID;
- char * this_str = NULL;
- char * token;
- char * cptr = NULL;
- int n;
- size_t retVal = 0;
+
+ size_t retVal = 0;
+ size_t typeSize = 0;
+ hid_t mtid = H5I_INVALID_HID;
+ char * this_str = NULL;
+ char * cptr = NULL;
+ char * token;
+ int n;
if (!in_str)
H5_NULL_ARGUMENT_ERROR(ENVONLY, "h5str_convert: in_str is NULL");
@@ -239,7 +239,7 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
case sizeof(long double): {
long double tmp_ldouble = 0.0;
- sscanf(token, "%Lf", &tmp_ldouble);
+ sscanf(token, "%Lg", &tmp_ldouble);
HDmemcpy(cptr, &tmp_ldouble, sizeof(long double));
break;
}
@@ -644,27 +644,27 @@ h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_
*
* Purpose: Object reference -- show the name of the referenced object.
*
- * Return: Nothing
+ * Return: SUCCEED or FAIL
*-------------------------------------------------------------------------
*/
-void
-h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, hid_t container, void *ref_p)
+int
+h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, void *ref_p)
{
- ssize_t buf_size;
- char * ref_name = NULL;
- const H5R_ref_t *ref_vp = (H5R_ref_t *)ref_p;
+ ssize_t buf_size;
+ char * ref_name = NULL;
+ H5R_ref_t *ref_vp = (H5R_ref_t *)ref_p;
- UNUSED(container);
+ int ret_value = FAIL;
if (!h5str_append(out_str, " \""))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
buf_size = H5Rget_file_name(ref_vp, NULL, 0);
if (buf_size) {
ref_name = (char *)HDmalloc(sizeof(char) * (size_t)buf_size + 1);
if (H5Rget_file_name(ref_vp, ref_name, buf_size + 1) >= 0) {
ref_name[buf_size] = '\0';
if (!h5str_append(out_str, ref_name))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
}
HDfree(ref_name);
ref_name = NULL;
@@ -676,7 +676,7 @@ h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, hid_t container, void *ref
if (H5Rget_obj_name(ref_vp, H5P_DEFAULT, ref_name, buf_size + 1) >= 0) {
ref_name[buf_size] = '\0';
if (!h5str_append(out_str, ref_name))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
}
HDfree(ref_name);
ref_name = NULL;
@@ -689,17 +689,61 @@ h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, hid_t container, void *ref
if (H5Rget_attr_name(ref_vp, ref_name, buf_size + 1) >= 0) {
ref_name[buf_size] = '\0';
if (!h5str_append(out_str, ref_name))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
}
HDfree(ref_name);
ref_name = NULL;
}
}
if (!h5str_append(out_str, "\""))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ ret_value = SUCCEED;
done:
if (ref_name)
HDfree(ref_name);
+
+ return ret_value;
+} /* h5str_sprint_reference */
+
+int
+h5str_region_dataset(JNIEnv *env, h5str_t *out_str, H5R_ref_t *ref_vp, int expand_data)
+{
+ hid_t new_obj_id = H5I_INVALID_HID;
+ hid_t new_obj_sid = H5I_INVALID_HID;
+ H5S_sel_type region_type;
+
+ int ret_value = FAIL;
+
+ if ((new_obj_id = H5Ropen_object(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
+ ret_value = SUCCEED; /* An uncreated region is a valid state */
+ goto done;
+ }
+
+ if ((new_obj_sid = H5Ropen_region(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if ((region_type = H5Sget_select_type(new_obj_sid)) > H5S_SEL_ERROR) {
+ if (H5S_SEL_POINTS == region_type) {
+ if (h5str_dump_region_points(ENVONLY, out_str, new_obj_sid, new_obj_id, expand_data) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ }
+ else if (H5S_SEL_HYPERSLABS == region_type) {
+ if (h5str_dump_region_blocks(ENVONLY, out_str, new_obj_sid, new_obj_id, expand_data) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ }
+ }
+
+ ret_value = SUCCEED;
+done:
+ if (new_obj_sid >= 0)
+ if (H5Sclose(new_obj_sid) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ if (new_obj_id >= 0)
+ if (H5Dclose(new_obj_id) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ return ret_value;
}
/*
@@ -710,8 +754,7 @@ h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, hid_t container, void *ref
* FAILURE: 0
*/
size_t
-h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *in_buf, size_t in_buf_len,
- int expand_data)
+h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *in_buf, int expand_data)
{
unsigned char *ucptr = (unsigned char *)in_buf;
static char fmt_llong[8], fmt_ullong[8];
@@ -719,7 +762,6 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
size_t typeSize = 0;
H5T_sign_t nsign = H5T_SGN_ERROR;
hid_t mtid = H5I_INVALID_HID;
- hid_t obj = H5I_INVALID_HID;
char * cptr = (char *)in_buf;
char * this_str = NULL;
int n;
@@ -734,8 +776,6 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
H5_LIBRARY_ERROR(ENVONLY);
if (!(typeSize = H5Tget_size(tid)))
H5_LIBRARY_ERROR(ENVONLY);
- if (!(nsign = H5Tget_sign(tid)))
- H5_LIBRARY_ERROR(ENVONLY);
/* Build default formats for long long types */
if (!fmt_llong[0]) {
@@ -744,7 +784,6 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
if (HDsnprintf(fmt_ullong, sizeof(fmt_ullong), "%%%su", H5_PRINTF_LL_WIDTH) < 0)
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsnprintf failure");
} /* end if */
-
switch (tclass) {
case H5T_FLOAT: {
switch (typeSize) {
@@ -805,6 +844,8 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
htri_t is_variable;
char * tmp_str;
+ typeSize = 0;
+
if ((is_variable = H5Tis_variable_str(tid)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1003,7 +1044,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
H5_LIBRARY_ERROR(ENVONLY);
if (!h5str_append(out_str, H5_COMPOUND_BEGIN_INDICATOR))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
for (i = 0; i < (unsigned)n; i++) {
offset = H5Tget_member_offset(tid, i);
@@ -1011,12 +1052,12 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
if ((mtid = H5Tget_member_type(tid, i)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
- if (!h5str_sprintf(ENVONLY, out_str, container, mtid, &cptr[offset], in_buf_len, expand_data))
+ if (!h5str_sprintf(ENVONLY, out_str, container, mtid, &cptr[offset], expand_data))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if ((i + 1) < (unsigned)n)
if (!h5str_append(out_str, ", "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
if (H5Tclose(mtid) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1024,7 +1065,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
}
if (!h5str_append(out_str, H5_COMPOUND_END_INDICATOR))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
break;
}
@@ -1034,7 +1075,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
if (H5Tenum_nameof(tid, cptr, enum_name, sizeof enum_name) >= 0) {
if (!h5str_append(out_str, enum_name))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
}
else {
size_t i;
@@ -1057,130 +1098,120 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
}
case H5T_REFERENCE: {
- if (h5str_is_zero(cptr, typeSize)) {
- if (!h5str_append(out_str, "NULL"))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- break;
- }
-
if (H5Tequal(tid, H5T_STD_REF)) {
- H5O_type_t obj_type = -1; /* Object type */
- H5R_type_t ref_type; /* Reference type */
- const H5R_ref_t *ref_vp = (H5R_ref_t *)cptr;
+ hid_t new_obj_id = H5I_INVALID_HID;
+ H5O_type_t obj_type = -1; /* Object type */
+ H5R_type_t ref_type; /* Reference type */
+
+ H5R_ref_t *ref_vp = (H5R_ref_t *)cptr;
ref_type = H5Rget_type(ref_vp);
- H5Rget_obj_type3(ref_vp, H5P_DEFAULT, &obj_type);
switch (ref_type) {
- case H5R_OBJECT1: {
- /* Object references -- show the type and OID of the referenced object. */
- H5O_info2_t oi;
-
- if ((obj = H5Ropen_object(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
- H5Oget_info3(obj, &oi, H5O_INFO_BASIC);
- if (H5Oclose(obj) < 0)
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ case H5R_OBJECT1:
+ if (H5Rget_obj_type3(ref_vp, H5P_DEFAULT, &obj_type) >= 0) {
+ switch (obj_type) {
+ case H5O_TYPE_DATASET:
+ if (h5str_region_dataset(ENVONLY, out_str, ref_vp, expand_data) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ break;
+
+ case H5O_TYPE_GROUP:
+ case H5O_TYPE_NAMED_DATATYPE:
+ case H5O_TYPE_MAP:
+ case H5O_TYPE_UNKNOWN:
+ case H5O_TYPE_NTYPES:
+ default: {
+ /* Object references -- show the type and OID of the referenced object. */
+ H5O_info2_t oi;
+ char * obj_tok_str = NULL;
+ if ((new_obj_id = H5Ropen_object(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) >=
+ 0) {
+ H5Oget_info3(new_obj_id, &oi, H5O_INFO_BASIC);
+ H5Otoken_to_str(new_obj_id, &oi.token, &obj_tok_str);
+ if (H5Dclose(new_obj_id) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ }
+ else
+ H5_LIBRARY_ERROR(ENVONLY);
+
+ if (NULL == (this_str = (char *)HDmalloc(14)))
+ H5_OUT_OF_MEMORY_ERROR(
+ ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ if (HDsprintf(this_str, "%u-", (unsigned)oi.type) < 0)
+ H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
+ if (!h5str_append(out_str, this_str))
+ H5_LIBRARY_ERROR(ENVONLY);
+ HDfree(this_str);
+ this_str = NULL;
+
+ /* Print OID */
+ {
+ char *token_str;
+
+ H5Otoken_to_str(tid, &oi.token, &token_str);
+
+ if (NULL == (this_str = (char *)HDmalloc(64 + strlen(token_str) + 1)))
+ H5_OUT_OF_MEMORY_ERROR(
+ ENVONLY, "h5str_sprintf: failed to allocate string buffer");
+ if (HDsprintf(this_str, "%lu:%s", oi.fileno, token_str) < 0)
+ H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
+
+ H5free_memory(token_str);
+ }
+ } break;
+ } /* end switch */
}
else
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
-
- if (NULL == (this_str = (char *)HDmalloc(14)))
- H5_OUT_OF_MEMORY_ERROR(ENVONLY,
- "h5str_sprintf: failed to allocate string buffer");
- if (HDsprintf(this_str, "%u-", (unsigned)oi.type) < 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
- if (!h5str_append(out_str, this_str))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- HDfree(this_str);
- this_str = NULL;
-
- switch (obj_type) {
- case H5O_TYPE_GROUP:
- if (!h5str_append(out_str, H5_TOOLS_GROUP))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- break;
-
- case H5O_TYPE_DATASET:
- if (!h5str_append(out_str, H5_TOOLS_DATASET))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- break;
-
- case H5O_TYPE_NAMED_DATATYPE:
- if (!h5str_append(out_str, H5_TOOLS_DATATYPE))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- break;
-
- case H5O_TYPE_MAP:
- case H5O_TYPE_UNKNOWN:
- case H5O_TYPE_NTYPES:
- default:
- break;
- } /* end switch */
- H5Oclose(obj);
- h5str_sprint_reference(ENVONLY, out_str, container, ref_vp);
-
- /* Print OID */
- {
- char *token_str;
-
- H5Otoken_to_str(tid, &oi.token, &token_str);
-
- if (NULL == (this_str = (char *)HDmalloc(64 + strlen(token_str) + 1)))
- H5_OUT_OF_MEMORY_ERROR(ENVONLY,
- "h5str_sprintf: failed to allocate string buffer");
- if (HDsprintf(this_str, "%lu:%s", oi.fileno, token_str) < 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: HDsprintf failure");
-
- H5free_memory(token_str);
- }
-
- }
-
- break;
+ H5_LIBRARY_ERROR(ENVONLY);
+ break;
case H5R_DATASET_REGION1:
- if (!h5str_append(out_str, H5_TOOLS_DATASET))
+ if (h5str_region_dataset(ENVONLY, out_str, ref_vp, expand_data) < 0)
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- h5str_sprint_reference(ENVONLY, out_str, container, (void *)cptr);
break;
case H5R_OBJECT2:
- switch (obj_type) {
- case H5O_TYPE_GROUP:
- if (!h5str_append(out_str, H5_TOOLS_GROUP))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- break;
-
- case H5O_TYPE_DATASET:
- if (!h5str_append(out_str, H5_TOOLS_DATASET))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- break;
-
- case H5O_TYPE_NAMED_DATATYPE:
- if (!h5str_append(out_str, H5_TOOLS_DATATYPE))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- break;
-
- case H5O_TYPE_MAP:
- case H5O_TYPE_UNKNOWN:
- case H5O_TYPE_NTYPES:
- default:
- break;
- } /* end switch */
- h5str_sprint_reference(ENVONLY, out_str, container, (void *)cptr);
+ if (H5Rget_obj_type3(ref_vp, H5P_DEFAULT, &obj_type) >= 0) {
+ switch (obj_type) {
+ case H5O_TYPE_GROUP:
+ break;
+
+ case H5O_TYPE_DATASET:
+ if (h5str_region_dataset(ENVONLY, out_str, ref_vp, expand_data) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ break;
+
+ case H5O_TYPE_NAMED_DATATYPE:
+ break;
+
+ case H5O_TYPE_MAP:
+ case H5O_TYPE_UNKNOWN:
+ case H5O_TYPE_NTYPES:
+ default:
+ break;
+ } /* end switch */
+ }
+ else
+ H5_JNI_FATAL_ERROR(ENVONLY, "h5str_sprintf: H5R_OBJECT2 failed");
break;
case H5R_DATASET_REGION2:
- if (!h5str_append(out_str, H5_TOOLS_DATASET))
+ if (h5str_region_dataset(ENVONLY, out_str, ref_vp, expand_data) < 0)
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- h5str_sprint_reference(ENVONLY, out_str, container, (void *)cptr);
break;
case H5R_ATTR:
- if (!h5str_append(out_str, H5_TOOLS_ATTRIBUTE))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- h5str_sprint_reference(ENVONLY, out_str, container, (void *)cptr);
+ if ((new_obj_id = H5Ropen_attr(ref_vp, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
+ if (h5str_dump_region_attribute(ENVONLY, out_str, new_obj_id) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ if (H5Aclose(new_obj_id) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ }
break;
case H5R_BADTYPE:
case H5R_MAXTYPE:
default:
break;
} /* end switch */
+
+ if (H5Rdestroy(ref_vp) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
}
else if (H5Tequal(tid, H5T_STD_REF_DSETREG)) {
/* (H5R_DSET_REG_REF_BUF_SIZE == typeSize) */
@@ -1200,7 +1231,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
int rank = 0;
if (!h5str_append(out_str, H5_ARRAY_BEGIN_INDICATOR))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
if ((mtid = H5Tget_super(tid)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1218,17 +1249,16 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
total_elmts *= dims[i];
for (i = 0; i < total_elmts; i++) {
- if (!h5str_sprintf(ENVONLY, out_str, container, mtid, &(cptr[i * baseSize]), in_buf_len,
- expand_data))
+ if (!h5str_sprintf(ENVONLY, out_str, container, mtid, &(cptr[i * baseSize]), expand_data))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if ((i + 1) < total_elmts)
if (!h5str_append(out_str, ", "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
}
if (!h5str_append(out_str, H5_ARRAY_END_INDICATOR))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
if (H5Tclose(mtid) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1249,20 +1279,20 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
H5_LIBRARY_ERROR(ENVONLY);
if (!h5str_append(out_str, H5_VLEN_BEGIN_INDICATOR))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
for (i = 0; i < (unsigned)vl_buf->len; i++) {
if (!h5str_sprintf(ENVONLY, out_str, container, mtid, &(((char *)vl_buf->p)[i * baseSize]),
- vl_buf->len, expand_data))
+ expand_data))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if ((i + 1) < (unsigned)vl_buf->len)
if (!h5str_append(out_str, ", "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
}
if (!h5str_append(out_str, H5_VLEN_END_INDICATOR))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
if (H5Tclose(mtid) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1304,7 +1334,7 @@ h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *i
if (this_str) {
if (!h5str_append(out_str, this_str))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
HDfree(this_str);
this_str = NULL;
@@ -1405,12 +1435,12 @@ h5str_print_region_data_blocks(JNIEnv *env, hid_t region_id, h5str_t *str, int n
for (numindex = 0; numindex < numelem; numindex++) {
if (!h5str_sprintf(ENVONLY, str, region_id, type_id, ((char *)region_buf + numindex * type_size),
- 0, 1))
+ 1))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if (numindex + 1 < numelem)
if (!h5str_append(str, ", "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
} /* end for (jndx = 0; jndx < numelem; jndx++, region_elmtno++, ctx.cur_elmt++) */
} /* end for (blkndx = 0; blkndx < nblocks; blkndx++) */
@@ -1434,7 +1464,7 @@ h5str_print_region_data_blocks(JNIEnv *env, hid_t region_id, h5str_t *str, int n
} /* end h5str_print_region_data_blocks */
int
-h5str_dump_region_blocks_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_id)
+h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region_space, hid_t region_id, int expand_data)
{
hssize_t nblocks;
hsize_t alloc_size;
@@ -1443,29 +1473,31 @@ h5str_dump_region_blocks_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t reg
hid_t type_id = H5I_INVALID_HID;
int ndims = -1;
int ret_value = FAIL;
+ int i;
+ char tmp_str[256];
/*
* This function fails if the region does not have blocks.
*/
- H5E_BEGIN_TRY { nblocks = H5Sget_select_hyper_nblocks(region); }
+ H5E_BEGIN_TRY { nblocks = H5Sget_select_hyper_nblocks(region_space); }
H5E_END_TRY;
- if (nblocks < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- if ((ndims = H5Sget_simple_extent_ndims(region)) < 0)
+ if (nblocks <= 0) {
+ ret_value = SUCCEED;
+ goto done;
+ }
+ if ((ndims = H5Sget_simple_extent_ndims(region_space)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
/* Print block information */
alloc_size = (hsize_t)nblocks * (hsize_t)ndims * 2 * (hsize_t)sizeof(ptdata[0]);
- if (alloc_size == (hsize_t)((size_t)alloc_size)) {
- if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)))
- H5_OUT_OF_MEMORY_ERROR(ENVONLY,
- "h5str_dump_region_blocks_data: failed to allocate region block buffer");
+ if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_region_blocks: failed to allocate region block buffer");
- if (H5Sget_select_hyper_blocklist(region, (hsize_t)0, (hsize_t)nblocks, ptdata) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ if (H5Sget_select_hyper_blocklist(region_space, (hsize_t)0, (hsize_t)nblocks, ptdata) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ if (expand_data) {
if ((dtype = H5Dget_type(region_id)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
@@ -1474,66 +1506,19 @@ h5str_dump_region_blocks_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t reg
if (h5str_print_region_data_blocks(ENVONLY, region_id, str, ndims, type_id, nblocks, ptdata) < 0)
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- } /* if (alloc_size == (hsize_t)((size_t)alloc_size)) */
-
- ret_value = SUCCEED;
-
-done:
- if (type_id >= 0)
- H5Tclose(type_id);
- if (dtype >= 0)
- H5Tclose(dtype);
- if (ptdata)
- HDfree(ptdata);
-
- return ret_value;
-} /* end h5str_dump_region_blocks_data */
-
-#ifndef SKIP_UNUSED_DUMP_ROUTINES
-static int
-h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_id)
-{
- hssize_t nblocks;
- hsize_t alloc_size;
- hsize_t *ptdata = NULL;
- char tmp_str[256];
- int ndims = -1;
- int ret_value = FAIL;
-
- UNUSED(region_id);
-
- /*
- * This function fails if the region does not have blocks.
- */
- H5E_BEGIN_TRY { nblocks = H5Sget_select_hyper_nblocks(region); }
- H5E_END_TRY;
-
- if (nblocks < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- if ((ndims = H5Sget_simple_extent_ndims(region)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- /* Print block information */
- alloc_size = (hsize_t)nblocks * (hsize_t)ndims * 2 * (hsize_t)sizeof(ptdata[0]);
- if (alloc_size == (hsize_t)((size_t)alloc_size)) {
- int i;
-
- if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)))
- H5_OUT_OF_MEMORY_ERROR(ENVONLY,
- "h5str_dump_region_blocks: failed to allocate region block buffer");
-
- if (H5Sget_select_hyper_blocklist(region, (hsize_t)0, (hsize_t)nblocks, ptdata) < 0)
+ }
+ else {
+ if (!h5str_append(str, " REGION_TYPE BLOCK"))
H5_LIBRARY_ERROR(ENVONLY);
if (!h5str_append(str, " {"))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
for (i = 0; i < nblocks; i++) {
int j;
if (!h5str_append(str, " "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
/* Start coordinates and opposite corner */
for (j = 0; j < ndims; j++) {
@@ -1543,7 +1528,7 @@ h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_i
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_region_blocks: HDsprintf failure");
if (!h5str_append(str, tmp_str))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
}
for (j = 0; j < ndims; j++) {
@@ -1554,28 +1539,30 @@ h5str_dump_region_blocks(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_i
H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_region_blocks: HDsprintf failure");
if (!h5str_append(str, tmp_str))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
}
if (!h5str_append(str, ") "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
tmp_str[0] = '\0';
}
if (!h5str_append(str, " }"))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- } /* if (alloc_size == (hsize_t)((size_t)alloc_size)) */
-
+ H5_LIBRARY_ERROR(ENVONLY);
+ }
ret_value = SUCCEED;
done:
+ if (type_id >= 0)
+ H5Tclose(type_id);
+ if (dtype >= 0)
+ H5Tclose(dtype);
if (ptdata)
HDfree(ptdata);
return ret_value;
} /* end h5str_dump_region_blocks */
-#endif
/*-------------------------------------------------------------------------
* Purpose: Print the data values from a dataset referenced by region points.
@@ -1628,12 +1615,12 @@ h5str_print_region_data_points(JNIEnv *env, hid_t region_space, hid_t region_id,
if (H5Sget_simple_extent_dims(mem_space, total_size, NULL) < 0)
H5_LIBRARY_ERROR(ENVONLY);
- if (!h5str_sprintf(ENVONLY, str, region_id, type_id, ((char *)region_buf + jndx * type_size), 0, 1))
+ if (!h5str_sprintf(ENVONLY, str, region_id, type_id, ((char *)region_buf + jndx * type_size), 1))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if (jndx + 1 < (size_t)npoints)
if (!h5str_append(str, ", "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+ H5_LIBRARY_ERROR(ENVONLY);
} /* end for (jndx = 0; jndx < npoints; jndx++, elmtno++) */
ret_value = SUCCEED;
@@ -1650,140 +1637,93 @@ h5str_print_region_data_points(JNIEnv *env, hid_t region_space, hid_t region_id,
} /* end h5str_print_region_data_points */
int
-h5str_dump_region_points_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_id)
+h5str_dump_region_points(JNIEnv *env, h5str_t *str, hid_t region_space, hid_t region_id, int expand_data)
{
- hssize_t npoints;
hsize_t alloc_size;
+ hssize_t npoints = -1;
hsize_t *ptdata = NULL;
hid_t dtype = H5I_INVALID_HID;
hid_t type_id = H5I_INVALID_HID;
int ndims = -1;
int ret_value = FAIL;
+ int i;
+ char tmp_str[256];
/*
* This function fails if the region does not have points.
*/
- H5E_BEGIN_TRY { npoints = H5Sget_select_elem_npoints(region); }
+ H5E_BEGIN_TRY { npoints = H5Sget_select_elem_npoints(region_space); }
H5E_END_TRY;
- if (npoints < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- if ((ndims = H5Sget_simple_extent_ndims(region)) < 0)
+ if (npoints <= 0) {
+ ret_value = SUCCEED;
+ goto done;
+ }
+ if ((ndims = H5Sget_simple_extent_ndims(region_space)) < 0)
H5_LIBRARY_ERROR(ENVONLY);
/* Print point information */
- if (npoints > 0) {
- alloc_size = (hsize_t)npoints * (hsize_t)ndims * (hsize_t)sizeof(ptdata[0]);
- if (alloc_size == (hsize_t)((size_t)alloc_size)) {
- if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)))
- H5_OUT_OF_MEMORY_ERROR(
- ENVONLY, "h5str_dump_region_points_data: failed to allocate region point data buffer");
+ alloc_size = (hsize_t)npoints * (hsize_t)ndims * (hsize_t)sizeof(ptdata[0]);
+ if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)))
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY,
+ "h5str_dump_region_points: failed to allocate region point data buffer");
- if (H5Sget_select_elem_pointlist(region, (hsize_t)0, (hsize_t)npoints, ptdata) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ if (H5Sget_select_elem_pointlist(region_space, (hsize_t)0, (hsize_t)npoints, ptdata) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- if ((dtype = H5Dget_type(region_id)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ if (expand_data) {
+ if ((dtype = H5Dget_type(region_id)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- if ((type_id = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
+ if ((type_id = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
- if (h5str_print_region_data_points(ENVONLY, region, region_id, str, ndims, type_id, npoints,
- ptdata) < 0)
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- }
+ if (h5str_print_region_data_points(ENVONLY, region_space, region_id, str, ndims, type_id, npoints,
+ ptdata) < 0)
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
}
+ else {
+ if (!h5str_append(str, " REGION_TYPE POINT"))
+ H5_LIBRARY_ERROR(ENVONLY);
- ret_value = SUCCEED;
-
-done:
- if (type_id >= 0)
- H5Tclose(type_id);
- if (dtype >= 0)
- H5Tclose(dtype);
- if (ptdata)
- HDfree(ptdata);
-
- return ret_value;
-} /* end h5str_dump_region_points_data */
-
-#ifndef SKIP_UNUSED_DUMP_ROUTINES
-static int
-h5str_dump_region_points(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_id)
-{
- hssize_t npoints;
- hsize_t alloc_size;
- hsize_t *ptdata = NULL;
- char tmp_str[256];
- int ndims = -1;
- int ret_value = FAIL;
-
- UNUSED(region_id);
-
- /*
- * This function fails if the region does not have points.
- */
- H5E_BEGIN_TRY { npoints = H5Sget_select_elem_npoints(region); }
- H5E_END_TRY;
-
- if (npoints < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- if ((ndims = H5Sget_simple_extent_ndims(region)) < 0)
- H5_LIBRARY_ERROR(ENVONLY);
-
- /* Print point information */
- if (npoints > 0) {
- int i;
+ if (!h5str_append(str, " {"))
+ H5_LIBRARY_ERROR(ENVONLY);
- alloc_size = (hsize_t)npoints * (hsize_t)ndims * (hsize_t)sizeof(ptdata[0]);
- if (alloc_size == (hsize_t)((size_t)alloc_size)) {
- if (NULL == (ptdata = (hsize_t *)HDmalloc((size_t)alloc_size)))
- H5_OUT_OF_MEMORY_ERROR(ENVONLY,
- "h5str_dump_region_points: failed to allocate region point buffer");
+ for (i = 0; i < npoints; i++) {
+ int j;
- if (H5Sget_select_elem_pointlist(region, (hsize_t)0, (hsize_t)npoints, ptdata) < 0)
+ if (!h5str_append(str, " "))
H5_LIBRARY_ERROR(ENVONLY);
- if (!h5str_append(str, " {"))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
-
- for (i = 0; i < npoints; i++) {
- int j;
-
- if (!h5str_append(str, " "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
-
- for (j = 0; j < ndims; j++) {
- tmp_str[0] = '\0';
-
- if (HDsprintf(tmp_str, "%s%lu", j ? "," : "(", (unsigned long)(ptdata[i * ndims + j])) <
- 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_region_points: HDsprintf failure");
+ for (j = 0; j < ndims; j++) {
+ tmp_str[0] = '\0';
- if (!h5str_append(str, tmp_str))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- } /* end for (j = 0; j < ndims; j++) */
+ if (HDsprintf(tmp_str, "%s%lu", j ? "," : "(", (unsigned long)(ptdata[i * ndims + j])) < 0)
+ H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_region_points: HDsprintf failure");
- if (!h5str_append(str, ") "))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- } /* end for (i = 0; i < npoints; i++) */
+ if (!h5str_append(str, tmp_str))
+ H5_LIBRARY_ERROR(ENVONLY);
+ } /* end for (j = 0; j < ndims; j++) */
- if (!h5str_append(str, " }"))
- CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- } /* end if (alloc_size == (hsize_t)((size_t) alloc_size)) */
- } /* end if (npoints > 0) */
+ if (!h5str_append(str, ") "))
+ H5_LIBRARY_ERROR(ENVONLY);
+ } /* end for (i = 0; i < npoints; i++) */
+ if (!h5str_append(str, " }"))
+ H5_LIBRARY_ERROR(ENVONLY);
+ }
ret_value = SUCCEED;
done:
+ if (type_id >= 0)
+ H5Tclose(type_id);
+ if (dtype >= 0)
+ H5Tclose(dtype);
if (ptdata)
HDfree(ptdata);
return ret_value;
} /* end h5str_dump_region_points */
-#endif
static int
h5str_is_zero(const void *_mem, size_t size)
@@ -2308,30 +2248,22 @@ h5str_render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hs
/* Region data */
for (block_index = 0; block_index < block_nelmts; block_index++) {
mem = ((unsigned char *)_mem) + block_index * size;
- if ((region_id = H5Ropen_object((const H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if ((region_id = H5Ropen_object((H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) < 0)
continue;
- else {
- if ((region_space =
- H5Ropen_region((const H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
- if (!h5str_is_zero(mem, H5Tget_size(H5T_STD_REF))) {
- region_type = H5Sget_select_type(region_space);
- if (region_type == H5S_SEL_POINTS)
- ret_value = render_bin_output_region_points(stream, region_space,
- region_id, container);
- else
- ret_value = render_bin_output_region_blocks(stream, region_space,
- region_id, container);
- }
- H5Sclose(region_space);
- } /* end if (region_space >= 0) */
- H5Dclose(region_id);
- }
-
- if ((region_type = H5Sget_select_type(region_space)) < 0) {
+ if ((region_space = H5Ropen_region((H5R_ref_t *)mem, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
+ if (!h5str_is_zero(mem, H5Tget_size(H5T_STD_REF))) {
+ region_type = H5Sget_select_type(region_space);
+ if (region_type == H5S_SEL_POINTS)
+ ret_value = render_bin_output_region_points(stream, region_space, region_id,
+ container);
+ else if (region_type == H5S_SEL_HYPERSLABS)
+ ret_value = render_bin_output_region_blocks(stream, region_space, region_id,
+ container);
+ }
H5Sclose(region_space);
- H5Dclose(region_id);
- continue;
- }
+ } /* end if (region_space >= 0) */
+ H5Dclose(region_id);
+
if (ret_value < 0)
break;
}
@@ -2711,6 +2643,109 @@ render_bin_output_region_points(FILE *stream, hid_t region_space, hid_t region_i
return ret_value;
} /* end render_bin_output_region_points */
+/*-------------------------------------------------------------------------
+ * Purpose: Print some values from an attribute referenced by object reference.
+ *
+ * Parameters Description:
+ * FILE *buffer is the string into which to render
+ *-------------------------------------------------------------------------
+ */
+static int
+h5str_dump_region_attribute(JNIEnv *env, h5str_t *str, hid_t region_id)
+{
+ int ret_value = SUCCEED;
+ hid_t atype = H5I_INVALID_HID;
+ hid_t type_id = H5I_INVALID_HID;
+ hid_t region_space = H5I_INVALID_HID;
+ hsize_t total_size[H5S_MAX_RANK]; /* total size of dataset*/
+ size_t i; /* counter */
+ size_t size; /* datum size */
+ int sndims; /* rank of dataspace */
+ hsize_t p_nelmts; /* total selected elmts */
+ hsize_t alloc_size;
+
+ unsigned char *buf = NULL; /* buffer for raw data */
+
+ /* VL data special information */
+ unsigned int vl_data = 0; /* contains VL datatypes */
+
+ if ((region_space = H5Aget_space(region_id)) < 0) {
+ ret_value = FAIL;
+ goto done;
+ }
+
+ if ((sndims = H5Sget_simple_extent_ndims(region_space)) < 0) {
+ ret_value = FAIL;
+ goto done;
+ }
+
+ /* Assume entire data space to be read */
+ H5Sget_simple_extent_dims(region_space, total_size, NULL);
+ p_nelmts = 1;
+
+ for (i = 0; i < sndims; i++)
+ p_nelmts *= total_size[i];
+
+ if ((atype = H5Aget_type(region_id)) < 0) {
+ ret_value = FAIL;
+ goto done;
+ }
+ if ((type_id = H5Tget_native_type(atype, H5T_DIR_DEFAULT)) < 0) {
+ ret_value = FAIL;
+ goto done;
+ }
+
+ /* Check if we have VL data in the dataset's datatype */
+ if (h5str_detect_vlen(type_id) == TRUE)
+ vl_data = TRUE;
+
+ if (!(size = H5Tget_size(type_id))) {
+ ret_value = FAIL;
+ goto done;
+ }
+
+ alloc_size = p_nelmts * size;
+ HDassert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/
+ if (NULL != (buf = (unsigned char *)HDmalloc((size_t)alloc_size))) {
+ /* Read the data */
+ if (H5Aread(region_id, type_id, buf) >= 0) {
+
+ for (i = 0; i < p_nelmts; i++) {
+ size_t bytes_in = 0; /* # of bytes to write */
+ void * memref = buf + i * size;
+
+ if (!(bytes_in = h5str_sprintf(ENVONLY, str, region_id, type_id, memref, 1)))
+ CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
+
+ if ((i < p_nelmts - 1) && (bytes_in > 0)) {
+ if (!h5str_append(str, ", "))
+ H5_LIBRARY_ERROR(ENVONLY);
+ }
+ }
+
+ /* Reclaim any VL memory, if necessary */
+ if (vl_data) {
+ if (H5Treclaim(type_id, region_space, H5P_DEFAULT, buf) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+ }
+ }
+ else
+ H5_LIBRARY_ERROR(ENVONLY);
+ }
+
+done:
+ if (buf)
+ HDfree(buf);
+ if (region_space >= 0)
+ H5Sclose(region_space);
+ if (type_id >= 0)
+ H5Tclose(type_id);
+ if (atype >= 0)
+ H5Tclose(type_id);
+
+ return ret_value;
+}
+
int
h5str_dump_simple_dset(JNIEnv *env, FILE *stream, hid_t dset, int binary_order)
{
@@ -2865,7 +2900,7 @@ h5str_dump_simple_dset(JNIEnv *env, FILE *stream, hid_t dset, int binary_order)
H5_LIBRARY_ERROR(ENVONLY);
if (binary_order == 99) {
- if (h5tools_dump_simple_data(ENVONLY, stream, dset, p_type, sm_buf, hs_nelmts) < 0)
+ if (h5str_dump_simple_data(ENVONLY, stream, dset, p_type, sm_buf, hs_nelmts) < 0)
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
}
else {
@@ -2936,7 +2971,7 @@ H5Tdetect_variable_str(hid_t tid)
} /* end H5Tdetect_variable_str */
static int
-h5tools_dump_simple_data(JNIEnv *env, FILE *stream, hid_t container, hid_t type, void *_mem, hsize_t nelmts)
+h5str_dump_simple_data(JNIEnv *env, FILE *stream, hid_t container, hid_t type, void *_mem, hsize_t nelmts)
{
unsigned char *mem = (unsigned char *)_mem;
h5str_t buffer; /* string into which to render */
@@ -2956,38 +2991,38 @@ h5tools_dump_simple_data(JNIEnv *env, FILE *stream, hid_t container, hid_t type,
h5str_new(&buffer, 32 * size);
if (!buffer.s)
- H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5tools_dump_simple_data: failed to allocate buffer");
+ H5_OUT_OF_MEMORY_ERROR(ENVONLY, "h5str_dump_simple_data: failed to allocate buffer");
- if (!(bytes_in = h5str_sprintf(ENVONLY, &buffer, container, type, memref, 0, 1)))
+ if (!(bytes_in = h5str_sprintf(ENVONLY, &buffer, container, type, memref, 1)))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
- if (i > 0) {
+ if ((i > 0) && (bytes_in > 0)) {
if (HDfprintf(stream, ", ") < 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5tools_dump_simple_data: HDfprintf failure");
+ H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_simple_data: HDfprintf failure");
if (line_count >= H5TOOLS_TEXT_BLOCK) {
line_count = 0;
if (HDfprintf(stream, "\n") < 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5tools_dump_simple_data: HDfprintf failure");
+ H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_simple_data: HDfprintf failure");
}
}
if (HDfprintf(stream, "%s", buffer.s) < 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5tools_dump_simple_data: HDfprintf failure");
+ H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_simple_data: HDfprintf failure");
h5str_free(&buffer);
} /* end for (i = 0; i < nelmts... */
if (HDfprintf(stream, "\n") < 0)
- H5_JNI_FATAL_ERROR(ENVONLY, "h5tools_dump_simple_data: HDfprintf failure");
+ H5_JNI_FATAL_ERROR(ENVONLY, "h5str_dump_simple_data: HDfprintf failure");
done:
if (buffer.s)
h5str_free(&buffer);
return ret_value;
-} /* end h5tools_dump_simple_data */
+} /* end h5str_dump_simple_data */
/*
* Utility Java APIs
@@ -3041,7 +3076,7 @@ Java_hdf_hdf5lib_H5_H5AreadComplex(JNIEnv *env, jclass clss, jlong attr_id, jlon
for (i = 0; i < (size_t)n; i++) {
h5str.s[0] = '\0';
- if (!h5str_sprintf(ENVONLY, &h5str, attr_id, mem_type_id, readBuf + (i * size), 0, 0))
+ if (!h5str_sprintf(ENVONLY, &h5str, attr_id, mem_type_id, readBuf + (i * size), 0))
CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);
if (NULL == (jstr = ENVPTR->NewStringUTF(ENVONLY, h5str.s)))
diff --git a/java/src/jni/h5util.h b/java/src/jni/h5util.h
index 4b79eda58c6..a5e9607816a 100644
--- a/java/src/jni/h5util.h
+++ b/java/src/jni/h5util.h
@@ -41,13 +41,11 @@ extern void h5str_resize(h5str_t *str, size_t new_len);
extern char * h5str_append(h5str_t *str, const char *cstr);
extern size_t h5str_convert(JNIEnv *env, char **in_str, hid_t container, hid_t tid, void *out_buf,
size_t out_buf_offset);
-extern void h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, hid_t container, void *ref_p);
+extern int h5str_sprint_reference(JNIEnv *env, h5str_t *out_str, void *ref_p);
extern size_t h5str_sprintf(JNIEnv *env, h5str_t *out_str, hid_t container, hid_t tid, void *in_buf,
- size_t in_buf_len, int expand_data);
+ int expand_data);
extern void h5str_array_free(char **strs, size_t len);
extern int h5str_dump_simple_dset(JNIEnv *env, FILE *stream, hid_t dset, int binary_order);
-extern int h5str_dump_region_blocks_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj);
-extern int h5str_dump_region_points_data(JNIEnv *env, h5str_t *str, hid_t region, hid_t region_obj);
extern htri_t H5Tdetect_variable_str(hid_t tid);
diff --git a/java/src/jni/h5vlImp.c b/java/src/jni/h5vlImp.c
index 9b48d21228f..40f8863c95d 100644
--- a/java/src/jni/h5vlImp.c
+++ b/java/src/jni/h5vlImp.c
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5vlImp.h b/java/src/jni/h5vlImp.h
index 70c50062fbd..bf467aff563 100644
--- a/java/src/jni/h5vlImp.h
+++ b/java/src/jni/h5vlImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/h5zImp.h b/java/src/jni/h5zImp.h
index 924776c731c..4e8982e033a 100644
--- a/java/src/jni/h5zImp.h
+++ b/java/src/jni/h5zImp.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/src/jni/nativeData.h b/java/src/jni/nativeData.h
index 398dfc9a8cc..0150c75809d 100644
--- a/java/src/jni/nativeData.h
+++ b/java/src/jni/nativeData.h
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt
index b0a0d5326d5..6544b77b12f 100644
--- a/java/test/CMakeLists.txt
+++ b/java/test/CMakeLists.txt
@@ -27,6 +27,7 @@ set (HDF5_JAVA_TEST_SOURCES
TestH5Lbasic
TestH5Lcreate
TestH5R
+ TestH5Rref
TestH5P
TestH5PData
TestH5Pfapl
@@ -93,6 +94,8 @@ HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/h5ex_g_iterateL2.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/h5ex_g_iterateO1.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/h5ex_g_iterateO2.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
+HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/trefer_reg.h5" "${PROJECT_BINARY_DIR}/trefer_reg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
+HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/trefer_attr.h5" "${PROJECT_BINARY_DIR}/trefer_attr.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_files")
add_custom_target(${HDF5_JAVA_TEST_LIB_TARGET}_files ALL COMMENT "Copying files needed by ${HDF5_JAVA_TEST_LIB_TARGET} tests" DEPENDS ${${HDF5_JAVA_TEST_LIB_TARGET}_files_list})
@@ -206,6 +209,8 @@ if (HDF5_TEST_JAVA AND HDF5_TEST_SERIAL)
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/${voltest}/h5ex_g_iterateL2.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/${voltest}/h5ex_g_iterateO1.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/h5ex_g_iterate.orig" "${PROJECT_BINARY_DIR}/${voltest}/h5ex_g_iterateO2.hdf" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/trefer_reg.h5" "${PROJECT_BINARY_DIR}/${voltest}/trefer_reg.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/trefer_attr.h5" "${PROJECT_BINARY_DIR}/${voltest}/trefer_attr.h5" "${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files")
add_custom_target(${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files ALL COMMENT "Copying files needed by ${HDF5_JAVA_TEST_LIB_TARGET} tests" DEPENDS ${${HDF5_JAVA_TEST_LIB_TARGET}_${voltest}_files_list})
diff --git a/java/test/Makefile.am b/java/test/Makefile.am
index e953c6b50f5..41cd56eecc7 100644
--- a/java/test/Makefile.am
+++ b/java/test/Makefile.am
@@ -1,6 +1,5 @@
#
# Copyright by The HDF Group.
-# Copyright by the Board of Trustees of the University of Illinois.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
@@ -58,6 +57,7 @@ noinst_JAVA = \
TestH5Lbasic.java \
TestH5Lcreate.java \
TestH5R.java \
+ TestH5Rref.java \
TestH5P.java \
TestH5PData.java \
TestH5Pfapl.java \
diff --git a/java/test/TestH5.java b/java/test/TestH5.java
index 1f9ea06bf30..a6b60d38514 100644
--- a/java/test/TestH5.java
+++ b/java/test/TestH5.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -32,6 +31,7 @@
import hdf.hdf5lib.H5;
import hdf.hdf5lib.HDF5Constants;
+import hdf.hdf5lib.exceptions.HDF5Exception;
import hdf.hdf5lib.exceptions.HDF5LibraryException;
import org.junit.After;
@@ -47,22 +47,21 @@
*/
public class TestH5 {
@Rule public TestName testname = new TestName();
- @Before
- public void showTestName() {
- System.out.print(testname.getMethodName());
- }
- @After
- public void nextTestName() {
- System.out.println();
- }
private static final String H5_FILE = "testData.h5";
private static final String EXPORT_FILE = "testExport.txt";
+ private static final String H5_DREG_FILE = "trefer_reg.h5";
+ private static final String EXPORT_DREG_FILE = "testExportReg.txt";
+ private static final String H5_AREG_FILE = "trefer_attr.h5";
+ private static final String EXPORT_AREG_FILE = "testExportAReg.txt";
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
+ private static final int DIM_BLKS = 36;
+ private static final int DIM_PNTS = 10;
+ private static final int DIM_ATTR = 12;
private static final int RANK = 2;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
private final void _deleteFile(String filename) {
@@ -78,7 +77,7 @@ private final void _deleteFile(String filename) {
}
private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32LE, dsid,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl);
@@ -115,22 +114,64 @@ private final void _createH5File() {
}
}
- public final void _closeH5File() throws HDF5LibraryException {
+ private final void _closeH5File() {
if (H5did >= 0)
try {H5.H5Dclose(H5did);} catch (Exception ex) {}
if (H5dsid > 0)
try {H5.H5Sclose(H5dsid);} catch (Exception ex) {}
if (H5fid > 0)
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
- H5fid = -1;
- H5dsid = -1;
- H5did = -1;
+ H5fid = HDF5Constants.H5I_INVALID_HID;
+ H5dsid = HDF5Constants.H5I_INVALID_HID;
+ H5did = HDF5Constants.H5I_INVALID_HID;
+ }
+
+ public void _openH5File(String filename, String dsetname) {
+ try {
+ H5fid = H5.H5Fopen(filename,
+ HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5._openH5file: " + err);
+ }
+ assertTrue("TestH5._openH5file: H5.H5Fopen: ", H5fid >= 0);
+ try {
+ H5did = H5.H5Dopen(H5fid, dsetname, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5._openH5file: " + err);
+ }
+ assertTrue("TestH5._openH5file: H5.H5Dopen: ", H5did >= 0);
+ try {
+ H5dsid = H5.H5Dget_space(H5did);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5._openH5file: " + err);
+ }
+ assertTrue("TestH5._openH5file: H5.H5Screate_simple: ",H5dsid > 0);
}
public final void _deleteH5file() {
+ _closeH5File();
_deleteFile(H5_FILE);
}
+ @After
+ public void closeH5File() throws HDF5LibraryException {
+ _closeH5File();
+ System.out.println();
+ }
+
+ @Before
+ public void verifyCount()
+ throws NullPointerException, HDF5Exception {
+ assertTrue("H5 open ids is 0", H5.getOpenIDCount()==0);
+ System.out.print(testname.getMethodName());
+ }
+
/**
* Test method for {@link hdf.hdf5lib.H5#J2C(int)}.
* NOTE:
@@ -411,4 +452,84 @@ public void testH5export_dataset() {
}
_deleteH5file();
}
+
+ @Test
+ public void testH5export_regdataset() {
+ int[] dset_data_expect = {66, 69, 72, 75, 78, 81, 96, 99, 102, 105, 108,
+ 111, 126, 129, 132, 135, 138, 141, 156, 159, 162, 165, 168, 171,
+ 186, 189, 192, 195, 198, 201, 216, 219, 222, 225, 228, 231,
+ 207, 66, 252, 48, 84, 96, 12, 14, 213, 99};
+ int[] dset_indata = new int[DIM_BLKS+DIM_PNTS];
+ String objName = "/Dataset1";
+
+ _openH5File(H5_DREG_FILE, objName);
+
+ try {
+ H5.H5export_dataset(EXPORT_DREG_FILE, H5_DREG_FILE, objName, 99);
+ }
+ catch (HDF5LibraryException err) {
+ err.printStackTrace();
+ fail("H5export_dataset failed: " + err);
+ }
+
+ File file = new File(EXPORT_DREG_FILE);
+
+ try {
+ Reader reader = new FileReader(EXPORT_DREG_FILE);
+ StreamTokenizer streamTokenizer = new StreamTokenizer(reader);
+ int indx = 0;
+ while(streamTokenizer.nextToken() != StreamTokenizer.TT_EOF){
+ if(streamTokenizer.ttype == StreamTokenizer.TT_NUMBER) {
+ dset_indata[indx] = (int)streamTokenizer.nval;
+ indx++;
+ }
+ }
+ reader.close();
+ }
+ catch (IOException err) {
+ err.printStackTrace();
+ fail("read file failed: " + err);
+ }
+ for(int row = 0; row < DIM_X; row++)
+ assertTrue("H5export_dataset: <"+row+">"+dset_indata[row], dset_indata[row]==dset_data_expect[row]);
+ }
+
+ @Test
+ public void testH5export_attrdataset() {
+ int[] dset_data_expect = {0, 3, 6, 9, 1, 4, 7, 10, 2, 5, 8, 11};
+ int[] dset_indata = new int[DIM_ATTR];
+ String objName = "/Dataset3";
+
+ _openH5File(H5_AREG_FILE, objName);
+
+ try {
+ H5.H5export_dataset(EXPORT_AREG_FILE, H5_AREG_FILE, objName, 99);
+ }
+ catch (HDF5LibraryException err) {
+ err.printStackTrace();
+ fail("H5export_dataset failed: " + err);
+ }
+
+ File file = new File(EXPORT_AREG_FILE);
+
+ try {
+ Reader reader = new FileReader(EXPORT_AREG_FILE);
+ StreamTokenizer streamTokenizer = new StreamTokenizer(reader);
+ int indx = 0;
+ int jndx = 0;
+ while(streamTokenizer.nextToken() != StreamTokenizer.TT_EOF){
+ if(streamTokenizer.ttype == StreamTokenizer.TT_NUMBER) {
+ dset_indata[indx] = (int)streamTokenizer.nval;
+ indx++;
+ }
+ }
+ reader.close();
+ }
+ catch (IOException err) {
+ err.printStackTrace();
+ fail("read file failed: " + err);
+ }
+ for(int row = 0; row < DIM_X; row++)
+ assertTrue("H5export_dataset: <"+row+">"+dset_indata[row], dset_indata[row]==dset_data_expect[row]);
+ }
}
diff --git a/java/test/TestH5A.java b/java/test/TestH5A.java
index cff03f95d44..f2134d2a2fe 100644
--- a/java/test/TestH5A.java
+++ b/java/test/TestH5A.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -43,14 +42,14 @@ public class TestH5A {
private static final String H5_FILE = "testA.h5";
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
- long type_id = -1;
- long space_id = -1;
- long lapl_id = -1;
- long aapl_id = -1;
+ long type_id = HDF5Constants.H5I_INVALID_HID;
+ long space_id = HDF5Constants.H5I_INVALID_HID;
+ long lapl_id = HDF5Constants.H5I_INVALID_HID;
+ long aapl_id = HDF5Constants.H5I_INVALID_HID;
private final void _deleteFile(String filename) {
File file = new File(filename);
@@ -61,7 +60,7 @@ private final void _deleteFile(String filename) {
}
private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32BE, dsid,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl);
@@ -132,7 +131,7 @@ public void deleteH5file() throws HDF5LibraryException {
@Test
public void testH5Acreate2() {
- long attr_id = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
try {
attr_id = H5.H5Acreate(H5did, "dset", type_id, space_id, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
assertTrue("testH5Acreate2", attr_id >= 0);
@@ -160,8 +159,8 @@ public void testH5Acreate2_nullname() throws Throwable {
@Test
public void testH5Aopen() {
String attr_name = "dset";
- long attribute_id = -1;
- long attr_id = -1;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
try {
attr_id = H5.H5Acreate(H5did, attr_name, type_id, space_id,
@@ -197,8 +196,8 @@ public void testH5Aopen_by_idx() {
int idx_type = HDF5Constants.H5_INDEX_CRT_ORDER;
int order = HDF5Constants.H5_ITER_INC;
long n = 0;
- long attr_id = -1;
- long attribute_id = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
try {
attr_id = H5.H5Acreate(H5did, "file", type_id, space_id,
@@ -256,7 +255,7 @@ public void testH5Aopen_by_idx() {
public void testH5Acreate_by_name() {
String obj_name = ".";
String attr_name = "DATASET";
- long attribute_id = -1;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
boolean bool_val = false;
try {
@@ -288,7 +287,7 @@ public void testH5Arename() throws Throwable, HDF5LibraryException, NullPointerE
long loc_id = H5fid;
String old_attr_name = "old";
String new_attr_name = "new";
- long attr_id = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
int ret_val = -1;
boolean bool_val = false;
@@ -326,7 +325,7 @@ public void testH5Arename_by_name() {
String obj_name = ".";
String old_attr_name = "old";
String new_attr_name = "new";
- long attr_id = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
int ret_val = -1;
boolean bool_val = false;
@@ -368,7 +367,7 @@ public void testH5Aget_name() {
String obj_name = ".";
String attr_name = "DATASET1";
String ret_name = null;
- long attribute_id = -1;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
try {
attribute_id = H5.H5Acreate_by_name(H5fid, obj_name, attr_name,
@@ -398,8 +397,8 @@ public void testH5Aget_name_by_idx() {
int idx_type = HDF5Constants.H5_INDEX_NAME;
int order = HDF5Constants.H5_ITER_INC;
int n = 0;
- long attr1_id = -1;
- long attr2_id = -1;
+ long attr1_id = HDF5Constants.H5I_INVALID_HID;
+ long attr2_id = HDF5Constants.H5I_INVALID_HID;
try {
attr1_id = H5.H5Acreate_by_name(loc_id, obj_name, attr_name,
@@ -435,8 +434,8 @@ public void testH5Aget_name_by_idx() {
@Test
public void testH5Aget_storage_size() {
- long attr_id = -1;
- long attr_size = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
+ long attr_size = HDF5Constants.H5I_INVALID_HID;
try {
attr_id = H5.H5Acreate(H5did, "dset", type_id, space_id,
@@ -458,8 +457,8 @@ public void testH5Aget_storage_size() {
@Test
public void testH5Aget_info() {
H5A_info_t attr_info = null;
- long attribute_id = -1;
- long attr_id = -1;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
try {
attr_id = H5.H5Acreate(H5did, "dset", type_id, space_id,
@@ -490,8 +489,8 @@ public void testH5Aget_info() {
@Test
public void testH5Aget_info1() {
H5A_info_t attr_info = null;
- long attribute_id = -1;
- long attr_id = -1;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
int order = HDF5Constants.H5_ITER_INC;
try {
@@ -526,8 +525,8 @@ public void testH5Aget_info1() {
@Test
public void testH5Aget_info_by_idx() {
- long attr_id = -1;
- long attr2_id = -1;;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
+ long attr2_id = HDF5Constants.H5I_INVALID_HID;;
H5A_info_t attr_info = null;
try {
@@ -582,7 +581,7 @@ public void testH5Aget_info_by_idx() {
@Test
public void testH5Aget_info_by_name() {
- long attr_id = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
H5A_info_t attr_info = null;
String obj_name = ".";
String attr_name = "DATASET";
@@ -607,7 +606,7 @@ public void testH5Aget_info_by_name() {
@Test
public void testH5Adelete_by_name() {
- long attr_id = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
int ret_val = -1;
boolean bool_val = false;
boolean exists = false;
@@ -650,8 +649,8 @@ public void testH5Adelete_by_name() {
@Test
public void testH5Aexists() {
boolean exists = false;
- long attr_id = -1;
- long attribute_id = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
try {
exists = H5.H5Aexists(H5fid, "None");
@@ -689,10 +688,10 @@ public void testH5Aexists() {
@Test
public void testH5Adelete_by_idx_order() {
boolean exists = false;
- long attr1_id = -1;
- long attr2_id = -1;
- long attr3_id = -1;
- long attr4_id = -1;
+ long attr1_id = HDF5Constants.H5I_INVALID_HID;
+ long attr2_id = HDF5Constants.H5I_INVALID_HID;
+ long attr3_id = HDF5Constants.H5I_INVALID_HID;
+ long attr4_id = HDF5Constants.H5I_INVALID_HID;
try {
attr1_id = H5.H5Acreate_by_name(H5fid, ".", "attribute1",
@@ -731,9 +730,9 @@ public void testH5Adelete_by_idx_order() {
@Test
public void testH5Adelete_by_idx_name1() {
boolean exists = false;
- long attr1_id = -1;
- long attr2_id = -1;
- long attr3_id = -1;
+ long attr1_id = HDF5Constants.H5I_INVALID_HID;
+ long attr2_id = HDF5Constants.H5I_INVALID_HID;
+ long attr3_id = HDF5Constants.H5I_INVALID_HID;
try {
attr1_id = H5.H5Acreate_by_name(H5fid, ".", "attribute1",
@@ -766,10 +765,10 @@ public void testH5Adelete_by_idx_name1() {
@Test
public void testH5Adelete_by_idx_name2() {
boolean exists = false;
- long attr1_id = -1;
- long attr2_id = -1;
- long attr3_id = -1;
- long attr4_id = -1;
+ long attr1_id = HDF5Constants.H5I_INVALID_HID;
+ long attr2_id = HDF5Constants.H5I_INVALID_HID;
+ long attr3_id = HDF5Constants.H5I_INVALID_HID;
+ long attr4_id = HDF5Constants.H5I_INVALID_HID;
try {
attr1_id = H5.H5Acreate_by_name(H5fid, ".", "attribute1",
@@ -821,8 +820,8 @@ public void testH5Adelete_by_idx_invalidobject() throws Throwable {
public void testH5Aopen_by_name() {
String obj_name = ".";
String attr_name = "DATASET";
- long attribute_id = -1;
- long aid = -1;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
+ long aid = HDF5Constants.H5I_INVALID_HID;
try {
attribute_id = H5.H5Acreate_by_name(H5fid, obj_name, attr_name,
@@ -856,9 +855,9 @@ public void testH5Aopen_by_name() {
@Test
public void testH5Awrite_readVL() {
String attr_name = "VLdata";
- long attr_id = -1;
- long atype_id = -1;
- long aspace_id = -1;
+ long attr_id = HDF5Constants.H5I_INVALID_HID;
+ long atype_id = HDF5Constants.H5I_INVALID_HID;
+ long aspace_id = HDF5Constants.H5I_INVALID_HID;
String[] str_data = { "Parting", "is such", "sweet", "sorrow." };
long[] dims = { str_data.length };
long lsize = 1;
@@ -923,8 +922,8 @@ public void testH5Awrite_readVL() {
public void testH5Aget_create_plist() {
String attr_name = "DATASET1";
int char_encoding = 0;
- long plist_id = -1;
- long attribute_id = -1;
+ long plist_id = HDF5Constants.H5I_INVALID_HID;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
try {
plist_id = H5.H5Pcreate(HDF5Constants.H5P_ATTRIBUTE_CREATE);
@@ -984,10 +983,10 @@ public void testH5Aget_create_plist() {
@Test
public void testH5Aiterate() {
- long attr1_id = -1;
- long attr2_id = -1;
- long attr3_id = -1;
- long attr4_id = -1;
+ long attr1_id = HDF5Constants.H5I_INVALID_HID;
+ long attr2_id = HDF5Constants.H5I_INVALID_HID;
+ long attr3_id = HDF5Constants.H5I_INVALID_HID;
+ long attr4_id = HDF5Constants.H5I_INVALID_HID;
class idata {
public String attr_name = null;
@@ -1052,10 +1051,10 @@ public int callback(long group, String name, H5A_info_t info, H5A_iterate_t op_d
@Test
public void testH5Aiterate_by_name() {
- long attr1_id = -1;
- long attr2_id = -1;
- long attr3_id = -1;
- long attr4_id = -1;
+ long attr1_id = HDF5Constants.H5I_INVALID_HID;
+ long attr2_id = HDF5Constants.H5I_INVALID_HID;
+ long attr3_id = HDF5Constants.H5I_INVALID_HID;
+ long attr4_id = HDF5Constants.H5I_INVALID_HID;
class idata {
public String attr_name = null;
diff --git a/java/test/TestH5D.java b/java/test/TestH5D.java
index 21f0879f02d..863ce791624 100644
--- a/java/test/TestH5D.java
+++ b/java/test/TestH5D.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -39,13 +38,13 @@ public class TestH5D {
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
private static final int RANK = 2;
- long H5fid = -1;
- long H5faplid = -1;
- long H5dsid = -1;
- long H5dtid = -1;
- long H5did = -1;
- long H5did0 = -1;
- long H5dcpl_id = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5faplid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5dtid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+ long H5did0 = HDF5Constants.H5I_INVALID_HID;
+ long H5dcpl_id = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
// Values for the status of space allocation
@@ -195,9 +194,9 @@ private final void _closeH5file() throws HDF5LibraryException {
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
}
- private final void _openH5file(String name, long dapl) {
+ private final void _openH5file(String filename, String dsetname, long dapl) {
try {
- H5fid = H5.H5Fopen(H5_FILE,
+ H5fid = H5.H5Fopen(filename,
HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
@@ -206,7 +205,7 @@ private final void _openH5file(String name, long dapl) {
}
assertTrue("TestH5D._openH5file: H5.H5Fopen: ",H5fid >= 0);
try {
- H5did = H5.H5Dopen(H5fid, name, dapl);
+ H5did = H5.H5Dopen(H5fid, dsetname, dapl);
}
catch (Throwable err) {
err.printStackTrace();
@@ -268,7 +267,7 @@ public void deleteH5file() throws HDF5LibraryException {
@Test
public void testH5Dcreate() {
- long dataset_id = -1;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
try {
dataset_id = H5.H5Dcreate(H5fid, "dset",
HDF5Constants.H5T_STD_I32BE, H5dsid,
@@ -292,7 +291,7 @@ public void testH5Dcreate() {
@Test
public void testH5Dcreate_anon() {
- long dataset_id = -1;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
try {
dataset_id = H5.H5Dcreate_anon(H5fid, HDF5Constants.H5T_STD_I32BE,
H5dsid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
@@ -315,12 +314,12 @@ public void testH5Dcreate_anon() {
@Test
public void testH5Dopen() {
- long dataset_id = -1;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
_createDataset(H5fid, H5dsid, "dset", HDF5Constants.H5P_DEFAULT);
try {
H5.H5Dclose(H5did);
- H5did = -1;
+ H5did = HDF5Constants.H5I_INVALID_HID;
dataset_id = H5.H5Dopen(H5fid, "dset", HDF5Constants.H5P_DEFAULT);
}
catch (Exception err) {
@@ -388,8 +387,8 @@ public void testH5Dget_storage_size() {
@Test
public void testH5Dget_access_plist() {
- long dapl_id = -1;
- long test_dapl_id = -1;
+ long dapl_id = HDF5Constants.H5I_INVALID_HID;
+ long test_dapl_id = HDF5Constants.H5I_INVALID_HID;
int[] mdc_nelmts1 = {0};
int[] mdc_nelmts2 = {0};
long[] rdcc_nelmts1 = {0};
@@ -500,7 +499,7 @@ public void testH5Dget_space_status() {
@Test(expected = HDF5LibraryException.class)
public void testH5Dget_space_closed() throws Throwable {
- long dataset_id = -1;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
try {
dataset_id = H5.H5Dcreate(H5fid, "dset",
HDF5Constants.H5T_STD_I32BE, H5dsid,
@@ -518,7 +517,7 @@ public void testH5Dget_space_closed() throws Throwable {
@Test
public void testH5Dget_space() {
- long dataspace_id = -1;
+ long dataspace_id = HDF5Constants.H5I_INVALID_HID;
_createDataset(H5fid, H5dsid, "dset", HDF5Constants.H5P_DEFAULT);
try {
@@ -542,7 +541,7 @@ public void testH5Dget_space() {
@Test(expected = HDF5LibraryException.class)
public void testH5Dget_type_closed() throws Throwable {
- long dataset_id = -1;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
try {
dataset_id = H5.H5Dcreate(H5fid, "dset",
HDF5Constants.H5T_STD_I32BE, H5dsid,
@@ -560,7 +559,7 @@ public void testH5Dget_type_closed() throws Throwable {
@Test
public void testH5Dget_type() {
- long datatype_id = -1;
+ long datatype_id = HDF5Constants.H5I_INVALID_HID;
_createDataset(H5fid, H5dsid, "dset", HDF5Constants.H5P_DEFAULT);
try {
diff --git a/java/test/TestH5Dparams.java b/java/test/TestH5Dparams.java
index 66f0d838b58..36611394e84 100644
--- a/java/test/TestH5Dparams.java
+++ b/java/test/TestH5Dparams.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/test/TestH5Dplist.java b/java/test/TestH5Dplist.java
index 97ce0849bd3..774b9dd7f78 100644
--- a/java/test/TestH5Dplist.java
+++ b/java/test/TestH5Dplist.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -42,10 +41,10 @@ public class TestH5Dplist {
private static final int NDIMS = 2;
private static final int FILLVAL = 99;
private static final int RANK = 2;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did = -1;
- long H5dcpl_id = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+ long H5dcpl_id = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
long[] H5extdims = { EDIM_X, EDIM_Y };
long[] H5chunk_dims = { CHUNK_X, CHUNK_Y };
diff --git a/java/test/TestH5E.java b/java/test/TestH5E.java
index 68cd933e69b..cad0a06e41e 100644
--- a/java/test/TestH5E.java
+++ b/java/test/TestH5E.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/test/TestH5Edefault.java b/java/test/TestH5Edefault.java
index 2f05c752d14..9e93cea48f6 100644
--- a/java/test/TestH5Edefault.java
+++ b/java/test/TestH5Edefault.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -58,27 +57,27 @@ public void testH5Eprint2_invalid_classid() throws Throwable {
@Ignore
public void testH5Eprint() {
- /*
- * If HDF5_VOL_CONNECTOR is set, this might not be the
- * native connector and the error stack might be different.
- * Only check for the specific error stack if the native
- * connector is being used.
- */
- String connector = System.getenv("HDF5_VOL_CONNECTOR");
- if (connector == null) {
- try {
- H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
- }
- catch (Throwable err) {
- }
- try {
- H5.H5Eprint2(HDF5Constants.H5E_DEFAULT, null);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5Eprint: " + err);
- }
- }
+ /*
+ * If HDF5_VOL_CONNECTOR is set, this might not be the
+ * native connector and the error stack might be different.
+ * Only check for the specific error stack if the native
+ * connector is being used.
+ */
+ String connector = System.getenv("HDF5_VOL_CONNECTOR");
+ if (connector == null) {
+ try {
+ H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ }
+ try {
+ H5.H5Eprint2(HDF5Constants.H5E_DEFAULT, null);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5Eprint: " + err);
+ }
+ }
}
@Test
@@ -439,27 +438,27 @@ public void testH5EprintInt_invalid_classid() throws Throwable {
@Ignore
public void testH5EprintInt() {
- /*
- * If HDF5_VOL_CONNECTOR is set, this might not be the
- * native connector and the error stack might be different.
- * Only check for the specific error stack if the native
- * connector is being used.
- */
- String connector = System.getenv("HDF5_VOL_CONNECTOR");
- if (connector == null) {
- try {
- H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
- }
- catch (Throwable err) {
- }
- try {
- H5.H5Eprint2(HDF5Constants.H5E_DEFAULT, null);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5EprintInt: " + err);
- }
- }
+ /*
+ * If HDF5_VOL_CONNECTOR is set, this might not be the
+ * native connector and the error stack might be different.
+ * Only check for the specific error stack if the native
+ * connector is being used.
+ */
+ String connector = System.getenv("HDF5_VOL_CONNECTOR");
+ if (connector == null) {
+ try {
+ H5.H5Fopen("test", HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ }
+ try {
+ H5.H5Eprint2(HDF5Constants.H5E_DEFAULT, null);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5EprintInt: " + err);
+ }
+ }
}
@Test
diff --git a/java/test/TestH5Eparams.java b/java/test/TestH5Eparams.java
index e74475f066d..e55f1fc702f 100644
--- a/java/test/TestH5Eparams.java
+++ b/java/test/TestH5Eparams.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/test/TestH5Eregister.java b/java/test/TestH5Eregister.java
index 99f8303b208..99e8e5f004b 100644
--- a/java/test/TestH5Eregister.java
+++ b/java/test/TestH5Eregister.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/test/TestH5F.java b/java/test/TestH5F.java
index 3ef463575b1..16786b95fc4 100644
--- a/java/test/TestH5F.java
+++ b/java/test/TestH5F.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -49,7 +48,7 @@ public class TestH5F {
HDF5Constants.H5F_OBJ_DATASET, HDF5Constants.H5F_OBJ_GROUP,
HDF5Constants.H5F_OBJ_DATATYPE, HDF5Constants.H5F_OBJ_ATTR,
HDF5Constants.H5F_OBJ_ALL };
- long H5fid = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
private final void _deleteFile(String filename) {
File file = new File(filename);
@@ -74,7 +73,7 @@ public void createH5file()
public void deleteH5file() throws HDF5LibraryException {
if (H5fid > 0) {
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
- H5fid = -1;
+ H5fid = HDF5Constants.H5I_INVALID_HID;
}
_deleteFile(H5_FILE);
System.out.println();
@@ -82,7 +81,7 @@ public void deleteH5file() throws HDF5LibraryException {
@Test
public void testH5Fget_create_plist() {
- long plist = -1;
+ long plist = HDF5Constants.H5I_INVALID_HID;
try {
plist = H5.H5Fget_create_plist(H5fid);
@@ -106,7 +105,7 @@ public void testH5Fget_create_plist_closed() throws Throwable {
@Test
public void testH5Fget_access_plist() {
- long plist = -1;
+ long plist = HDF5Constants.H5I_INVALID_HID;
try {
plist = H5.H5Fget_access_plist(H5fid);
@@ -134,7 +133,7 @@ public void testH5Fget_intent_rdwr() {
if (H5fid > 0) {
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
- H5fid = -1;
+ H5fid = HDF5Constants.H5I_INVALID_HID;
}
try {
@@ -159,7 +158,7 @@ public void testH5Fget_intent_rdonly() {
if (H5fid > 0) {
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
- H5fid = -1;
+ H5fid = HDF5Constants.H5I_INVALID_HID;
}
try {
@@ -182,8 +181,8 @@ public void testH5Fget_intent_rdonly() {
public void testH5Fget_fileno_same() {
long fileno1 = 0;
long fileno2 = 0;
- long fid1 = -1;
- long fid2 = -1;
+ long fid1 = HDF5Constants.H5I_INVALID_HID;
+ long fid2 = HDF5Constants.H5I_INVALID_HID;
try {
fid1 = H5.H5Fcreate(H5_FILE2, HDF5Constants.H5F_ACC_TRUNC,
@@ -213,7 +212,7 @@ public void testH5Fget_fileno_same() {
public void testH5Fget_fileno_diff() {
long fileno1 = 0;
long fileno2 = 0;
- long fid2 = -1;
+ long fid2 = HDF5Constants.H5I_INVALID_HID;
try {
fid2 = H5.H5Fcreate(H5_FILE2, HDF5Constants.H5F_ACC_TRUNC,
diff --git a/java/test/TestH5Fbasic.java b/java/test/TestH5Fbasic.java
index 225e31151fe..4f3d9286e73 100644
--- a/java/test/TestH5Fbasic.java
+++ b/java/test/TestH5Fbasic.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -35,7 +34,7 @@ public class TestH5Fbasic {
@Rule public TestName testname = new TestName();
private static final String H5_FILE = "testFb.h5";
private static final String TXT_FILE = "testFb.txt";
- long H5fid = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
private final void _deleteFile(String filename) {
File file = new File(filename);
@@ -90,7 +89,7 @@ public void testH5Fcreate_EXCL() throws Throwable {
@Test(expected = HDF5LibraryException.class)
public void testH5Fopen_read_only() throws Throwable {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
try {
fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR,
@@ -125,8 +124,8 @@ public void testH5Fopen_read_only() throws Throwable {
@Test(expected = HDF5LibraryException.class)
public void testH5Freopen_closed() throws Throwable {
- long fid = -1;
- long fid2 = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
+ long fid2 = HDF5Constants.H5I_INVALID_HID;
try {
fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR,
@@ -148,8 +147,8 @@ public void testH5Freopen_closed() throws Throwable {
@Test
public void testH5Freopen() {
- long fid = -1;
- long fid2 = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
+ long fid2 = HDF5Constants.H5I_INVALID_HID;
try {
fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR,
@@ -182,7 +181,7 @@ public void testH5Freopen() {
@Test
public void testH5Fclose() {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
try {
fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR,
@@ -202,7 +201,7 @@ public void testH5Fclose() {
@Test(expected = HDF5LibraryException.class)
public void testH5Fclose_twice() throws Throwable {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
try {
fid = H5.H5Fopen(H5_FILE, HDF5Constants.H5F_ACC_RDWR,
diff --git a/java/test/TestH5Fparams.java b/java/test/TestH5Fparams.java
index 85bfdf5c4a7..0376485d907 100644
--- a/java/test/TestH5Fparams.java
+++ b/java/test/TestH5Fparams.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -105,7 +104,7 @@ public void testH5Fclose_negative() throws Throwable {
@Test
public void testH5Fcreate() {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
File file = null;
try {
@@ -132,7 +131,7 @@ public void testH5Fcreate() {
@Test
public void testH5Fflush_global() {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
try {
fid = H5.H5Fcreate("test.h5", HDF5Constants.H5F_ACC_TRUNC,
@@ -158,7 +157,7 @@ public void testH5Fflush_global() {
@Test
public void testH5Fflush_local() {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
try {
fid = H5.H5Fcreate("test.h5", HDF5Constants.H5F_ACC_TRUNC,
@@ -184,7 +183,7 @@ public void testH5Fflush_local() {
@Test
public void testH5Fget_info() {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
try {
try {
@@ -215,7 +214,7 @@ public void testH5Fget_info() {
@Ignore//(expected = HDF5FunctionArgumentException.class)
public void testH5Fset_libver_bounds_invalidlow() throws Throwable {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
try {
try {
@@ -234,7 +233,7 @@ public void testH5Fset_libver_bounds_invalidlow() throws Throwable {
@Ignore//(expected = HDF5FunctionArgumentException.class)
public void testH5Fset_libver_bounds_invalidhigh() throws Throwable {
- long fid = -1;
+ long fid = HDF5Constants.H5I_INVALID_HID;
try {
try {
diff --git a/java/test/TestH5Fswmr.java b/java/test/TestH5Fswmr.java
index 6a7ccfa351b..1ec78fe9974 100644
--- a/java/test/TestH5Fswmr.java
+++ b/java/test/TestH5Fswmr.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -33,9 +32,9 @@ public class TestH5Fswmr {
@Rule public TestName testname = new TestName();
private static final String H5_FILE = "testswmr.h5";
- long H5fid = -1;
- long H5fapl = -1;
- long H5fcpl = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5fapl = HDF5Constants.H5I_INVALID_HID;
+ long H5fcpl = HDF5Constants.H5I_INVALID_HID;
private final void _deleteFile(String filename) {
File file = new File(filename);
@@ -63,15 +62,15 @@ public void createH5file()
public void deleteH5file() throws HDF5LibraryException {
if (H5fapl > 0) {
try {H5.H5Pclose(H5fapl);} catch (Exception ex) {}
- H5fapl = -1;
+ H5fapl = HDF5Constants.H5I_INVALID_HID;
}
if (H5fcpl > 0) {
try {H5.H5Pclose(H5fcpl);} catch (Exception ex) {}
- H5fcpl = -1;
+ H5fcpl = HDF5Constants.H5I_INVALID_HID;
}
if (H5fid > 0) {
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
- H5fid = -1;
+ H5fid = HDF5Constants.H5I_INVALID_HID;
}
_deleteFile(H5_FILE);
System.out.println();
diff --git a/java/test/TestH5G.java b/java/test/TestH5G.java
index abd964215f9..edf2cbe848a 100644
--- a/java/test/TestH5G.java
+++ b/java/test/TestH5G.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -39,11 +38,11 @@ public class TestH5G {
private static final String[] GROUPS = { "/G1", "/G1/G11", "/G1/G12",
"/G1/G11/G111", "/G1/G11/G112", "/G1/G11/G113", "/G1/G11/G114" };
private static final String[] GROUPS2 = { "/G1", "/G1/G14", "/G1/G12", "/G1/G13", "/G1/G11"};
- long H5fid = -1;
- long H5fid2 = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5fid2 = HDF5Constants.H5I_INVALID_HID;
private final long _createGroup(long fid, String name) {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
@@ -58,8 +57,8 @@ private final long _createGroup(long fid, String name) {
}
private final long _createGroup2(long fid, String name) {
- long gid = -1;
- long gcpl = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
+ long gcpl = HDF5Constants.H5I_INVALID_HID;
try {
gcpl = H5.H5Pcreate(HDF5Constants.H5P_GROUP_CREATE); //create gcpl
}
@@ -92,12 +91,12 @@ private final long _createGroup2(long fid, String name) {
}
private final long _openGroup(long fid, String name) {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
gid = H5.H5Gopen(fid, name, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
- gid = -1;
+ gid = HDF5Constants.H5I_INVALID_HID;
err.printStackTrace();
fail("H5.H5Gopen: " + err);
}
@@ -134,7 +133,7 @@ public void createH5file()
assertTrue("TestH5G.createH5file: H5.H5Fcreate: ", H5fid > 0);
assertTrue("TestH5G.createH5file: H5.H5Fcreate: ", H5fid2 > 0);
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
for (int i = 0; i < GROUPS.length; i++) {
gid = _createGroup(H5fid, GROUPS[i]);
@@ -165,7 +164,7 @@ public void deleteH5file() throws HDF5LibraryException {
@Test
public void testH5Gopen() {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
for (int i = 0; i < GROUPS.length; i++) {
try {
gid = H5.H5Gopen(H5fid, GROUPS[i], HDF5Constants.H5P_DEFAULT);
@@ -185,8 +184,8 @@ public void testH5Gopen() {
@Test
public void testH5Gget_create_plist() {
- long gid = -1;
- long pid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
+ long pid = HDF5Constants.H5I_INVALID_HID;
for (int i = 0; i < GROUPS.length; i++) {
try {
@@ -325,7 +324,7 @@ public void testH5Gget_obj_info_all_gid() {
int names_found = 0;
try {
names_found = H5.H5Gget_obj_info_all(gid, null, objNames, objTypes, lnkTypes,
- objTokens, HDF5Constants.H5_INDEX_NAME);
+ objTokens, HDF5Constants.H5_INDEX_NAME);
}
catch (Throwable err) {
err.printStackTrace();
@@ -366,7 +365,7 @@ public void testH5Gget_obj_info_all_gid2() {
int names_found = 0;
try {
names_found = H5.H5Gget_obj_info_all(gid, null, objNames, objTypes, lnkTypes,
- objTokens, HDF5Constants.H5_INDEX_NAME);
+ objTokens, HDF5Constants.H5_INDEX_NAME);
}
catch (Throwable err) {
err.printStackTrace();
@@ -401,7 +400,7 @@ public void testH5Gget_obj_info_max() {
int names_found = 0;
try {
names_found = H5.H5Gget_obj_info_max(gid, objNames, objTypes, lnkTypes,
- objTokens, groups_max_size);
+ objTokens, groups_max_size);
}
catch (Throwable err) {
err.printStackTrace();
@@ -432,7 +431,7 @@ public void testH5Gget_obj_info_max_limit() {
int names_found = 0;
try {
names_found = H5.H5Gget_obj_info_max(gid, objNames, objTypes, lnkTypes,
- objTokens, groups_max_size);
+ objTokens, groups_max_size);
}
catch (Throwable err) {
err.printStackTrace();
diff --git a/java/test/TestH5Gbasic.java b/java/test/TestH5Gbasic.java
index aea417ef6ae..6e2e4505e6e 100644
--- a/java/test/TestH5Gbasic.java
+++ b/java/test/TestH5Gbasic.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -33,10 +32,10 @@
public class TestH5Gbasic {
@Rule public TestName testname = new TestName();
private static final String H5_FILE = "testGb.h5";
- long H5fid = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
private final long _createGroup(long fid, String name) {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
@@ -85,7 +84,7 @@ public void testH5Gclose_invalid() throws Throwable {
@Test(expected = NullPointerException.class)
public void testH5Gcreate_null() throws Throwable {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
// it should fail because the group name is null
gid = H5.H5Gcreate(H5fid, null, HDF5Constants.H5P_DEFAULT,
@@ -102,7 +101,7 @@ public void testH5Gcreate_invalid() throws Throwable {
@Test
public void testH5Gcreate() {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
gid = H5.H5Gcreate(H5fid, "/testH5Gcreate",
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT,
@@ -145,7 +144,7 @@ public void testH5Gcreate_exists() throws Throwable {
@Test
public void testH5Gcreate_anon() {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
gid = H5.H5Gcreate_anon(H5fid, HDF5Constants.H5P_DEFAULT,
HDF5Constants.H5P_DEFAULT);
@@ -161,7 +160,7 @@ public void testH5Gcreate_anon() {
@Test(expected = NullPointerException.class)
public void testH5Gopen_null() throws Throwable {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
gid = H5.H5Gopen(H5fid, null, HDF5Constants.H5P_DEFAULT);
@@ -175,7 +174,7 @@ public void testH5Gopen_invalid() throws Throwable {
@Test(expected = HDF5LibraryException.class)
public void testH5Gopen_not_exists() throws Throwable {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
gid = H5.H5Gopen(H5fid, "Never_created", HDF5Constants.H5P_DEFAULT);
@@ -209,7 +208,7 @@ public void testH5Gget_create_plist_invalid() throws Throwable {
@Test
public void testH5Gget_create_plist() {
- long pid = -1;
+ long pid = HDF5Constants.H5I_INVALID_HID;
long gid = _createGroup(H5fid, "/testH5Gcreate");
assertTrue(gid > 0);
diff --git a/java/test/TestH5Giterate.java b/java/test/TestH5Giterate.java
index af210ca4dcd..388d2acace9 100644
--- a/java/test/TestH5Giterate.java
+++ b/java/test/TestH5Giterate.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -31,15 +30,15 @@
public class TestH5Giterate {
@Rule public TestName testname = new TestName();
private static final String H5_FILE = "h5ex_g_iterate.hdf";
- long H5fid = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
private final long _openGroup(long fid, String name) {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
gid = H5.H5Gopen(fid, name, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
- gid = -1;
+ gid = HDF5Constants.H5I_INVALID_HID;
err.printStackTrace();
fail("H5.H5Gcreate: " + err);
}
diff --git a/java/test/TestH5Lbasic.java b/java/test/TestH5Lbasic.java
index bc4d65cb749..a28fc3d16b0 100644
--- a/java/test/TestH5Lbasic.java
+++ b/java/test/TestH5Lbasic.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -35,7 +34,7 @@
public class TestH5Lbasic {
@Rule public TestName testname = new TestName();
private static final String H5_FILE = "h5ex_g_iterateL1.hdf";
- long H5fid = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
@Before
public void openH5file()
diff --git a/java/test/TestH5Lcreate.java b/java/test/TestH5Lcreate.java
index de29c1e4080..44af2e57cfc 100644
--- a/java/test/TestH5Lcreate.java
+++ b/java/test/TestH5Lcreate.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -41,13 +40,13 @@ public class TestH5Lcreate {
private static final String H5_FILE = "testL.h5";
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
- long H5fcpl = -1;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did1 = -1;
- long H5did2 = -1;
- long H5gcpl = -1;
- long H5gid = -1;
+ long H5fcpl = HDF5Constants.H5I_INVALID_HID;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did1 = HDF5Constants.H5I_INVALID_HID;
+ long H5did2 = HDF5Constants.H5I_INVALID_HID;
+ long H5gcpl = HDF5Constants.H5I_INVALID_HID;
+ long H5gid = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
private final void _deleteFile(String filename) {
@@ -64,7 +63,7 @@ private final void _deleteFile(String filename) {
}
private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name,
HDF5Constants.H5T_STD_I32BE, dsid,
@@ -80,7 +79,7 @@ private final long _createDataset(long fid, long dsid, String name, long dapl) {
}
private final long _createGroup(long fid, String name) {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
H5gcpl = HDF5Constants.H5P_DEFAULT;
gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT,
diff --git a/java/test/TestH5Lparams.java b/java/test/TestH5Lparams.java
index 2ce1eca2b71..30ee242fc70 100644
--- a/java/test/TestH5Lparams.java
+++ b/java/test/TestH5Lparams.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/test/TestH5Obasic.java b/java/test/TestH5Obasic.java
index 89474c4471b..350b7aaf7e4 100644
--- a/java/test/TestH5Obasic.java
+++ b/java/test/TestH5Obasic.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -41,7 +40,7 @@ public class TestH5Obasic {
private static final String H5_FILE = "h5ex_g_iterateO1.hdf";
private static H5O_token_t H5la_ds1 = null;
private static H5O_token_t H5la_l1 = null;
- long H5fid = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
@Before
public void openH5file()
@@ -69,7 +68,7 @@ public void closeH5file() throws HDF5LibraryException {
@Test(expected = HDF5LibraryException.class)
public void testH5Oopen_not_exists() throws Throwable {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
oid = H5.H5Oopen(H5fid, "Never_created", HDF5Constants.H5P_DEFAULT);
@@ -78,7 +77,7 @@ public void testH5Oopen_not_exists() throws Throwable {
@Test
public void testH5Oget_info_dataset() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
@@ -96,7 +95,7 @@ public void testH5Oget_info_dataset() {
@Test
public void testH5Oget_info_hardlink() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
oid = H5.H5Oopen(H5fid, "L1", HDF5Constants.H5P_DEFAULT);
@@ -113,7 +112,7 @@ public void testH5Oget_info_hardlink() {
@Test
public void testH5Oget_info_group() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
oid = H5.H5Oopen(H5fid, "G1", HDF5Constants.H5P_DEFAULT);
@@ -130,7 +129,7 @@ public void testH5Oget_info_group() {
@Test
public void testH5Oget_info_datatype() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
oid = H5.H5Oopen(H5fid, "DT1", HDF5Constants.H5P_DEFAULT);
@@ -234,7 +233,7 @@ public void testH5Oget_info_by_idx_not_exist_create() throws Throwable {
@Test
public void testH5Oget_info_by_idx_n0() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
oid = H5.H5Oopen(H5fid, "DS1", HDF5Constants.H5P_DEFAULT);
@@ -260,7 +259,7 @@ public void testH5Oget_info_by_idx_n0() {
@Test
public void testH5Oget_info_by_idx_n3() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
oid = H5.H5Oopen(H5fid, "L1", HDF5Constants.H5P_DEFAULT);
@@ -286,7 +285,7 @@ public void testH5Oget_info_by_idx_n3() {
@Test
public void testH5Oget_native_info_dataset() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_native_info_t native_info = null;
try {
@@ -306,7 +305,7 @@ public void testH5Oget_native_info_dataset() {
@Test
public void testH5Oget_native_info_hardlink() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_native_info_t native_info = null;
try {
@@ -326,7 +325,7 @@ public void testH5Oget_native_info_hardlink() {
@Test
public void testH5Oget_native_info_group() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_native_info_t native_info = null;
try {
@@ -346,7 +345,7 @@ public void testH5Oget_native_info_group() {
@Test
public void testH5Oget_native_info_datatype() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_native_info_t native_info = null;
try {
@@ -376,10 +375,10 @@ public void testH5Oget_native_info_by_name_not_exists() throws Throwable {
@Test
public void testH5Oget_native_info_by_name_dataset() {
- H5O_native_info_t native_info = null;
+ H5O_native_info_t native_info = null;
try {
- native_info = H5.H5Oget_native_info_by_name(H5fid, "DS1", HDF5Constants.H5P_DEFAULT);
+ native_info = H5.H5Oget_native_info_by_name(H5fid, "DS1", HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -393,10 +392,10 @@ public void testH5Oget_native_info_by_name_dataset() {
@Test
public void testH5Oget_native_info_by_name_hardlink() {
- H5O_native_info_t native_info = null;
+ H5O_native_info_t native_info = null;
try {
- native_info = H5.H5Oget_native_info_by_name(H5fid, "L1", HDF5Constants.H5P_DEFAULT);
+ native_info = H5.H5Oget_native_info_by_name(H5fid, "L1", HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -410,10 +409,10 @@ public void testH5Oget_native_info_by_name_hardlink() {
@Test
public void testH5Oget_native_info_by_name_group() {
- H5O_native_info_t native_info = null;
+ H5O_native_info_t native_info = null;
try {
- native_info = H5.H5Oget_native_info_by_name(H5fid, "G1", HDF5Constants.H5P_DEFAULT);
+ native_info = H5.H5Oget_native_info_by_name(H5fid, "G1", HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -427,10 +426,10 @@ public void testH5Oget_native_info_by_name_group() {
@Test
public void testH5Oget_native_info_by_name_datatype() {
- H5O_native_info_t native_info = null;
+ H5O_native_info_t native_info = null;
try {
- native_info = H5.H5Oget_native_info_by_name(H5fid, "DT1", HDF5Constants.H5P_DEFAULT);
+ native_info = H5.H5Oget_native_info_by_name(H5fid, "DT1", HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -464,7 +463,7 @@ public void testH5Oget_native_info_by_idx_not_exist_create() throws Throwable {
@Test
public void testH5Oget_native_info_by_idx_n0() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_native_info_t native_info = null;
H5O_hdr_info_t ohdr;
H5_ih_info_t oinfo;
@@ -486,7 +485,7 @@ public void testH5Oget_native_info_by_idx_n0() {
try {H5.H5Oclose(oid);} catch (Exception ex) {}
try {
- native_info = H5.H5Oget_native_info_by_idx(H5fid, "/", HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_INC, 0, HDF5Constants.H5P_DEFAULT);
+ native_info = H5.H5Oget_native_info_by_idx(H5fid, "/", HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_INC, 0, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -503,7 +502,7 @@ public void testH5Oget_native_info_by_idx_n0() {
@Test
public void testH5Oget_native_info_by_idx_n3() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_native_info_t native_info = null;
H5O_hdr_info_t ohdr;
H5_ih_info_t oinfo;
@@ -525,7 +524,7 @@ public void testH5Oget_native_info_by_idx_n3() {
try {H5.H5Oclose(oid);} catch (Exception ex) {}
try {
- native_info = H5.H5Oget_native_info_by_idx(H5fid, "/", HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_INC, 3, HDF5Constants.H5P_DEFAULT);
+ native_info = H5.H5Oget_native_info_by_idx(H5fid, "/", HDF5Constants.H5_INDEX_NAME, HDF5Constants.H5_ITER_INC, 3, HDF5Constants.H5P_DEFAULT);
}
catch (Throwable err) {
err.printStackTrace();
@@ -630,7 +629,7 @@ public void testH5Oexists_by_name() {
@Test
public void testH5Oopen_by_token() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
try {
@@ -668,7 +667,7 @@ public void testH5Oopen_by_token() {
@Test
public void testH5Oopen_by_idx_n0() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
try {
@@ -706,7 +705,7 @@ public void testH5Oopen_by_idx_n0() {
@Test
public void testH5Oopen_by_idx_n3() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
try {
diff --git a/java/test/TestH5Ocopy.java b/java/test/TestH5Ocopy.java
index 4888e76ad01..b3b1acd9cdc 100644
--- a/java/test/TestH5Ocopy.java
+++ b/java/test/TestH5Ocopy.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -36,13 +35,13 @@ public class TestH5Ocopy {
private static final String FILENAME = "testRefsattribute.h5";
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did1 = -1;
- long H5did2 = -1;
- long H5gcpl = -1;
- long H5gid = -1;
- long H5dsid2 = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did1 = HDF5Constants.H5I_INVALID_HID;
+ long H5did2 = HDF5Constants.H5I_INVALID_HID;
+ long H5gcpl = HDF5Constants.H5I_INVALID_HID;
+ long H5gid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid2 = HDF5Constants.H5I_INVALID_HID;
long[] dims = { 2 };
private final void _deleteFile(String filename) {
@@ -59,7 +58,7 @@ private final void _deleteFile(String filename) {
}
private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name,
HDF5Constants.H5T_STD_I32BE, dsid,
@@ -75,7 +74,7 @@ private final long _createDataset(long fid, long dsid, String name, long dapl) {
}
private final long _createGroup(long fid, String name) {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
H5gcpl = HDF5Constants.H5P_DEFAULT;
gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT,
@@ -136,10 +135,10 @@ public void deleteH5file() throws HDF5LibraryException {
@Test
public void testH5OcopyRefsAttr() {
- long ocp_plist_id = -1;
+ long ocp_plist_id = HDF5Constants.H5I_INVALID_HID;
byte rbuf0[]=null , rbuf1[] = null;
byte[] dset_data = new byte[16];
- long attribute_id = -1;
+ long attribute_id = HDF5Constants.H5I_INVALID_HID;
try {
@@ -184,9 +183,9 @@ public void testH5OcopyRefsAttr() {
public void testH5OcopyRefsDatasettodiffFile() {
byte rbuf1[] = null;
byte[] dset_data = new byte[16];
- long ocp_plist_id = -1;
- long dataset_id = -1;
- long H5fid2 = -1;
+ long ocp_plist_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long H5fid2 = HDF5Constants.H5I_INVALID_HID;
try {
rbuf1 = H5.H5Rcreate(H5fid, "DS2", HDF5Constants.H5R_OBJECT, -1);
@@ -244,9 +243,9 @@ public void testH5OcopyRefsDatasettodiffFile() {
public void testH5OcopyRefsDatasettosameFile() {
byte rbuf0[]=null , rbuf1[] = null;
byte[] dset_data = new byte[16];
- long ocp_plist_id = -1;
- long dataset_id = -1;
- long did = -1;
+ long ocp_plist_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long did = HDF5Constants.H5I_INVALID_HID;
int obj_type = -1;
byte[] read_data = new byte[16];
@@ -328,9 +327,9 @@ public void testH5OcopyRefsDatasettosameFile() {
// @Test(expected = HDF5LibraryException.class)
// public void testH5OcopyInvalidRef() throws Throwable {
// final long _pid_ = HDF5Constants.H5P_DEFAULT;
-// long sid = -1;
-// long did = -1;
-// long aid = -1;
+// long sid = HDF5Constants.H5I_INVALID_HID;
+// long did = HDF5Constants.H5I_INVALID_HID;
+// long aid = HDF5Constants.H5I_INVALID_HID;
//
// try {
// sid = H5.H5Screate_simple(1, new long[] {1}, null);
diff --git a/java/test/TestH5Ocreate.java b/java/test/TestH5Ocreate.java
index 959e99021f4..78ea7441694 100644
--- a/java/test/TestH5Ocreate.java
+++ b/java/test/TestH5Ocreate.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -41,13 +40,13 @@ public class TestH5Ocreate {
private static final String H5_FILE = "testO.h5";
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
- long H5fcpl = -1;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did1 = -1;
- long H5did2 = -1;
- long H5gcpl = -1;
- long H5gid = -1;
+ long H5fcpl = HDF5Constants.H5I_INVALID_HID;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did1 = HDF5Constants.H5I_INVALID_HID;
+ long H5did2 = HDF5Constants.H5I_INVALID_HID;
+ long H5gcpl = HDF5Constants.H5I_INVALID_HID;
+ long H5gid = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
private final void _deleteFile(String filename) {
@@ -64,7 +63,7 @@ private final void _deleteFile(String filename) {
}
private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name,
HDF5Constants.H5T_STD_I32BE, dsid,
@@ -80,7 +79,7 @@ private final long _createDataset(long fid, long dsid, String name, long dapl) {
}
private final long _createGroup(long fid, String name) {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
H5gcpl = HDF5Constants.H5P_DEFAULT;
gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT,
@@ -293,7 +292,7 @@ public void testH5Oget_info_externallink() {
@Test
public void testH5Olink() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
H5O_info_t dst_obj_info = null;
try {
@@ -380,7 +379,7 @@ public int callback(long group, String name, H5O_info_t info, H5O_iterate_opdata
@Test
public void testH5Ocomment() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
String obj_comment = null;
try {
oid = H5.H5Oopen(H5fid, "DS1", HDF5Constants.H5P_DEFAULT);
@@ -405,7 +404,7 @@ public void testH5Ocomment() {
@Test
public void testH5Ocomment_clear() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
String obj_comment = null;
try {
oid = H5.H5Oopen(H5fid, "DS1", HDF5Constants.H5P_DEFAULT);
@@ -506,7 +505,7 @@ public void testH5Ocomment_by_name_clear() {
@Test
public void testH5Oinc_dec_count() {
- long oid = -1;
+ long oid = HDF5Constants.H5I_INVALID_HID;
H5O_info_t obj_info = null;
try {
try {
diff --git a/java/test/TestH5Oparams.java b/java/test/TestH5Oparams.java
index 1ad31cb78cd..5cbabe11b0a 100644
--- a/java/test/TestH5Oparams.java
+++ b/java/test/TestH5Oparams.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/test/TestH5P.java b/java/test/TestH5P.java
index 786c330f81e..38791282000 100644
--- a/java/test/TestH5P.java
+++ b/java/test/TestH5P.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -41,20 +40,20 @@ public class TestH5P {
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
long[] H5dims = { DIM_X, DIM_Y };
- long H5fid = -1;
- long H5dsid = -1;
- long H5did = -1;
- long lapl_id = -1;
- long fapl_id = -1;
- long fcpl_id = -1;
- long ocpl_id = -1;
- long ocp_plist_id = -1;
- long lcpl_id = -1;
- long plapl_id = -1;
- long plist_id = -1;
- long gapl_id = -1;
- long gcpl_id = -1;
- long acpl_id = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+ long lapl_id = HDF5Constants.H5I_INVALID_HID;
+ long fapl_id = HDF5Constants.H5I_INVALID_HID;
+ long fcpl_id = HDF5Constants.H5I_INVALID_HID;
+ long ocpl_id = HDF5Constants.H5I_INVALID_HID;
+ long ocp_plist_id = HDF5Constants.H5I_INVALID_HID;
+ long lcpl_id = HDF5Constants.H5I_INVALID_HID;
+ long plapl_id = HDF5Constants.H5I_INVALID_HID;
+ long plist_id = HDF5Constants.H5I_INVALID_HID;
+ long gapl_id = HDF5Constants.H5I_INVALID_HID;
+ long gcpl_id = HDF5Constants.H5I_INVALID_HID;
+ long acpl_id = HDF5Constants.H5I_INVALID_HID;
private final void _deleteFile(String filename) {
File file = new File(filename);
@@ -65,7 +64,7 @@ private final void _deleteFile(String filename) {
}
private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32BE, dsid,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl);
diff --git a/java/test/TestH5PData.java b/java/test/TestH5PData.java
index 82864cd04ee..8b04629e75b 100644
--- a/java/test/TestH5PData.java
+++ b/java/test/TestH5PData.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -37,10 +36,10 @@ public class TestH5PData {
private static final String H5_FILE = "testPD.h5";
private static final int DIM_X = 12;
private static final int DIM_Y = 18;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did = -1;
- long plist_id = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+ long plist_id = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
double windchillF[][] =
{{36.0, 31.0, 25.0, 19.0, 13.0, 7.0, 1.0, -5.0, -11.0, -16.0, -22.0, -28.0, -34.0, -40.0, -46.0, -52.0, -57.0, -63.0},
@@ -66,7 +65,7 @@ private final void _deleteFile(String filename) {
}
private final long _createFloatDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_NATIVE_FLOAT, dsid,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl);
diff --git a/java/test/TestH5PL.java b/java/test/TestH5PL.java
index 98665dc8617..d44cc0b878a 100644
--- a/java/test/TestH5PL.java
+++ b/java/test/TestH5PL.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -147,11 +146,11 @@ public void TestH5PLpaths() {
@Ignore
public void TestH5PLdlopen() {
- long file_id = -1;
- long filespace_id = -1;
- long dataset_id = -1;
- long fapl_id = -1;
- long dcpl_id = -1;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
+ long filespace_id = HDF5Constants.H5I_INVALID_HID;
+ long dataset_id = HDF5Constants.H5I_INVALID_HID;
+ long fapl_id = HDF5Constants.H5I_INVALID_HID;
+ long dcpl_id = HDF5Constants.H5I_INVALID_HID;
try {
int[] cd_values = {9, 0, 0, 0};
int[] libversion = {0, 0, 0};
diff --git a/java/test/TestH5Pfapl.java b/java/test/TestH5Pfapl.java
index d5d090122c6..cc674e2cdd1 100644
--- a/java/test/TestH5Pfapl.java
+++ b/java/test/TestH5Pfapl.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -47,17 +46,17 @@ public class TestH5Pfapl {
private static final int DIM_Y = 6;
private static final int DIMF_X = 12;
private static final int DIMF_Y = 18;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did = -1;
- long H5Fdsid = -1;
- long H5Fdid = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+ long H5Fdsid = HDF5Constants.H5I_INVALID_HID;
+ long H5Fdid = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
- long fapl_id = -1;
- long plapl_id = -1;
- long dapl_id = -1;
- long plist_id = -1;
- long btplist_id = -1;
+ long fapl_id = HDF5Constants.H5I_INVALID_HID;
+ long plapl_id = HDF5Constants.H5I_INVALID_HID;
+ long dapl_id = HDF5Constants.H5I_INVALID_HID;
+ long plist_id = HDF5Constants.H5I_INVALID_HID;
+ long btplist_id = HDF5Constants.H5I_INVALID_HID;
long[] H5Fdims = { DIMF_X, DIMF_Y };
double windchillF[][] =
{{36.0, 31.0, 25.0, 19.0, 13.0, 7.0, 1.0, -5.0, -11.0, -16.0, -22.0, -28.0, -34.0, -40.0, -46.0, -52.0, -57.0, -63.0},
@@ -130,7 +129,7 @@ private final void _deleteMultiFile() {
}
private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name, HDF5Constants.H5T_STD_I32BE, dsid,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT, dapl);
@@ -385,7 +384,7 @@ public void testH5Pset_elink_fapl() {
@Test
public void testH5Pget_elink_fapl() {
- long ret_val_id = -1;
+ long ret_val_id = HDF5Constants.H5I_INVALID_HID;
try {
ret_val_id = H5.H5Pget_elink_fapl(plapl_id);
assertTrue("H5Pget_elink_fapl", ret_val_id >= 0);
@@ -403,7 +402,7 @@ public void testH5Pget_elink_fapl() {
@Test
public void testH5P_elink_fapl() {
- long ret_val_id = -1;
+ long ret_val_id = HDF5Constants.H5I_INVALID_HID;
try {
H5.H5Pset_elink_fapl(plapl_id, fapl_id );
ret_val_id = H5.H5Pget_elink_fapl(plapl_id);
@@ -421,7 +420,7 @@ public void testH5P_elink_fapl() {
@Test
public void testH5P_elink_file_cache_size() {
- long elink_fapl_id = -1;
+ long elink_fapl_id = HDF5Constants.H5I_INVALID_HID;
int efc_size = 0;
try {
H5.H5Pset_elink_fapl(plapl_id, fapl_id );
diff --git a/java/test/TestH5Pfaplhdfs.java b/java/test/TestH5Pfaplhdfs.java
index 398a4d4c5eb..d9226662d69 100644
--- a/java/test/TestH5Pfaplhdfs.java
+++ b/java/test/TestH5Pfaplhdfs.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -34,11 +33,11 @@
public class TestH5Pfaplhdfs {
@Rule public TestName testname = new TestName();
- long fapl_id = -1;
- long plapl_id = -1;
- long dapl_id = -1;
- long plist_id = -1;
- long btplist_id = -1;
+ long fapl_id = HDF5Constants.H5I_INVALID_HID;
+ long plapl_id = HDF5Constants.H5I_INVALID_HID;
+ long dapl_id = HDF5Constants.H5I_INVALID_HID;
+ long plist_id = HDF5Constants.H5I_INVALID_HID;
+ long btplist_id = HDF5Constants.H5I_INVALID_HID;
@Before
public void createFileAccess() throws NullPointerException, HDF5Exception
diff --git a/java/test/TestH5Pfapls3.java b/java/test/TestH5Pfapls3.java
index a55856ce325..dda27169880 100644
--- a/java/test/TestH5Pfapls3.java
+++ b/java/test/TestH5Pfapls3.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -34,11 +33,11 @@
public class TestH5Pfapls3 {
@Rule public TestName testname = new TestName();
- long fapl_id = -1;
- long plapl_id = -1;
- long dapl_id = -1;
- long plist_id = -1;
- long btplist_id = -1;
+ long fapl_id = HDF5Constants.H5I_INVALID_HID;
+ long plapl_id = HDF5Constants.H5I_INVALID_HID;
+ long dapl_id = HDF5Constants.H5I_INVALID_HID;
+ long plist_id = HDF5Constants.H5I_INVALID_HID;
+ long btplist_id = HDF5Constants.H5I_INVALID_HID;
@Before
public void createFileAccess() throws NullPointerException, HDF5Exception
diff --git a/java/test/TestH5Plist.java b/java/test/TestH5Plist.java
index 7c436930550..0d5307164b7 100644
--- a/java/test/TestH5Plist.java
+++ b/java/test/TestH5Plist.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -85,7 +84,7 @@ public class TestH5Plist {
PROP3_NAME,
PROP4_NAME};
- long plist_class_id = -1;
+ long plist_class_id = HDF5Constants.H5I_INVALID_HID;
@Before
public void createPropClass()throws NullPointerException, HDF5Exception
@@ -114,9 +113,9 @@ public void deleteFileAccess() throws HDF5LibraryException {
@Test
public void testH5P_genprop_basic_class() {
int status = -1;
- long cid1 = -1; // Generic Property class ID
- long cid2 = -1; // Generic Property class ID
- long cid3 = -1; // Generic Property class ID
+ long cid1 = HDF5Constants.H5I_INVALID_HID; // Generic Property class ID
+ long cid2 = HDF5Constants.H5I_INVALID_HID; // Generic Property class ID
+ long cid3 = HDF5Constants.H5I_INVALID_HID; // Generic Property class ID
String name = null; // Name of class
try {
@@ -162,7 +161,7 @@ public void testH5P_genprop_basic_class() {
// Close parent class
try {
H5.H5Pclose_class(cid2);
- cid2 = -1;
+ cid2 = HDF5Constants.H5I_INVALID_HID;
}
catch (Throwable err) {
err.printStackTrace();
@@ -172,7 +171,7 @@ public void testH5P_genprop_basic_class() {
// Close class
try {
H5.H5Pclose_class(plist_class_id);
- plist_class_id = -1;
+ plist_class_id = HDF5Constants.H5I_INVALID_HID;
}
catch (Throwable err) {
err.printStackTrace();
@@ -242,7 +241,7 @@ public void testH5P_genprop_basic_class() {
// Close parent class's parent
try {
H5.H5Pclose_class(cid3);
- cid3 = -1;
+ cid3 = HDF5Constants.H5I_INVALID_HID;
}
catch (Throwable err) {
err.printStackTrace();
@@ -252,7 +251,7 @@ public void testH5P_genprop_basic_class() {
// Close parent class's parent
try {
H5.H5Pclose_class(cid2);
- cid2 = -1;
+ cid2 = HDF5Constants.H5I_INVALID_HID;
}
catch (Throwable err) {
err.printStackTrace();
@@ -262,7 +261,7 @@ public void testH5P_genprop_basic_class() {
// Close parent class's parent
try {
H5.H5Pclose_class(cid1);
- cid1 = -1;
+ cid1 = HDF5Constants.H5I_INVALID_HID;
}
catch (Throwable err) {
err.printStackTrace();
@@ -634,7 +633,7 @@ public int callback(long list_id, String name, H5P_iterate_t op_data) {
@Test
public void testH5P_genprop_basic_list_prop() {
boolean status = false;
- long lid1 = -1; // Generic Property list ID
+ long lid1 = HDF5Constants.H5I_INVALID_HID; // Generic Property list ID
long nprops = -1; // Number of properties in class
try {
@@ -760,7 +759,7 @@ public void testH5P_genprop_basic_list_prop() {
// @Test
// public void testH5P_genprop_class_callback() {
// class cdata {
-// public long cls_id = -1;
+// public long cls_id = HDF5Constants.H5I_INVALID_HID;
// public int cls_count = -1;
// cdata(long id, int count) {
// this.cls_id = id;
@@ -813,11 +812,11 @@ public void testH5P_genprop_basic_list_prop() {
// }
// H5P_cls_close_func_cb cls_close_cb = new H5P_cls_close_callback();
//
-// long cid1 = -1; // Generic Property class ID
-// long cid2 = -1; // Generic Property class ID
-// long lid1 = -1; // Generic Property list ID
-// long lid2 = -1; // Generic Property list ID
-// long lid3 = -1; // Generic Property list ID
+// long cid1 = HDF5Constants.H5I_INVALID_HID; // Generic Property class ID
+// long cid2 = HDF5Constants.H5I_INVALID_HID; // Generic Property class ID
+// long lid1 = HDF5Constants.H5I_INVALID_HID; // Generic Property list ID
+// long lid2 = HDF5Constants.H5I_INVALID_HID; // Generic Property list ID
+// long lid3 = HDF5Constants.H5I_INVALID_HID; // Generic Property list ID
// long nprops = -1; // Number of properties in class
//
// try {
diff --git a/java/test/TestH5Pvirtual.java b/java/test/TestH5Pvirtual.java
index 4c9a763232e..0478356cda6 100644
--- a/java/test/TestH5Pvirtual.java
+++ b/java/test/TestH5Pvirtual.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -52,13 +51,13 @@ public class TestH5Pvirtual {
private static final int fill_value = -1;
long[] H5dims = { DIM_Y };
long[] VDSH5dims = { VDSDIM_X, VDSDIM_Y };
- long H5fid = -1;
- long H5dsid = -1;
- long H5dssid = -1;
- long H5dvsid = -1;
- long H5did = -1;
- long H5dcplid = -1;
- long H5dapl_id = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5dssid = HDF5Constants.H5I_INVALID_HID;
+ long H5dvsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+ long H5dcplid = HDF5Constants.H5I_INVALID_HID;
+ long H5dapl_id = HDF5Constants.H5I_INVALID_HID;
private final void _deleteFile(String filename) {
File file = new File(filename);
@@ -69,8 +68,8 @@ private final void _deleteFile(String filename) {
}
private final long _createDataset(long fid, long dsid, String name, long dcpl, long dapl) {
- long did = -1;
- long space_id = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
+ long space_id = HDF5Constants.H5I_INVALID_HID;
long[] start = {0, 0};
long[] stride = null;
long[] count = {1, 1};
@@ -100,9 +99,9 @@ private final void _createH5File(long fcpl, long fapl) {
int[] dset_data = new int[DIM_Y];
// Create source files and datasets
for (int i=0; i < 3; i++) {
- long space_id = -1;
- long dset_id = -1;
- long file_id = -1;
+ long space_id = HDF5Constants.H5I_INVALID_HID;
+ long dset_id = HDF5Constants.H5I_INVALID_HID;
+ long file_id = HDF5Constants.H5I_INVALID_HID;
for (int j = 0; j < DIM_Y; j++) dset_data[j] = i+1;
try {
@@ -265,7 +264,7 @@ public void testH5Pget_source_datasetname() throws Throwable {
@Test
public void testH5Pget_selection_source_dataset() throws Throwable {
- long src_space = -1;
+ long src_space = HDF5Constants.H5I_INVALID_HID;
long src_selection = -1;
H5did = _createDataset(H5fid, H5dsid, "VDS", H5dcplid, H5dapl_id);
diff --git a/java/test/TestH5R.java b/java/test/TestH5R.java
index a51c7b62abb..031b8e49ace 100644
--- a/java/test/TestH5R.java
+++ b/java/test/TestH5R.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -39,11 +38,11 @@ public class TestH5R {
private static final String H5_FILE = "testH5R.h5";
private static final int DIM_X = 4;
private static final int DIM_Y = 6;
- long H5fid = -1;
- long H5dsid = -1;
- long H5did = -1;
- long H5gid = -1;
- long H5did2 = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+ long H5gid = HDF5Constants.H5I_INVALID_HID;
+ long H5did2 = HDF5Constants.H5I_INVALID_HID;
long[] H5dims = { DIM_X, DIM_Y };
int[][] dset_data = new int[DIM_X][DIM_Y];
int FILLVAL = 99;
@@ -62,7 +61,7 @@ private final void _deleteFile(String filename) {
}
private final long _createDataset(long fid, long dsid, String name, long dapl) {
- long did = -1;
+ long did = HDF5Constants.H5I_INVALID_HID;
try {
did = H5.H5Dcreate(fid, name,
HDF5Constants.H5T_STD_I32BE, dsid,
@@ -78,7 +77,7 @@ private final long _createDataset(long fid, long dsid, String name, long dapl) {
}
private final long _createGroup(long fid, String name) {
- long gid = -1;
+ long gid = HDF5Constants.H5I_INVALID_HID;
try {
gid = H5.H5Gcreate(fid, name, HDF5Constants.H5P_DEFAULT,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
@@ -150,109 +149,6 @@ public void deleteH5file() throws HDF5LibraryException {
System.out.println();
}
- // Test v1.8 APIs params
- /*
- * @Ignore public void testH5Rget_name() { long loc_id = H5fid; int ref_type =
- * HDF5Constants.H5R_OBJECT; long ret_val = -1; byte[] ref = null; String[] name = {""}; String
- * objName = "/dset";
- *
- * try { ref = H5.H5Rcreate(H5fid, objName, ref_type, -1); } catch (Throwable err) {
- * err.printStackTrace(); fail("H5.H5Rget_name:H5Rcreate " + err); }
- *
- * try { ret_val = H5.H5Rget_name(loc_id, ref_type, ref, name, 16); } catch (Throwable err) {
- * err.printStackTrace(); fail("H5.H5Rget_name: " + err); }
- *
- * assertTrue("testH5Rget_name: H5Rget_name", ret_val>0); assertTrue("The name of the object: ",
- * objName.equals(name[0])); }
- *
- * @Ignore public void testH5Rget_obj_type2() { int ref_type=HDF5Constants.H5R_OBJECT; byte[]
- * ref=null;
- *
- * String objName = "/dset"; int obj_type = -1;
- *
- * try { ref = H5.H5Rcreate(H5fid, objName, ref_type, -1); } catch(Throwable err) {
- * err.printStackTrace(); }
- *
- * try { obj_type = H5.H5Rget_obj_type(H5fid, HDF5Constants.H5R_OBJECT, ref); } catch (Throwable
- * err) { err.printStackTrace(); fail("H5.H5Rget_obj_type2: " + err); } assertEquals(obj_type,
- * HDF5Constants.H5O_TYPE_DATASET); }
- *
- * @Ignore public void testH5Rcreate_refobj() { byte[] ref = null;
- *
- * try { ref = H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_OBJECT, -1); } catch (Throwable err) {
- * err.printStackTrace(); fail("H5.H5Rcreate: " + err); } assertNotNull(ref); }
- *
- * @Ignore public void testH5Rcreate_regionrefobj() { byte[] ref = null; try { ref =
- * H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_DATASET_REGION, H5dsid); } catch (Throwable err) {
- * err.printStackTrace(); fail("H5.H5Rcreate: " + err); } assertNotNull(ref); }
- *
- * @Ignore public void testH5Rdereference() { byte[] ref1 = null; byte[] ref2 = null; long
- * dataset_id = -1; long group_id = -1; try { //Create reference on dataset ref1 =
- * H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_DATASET_REGION, H5dsid); dataset_id=
- * H5.H5Rdereference(H5fid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5R_DATASET_REGION, ref1);
- *
- * //Create reference on group ref2 = H5.H5Rcreate(H5gid, "/Group1", HDF5Constants.H5R_OBJECT, -1);
- * group_id= H5.H5Rdereference(H5gid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5R_OBJECT, ref2);
- * assertNotNull(ref1); assertNotNull(ref2); assertTrue(dataset_id >= 0); assertTrue(group_id >= 0);
- * } catch (Throwable err) { err.printStackTrace(); fail("TestH5Rdereference " + err); } finally {
- * try {H5.H5Dclose(dataset_id);} catch (Exception ex) {} try {H5.H5Gclose(group_id);} catch
- * (Exception ex) {} } }
- *
- * @Ignore public void testH5Rget_region() { byte[] ref = null; long dsid = -1; try { ref =
- * H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_DATASET_REGION, H5dsid); dsid =
- * H5.H5Rget_region(H5fid, HDF5Constants.H5R_DATASET_REGION, ref); assertNotNull(ref);
- * assertTrue(dsid >= 0); } catch (Throwable err) { err.printStackTrace();
- * fail("TestH5Rget_region: " + err); } finally { try {H5.H5Sclose(dsid);} catch (Exception ex) {} }
- * }
- *
- * @Ignore//(expected = IllegalArgumentException.class) public void testH5Rget_name_Invalidreftype()
- * throws Throwable { byte[] ref = null; String[] name = {""}; ref = H5.H5Rcreate(H5fid, "/dset",
- * HDF5Constants.H5R_OBJECT, -1); H5.H5Rget_name(H5fid, HDF5Constants.H5R_DATASET_REGION, ref, name,
- * 16); }
- *
- * @Ignore//(expected = NullPointerException.class) public void testH5Rget_name_NULLreference()
- * throws Throwable { byte[] ref = null; String[] name = {""}; H5.H5Rget_name(H5fid,
- * HDF5Constants.H5R_OBJECT, ref, name, 16); }
- *
- * @Ignore//(expected = HDF5LibraryException.class) public void
- * testH5Rget_obj_type2_Invalidreftype() throws Throwable { byte[] ref = null; ref =
- * H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_OBJECT, -1); H5.H5Rget_obj_type(H5fid,
- * HDF5Constants.H5R_DATASET_REGION, ref); }
- *
- * @Ignore//(expected = HDF5LibraryException.class) public void testH5Rcreate_InvalidObjectName()
- * throws Throwable { byte[] ref=H5.H5Rcreate(H5fid, "/GROUPS", HDF5Constants.H5R_OBJECT, -1); }
- *
- * @Ignore//(expected = HDF5LibraryException.class) public void testH5Rcreate_Invalidspace_id()
- * throws Throwable { byte[] ref=H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_DATASET_REGION, -1);
- * }
- *
- * @Ignore//(expected = IllegalArgumentException.class) public void testH5Rcreate_Invalidreftype()
- * throws Throwable { byte[] ref=H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_BADTYPE, -1); }
- *
- * @Ignore//(expected = IllegalArgumentException.class) public void
- * testH5Rgetregion_Invalidreftype() throws Throwable { byte[] ref = null; ref = H5.H5Rcreate(H5fid,
- * "/dset", HDF5Constants.H5R_OBJECT, H5dsid); H5.H5Rget_region(H5fid,
- * HDF5Constants.H5R_DATASET_REGION, ref); }
- *
- * @Ignore//(expected = IllegalArgumentException.class) public void
- * testH5Rgetregion_Badreferencetype() throws Throwable { byte[] ref = null; ref =
- * H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_OBJECT, H5dsid); H5.H5Rget_region(H5fid,
- * HDF5Constants.H5R_OBJECT, ref); }
- *
- * @Ignore//(expected = NullPointerException.class) public void testH5Rgetregion_Nullreference()
- * throws Throwable { byte[] ref = null; H5.H5Rget_region(H5fid, HDF5Constants.H5R_DATASET_REGION,
- * ref); }
- *
- * @Ignore//(expected = NullPointerException.class) public void testH5Rdereference_Nullreference()
- * throws Throwable { byte[] ref = null; H5.H5Rdereference(H5did2, HDF5Constants.H5P_DEFAULT,
- * HDF5Constants.H5R_OBJECT, ref); }
- *
- * @Ignore//(expected = IllegalArgumentException.class) public void
- * testH5Rdereference_Invalidreference() throws Throwable { byte[] ref1 = null; byte[] ref2 = null;
- * ref1 = H5.H5Rcreate(H5fid, "/dset", HDF5Constants.H5R_DATASET_REGION, H5dsid); ref2 =
- * H5.H5Rcreate(H5gid, "/Group1", HDF5Constants.H5R_OBJECT, -1); H5.H5Rdereference(H5gid,
- * HDF5Constants.H5P_DEFAULT, HDF5Constants.H5R_OBJECT, ref1); }
- */
// Test v1.12 APIs params
@Test
diff --git a/java/test/TestH5Rref.java b/java/test/TestH5Rref.java
new file mode 100644
index 00000000000..e306d7a5e5c
--- /dev/null
+++ b/java/test/TestH5Rref.java
@@ -0,0 +1,562 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * 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://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+package test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+
+import hdf.hdf5lib.H5;
+import hdf.hdf5lib.HDF5Constants;
+import hdf.hdf5lib.exceptions.HDF5Exception;
+import hdf.hdf5lib.exceptions.HDF5LibraryException;
+import hdf.hdf5lib.exceptions.HDF5FunctionArgumentException;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TestName;
+
+public class TestH5Rref {
+ @Rule public TestName testname = new TestName();
+ private static final String H5_DREG_FILE = "trefer_reg.h5";
+ private static final String H5_AREG_FILE = "trefer_attr.h5";
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5dsid = HDF5Constants.H5I_INVALID_HID;
+ long H5did = HDF5Constants.H5I_INVALID_HID;
+
+ private boolean byteArrayCheck(final byte[] array) {
+ for (byte b : array) {
+ if (b != 0) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public void openH5file(String filename, String dsetname) {
+ try {
+ H5fid = H5.H5Fopen(filename,
+ HDF5Constants.H5F_ACC_RDWR, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5R._openH5file: " + err);
+ }
+ assertTrue("TestH5R._openH5file: H5.H5Fopen: ", H5fid >= 0);
+ try {
+ H5did = H5.H5Dopen(H5fid, dsetname, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5R._openH5file: " + err);
+ }
+ assertTrue("TestH5R._openH5file: H5.H5Dopen: ", H5did >= 0);
+ try {
+ H5dsid = H5.H5Dget_space(H5did);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5R._openH5file: " + err);
+ }
+ assertTrue("TestH5R._openH5file: H5.H5Screate_simple: ",H5dsid > 0);
+ }
+
+ @After
+ public void closeH5file() throws HDF5LibraryException {
+ if (H5did >= 0)
+ try {H5.H5Dclose(H5did);} catch (Exception ex) {}
+ if (H5dsid > 0)
+ try {H5.H5Sclose(H5dsid);} catch (Exception ex) {}
+ if (H5fid > 0)
+ try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
+ H5fid = HDF5Constants.H5I_INVALID_HID;
+ H5dsid = HDF5Constants.H5I_INVALID_HID;
+ H5did = HDF5Constants.H5I_INVALID_HID;
+ System.out.println();
+ }
+
+ @Before
+ public void verifyCount()
+ throws NullPointerException, HDF5Exception {
+ assertTrue("H5 open ids is 0", H5.getOpenIDCount()==0);
+ System.out.print(testname.getMethodName());
+ }
+
+ // Test v1.12 APIs params
+
+ @Test
+ public void testH5Rget_object() {
+ int ref_type = HDF5Constants.H5R_OBJECT1;
+ long f_type = HDF5Constants.H5I_INVALID_HID;
+ int obj_type = -1;
+ int ndims = 1;
+ long ret_val = -1;
+ byte[][] refbuf = null;
+ String name = "";
+ String objName = "/DS_NA";
+
+ try {
+ openH5file(H5_DREG_FILE, objName);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_object: openH5file: " + err);
+ }
+ try {
+ f_type = H5.H5Dget_type(H5did);
+ int result = H5.H5Tget_class(f_type);
+ assertTrue("testH5Rget_object: H5Tget_class", result > 0);
+ String class_name = H5.H5Tget_class_name(result);
+ assertTrue("testH5Rget_object: H5Tget_class", class_name.compareTo("H5T_REFERENCE")==0);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_object: " + err);
+ }
+ finally {
+ try {H5.H5Tclose(f_type);} catch (Exception ex) {}
+ }
+ try {
+ ndims = H5.H5Sget_simple_extent_ndims(H5dsid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_object: H5Sget_simple_extent_ndims: " + err);
+ }
+ refbuf = new byte[ndims][HDF5Constants.H5R_REF_BUF_SIZE];
+ // Read the reference from the dataset.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_STD_REF,
+ HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, refbuf);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Rget_object: H5Dread: " + err);
+ }
+
+ for (int i = 0; i < ndims; i++) {
+ try {
+ ret_val = H5.H5Rget_type(refbuf[i]);
+ assertTrue("testH5Rget_object: H5Rget_type["+i+"]="+ret_val, ret_val == ref_type);
+ if (!byteArrayCheck(refbuf[i])) {
+ try {
+ obj_type = H5.H5Rget_obj_type3(refbuf[i], HDF5Constants.H5P_DEFAULT);
+ assertEquals(obj_type, HDF5Constants.H5O_TYPE_DATASET);
+ }
+ catch (Throwable err2) {
+ err2.printStackTrace();
+ fail("testH5Rget_object: H5.H5Rget_obj_type3: " + err2);
+ }
+ }
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_object: H5Rget_type: " + err);
+ }
+ finally {
+ H5.H5Rdestroy(refbuf[i]);
+ }
+ }
+ }
+
+ @Test
+ public void testH5Rget_obj_type3() {
+ long f_type = HDF5Constants.H5I_INVALID_HID;
+ int ref_type = HDF5Constants.H5R_DATASET_REGION2;
+ int obj_type = -1;
+ int ndims = 1;
+ long ret_val = -1;
+ byte[][] refbuf = null;
+ String objName = "/Dataset1";
+
+ try {
+ openH5file(H5_DREG_FILE, objName);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_obj_type3: openH5file: " + err);
+ }
+ try {
+ f_type = H5.H5Dget_type(H5did);
+ int result = H5.H5Tget_class(f_type);
+ assertTrue("testH5Rget_obj_type3: H5Tget_class", result > 0);
+ String class_name = H5.H5Tget_class_name(result);
+ assertTrue("testH5Rget_obj_type3: H5Tget_class="+class_name, class_name.compareTo("H5T_REFERENCE")==0);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_obj_type3: " + err);
+ }
+ finally {
+ try {H5.H5Tclose(f_type);} catch (Exception ex) {}
+ }
+ try {
+ ndims = H5.H5Sget_simple_extent_ndims(H5dsid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_obj_type3: H5Sget_simple_extent_ndims: " + err);
+ }
+ refbuf = new byte[ndims][HDF5Constants.H5R_REF_BUF_SIZE];
+ // Read the reference from the dataset.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_STD_REF,
+ HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, refbuf);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Rget_obj_type3: H5Dread: " + err);
+ }
+
+ for (int i = 0; i < ndims; i++) {
+ try {
+ ret_val = H5.H5Rget_type(refbuf[i]);
+ assertTrue("testH5Rget_obj_type3: H5Rget_type["+i+"]="+ret_val, ret_val == ref_type);
+ if (!byteArrayCheck(refbuf[i])) {
+ try {
+ obj_type = H5.H5Rget_obj_type3(refbuf[i], HDF5Constants.H5P_DEFAULT);
+ assertEquals(obj_type, HDF5Constants.H5O_TYPE_DATASET);
+ }
+ catch (Throwable err2) {
+ err2.printStackTrace();
+ fail("testH5Rget_obj_type3: H5.H5Rget_obj_type3: " + err2);
+ }
+ }
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_obj_type3: H5Rget_type: " + err);
+ }
+ finally {
+ H5.H5Rdestroy(refbuf[i]);
+ }
+ }
+ }
+
+ @Test
+ public void testH5Rget_region_dataset() {
+ long f_type = HDF5Constants.H5I_INVALID_HID;
+ long loc_id = HDF5Constants.H5I_INVALID_HID;
+ long loc_sid = HDF5Constants.H5I_INVALID_HID;
+ int ref_type = HDF5Constants.H5R_DATASET_REGION2;
+ int ndims = 1;
+ long ret_val = -1;
+ byte[][] refbuf = null;
+ String name = "";
+ String objName = "/Dataset1";
+
+ try {
+ openH5file(H5_DREG_FILE, objName);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_dataset: openH5file: " + err);
+ }
+ try {
+ f_type = H5.H5Dget_type(H5did);
+ int result = H5.H5Tget_class(f_type);
+ assertTrue("testH5Rget_region_dataset: H5Tget_class", result > 0);
+ String class_name = H5.H5Tget_class_name(result);
+ assertTrue("testH5Rget_region_dataset: H5Tget_class="+class_name, class_name.compareTo("H5T_REFERENCE")==0);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_dataset: " + err);
+ }
+ finally {
+ try {H5.H5Tclose(f_type);} catch (Exception ex) {}
+ }
+ try {
+ ndims = H5.H5Sget_simple_extent_ndims(H5dsid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_dataset: H5Sget_simple_extent_ndims: " + err);
+ }
+ refbuf = new byte[ndims][HDF5Constants.H5R_REF_BUF_SIZE];
+ // Read the reference from the dataset.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_STD_REF,
+ HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, refbuf);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Rget_obj_type3: H5Dread: " + err);
+ }
+ for (int i = 0; i < ndims; i++) {
+ try {
+ ret_val = H5.H5Rget_type(refbuf[i]);
+ assertTrue("testH5Rget_region_dataset: H5Rget_type["+i+"]="+ret_val, ret_val == ref_type);
+ try {
+ loc_id = H5.H5Ropen_object(refbuf[i], HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
+ assertTrue(loc_id >= 0);
+ boolean regionzero = byteArrayCheck(refbuf[i]);
+ if (i > 1)
+ assertTrue(regionzero);
+ else {
+ try {
+ loc_sid = H5.H5Ropen_region(refbuf[i], HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
+ assertTrue(loc_sid >= 0);
+ int region_type = -1;
+ try {
+ int reg_ndims = H5.H5Sget_simple_extent_ndims(loc_sid);
+ region_type = H5.H5Sget_select_type(loc_sid);
+ if (i == 1)
+ assertTrue(region_type == HDF5Constants.H5S_SEL_POINTS);
+ else
+ assertTrue(region_type == HDF5Constants.H5S_SEL_HYPERSLABS);
+ if (region_type == HDF5Constants.H5S_SEL_POINTS) {
+ long reg_npoints = H5.H5Sget_select_elem_npoints(loc_sid);
+ // Coordinates for get point selection
+ long getcoord[] = new long[reg_ndims * (int)reg_npoints];
+ // Known coordinates for point selection
+ long coord[][] = {{6,9},{2,2},{8,4},{1,6},{2,8},{3,2},
+ {0,4},{9,0},{7,1},{3,3}};
+ try {
+ H5.H5Sget_select_elem_pointlist(loc_sid, 0, reg_npoints, getcoord);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[0][0] == getcoord[0]);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[0][1] == getcoord[1]);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[1][0] == getcoord[2]);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[1][1] == getcoord[3]);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[2][0] == getcoord[4]);
+ assertTrue("H5.H5Sget_select_elem_pointlist", coord[2][1] == getcoord[5]);
+ }
+ catch (Throwable err3) {
+ err3.printStackTrace();
+ fail("H5.H5Sget_select_elem_pointlist: " + err3);
+ }
+ }
+ else if (region_type == HDF5Constants.H5S_SEL_HYPERSLABS) {
+ long reg_nblocks = H5.H5Sget_select_hyper_nblocks(loc_sid);
+ assertTrue("H5Sget_select_hyper_nblocks", reg_nblocks == 1);
+ // Coordinates for get block selection
+ long getblocks[] = new long[reg_ndims * (int)reg_nblocks * 2];
+ long start[] = {2,2};
+ long block[] = {8,8};
+ try {
+ H5.H5Sget_select_hyper_blocklist(loc_sid, 0, reg_nblocks, getblocks);
+ assertTrue("H5.H5Sget_select_hyper_blocklist", start[0] == getblocks[0]);
+ assertTrue("H5.H5Sget_select_hyper_blocklist", start[1] == getblocks[1]);
+ assertTrue("H5.H5Sget_select_hyper_blocklist", (block[0]-1) == getblocks[2]);
+ assertTrue("H5.H5Sget_select_hyper_blocklist", (block[1]-1) == getblocks[3]);
+ }
+ catch (Throwable err3) {
+ err3.printStackTrace();
+ fail("H5.H5Sget_select_hyper_blocklist: " + err3);
+ }
+ }
+ }
+ catch (Throwable err2) {
+ err2.printStackTrace();
+ fail("testH5Rget_region_dataset: H5Sget_select_type: " + err2);
+ }
+ }
+ catch (Throwable err1) {
+ err1.printStackTrace();
+ fail("testH5Rget_region_dataset: " + err1);
+ }
+ finally {
+ try {H5.H5Sclose(loc_sid);} catch (Exception ex) {}
+ }
+ }
+ }
+ catch (Throwable err0) {
+ err0.printStackTrace();
+ fail("testH5Rget_region_dataset: " + err0);
+ }
+ finally {
+ try {H5.H5Dclose(loc_id);} catch (Exception ex) {}
+ }
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_dataset: H5Rget_type: " + err);
+ }
+ finally {
+ H5.H5Rdestroy(refbuf[i]);
+ }
+ } //for (int i = 0; i < ndims; i++)
+ }
+
+ @Test
+ public void testH5Rget_region_attribute() {
+ long f_type = HDF5Constants.H5I_INVALID_HID;
+ long loc_id = HDF5Constants.H5I_INVALID_HID;
+ long loc_sid = HDF5Constants.H5I_INVALID_HID;
+ int ref_type = HDF5Constants.H5R_ATTR;
+ int obj_type = -1;
+ int ndims = 1;
+ long ret_val = -1;
+ byte[][] refbuf = null;
+ String objName = "/Dataset3";
+
+ try {
+ openH5file(H5_AREG_FILE, objName);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_attribute: openH5file: " + err);
+ }
+ try {
+ f_type = H5.H5Dget_type(H5did);
+ int result = H5.H5Tget_class(f_type);
+ assertTrue("testH5Rget_region_attribute: H5Tget_class", result > 0);
+ String class_name = H5.H5Tget_class_name(result);
+ assertTrue("testH5Rget_region_attribute: H5Tget_class="+class_name, class_name.compareTo("H5T_REFERENCE")==0);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_attribute: " + err);
+ }
+ finally {
+ try {H5.H5Tclose(f_type);} catch (Exception ex) {}
+ }
+ try {
+ ndims = H5.H5Sget_simple_extent_ndims(H5dsid);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_attribute: H5Sget_simple_extent_ndims: " + err);
+ }
+ refbuf = new byte[ndims][HDF5Constants.H5R_REF_BUF_SIZE];
+ // Read the reference from the dataset.
+ try {
+ H5.H5Dread(H5did, HDF5Constants.H5T_STD_REF,
+ HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL,
+ HDF5Constants.H5P_DEFAULT, refbuf);
+ }
+ catch (Exception err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_attribute: H5Dread: " + err);
+ }
+
+ for (int i = 0; i < ndims; i++) {
+ try {
+ ret_val = H5.H5Rget_type(refbuf[i]);
+ assertTrue("testH5Rget_region_attribute: H5Rget_type["+i+"]="+ret_val, ret_val == ref_type);
+ try {
+ loc_id = H5.H5Ropen_attr(refbuf[i], HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
+ assertTrue(loc_id >= 0);
+ if (!byteArrayCheck(refbuf[i])) {
+ try {
+ loc_sid = H5.H5Aget_space(loc_id);
+ assertTrue(loc_sid >= 0);
+ }
+ catch (Throwable err1) {
+ err1.printStackTrace();
+ fail("testH5Rget_region_attribute: " + err1);
+ }
+ finally {
+ try {H5.H5Sclose(loc_sid);} catch (Exception ex) {}
+ }
+ }
+ }
+ catch (Throwable err0) {
+ err0.printStackTrace();
+ fail("testH5Rget_region_attribute: " + err0);
+ }
+ finally {
+ try {H5.H5Aclose(loc_id);} catch (Exception ex) {}
+ }
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("testH5Rget_region_attribute: H5Rget_type: " + err);
+ }
+ finally {
+ H5.H5Rdestroy(refbuf[i]);
+ }
+ }
+ }
+
+
+// These tests need to be updated with new APIs
+// @Test//
+// public void testH5Rget_group() {
+// long loc_id = H5fid;
+// int ref_type = HDF5Constants.H5R_OBJECT2;
+// long ret_val = -1;
+// byte[] ref = null;
+// String name = "";
+// String objName = "/dset";
+//
+// try {
+// ref = H5.H5Rcreate_object(H5fid, objName, HDF5Constants.H5P_DEFAULT);
+// }
+// catch (Throwable err) {
+// err.printStackTrace();
+// fail("testH5Rget_object: H5Rcreate_object " + err);
+// }
+// try {
+// dataset_id= H5.H5Rdereference(H5fid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5R_DATASET_REGION, ref1);
+//
+// //Create reference on group
+// ref2 = H5.H5Rcreate(H5gid, "/Group1", HDF5Constants.H5R_OBJECT, -1);
+// group_id= H5.H5Rdereference(H5gid, HDF5Constants.H5P_DEFAULT, HDF5Constants.H5R_OBJECT, ref2);
+// assertNotNull(ref1);
+// assertNotNull(ref2);
+// assertTrue(dataset_id >= 0);
+// assertTrue(group_id >= 0);
+// }
+// catch (Throwable err) {
+// err.printStackTrace();
+// fail("TestH5Rdereference " + err);
+// }
+// finally {
+// try {H5.H5Dclose(dataset_id);} catch (Exception ex) {}
+// try {H5.H5Gclose(group_id);} catch (Exception ex) {}
+// }
+// }
+
+// @Test//
+// public void testH5Rget_attr() {
+// long loc_id = H5fid;
+// int ref_type = HDF5Constants.H5R_OBJECT2;
+// long ret_val = -1;
+// byte[] ref = null;
+// String name = "";
+// String objName = "/dset";
+//
+// try {
+// ref = H5.H5Rcreate_object(H5fid, objName, HDF5Constants.H5P_DEFAULT);
+// }
+// catch (Throwable err) {
+// err.printStackTrace();
+// fail("testH5Rget_object: H5Rcreate_object " + err);
+// }
+// try {
+// dsid = H5.H5Rget_region(H5fid, HDF5Constants.H5R_DATASET_REGION, ref);
+// assertNotNull(ref);
+// assertTrue(dsid >= 0);
+// }
+// catch (Throwable err) {
+// err.printStackTrace();
+// fail("TestH5Rget_region: " + err);
+// }
+// finally {
+// try {H5.H5Sclose(dsid);} catch (Exception ex) {}
+// }
+// }
+
+}
diff --git a/java/test/TestH5S.java b/java/test/TestH5S.java
index 03943a4e860..7eeed7a67b6 100644
--- a/java/test/TestH5S.java
+++ b/java/test/TestH5S.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -30,7 +29,7 @@
public class TestH5S {
@Rule public TestName testname = new TestName();
- long H5sid = -1;
+ long H5sid = HDF5Constants.H5I_INVALID_HID;
int H5rank = 2;
long H5dims[] = {5, 5};
long H5maxdims[] = {10, 10};
@@ -181,7 +180,7 @@ public void testH5Sset_extent_none() {
@Test
public void testH5Scopy() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int read_rank = -1;
try {
@@ -201,7 +200,7 @@ public void testH5Scopy() {
@Test
public void testH5Sextent_copy() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int class_type = -1;
try {
@@ -222,7 +221,7 @@ public void testH5Sextent_copy() {
@Test
public void testH5Sextent_equal() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
boolean result = false;
try {
@@ -252,8 +251,8 @@ public void testH5Sextent_equal() {
@Test
public void testH5Sencode_decode_null_dataspace() {
- long sid = -1;
- long decoded_sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
+ long decoded_sid = HDF5Constants.H5I_INVALID_HID;
byte[] null_sbuf = null;
boolean result = false;
@@ -299,8 +298,8 @@ public void testH5Sencode_decode_null_dataspace() {
@Test
public void testH5Sencode_decode_scalar_dataspace() {
- long sid = -1;
- long decoded_sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
+ long decoded_sid = HDF5Constants.H5I_INVALID_HID;
byte[] scalar_sbuf = null;
boolean result = false;
int iresult = -1;
@@ -470,7 +469,7 @@ public void testH5Soffset_simple() {
@Test
public void testH5Sget_select_hyper() {
- long space1 = -1;
+ long space1 = HDF5Constants.H5I_INVALID_HID;
long start[] = {0,0};
long stride[] = {1,1};
long count[] = {1,1};
@@ -508,7 +507,7 @@ public void testH5Sget_select_hyper() {
@Test
public void testH5Sget_select_valid() {
- long space1 = -1;
+ long space1 = HDF5Constants.H5I_INVALID_HID;
long start[] = {1,0};
long stride[] = {1,1};
long count[] = {2,3};
diff --git a/java/test/TestH5Sbasic.java b/java/test/TestH5Sbasic.java
index e6698c6ecc9..548ac956621 100644
--- a/java/test/TestH5Sbasic.java
+++ b/java/test/TestH5Sbasic.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -56,7 +55,7 @@ public void testH5Sget_simple_extent_type_invalid() throws Throwable {
@Test
public void testH5Screate_scalar() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int class_type = -1;
try {
sid = H5.H5Screate(HDF5Constants.H5S_SCALAR);
@@ -75,7 +74,7 @@ public void testH5Screate_scalar() {
@Test
public void testH5Screate_null() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int class_type = -1;
try {
sid = H5.H5Screate(HDF5Constants.H5S_NULL);
@@ -125,7 +124,7 @@ public void testH5Screate_simple_dims_exceed() throws Throwable {
@Test
public void testH5Screate_simple() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int class_type = -1;
int rank = 2;
long dims[] = {5, 5};
@@ -148,7 +147,7 @@ public void testH5Screate_simple() {
@Test
public void testH5Screate_simple_unlimted() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int class_type = -1;
int rank = 2;
long dims[] = {5, 5};
@@ -171,7 +170,7 @@ public void testH5Screate_simple_unlimted() {
@Test
public void testH5Screate_simple_unlimted_1d() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int class_type = -1;
int rank = 1;
long dims[] = {5};
@@ -194,7 +193,7 @@ public void testH5Screate_simple_unlimted_1d() {
@Test
public void testH5Screate_simple_max_default() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int rank = 2;
long dims[] = {5, 5};
@@ -213,7 +212,7 @@ public void testH5Screate_simple_max_default() {
@Test
public void testH5Screate_simple_extent() {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
int rank = 2;
long dims[] = {5, 5};
long maxdims[] = {10, 10};
@@ -270,7 +269,7 @@ public void testH5Sselect_adjust_invalid() throws Throwable {
@Test(expected = IllegalArgumentException.class)
public void testH5Sselect_adjust_rank_offset() throws Throwable {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
long offset[][] = {{0,1},{2,4},{5,6}};
try {
@@ -292,7 +291,7 @@ public void testH5Sselect_intersect_block_invalid() throws Throwable {
@Test(expected = IllegalArgumentException.class)
public void testH5Sselect_intersect_block_rank_start() throws Throwable {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
long start[] = new long[2];
long end[] = null;
@@ -308,7 +307,7 @@ public void testH5Sselect_intersect_block_rank_start() throws Throwable {
@Test(expected = IllegalArgumentException.class)
public void testH5Sselect_intersect_block_rank_end() throws Throwable {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
long start[] = null;
long end[] = new long[2];
@@ -336,7 +335,7 @@ public void testH5Scombine_hyperslab_invalid() throws Throwable {
@Test(expected = NullPointerException.class)
public void testH5Scombine_hyperslab_null_start() throws Throwable {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
long start[] = null;
long stride[] = null;
long count[] = new long[2];
@@ -354,7 +353,7 @@ public void testH5Scombine_hyperslab_null_start() throws Throwable {
@Test(expected = NullPointerException.class)
public void testH5Scombine_hyperslab_null_count() throws Throwable {
- long sid = -1;
+ long sid = HDF5Constants.H5I_INVALID_HID;
long start[] = new long[2];
long stride[] = null;
long count[] = null;
diff --git a/java/test/TestH5T.java b/java/test/TestH5T.java
index 18b5985caf4..c882f8ee4e7 100644
--- a/java/test/TestH5T.java
+++ b/java/test/TestH5T.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -33,8 +32,8 @@
public class TestH5T {
@Rule public TestName testname = new TestName();
private static final String H5_FILE = "testT.h5";
- long H5fid = -1;
- long H5strdid = -1;
+ long H5fid = HDF5Constants.H5I_INVALID_HID;
+ long H5strdid = HDF5Constants.H5I_INVALID_HID;
private final void _deleteFile(String filename) {
File file = null;
@@ -129,7 +128,7 @@ public void testH5Tset_size() {
@Test
public void testH5Tarray_create() {
- long filetype_id = -1;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
long[] adims = { 3, 5 };
try {
@@ -148,7 +147,7 @@ public void testH5Tarray_create() {
@Test
public void testH5Tget_array_ndims() {
- long filetype_id = -1;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
int ndims = 0;
long[] adims = { 3, 5 };
@@ -176,7 +175,7 @@ public void testH5Tget_array_ndims() {
@Test
public void testH5Tget_array_dims() {
- long filetype_id = -1;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
int ndims = 0;
long[] adims = { 3, 5 };
long[] rdims = new long[2];
@@ -207,7 +206,7 @@ public void testH5Tget_array_dims() {
@Test
public void testH5Tenum_functions() {
- long filetype_id =-1;
+ long filetype_id =HDF5Constants.H5I_INVALID_HID;
String enum_type ="Enum_type";
byte[] enum_val = new byte[1];
String enum_name = null;
@@ -275,7 +274,7 @@ public void testH5Tenum_functions() {
@Test
public void testH5Tenum_create_functions() {
- long filetype_id = -1;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
byte[] enum_val = new byte[1];
// Create a enumerate datatype
@@ -315,7 +314,7 @@ public void testH5Tenum_create_functions() {
@Test
public void testH5Topaque_functions() {
- long filetype_id = -1;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
String opaque_name = null;
// Create a opaque datatype
@@ -345,7 +344,7 @@ public void testH5Topaque_functions() {
@Test
public void testH5Tvlen_create() {
- long filetype_id = -1;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
try {
filetype_id = H5.H5Tvlen_create(HDF5Constants.H5T_C_S1);
@@ -368,7 +367,7 @@ public void testH5Tvlen_create() {
@Test
public void testH5Tis_variable_str() {
- long filetype_id = -1;
+ long filetype_id = HDF5Constants.H5I_INVALID_HID;
try {
filetype_id = H5.H5Tcopy(HDF5Constants.H5T_C_S1);
@@ -399,7 +398,7 @@ public void testH5Tis_variable_str() {
@Test
public void testH5Tcompound_functions() {
- long filetype_id =-1;
+ long filetype_id =HDF5Constants.H5I_INVALID_HID;
// Create a compound datatype
try {
diff --git a/java/test/TestH5Tbasic.java b/java/test/TestH5Tbasic.java
index 6dbc6e32ed0..7aac2ab24eb 100644
--- a/java/test/TestH5Tbasic.java
+++ b/java/test/TestH5Tbasic.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -40,7 +39,7 @@ public void nextTestName() {
@Test
public void testH5Tcopy() {
- long H5strdid = -1;
+ long H5strdid = HDF5Constants.H5I_INVALID_HID;
try {
H5strdid = H5.H5Tcopy(HDF5Constants.H5T_C_S1);
assertTrue("H5.H5Tcopy",H5strdid > 0);
@@ -57,7 +56,7 @@ public void testH5Tcopy() {
@Test
public void testH5Tequal() {
- long H5strdid = -1;
+ long H5strdid = HDF5Constants.H5I_INVALID_HID;
try {
H5strdid = H5.H5Tcopy(HDF5Constants.H5T_C_S1);
assertTrue("H5.H5Tcopy",H5strdid > 0);
@@ -76,7 +75,7 @@ public void testH5Tequal() {
@Test
public void testH5Tequal_not() {
- long H5strdid = -1;
+ long H5strdid = HDF5Constants.H5I_INVALID_HID;
try {
H5strdid = H5.H5Tcopy(HDF5Constants.H5T_STD_U64LE);
assertTrue("H5.H5Tcopy",H5strdid > 0);
@@ -98,8 +97,8 @@ public void testH5Tconvert() {
String[] strs = {"a1234","b1234"};
int srcLen = 5;
int dstLen = 10;
- long srcId = -1;
- long dstId = -1;
+ long srcId = HDF5Constants.H5I_INVALID_HID;
+ long dstId = HDF5Constants.H5I_INVALID_HID;
int dimSize = strs.length;
byte[] buf = new byte[dimSize*dstLen];
@@ -131,7 +130,7 @@ public void testH5Tconvert() {
@Test
public void testH5Torder_size() {
- long H5strdid = -1;
+ long H5strdid = HDF5Constants.H5I_INVALID_HID;
try {
// Fixed length string
H5strdid = H5.H5Tcopy(HDF5Constants.H5T_C_S1);
diff --git a/java/test/TestH5Tparams.java b/java/test/TestH5Tparams.java
index 4180de511d3..92a034c8420 100644
--- a/java/test/TestH5Tparams.java
+++ b/java/test/TestH5Tparams.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/test/TestH5VL.java b/java/test/TestH5VL.java
index 554c1f7eea9..4253d20802e 100644
--- a/java/test/TestH5VL.java
+++ b/java/test/TestH5VL.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
@@ -72,28 +71,28 @@ public void testH5VLnative_init() {
@Test
public void testH5VLget_connector_id() {
- String H5_FILE = "testFvl.h5";
+ String H5_FILE = "testFvl.h5";
long H5fid = H5.H5Fcreate(H5_FILE, HDF5Constants.H5F_ACC_TRUNC,
HDF5Constants.H5P_DEFAULT, HDF5Constants.H5P_DEFAULT);
- try {
- long native_id = H5.H5VLget_connector_id(H5fid);
- assertTrue("H5.H5VLget_connector_id", native_id >= 0);
-
- /*
- * If HDF5_VOL_CONNECTOR is set, this might not be the
- * native connector. Only check for the native connector
- * if this isn't set.
- */
- String connector = System.getenv("HDF5_VOL_CONNECTOR");
- if (connector == null)
- assertEquals(HDF5Constants.H5VL_NATIVE, native_id);
- }
- catch (Throwable err) {
- err.printStackTrace();
- fail("H5.H5VLget_connector_id " + err);
- }
+ try {
+ long native_id = H5.H5VLget_connector_id(H5fid);
+ assertTrue("H5.H5VLget_connector_id", native_id >= 0);
+
+ /*
+ * If HDF5_VOL_CONNECTOR is set, this might not be the
+ * native connector. Only check for the native connector
+ * if this isn't set.
+ */
+ String connector = System.getenv("HDF5_VOL_CONNECTOR");
+ if (connector == null)
+ assertEquals(HDF5Constants.H5VL_NATIVE, native_id);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("H5.H5VLget_connector_id " + err);
+ }
finally {
if (H5fid > 0) {
try {H5.H5Fclose(H5fid);} catch (Exception ex) {}
@@ -139,14 +138,14 @@ public void testH5VLget_connector_name() {
try {
String native_name = H5.H5VLget_connector_name(H5fid);
- /*
- * If HDF5_VOL_CONNECTOR is set, this might not be the
- * native connector. Only check for the native connector
- * if this isn't set.
- */
- String connector = System.getenv("HDF5_VOL_CONNECTOR");
- if (connector == null)
- assertTrue("H5.H5VLget_connector_name H5VL_NATIVE", native_name.compareToIgnoreCase(HDF5Constants.H5VL_NATIVE_NAME)==0);
+ /*
+ * If HDF5_VOL_CONNECTOR is set, this might not be the
+ * native connector. Only check for the native connector
+ * if this isn't set.
+ */
+ String connector = System.getenv("HDF5_VOL_CONNECTOR");
+ if (connector == null)
+ assertTrue("H5.H5VLget_connector_name H5VL_NATIVE", native_name.compareToIgnoreCase(HDF5Constants.H5VL_NATIVE_NAME)==0);
}
catch (Throwable err) {
err.printStackTrace();
diff --git a/java/test/TestH5Z.java b/java/test/TestH5Z.java
index 696642b4ada..fde8f1a2d95 100644
--- a/java/test/TestH5Z.java
+++ b/java/test/TestH5Z.java
@@ -1,6 +1,5 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
- * Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in
index 2eabdf0964a..81ce13bba1f 100644
--- a/java/test/junit.sh.in
+++ b/java/test/junit.sh.in
@@ -1,7 +1,6 @@
#! /bin/sh
#
# Copyright by The HDF Group.
-# Copyright by the Board of Trustees of the University of Illinois.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
@@ -46,6 +45,8 @@ HDFLIB_HOME="$top_srcdir/java/lib"
BLDDIR="."
BLDLIBDIR="$BLDDIR/testlibs"
HDFTEST_HOME="$top_srcdir/java/test"
+TOOLS_TESTFILES="$top_srcdir/tools/testfiles"
+
JARFILE=jar@PACKAGE_TARNAME@-@PACKAGE_VERSION@.jar
TESTJARFILE=jar@PACKAGE_TARNAME@test.jar
test -d $BLDLIBDIR || mkdir -p $BLDLIBDIR
@@ -93,6 +94,7 @@ $HDFTEST_HOME/testfiles/JUnit-TestH5Lparams.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Lbasic.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Lcreate.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5R.txt
+$HDFTEST_HOME/testfiles/JUnit-TestH5Rref.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5P.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5PData.txt
$HDFTEST_HOME/testfiles/JUnit-TestH5Pfapl.txt
@@ -146,7 +148,7 @@ COPY_LIBFILES_TO_BLDLIBDIR()
fi
fi
done
- if [ "$IS_DARWIN" = "yes" ]; then
+ if [ "$IS_DARWIN" = "yes" ]; then
(cd testlibs; \
install_name_tool -add_rpath @loader_path libhdf5_java.dylib; \
exist_path=` otool -l libhdf5_java.dylib | grep libhdf5 | grep -v java | awk '{print $2}'`; \
@@ -248,6 +250,8 @@ COPY_DATAFILES_TO_BLDDIR()
$CP -f $HDFTEST_HOME/h5ex_g_iterate.orig $BLDDIR/h5ex_g_iterateL2.hdf
$CP -f $HDFTEST_HOME/h5ex_g_iterate.orig $BLDDIR/h5ex_g_iterateO1.hdf
$CP -f $HDFTEST_HOME/h5ex_g_iterate.orig $BLDDIR/h5ex_g_iterateO2.hdf
+ $CP -f $TOOLS_TESTFILES/trefer_reg.h5 $BLDDIR/trefer_reg.h5
+ $CP -f $TOOLS_TESTFILES/trefer_attr.h5 $BLDDIR/trefer_attr.h5
}
CLEAN_DATAFILES_AND_BLDDIR()
@@ -768,6 +772,27 @@ else
test yes = "$verbose" && $DIFF JUnit-TestH5R.txt JUnit-TestH5R.out |sed 's/^/ /'
fi
+echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Rref"
+TESTING JUnit-TestH5Rref
+($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5Rref > JUnit-TestH5Rref.ext)
+
+# Extract file name, line number, version and thread IDs because they may be different
+sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \
+ -e 's/line [0-9]*/line (number)/' \
+ -e 's/Time: [0-9]*[\.,[0-9]*]*/Time: XXXX/' \
+ -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \
+ -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \
+ JUnit-TestH5Rref.ext > JUnit-TestH5Rref.out
+
+if diff JUnit-TestH5Rref.out JUnit-TestH5Rref.txt > /dev/null; then
+ echo " PASSED JUnit-TestH5Rref"
+else
+ echo "**FAILED** JUnit-TestH5Rref"
+ echo " Expected result differs from actual result"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF JUnit-TestH5Rref.txt JUnit-TestH5Rref.out |sed 's/^/ /'
+fi
+
echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5P"
TESTING JUnit-TestH5P
($RUNSERIAL $JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestH5P > JUnit-TestH5P.ext)
diff --git a/java/test/testfiles/JUnit-TestH5.txt b/java/test/testfiles/JUnit-TestH5.txt
index 4bab633808a..59765d90b93 100644
--- a/java/test/testfiles/JUnit-TestH5.txt
+++ b/java/test/testfiles/JUnit-TestH5.txt
@@ -3,8 +3,10 @@ JUnit version 4.11
.testJ2C
.testH5export_dataset
.testIsSerializable
+.testH5export_attrdataset
.testH5garbage_collect
.testH5error_off
+.testH5export_regdataset
.serializeToDisk
.testH5open
.testH5check_version
@@ -13,5 +15,5 @@ JUnit version 4.11
Time: XXXX
-OK (11 tests)
+OK (13 tests)
diff --git a/java/test/testfiles/JUnit-TestH5Rref.txt b/java/test/testfiles/JUnit-TestH5Rref.txt
new file mode 100644
index 00000000000..05019c03561
--- /dev/null
+++ b/java/test/testfiles/JUnit-TestH5Rref.txt
@@ -0,0 +1,10 @@
+JUnit version 4.11
+.testH5Rget_region_dataset
+.testH5Rget_object
+.testH5Rget_region_attribute
+.testH5Rget_obj_type3
+
+Time: XXXX
+
+OK (4 tests)
+
diff --git a/test/use_common.c b/test/use_common.c
index f33a21b6664..4a878c7a65e 100644
--- a/test/use_common.c
+++ b/test/use_common.c
@@ -442,7 +442,7 @@ read_uc_file(hbool_t towait, options_t *opts)
{
hid_t fid; /* File ID for new HDF5 file */
hid_t dsid; /* dataset ID */
- UC_CTYPE *buffer, *bufptr; /* read data buffer */
+ UC_CTYPE *buffer = NULL, *bufptr = NULL; /* read data buffer */
hid_t f_sid; /* dataset file space id */
hid_t m_sid; /* memory space id */
int rank; /* rank */
@@ -605,6 +605,8 @@ read_uc_file(hbool_t towait, options_t *opts)
return -1;
}
+ HDfree(buffer);
+
if (nreadererr)
return -1;
else
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index d9616e18ee1..f97ef502b0e 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -472,9 +472,7 @@ diff_datum(void *_mem1, void *_mem2, hsize_t elemtno, diff_opt_t *opts, hid_t co
size_t size = 0;
hbool_t iszero1;
hbool_t iszero2;
- hsize_t nfound = 0; /* differences found */
- double per;
- hbool_t both_zero;
+ hsize_t nfound = 0; /* differences found */
diff_err_t ret_value = opts->err_stat;
H5TOOLS_START_DEBUG("ph:%d elemtno:%d - errstat:%d", opts->print_header, elemtno, opts->err_stat);
@@ -3364,48 +3362,66 @@ print_pos(diff_opt_t *opts, hsize_t idx, size_t u)
hsize_t curr_pos = idx;
parallel_print("[ ");
- H5TOOLS_DEBUG("do calc_acc_pos[%ld] nelmts:%d - errstat:%d", i, opts->hs_nelmts, opts->err_stat);
+ H5TOOLS_DEBUG("do calc_acc_pos[%ld] nelmts:%d - errstat:%d", idx, opts->hs_nelmts,
+ opts->err_stat);
if (opts->sset[0] != NULL) {
/* Subsetting is used - calculate total position */
- hsize_t elmnt_cnt = 1;
- hsize_t dim_cnt = 0; /* previous dim size */
- hsize_t str_cnt = 0; /* previous dim stride */
- hsize_t curr_idx = idx; /* calculated running position */
- hsize_t str_idx = 0;
- hsize_t blk_idx = 0;
- hsize_t cnt_idx = 0;
- hsize_t hs_idx = 0;
- j = opts->rank - 1;
+ hsize_t prev_dim_size = 0; /* previous dim size */
+ hsize_t prev_str = 0; /* previouw stride idx*/
+ hsize_t str_cnt = 0; /* stride multiplier*/
+ hsize_t curr_idx = 0; /* calculated running position */
+ hsize_t str_idx = 0;
+ hsize_t blk_idx = 0;
+ hsize_t cnt_idx = 0;
+ hsize_t dim_size = 0; /* current dim size */
+ hsize_t elmnt_cnt = 1;
+ hsize_t next_idx = idx;
+ hsize_t data_idx = 0;
+ j = opts->rank - 1;
+ H5TOOLS_DEBUG("...begin:%ld=> opts->rank:%ld (idx:%ld)", j, opts->rank, idx);
do {
- cnt_idx = opts->sset[0]->count.data[j]; /* Count value for current dim */
- H5TOOLS_DEBUG("... sset loop:%d with curr_pos:%ld (curr_idx:%ld) - count:%ld", j,
- curr_pos, curr_idx, cnt_idx);
- blk_idx = opts->sset[0]->block.data[j]; /* Block value for current dim */
- H5TOOLS_DEBUG("... sset loop:%d with curr_pos:%ld (curr_idx:%ld) - block:%ld", j,
- curr_pos, curr_idx, blk_idx);
- hs_idx = cnt_idx * blk_idx; /* hyperslab area value for current dim */
- H5TOOLS_DEBUG("... sset loop:%d with curr_pos:%ld (curr_idx:%ld) - hs:%ld", j, curr_pos,
- curr_idx, hs_idx);
- str_idx = opts->sset[0]->stride.data[j]; /* Stride value for current dim */
- H5TOOLS_DEBUG("... sset loop:%d with curr_pos:%ld (curr_idx:%ld) - stride:%ld", j,
- curr_pos, curr_idx, str_idx);
- elmnt_cnt *= opts->dims[j]; /* Total number of elements in dimension */
- H5TOOLS_DEBUG("... sset loop:%d with elmnt_cnt:%ld", j, elmnt_cnt);
- if (str_idx > blk_idx)
- curr_idx += dim_cnt * (str_idx - blk_idx); /* */
- else if (curr_idx >= hs_idx)
- curr_idx += dim_cnt * str_cnt;
- H5TOOLS_DEBUG("... sset loop:%d with idx:%ld (curr_idx:%ld) - stride:%ld", j, idx,
- curr_idx, str_idx);
- dim_cnt = elmnt_cnt; /* */
- if (str_idx > blk_idx)
- str_cnt = str_idx - blk_idx; /* */
- else
- str_cnt = str_idx; /* */
- H5TOOLS_DEBUG("... sset loop:%d with dim_cnt:%ld - str_cnt:%ld", j, dim_cnt, str_cnt);
+ curr_idx = next_idx; /* New current data position */
+ cnt_idx = opts->sset[0]->count.data[j]; /* Count value for current dim */
+ blk_idx = opts->sset[0]->block.data[j]; /* Block value for current dim */
+ str_idx = opts->sset[0]->stride.data[j]; /* Stride value for current dim */
+ H5TOOLS_DEBUG("... sset loop:%d with curr_pos:%ld (curr_idx:%ld) - c:%ld b:%ld s:%ld", j,
+ curr_pos, curr_idx, cnt_idx, blk_idx, str_idx);
+ dim_size = opts->dims[j]; /* Current dimension size */
+ // elmnt_cnt *= dim_size; /* Total number of elements in dimension */
+ H5TOOLS_DEBUG("... sset loop:%d with elmnt_cnt:%ld - (prev_dim_size:%ld - dim_size:%ld) "
+ "- str_cnt:%ld",
+ j, elmnt_cnt, prev_dim_size, dim_size, str_cnt);
+ data_idx = elmnt_cnt * dim_size;
+ H5TOOLS_DEBUG("... sset loop:%d with curr_pos:%ld (data_idx:%ld)", j, curr_pos, data_idx);
+ for (i = 0; i < cnt_idx; i++) {
+ H5TOOLS_DEBUG("... ... data loop:%d with cnt_idx:%ld - str_cnt:%ld (curr_idx:%ld - "
+ "data_idx:%ld)",
+ i, cnt_idx, str_cnt, curr_idx, data_idx);
+ if (curr_idx >= data_idx) {
+ /* get to next block */
+ data_idx += str_idx * dim_size;
+ /* get next block */
+ str_cnt++;
+ H5TOOLS_DEBUG(
+ "... ... data loop:%d with cnt_idx:%ld - str_cnt:%ld - data_idx:%ld", i,
+ cnt_idx, str_cnt, data_idx);
+ }
+ H5TOOLS_DEBUG("... ... end data loop:%d with dim_cnt:%ld - str_cnt:%ld - "
+ "(curr_idx:%ld - data_idx:%ld)",
+ i, dim_size, str_cnt, curr_idx, data_idx);
+ }
+ next_idx += dim_size * str_cnt; // + prev_dim_size;
+ H5TOOLS_DEBUG("... sset loop:%d with curr_idx:%ld (next_idx:%ld)", j, curr_idx, next_idx);
+ str_cnt = 0;
+ prev_str = str_idx;
+ prev_dim_size = dim_size;
+ H5TOOLS_DEBUG("... end sset loop:%d with prev_dim_size:%ld (curr_idx:%ld - data_idx:%ld) "
+ "- str_cnt:%ld",
+ j, prev_dim_size, curr_idx, data_idx, str_cnt);
+ elmnt_cnt *= dim_size; /* Total number of elements in dimension */
j--;
- } while (curr_idx >= elmnt_cnt && j >= 0);
+ } while (next_idx >= elmnt_cnt && j >= 0);
curr_pos = curr_idx; /* New current position */
H5TOOLS_DEBUG("pos loop:%d,%d with elmnt_cnt:%ld - curr_pos:%ld", i, j, elmnt_cnt, curr_pos);
} /* if (opts->sset[0] != NULL) */
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index f6566d960ed..3b7849164ad 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -1778,7 +1778,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
} break;
case H5T_ARRAY: {
int k, ndims;
- hsize_t dims[H5S_MAX_RANK], temp_nelmts, nelmts;
+ hsize_t dims[H5S_MAX_RANK], temp_nelmts, nelmts = 0;
hid_t memb = H5I_INVALID_HID;
H5TOOLS_DEBUG("H5T_ARRAY");
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index dd3ae67b8f7..212b13e4dc9 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -705,7 +705,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
long double templdouble;
HDmemcpy(&templdouble, vp, sizeof(long double));
- h5tools_str_append(str, OPT(info->fmt_double, "%Lf"), templdouble);
+ h5tools_str_append(str, "%Lg", templdouble);
#endif
}
break;
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index 708fb2c2e44..b33d908a65b 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -196,7 +196,7 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
/* long command line option */
int i;
const char ch = '=';
- char * arg = &argv[opt_ind][2];
+ char * arg = HDstrdup(&argv[opt_ind][2]);
size_t arg_len = 0;
opt_arg = strchr(&argv[opt_ind][2], ch);
@@ -208,8 +208,6 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
arg[arg_len] = 0;
for (i = 0; l_opts && l_opts[i].name; i++) {
- size_t len = HDstrlen(l_opts[i].name);
-
if (HDstrcmp(arg, l_opts[i].name) == 0) {
/* we've found a matching long command line flag */
opt_opt = l_opts[i].shortval;
@@ -253,6 +251,8 @@ get_option(int argc, const char **argv, const char *opts, const struct long_opti
opt_ind++;
sp = 1;
+
+ HDfree(arg);
}
else {
register char *cp; /* pointer into current token */
diff --git a/tools/src/h5diff/h5diff_common.c b/tools/src/h5diff/h5diff_common.c
index b51950e7507..99cd6533f5f 100644
--- a/tools/src/h5diff/h5diff_common.c
+++ b/tools/src/h5diff/h5diff_common.c
@@ -76,7 +76,6 @@ check_options(diff_opt_t *opts)
}
}
-#if TRILABS_227
/*-------------------------------------------------------------------------
* Function: parse_hsize_list
*
@@ -192,7 +191,6 @@ parse_subset_params(const char *dset)
return s;
}
-#endif
/*-------------------------------------------------------------------------
* Function: parse_command_line
@@ -480,11 +478,9 @@ parse_command_line(int argc, const char *argv[], const char **fname1, const char
* TRILABS_227 is complete except for an issue with printing indices
* the following calls will enable subsetting
*/
-#if TRILABS_227
opts->sset[0] = parse_subset_params(*objname1);
opts->sset[1] = parse_subset_params(*objname2);
-#endif
H5TOOLS_ENDDEBUG("");
}
@@ -822,19 +818,27 @@ usage(void)
/*
* TRILABS_227 is complete except for an issue with printing indices
* the following will be needed for subsetting
+ */
PRINTVALSTREAM(rawoutstream, " Subsetting options:\n");
- PRINTVALSTREAM(rawoutstream, " Subsetting is available by using the fcompact form of subsetting, as
- follows:\n"); PRINTVALSTREAM(rawoutstream, " obj1 /foo/mydataset[START;STRIDE;COUNT;BLOCK]\n");
- PRINTVALSTREAM(rawoutstream, " It is not required to use all parameters, but until the last parameter
- value used,\n"); PRINTVALSTREAM(rawoutstream, " all of the semicolons (;) are required, even when a
- parameter value is not specified. Example:\n"); PRINTVALSTREAM(rawoutstream, " obj1
- /foo/mydataset[START;;COUNT;BLOCK]\n"); PRINTVALSTREAM(rawoutstream, " obj1 /foo/mydataset[START]\n");
- PRINTVALSTREAM(rawoutstream, " The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1
- in\n"); PRINTVALSTREAM(rawoutstream, " each dimension. START is optional and will default to 0 in each
- dimension.\n"); PRINTVALSTREAM(rawoutstream, " Each of START, STRIDE, COUNT, and BLOCK must be a
- comma-separated list of integers with\n"); PRINTVALSTREAM(rawoutstream, " one integer for each dimension
- of the dataset.\n"); PRINTVALSTREAM(rawoutstream, "\n");
- */
+ PRINTVALSTREAM(rawoutstream,
+ " Subsetting is available by using the fcompact form of subsetting, as follows:\n");
+ PRINTVALSTREAM(rawoutstream, " obj1 /foo/mydataset[START;STRIDE;COUNT;BLOCK]\n");
+ PRINTVALSTREAM(rawoutstream,
+ " It is not required to use all parameters, but until the last parameter value used,\n");
+ PRINTVALSTREAM(
+ rawoutstream,
+ " all of the semicolons (;) are required, even when a parameter value is not specified. Example:\n");
+ PRINTVALSTREAM(rawoutstream, " obj1 /foo/mydataset[START;;COUNT;BLOCK]\n");
+ PRINTVALSTREAM(rawoutstream, " obj1 /foo/mydataset[START]\n");
+ PRINTVALSTREAM(rawoutstream,
+ " The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in\n");
+ PRINTVALSTREAM(rawoutstream,
+ " each dimension. START is optional and will default to 0 in each dimension.\n");
+ PRINTVALSTREAM(
+ rawoutstream,
+ " Each of START, STRIDE, COUNT, and BLOCK must be a comma-separated list of integers with\n");
+ PRINTVALSTREAM(rawoutstream, " one integer for each dimension of the dataset.\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " Exit code:\n");
PRINTVALSTREAM(rawoutstream, " 0 if no differences, 1 if differences found, 2 if error\n");
PRINTVALSTREAM(rawoutstream, "\n");
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index e3f438462d3..471af51a452 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -2536,7 +2536,7 @@ parsePathInfo(struct path_info *path, char *temp)
token = HDstrtok(temp, delimiter);
if (HDstrlen(token) >= MAX_PATH_NAME_LENGTH) {
- (void)HDfprintf(stderr, err1);
+ (void)HDfprintf(stderr, "%s", err1);
return (-1);
}
HDstrcpy(path->group[i++], token);
@@ -2546,7 +2546,7 @@ parsePathInfo(struct path_info *path, char *temp)
if (token == NULL)
break;
if (HDstrlen(token) >= MAX_PATH_NAME_LENGTH) {
- (void)HDfprintf(stderr, err1);
+ (void)HDfprintf(stderr, "%s", err1);
return (-1);
}
HDstrcpy(path->group[i++], token);
diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c
index b29ed729038..86fb9ecc9cf 100644
--- a/tools/src/h5ls/h5ls.c
+++ b/tools/src/h5ls/h5ls.c
@@ -530,7 +530,10 @@ print_native_type(h5tools_str_t *buffer, hid_t type, int ind)
h5tools_str_append(buffer, "native hbool_t");
}
else {
- return print_int_type(buffer, type, ind);
+ if (H5T_FLOAT == H5Tget_class(type))
+ return print_float_type(buffer, type, ind);
+ else
+ return print_int_type(buffer, type, ind);
}
}
else {
@@ -2648,7 +2651,7 @@ int
main(int argc, const char *argv[])
{
hid_t file_id = H5I_INVALID_HID;
- char * fname = NULL, *oname = NULL, *x;
+ char * fname = NULL, *oname = NULL, *x = NULL;
const char * s = NULL;
char * rest;
int argno;
diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c
index 20d277d9aa6..0aef7105f97 100644
--- a/tools/src/h5repack/h5repack_copy.c
+++ b/tools/src/h5repack/h5repack_copy.c
@@ -357,14 +357,14 @@ copy_objects(const char *fnamein, const char *fnameout, pack_opt_t *options)
done:
H5E_BEGIN_TRY
{
- H5Pclose(fcpl_in);
- H5Pclose(gcpl_in);
H5Pclose(fcpl);
+ H5Pclose(options->fout_fapl);
+ options->fout_fapl = H5P_DEFAULT;
+ H5Pclose(gcpl_in);
H5Gclose(grp_in);
- H5Fclose(fidin);
+ H5Pclose(fcpl_in);
H5Fclose(fidout);
H5Fclose(fidin);
- H5Fclose(fidout);
}
H5E_END_TRY;
if (travt)
diff --git a/tools/src/h5repack/h5repack_verify.c b/tools/src/h5repack/h5repack_verify.c
index cc5501d3d07..0542d03fa6d 100644
--- a/tools/src/h5repack/h5repack_verify.c
+++ b/tools/src/h5repack/h5repack_verify.c
@@ -378,9 +378,11 @@ h5repack_cmp_pl(const char *fname1, hid_t fname1_fapl, const char *fname2, hid_t
*-------------------------------------------------------------------------
*/
/* Open the files */
- if ((fid1 = h5tools_fopen(fname1, H5F_ACC_RDONLY, fname1_fapl, TRUE, NULL, 0)) < 0)
+ if ((fid1 = h5tools_fopen(fname1, H5F_ACC_RDONLY, fname1_fapl,
+ (fname1_fapl == H5P_DEFAULT) ? FALSE : TRUE, NULL, 0)) < 0)
H5TOOLS_GOTO_ERROR((-1), "h5tools_fopen failed <%s>: %s", fname1, H5FOPENERROR);
- if ((fid2 = h5tools_fopen(fname2, H5F_ACC_RDONLY, fname2_fapl, TRUE, NULL, 0)) < 0)
+ if ((fid2 = h5tools_fopen(fname2, H5F_ACC_RDONLY, fname2_fapl,
+ (fname2_fapl == H5P_DEFAULT) ? FALSE : TRUE, NULL, 0)) < 0)
H5TOOLS_GOTO_ERROR((-1), "h5tools_fopen failed <%s>: %s", fname2, H5FOPENERROR);
/*-------------------------------------------------------------------------
diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c
index 2426a11ad2e..8962a76d9ad 100644
--- a/tools/src/misc/h5debug.c
+++ b/tools/src/misc/h5debug.c
@@ -246,8 +246,8 @@ main(int argc, char *argv[])
haddr_t extra[10];
uint8_t sig[H5F_SIGNATURE_LEN];
size_t u;
- H5E_auto2_t func;
- void * edata;
+ H5E_auto2_t func = NULL;
+ void * edata = NULL;
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
herr_t status = SUCCEED;
int exit_value = 0;
diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c
index 77b40a1a2ba..a75f6d824c0 100644
--- a/tools/src/misc/h5repart.c
+++ b/tools/src/misc/h5repart.c
@@ -97,7 +97,7 @@ static off_t
get_size(const char *progname, int *argno, int argc, char *argv[])
{
off_t retval = -1;
- char *suffix;
+ char *suffix = NULL;
if (isdigit((int)(argv[*argno][2]))) {
retval = HDstrtol(argv[*argno] + 2, &suffix, 10);
diff --git a/tools/test/h5diff/testfiles/h5diff_10.txt b/tools/test/h5diff/testfiles/h5diff_10.txt
index b5ff01a17dc..3631db7ef2a 100644
--- a/tools/test/h5diff/testfiles/h5diff_10.txt
+++ b/tools/test/h5diff/testfiles/h5diff_10.txt
@@ -143,6 +143,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
(The option --follow-symlinks overrides the default behavior when
symbolic links are compared.).
+ Subsetting options:
+ Subsetting is available by using the fcompact form of subsetting, as follows:
+ obj1 /foo/mydataset[START;STRIDE;COUNT;BLOCK]
+ It is not required to use all parameters, but until the last parameter value used,
+ all of the semicolons (;) are required, even when a parameter value is not specified. Example:
+ obj1 /foo/mydataset[START;;COUNT;BLOCK]
+ obj1 /foo/mydataset[START]
+ The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in
+ each dimension. START is optional and will default to 0 in each dimension.
+ Each of START, STRIDE, COUNT, and BLOCK must be a comma-separated list of integers with
+ one integer for each dimension of the dataset.
+
Exit code:
0 if no differences, 1 if differences found, 2 if error
diff --git a/tools/test/h5diff/testfiles/h5diff_600.txt b/tools/test/h5diff/testfiles/h5diff_600.txt
index f52d8cca464..8a4ce6d501e 100644
--- a/tools/test/h5diff/testfiles/h5diff_600.txt
+++ b/tools/test/h5diff/testfiles/h5diff_600.txt
@@ -143,6 +143,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
(The option --follow-symlinks overrides the default behavior when
symbolic links are compared.).
+ Subsetting options:
+ Subsetting is available by using the fcompact form of subsetting, as follows:
+ obj1 /foo/mydataset[START;STRIDE;COUNT;BLOCK]
+ It is not required to use all parameters, but until the last parameter value used,
+ all of the semicolons (;) are required, even when a parameter value is not specified. Example:
+ obj1 /foo/mydataset[START;;COUNT;BLOCK]
+ obj1 /foo/mydataset[START]
+ The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in
+ each dimension. START is optional and will default to 0 in each dimension.
+ Each of START, STRIDE, COUNT, and BLOCK must be a comma-separated list of integers with
+ one integer for each dimension of the dataset.
+
Exit code:
0 if no differences, 1 if differences found, 2 if error
diff --git a/tools/test/h5diff/testfiles/h5diff_603.txt b/tools/test/h5diff/testfiles/h5diff_603.txt
index 84111b3cd2d..d4c73365ddd 100644
--- a/tools/test/h5diff/testfiles/h5diff_603.txt
+++ b/tools/test/h5diff/testfiles/h5diff_603.txt
@@ -144,6 +144,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
(The option --follow-symlinks overrides the default behavior when
symbolic links are compared.).
+ Subsetting options:
+ Subsetting is available by using the fcompact form of subsetting, as follows:
+ obj1 /foo/mydataset[START;STRIDE;COUNT;BLOCK]
+ It is not required to use all parameters, but until the last parameter value used,
+ all of the semicolons (;) are required, even when a parameter value is not specified. Example:
+ obj1 /foo/mydataset[START;;COUNT;BLOCK]
+ obj1 /foo/mydataset[START]
+ The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in
+ each dimension. START is optional and will default to 0 in each dimension.
+ Each of START, STRIDE, COUNT, and BLOCK must be a comma-separated list of integers with
+ one integer for each dimension of the dataset.
+
Exit code:
0 if no differences, 1 if differences found, 2 if error
diff --git a/tools/test/h5diff/testfiles/h5diff_606.txt b/tools/test/h5diff/testfiles/h5diff_606.txt
index d915d36a7be..3123587b097 100644
--- a/tools/test/h5diff/testfiles/h5diff_606.txt
+++ b/tools/test/h5diff/testfiles/h5diff_606.txt
@@ -144,6 +144,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
(The option --follow-symlinks overrides the default behavior when
symbolic links are compared.).
+ Subsetting options:
+ Subsetting is available by using the fcompact form of subsetting, as follows:
+ obj1 /foo/mydataset[START;STRIDE;COUNT;BLOCK]
+ It is not required to use all parameters, but until the last parameter value used,
+ all of the semicolons (;) are required, even when a parameter value is not specified. Example:
+ obj1 /foo/mydataset[START;;COUNT;BLOCK]
+ obj1 /foo/mydataset[START]
+ The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in
+ each dimension. START is optional and will default to 0 in each dimension.
+ Each of START, STRIDE, COUNT, and BLOCK must be a comma-separated list of integers with
+ one integer for each dimension of the dataset.
+
Exit code:
0 if no differences, 1 if differences found, 2 if error
diff --git a/tools/test/h5diff/testfiles/h5diff_612.txt b/tools/test/h5diff/testfiles/h5diff_612.txt
index 1ef8cdf4873..ce2d88740f9 100644
--- a/tools/test/h5diff/testfiles/h5diff_612.txt
+++ b/tools/test/h5diff/testfiles/h5diff_612.txt
@@ -144,6 +144,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
(The option --follow-symlinks overrides the default behavior when
symbolic links are compared.).
+ Subsetting options:
+ Subsetting is available by using the fcompact form of subsetting, as follows:
+ obj1 /foo/mydataset[START;STRIDE;COUNT;BLOCK]
+ It is not required to use all parameters, but until the last parameter value used,
+ all of the semicolons (;) are required, even when a parameter value is not specified. Example:
+ obj1 /foo/mydataset[START;;COUNT;BLOCK]
+ obj1 /foo/mydataset[START]
+ The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in
+ each dimension. START is optional and will default to 0 in each dimension.
+ Each of START, STRIDE, COUNT, and BLOCK must be a comma-separated list of integers with
+ one integer for each dimension of the dataset.
+
Exit code:
0 if no differences, 1 if differences found, 2 if error
diff --git a/tools/test/h5diff/testfiles/h5diff_615.txt b/tools/test/h5diff/testfiles/h5diff_615.txt
index 881362e3f8f..61fd0369e09 100644
--- a/tools/test/h5diff/testfiles/h5diff_615.txt
+++ b/tools/test/h5diff/testfiles/h5diff_615.txt
@@ -144,6 +144,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
(The option --follow-symlinks overrides the default behavior when
symbolic links are compared.).
+ Subsetting options:
+ Subsetting is available by using the fcompact form of subsetting, as follows:
+ obj1 /foo/mydataset[START;STRIDE;COUNT;BLOCK]
+ It is not required to use all parameters, but until the last parameter value used,
+ all of the semicolons (;) are required, even when a parameter value is not specified. Example:
+ obj1 /foo/mydataset[START;;COUNT;BLOCK]
+ obj1 /foo/mydataset[START]
+ The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in
+ each dimension. START is optional and will default to 0 in each dimension.
+ Each of START, STRIDE, COUNT, and BLOCK must be a comma-separated list of integers with
+ one integer for each dimension of the dataset.
+
Exit code:
0 if no differences, 1 if differences found, 2 if error
diff --git a/tools/test/h5diff/testfiles/h5diff_621.txt b/tools/test/h5diff/testfiles/h5diff_621.txt
index ba39a994752..dc8655d8bc5 100644
--- a/tools/test/h5diff/testfiles/h5diff_621.txt
+++ b/tools/test/h5diff/testfiles/h5diff_621.txt
@@ -144,6 +144,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
(The option --follow-symlinks overrides the default behavior when
symbolic links are compared.).
+ Subsetting options:
+ Subsetting is available by using the fcompact form of subsetting, as follows:
+ obj1 /foo/mydataset[START;STRIDE;COUNT;BLOCK]
+ It is not required to use all parameters, but until the last parameter value used,
+ all of the semicolons (;) are required, even when a parameter value is not specified. Example:
+ obj1 /foo/mydataset[START;;COUNT;BLOCK]
+ obj1 /foo/mydataset[START]
+ The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in
+ each dimension. START is optional and will default to 0 in each dimension.
+ Each of START, STRIDE, COUNT, and BLOCK must be a comma-separated list of integers with
+ one integer for each dimension of the dataset.
+
Exit code:
0 if no differences, 1 if differences found, 2 if error
diff --git a/tools/test/h5diff/testfiles/h5diff_622.txt b/tools/test/h5diff/testfiles/h5diff_622.txt
index 70421fc0cd0..f20ffbe1f9b 100644
--- a/tools/test/h5diff/testfiles/h5diff_622.txt
+++ b/tools/test/h5diff/testfiles/h5diff_622.txt
@@ -144,6 +144,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
(The option --follow-symlinks overrides the default behavior when
symbolic links are compared.).
+ Subsetting options:
+ Subsetting is available by using the fcompact form of subsetting, as follows:
+ obj1 /foo/mydataset[START;STRIDE;COUNT;BLOCK]
+ It is not required to use all parameters, but until the last parameter value used,
+ all of the semicolons (;) are required, even when a parameter value is not specified. Example:
+ obj1 /foo/mydataset[START;;COUNT;BLOCK]
+ obj1 /foo/mydataset[START]
+ The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in
+ each dimension. START is optional and will default to 0 in each dimension.
+ Each of START, STRIDE, COUNT, and BLOCK must be a comma-separated list of integers with
+ one integer for each dimension of the dataset.
+
Exit code:
0 if no differences, 1 if differences found, 2 if error
diff --git a/tools/test/h5diff/testfiles/h5diff_623.txt b/tools/test/h5diff/testfiles/h5diff_623.txt
index 0d74268196d..f73d20217b1 100644
--- a/tools/test/h5diff/testfiles/h5diff_623.txt
+++ b/tools/test/h5diff/testfiles/h5diff_623.txt
@@ -144,6 +144,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
(The option --follow-symlinks overrides the default behavior when
symbolic links are compared.).
+ Subsetting options:
+ Subsetting is available by using the fcompact form of subsetting, as follows:
+ obj1 /foo/mydataset[START;STRIDE;COUNT;BLOCK]
+ It is not required to use all parameters, but until the last parameter value used,
+ all of the semicolons (;) are required, even when a parameter value is not specified. Example:
+ obj1 /foo/mydataset[START;;COUNT;BLOCK]
+ obj1 /foo/mydataset[START]
+ The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in
+ each dimension. START is optional and will default to 0 in each dimension.
+ Each of START, STRIDE, COUNT, and BLOCK must be a comma-separated list of integers with
+ one integer for each dimension of the dataset.
+
Exit code:
0 if no differences, 1 if differences found, 2 if error
diff --git a/tools/test/h5diff/testfiles/h5diff_624.txt b/tools/test/h5diff/testfiles/h5diff_624.txt
index cb8b8b4c7cc..903b7380bb7 100644
--- a/tools/test/h5diff/testfiles/h5diff_624.txt
+++ b/tools/test/h5diff/testfiles/h5diff_624.txt
@@ -144,6 +144,18 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
(The option --follow-symlinks overrides the default behavior when
symbolic links are compared.).
+ Subsetting options:
+ Subsetting is available by using the fcompact form of subsetting, as follows:
+ obj1 /foo/mydataset[START;STRIDE;COUNT;BLOCK]
+ It is not required to use all parameters, but until the last parameter value used,
+ all of the semicolons (;) are required, even when a parameter value is not specified. Example:
+ obj1 /foo/mydataset[START;;COUNT;BLOCK]
+ obj1 /foo/mydataset[START]
+ The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in
+ each dimension. START is optional and will default to 0 in each dimension.
+ Each of START, STRIDE, COUNT, and BLOCK must be a comma-separated list of integers with
+ one integer for each dimension of the dataset.
+
Exit code:
0 if no differences, 1 if differences found, 2 if error
diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake
index 0d8563efa71..f54da76ece2 100644
--- a/tools/test/h5dump/CMakeTests.cmake
+++ b/tools/test/h5dump/CMakeTests.cmake
@@ -127,7 +127,7 @@
${HDF5_TOOLS_DIR}/testfiles/tintsattrs.ddl
${HDF5_TOOLS_DIR}/testfiles/tintsnodata.ddl
${HDF5_TOOLS_DIR}/testfiles/tlarge_objname.ddl
- #${HDF5_TOOLS_DIR}/testfiles/tldouble.ddl
+ ${HDF5_TOOLS_DIR}/testfiles/tldouble.ddl
${HDF5_TOOLS_DIR}/testfiles/tlonglinks.ddl
${HDF5_TOOLS_DIR}/testfiles/tloop-1.ddl
${HDF5_TOOLS_DIR}/testfiles/tmulti.ddl
@@ -293,7 +293,7 @@
${HDF5_TOOLS_DIR}/testfiles/tintsattrs.h5
${HDF5_TOOLS_DIR}/testfiles/tintsnodata.h5
${HDF5_TOOLS_DIR}/testfiles/tlarge_objname.h5
- #${HDF5_TOOLS_DIR}/testfiles/tldouble.h5
+ ${HDF5_TOOLS_DIR}/testfiles/tldouble.h5
${HDF5_TOOLS_DIR}/testfiles/tlonglinks.h5
${HDF5_TOOLS_DIR}/testfiles/tloop.h5
${HDF5_TOOLS_DIR}/testfiles/tmulti-b.h5
@@ -1085,7 +1085,7 @@
ADD_H5_TEST (zerodim 0 --enable-error-stack zerodim.h5)
# test for long double (some systems do not have long double)
- #ADD_H5_TEST (tldouble 0 --enable-error-stack tldouble.h5)
+# ADD_H5_TEST (tldouble 0 --enable-error-stack tldouble.h5)
# test for vms
ADD_H5_TEST (tvms 0 --enable-error-stack tvms.h5)
@@ -1170,7 +1170,7 @@
ADD_H5_TEST (err_attr_dspace 1 err_attr_dspace.h5)
# test to verify HDFFV-9407: long double full precision
- ADD_H5_GREP_TEST (t128bit_float 1 "1.123456789012345" -m %.35Lf t128bit_float.h5)
+# ADD_H5_GREP_TEST (t128bit_float 1 "1.123456789012345" -m %.35Lg t128bit_float.h5)
##############################################################################
### P L U G I N T E S T S
diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c
index 2746f700b9f..fed3a565bcc 100644
--- a/tools/test/h5dump/h5dumpgentest.c
+++ b/tools/test/h5dump/h5dumpgentest.c
@@ -115,6 +115,7 @@
#define FILE85 "tgrpnullspace.h5"
#define FILE86 "err_attr_dspace.h5"
#define FILE87 "tintsnodata.h5"
+#define FILE88 "tldouble_scalar.h5"
/*-------------------------------------------------------------------------
* prototypes
@@ -6332,6 +6333,57 @@ gent_ldouble(void)
return -1;
}
+/*-------------------------------------------------------------------------
+ * Function: gent_ldouble_scalar
+ *
+ * Purpose: make file with a long double scalar dataset
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+gent_ldouble_scalar(void)
+{
+ hid_t fid;
+ hid_t did;
+ hid_t tid;
+ hid_t sid;
+ hsize_t dims[1] = {6};
+ long double buf[6] = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
+
+ if ((fid = H5Fcreate(FILE88, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ if ((sid = H5Screate(H5S_SCALAR)) < 0)
+ goto error;
+
+ if ((tid = H5Tarray_create(H5T_NATIVE_LDOUBLE, 1, dims)) < 0)
+ goto error;
+
+ if (H5Tget_size(tid) == 0)
+ goto error;
+
+ if ((did = H5Dcreate2(fid, "dset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ goto error;
+
+ if (H5Sclose(sid) < 0)
+ goto error;
+ if (H5Tclose(tid) < 0)
+ goto error;
+ if (H5Dclose(did) < 0)
+ goto error;
+ if (H5Fclose(fid) < 0)
+ goto error;
+
+ return 0;
+
+error:
+ HDprintf("error !\n");
+ return -1;
+}
+
/*-------------------------------------------------------------------------
* Function: gent_binary
*
diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in
index 2c4f2da105c..8f478b0d2e9 100644
--- a/tools/test/h5dump/testh5dump.sh.in
+++ b/tools/test/h5dump/testh5dump.sh.in
@@ -142,7 +142,7 @@ $SRC_H5DUMP_TESTFILES/thyperslab.h5
$SRC_H5DUMP_TESTFILES/tintsattrs.h5
$SRC_H5DUMP_TESTFILES/tints4dims.h5
$SRC_H5DUMP_TESTFILES/tlarge_objname.h5
-#$SRC_H5DUMP_TESTFILES/tldouble.h5
+$SRC_H5DUMP_TESTFILES/tldouble.h5
$SRC_H5DUMP_TESTFILES/tlonglinks.h5
$SRC_H5DUMP_TESTFILES/tloop.h5
$SRC_H5DUMP_TESTFILES/tmulti-b.h5
@@ -287,7 +287,7 @@ $SRC_H5DUMP_TESTFILES/tints4dimsCountEq.ddl
$SRC_H5DUMP_TESTFILES/tints4dimsStride2.ddl
$SRC_H5DUMP_TESTFILES/tintsattrs.ddl
$SRC_H5DUMP_TESTFILES/tlarge_objname.ddl
-#$SRC_H5DUMP_TESTFILES/tldouble.ddl
+$SRC_H5DUMP_TESTFILES/tldouble.ddl
$SRC_H5DUMP_TESTFILES/tlonglinks.ddl
$SRC_H5DUMP_TESTFILES/tloop-1.ddl
$SRC_H5DUMP_TESTFILES/tmulti.ddl
@@ -1443,7 +1443,7 @@ TOOLTEST3 non_existing.ddl --enable-error-stack tgroup.h5 non_existing.h5
TOOLTEST err_attr_dspace.ddl err_attr_dspace.h5
# test to verify HDFFV-9407: long double full precision
-GREPTEST OUTTXT "1.123456789012345" t128bit_float.ddl -m %.35Lf t128bit_float.h5
+#GREPTEST OUTTXT "1.123456789012345" t128bit_float.ddl -m %.35Lf t128bit_float.h5
# Clean up temporary files/directories
CLEAN_TESTFILES_AND_TESTDIR
diff --git a/tools/testfiles/tldouble.ddl b/tools/testfiles/tldouble.ddl
new file mode 100644
index 00000000000..c032ef31a21
--- /dev/null
+++ b/tools/testfiles/tldouble.ddl
@@ -0,0 +1,11 @@
+HDF5 "tldouble.h5" {
+GROUP "/" {
+ DATASET "dset" {
+ DATATYPE H5T_NATIVE_LDOUBLE
+ DATASPACE SIMPLE { ( 3 ) / ( 3 ) }
+ DATA {
+ (0): 1, 2, 3
+ }
+ }
+}
+}
From 8691d6c27d555160c0da97e6f098c3ac90249d23 Mon Sep 17 00:00:00 2001
From: Allen Byrne