summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-01-14 16:29:10 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-01-14 16:29:10 (GMT)
commit0894356a3c6e17b00c7911d8199b64eefca7aa3a (patch)
tree9e9ab954ab103b64aa6ba87da4fbe30127f4035f /tools
parente0bb475838f0c31743018e5c1c770b30b9373440 (diff)
downloadhdf5-0894356a3c6e17b00c7911d8199b64eefca7aa3a.zip
hdf5-0894356a3c6e17b00c7911d8199b64eefca7aa3a.tar.gz
hdf5-0894356a3c6e17b00c7911d8199b64eefca7aa3a.tar.bz2
[svn-r16311] Description:
Bring revisions 16280:16307 back from trunk. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.6 (amazon) in debug mode Mac OS X/32 10.5.6 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'tools')
-rw-r--r--tools/h5diff/h5diff_common.c11
-rw-r--r--tools/h5diff/testfiles/h5diff_10.txt1
-rw-r--r--tools/h5diff/testfiles/h5diff_600.txt1
-rw-r--r--tools/h5diff/testfiles/h5diff_603.txt1
-rw-r--r--tools/h5diff/testfiles/h5diff_604.txt1
-rw-r--r--tools/h5diff/testfiles/h5diff_605.txt1
-rw-r--r--tools/h5diff/testfiles/h5diff_606.txt1
-rw-r--r--tools/h5diff/testfiles/h5diff_612.txt1
-rw-r--r--tools/h5diff/testfiles/h5diff_613.txt1
-rw-r--r--tools/h5diff/testfiles/h5diff_614.txt1
-rw-r--r--tools/h5diff/testfiles/h5diff_615.txt1
-rw-r--r--tools/h5diff/testfiles/h5diff_621.txt1
-rw-r--r--tools/h5diff/testfiles/h5diff_622.txt1
-rw-r--r--tools/h5diff/testfiles/h5diff_623.txt1
-rw-r--r--tools/h5diff/testfiles/h5diff_624.txt1
-rw-r--r--tools/h5ls/h5ls.c36
-rwxr-xr-xtools/h5ls/testh5ls.sh6
-rw-r--r--tools/h5repack/h5repack_main.c2
-rw-r--r--tools/lib/h5diff.h1
-rw-r--r--tools/lib/h5diff_array.c206
-rw-r--r--tools/testfiles/tdatareg.ls14
-rw-r--r--tools/testfiles/tvldtypes2.ls22
22 files changed, 208 insertions, 104 deletions
diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c
index 5a59215..8a49fa0 100644
--- a/tools/h5diff/h5diff_common.c
+++ b/tools/h5diff/h5diff_common.c
@@ -31,7 +31,7 @@ const char *progname = "h5diff";
* Command-line options: The user can specify short or long-named
* parameters.
*/
-static const char *s_opts = "hVrvqn:d:p:";
+static const char *s_opts = "hVrvqn:d:p:N";
static struct long_options l_opts[] = {
{ "help", no_arg, 'h' },
{ "version", no_arg, 'V' },
@@ -41,6 +41,7 @@ static struct long_options l_opts[] = {
{ "count", require_arg, 'n' },
{ "delta", require_arg, 'd' },
{ "relative", require_arg, 'p' },
+ { "nan", no_arg, 'N' },
{ NULL, 0, '\0' }
};
@@ -70,6 +71,9 @@ void parse_command_line(int argc,
/* assume equal contents initially */
options->contents = 1;
+ /* NaNs are handled by default */
+ options->do_nans = 1;
+
/* parse command line options */
while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF)
{
@@ -130,6 +134,10 @@ void parse_command_line(int argc,
options->count = atol( opt_arg );
break;
+
+ case 'N':
+ options->do_nans = 0;
+ break;
}
}
@@ -323,6 +331,7 @@ void usage(void)
printf(" -r, --report Report mode. Print differences\n");
printf(" -v, --verbose Verbose mode. Print differences, list of objects\n");
printf(" -q, --quiet Quiet mode. Do not do output\n");
+ printf(" -N, --nan Avoid NaNs detection\n");
printf(" -n C, --count=C Print differences up to C number\n");
printf(" -d D, --delta=D Print difference when greater than limit D\n");
diff --git a/tools/h5diff/testfiles/h5diff_10.txt b/tools/h5diff/testfiles/h5diff_10.txt
index a74a37c..5480df1 100644
--- a/tools/h5diff/testfiles/h5diff_10.txt
+++ b/tools/h5diff/testfiles/h5diff_10.txt
@@ -9,6 +9,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]]
-r, --report Report mode. Print differences
-v, --verbose Verbose mode. Print differences, list of objects
-q, --quiet Quiet mode. Do not do output
+ -N, --nan Avoid NaNs detection
-n C, --count=C Print differences up to C number
-d D, --delta=D Print difference when greater than limit D
-p R, --relative=R Print difference when greater than relative limit R
diff --git a/tools/h5diff/testfiles/h5diff_600.txt b/tools/h5diff/testfiles/h5diff_600.txt
index dcf14f7..22a3155 100644
--- a/tools/h5diff/testfiles/h5diff_600.txt
+++ b/tools/h5diff/testfiles/h5diff_600.txt
@@ -9,6 +9,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]]
-r, --report Report mode. Print differences
-v, --verbose Verbose mode. Print differences, list of objects
-q, --quiet Quiet mode. Do not do output
+ -N, --nan Avoid NaNs detection
-n C, --count=C Print differences up to C number
-d D, --delta=D Print difference when greater than limit D
-p R, --relative=R Print difference when greater than relative limit R
diff --git a/tools/h5diff/testfiles/h5diff_603.txt b/tools/h5diff/testfiles/h5diff_603.txt
index e274d88..80ee102 100644
--- a/tools/h5diff/testfiles/h5diff_603.txt
+++ b/tools/h5diff/testfiles/h5diff_603.txt
@@ -10,6 +10,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]]
-r, --report Report mode. Print differences
-v, --verbose Verbose mode. Print differences, list of objects
-q, --quiet Quiet mode. Do not do output
+ -N, --nan Avoid NaNs detection
-n C, --count=C Print differences up to C number
-d D, --delta=D Print difference when greater than limit D
-p R, --relative=R Print difference when greater than relative limit R
diff --git a/tools/h5diff/testfiles/h5diff_604.txt b/tools/h5diff/testfiles/h5diff_604.txt
index 8232c38..acb12b9 100644
--- a/tools/h5diff/testfiles/h5diff_604.txt
+++ b/tools/h5diff/testfiles/h5diff_604.txt
@@ -10,6 +10,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]]
-r, --report Report mode. Print differences
-v, --verbose Verbose mode. Print differences, list of objects
-q, --quiet Quiet mode. Do not do output
+ -N, --nan Avoid NaNs detection
-n C, --count=C Print differences up to C number
-d D, --delta=D Print difference when greater than limit D
-p R, --relative=R Print difference when greater than relative limit R
diff --git a/tools/h5diff/testfiles/h5diff_605.txt b/tools/h5diff/testfiles/h5diff_605.txt
index bce2118..94f016d 100644
--- a/tools/h5diff/testfiles/h5diff_605.txt
+++ b/tools/h5diff/testfiles/h5diff_605.txt
@@ -10,6 +10,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]]
-r, --report Report mode. Print differences
-v, --verbose Verbose mode. Print differences, list of objects
-q, --quiet Quiet mode. Do not do output
+ -N, --nan Avoid NaNs detection
-n C, --count=C Print differences up to C number
-d D, --delta=D Print difference when greater than limit D
-p R, --relative=R Print difference when greater than relative limit R
diff --git a/tools/h5diff/testfiles/h5diff_606.txt b/tools/h5diff/testfiles/h5diff_606.txt
index 9a0a8cd..f181030 100644
--- a/tools/h5diff/testfiles/h5diff_606.txt
+++ b/tools/h5diff/testfiles/h5diff_606.txt
@@ -10,6 +10,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]]
-r, --report Report mode. Print differences
-v, --verbose Verbose mode. Print differences, list of objects
-q, --quiet Quiet mode. Do not do output
+ -N, --nan Avoid NaNs detection
-n C, --count=C Print differences up to C number
-d D, --delta=D Print difference when greater than limit D
-p R, --relative=R Print difference when greater than relative limit R
diff --git a/tools/h5diff/testfiles/h5diff_612.txt b/tools/h5diff/testfiles/h5diff_612.txt
index 16baa7c..840058d 100644
--- a/tools/h5diff/testfiles/h5diff_612.txt
+++ b/tools/h5diff/testfiles/h5diff_612.txt
@@ -10,6 +10,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]]
-r, --report Report mode. Print differences
-v, --verbose Verbose mode. Print differences, list of objects
-q, --quiet Quiet mode. Do not do output
+ -N, --nan Avoid NaNs detection
-n C, --count=C Print differences up to C number
-d D, --delta=D Print difference when greater than limit D
-p R, --relative=R Print difference when greater than relative limit R
diff --git a/tools/h5diff/testfiles/h5diff_613.txt b/tools/h5diff/testfiles/h5diff_613.txt
index e57c320..5c18686 100644
--- a/tools/h5diff/testfiles/h5diff_613.txt
+++ b/tools/h5diff/testfiles/h5diff_613.txt
@@ -10,6 +10,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]]
-r, --report Report mode. Print differences
-v, --verbose Verbose mode. Print differences, list of objects
-q, --quiet Quiet mode. Do not do output
+ -N, --nan Avoid NaNs detection
-n C, --count=C Print differences up to C number
-d D, --delta=D Print difference when greater than limit D
-p R, --relative=R Print difference when greater than relative limit R
diff --git a/tools/h5diff/testfiles/h5diff_614.txt b/tools/h5diff/testfiles/h5diff_614.txt
index 828d250..a630e02 100644
--- a/tools/h5diff/testfiles/h5diff_614.txt
+++ b/tools/h5diff/testfiles/h5diff_614.txt
@@ -10,6 +10,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]]
-r, --report Report mode. Print differences
-v, --verbose Verbose mode. Print differences, list of objects
-q, --quiet Quiet mode. Do not do output
+ -N, --nan Avoid NaNs detection
-n C, --count=C Print differences up to C number
-d D, --delta=D Print difference when greater than limit D
-p R, --relative=R Print difference when greater than relative limit R
diff --git a/tools/h5diff/testfiles/h5diff_615.txt b/tools/h5diff/testfiles/h5diff_615.txt
index 654a743..8fdc0ce 100644
--- a/tools/h5diff/testfiles/h5diff_615.txt
+++ b/tools/h5diff/testfiles/h5diff_615.txt
@@ -10,6 +10,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]]
-r, --report Report mode. Print differences
-v, --verbose Verbose mode. Print differences, list of objects
-q, --quiet Quiet mode. Do not do output
+ -N, --nan Avoid NaNs detection
-n C, --count=C Print differences up to C number
-d D, --delta=D Print difference when greater than limit D
-p R, --relative=R Print difference when greater than relative limit R
diff --git a/tools/h5diff/testfiles/h5diff_621.txt b/tools/h5diff/testfiles/h5diff_621.txt
index 18acda6..746977e 100644
--- a/tools/h5diff/testfiles/h5diff_621.txt
+++ b/tools/h5diff/testfiles/h5diff_621.txt
@@ -10,6 +10,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]]
-r, --report Report mode. Print differences
-v, --verbose Verbose mode. Print differences, list of objects
-q, --quiet Quiet mode. Do not do output
+ -N, --nan Avoid NaNs detection
-n C, --count=C Print differences up to C number
-d D, --delta=D Print difference when greater than limit D
-p R, --relative=R Print difference when greater than relative limit R
diff --git a/tools/h5diff/testfiles/h5diff_622.txt b/tools/h5diff/testfiles/h5diff_622.txt
index 7740b0a..4ead1fb 100644
--- a/tools/h5diff/testfiles/h5diff_622.txt
+++ b/tools/h5diff/testfiles/h5diff_622.txt
@@ -10,6 +10,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]]
-r, --report Report mode. Print differences
-v, --verbose Verbose mode. Print differences, list of objects
-q, --quiet Quiet mode. Do not do output
+ -N, --nan Avoid NaNs detection
-n C, --count=C Print differences up to C number
-d D, --delta=D Print difference when greater than limit D
-p R, --relative=R Print difference when greater than relative limit R
diff --git a/tools/h5diff/testfiles/h5diff_623.txt b/tools/h5diff/testfiles/h5diff_623.txt
index e238a6b..fb94e0d 100644
--- a/tools/h5diff/testfiles/h5diff_623.txt
+++ b/tools/h5diff/testfiles/h5diff_623.txt
@@ -10,6 +10,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]]
-r, --report Report mode. Print differences
-v, --verbose Verbose mode. Print differences, list of objects
-q, --quiet Quiet mode. Do not do output
+ -N, --nan Avoid NaNs detection
-n C, --count=C Print differences up to C number
-d D, --delta=D Print difference when greater than limit D
-p R, --relative=R Print difference when greater than relative limit R
diff --git a/tools/h5diff/testfiles/h5diff_624.txt b/tools/h5diff/testfiles/h5diff_624.txt
index 7100555..bb4b133 100644
--- a/tools/h5diff/testfiles/h5diff_624.txt
+++ b/tools/h5diff/testfiles/h5diff_624.txt
@@ -10,6 +10,7 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]]
-r, --report Report mode. Print differences
-v, --verbose Verbose mode. Print differences, list of objects
-q, --quiet Quiet mode. Do not do output
+ -N, --nan Avoid NaNs detection
-n C, --count=C Print differences up to C number
-d D, --delta=D Print difference when greater than limit D
-p R, --relative=R Print difference when greater than relative limit R
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index eec1fcd..d0af4bb 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -1515,7 +1515,8 @@ dataset_list2(hid_t dset, const char UNUSED *name)
int ndims; /* dimensionality */
int n, max_len; /* max extern file name length */
double utilization; /* percent utilization of storage */
- int i;
+ H5T_class_t tclass; /* datatype class identifier */
+ int i;
if(verbose_g > 0) {
dcpl = H5Dget_create_plist(dset);
@@ -1539,14 +1540,35 @@ dataset_list2(hid_t dset, const char UNUSED *name)
/* Print total raw storage size */
total = H5Sget_simple_extent_npoints(space) * H5Tget_size(type);
used = H5Dget_storage_size(dset);
+ tclass = H5Tget_class(type);
printf(" %-10s ", "Storage:");
- printf("%lu logical byte%s, %lu allocated byte%s",
- (unsigned long)total, 1==total?"":"s",
- (unsigned long)used, 1==used?"":"s");
- if (used>0) {
- utilization = (total*100.0)/used;
- printf(", %1.2f%% utilization", utilization);
+ switch (tclass)
+ {
+
+ case H5T_VLEN:
+ printf("information not available");
+ break;
+
+ case H5T_REFERENCE:
+ if ( H5Tequal(type, H5T_STD_REF_DSETREG))
+ {
+ printf("information not available");
+ }
+ break;
+
+ default:
+ printf("%lu logical byte%s, %lu allocated byte%s",
+ (unsigned long)total, 1==total?"":"s",
+ (unsigned long)used, 1==used?"":"s");
+ if (used>0)
+ {
+ utilization = (total*100.0)/used;
+ printf(", %1.2f%% utilization", utilization);
+ }
+
}
+
+
putchar('\n');
/* Print information about external strorage */
diff --git a/tools/h5ls/testh5ls.sh b/tools/h5ls/testh5ls.sh
index 0bae60b..8194bfb 100755
--- a/tools/h5ls/testh5ls.sh
+++ b/tools/h5ls/testh5ls.sh
@@ -173,6 +173,12 @@ TOOLTEST tattr2.ls 0 -w80 -v -S tattr2.h5
# test for non-existing file
TOOLTEST nosuchfile.ls 0 nosuchfile.h5
+# test for variable length data types in verbose mode
+TOOLTEST tvldtypes2.ls 0 -v tvldtypes1.h5
+
+# test for dataset region references data types in verbose mode
+TOOLTEST tdatareg.ls 0 -v tdatareg.h5
+
if test $nerrors -eq 0 ; then
echo "All h5ls tests passed."
fi
diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c
index 8fd2046..f55bd2e 100644
--- a/tools/h5repack/h5repack_main.c
+++ b/tools/h5repack/h5repack_main.c
@@ -183,7 +183,7 @@ static void usage(const char *prog)
printf("\n");
- printf(" M - is an integer greater than 1, size of dataset in bytes \n");
+ printf(" M - is an integer greater than 1, size of dataset in bytes (default is 1024) \n");
printf(" E - is a filename.\n");
printf(" S - is an integer\n");
printf(" U - is a filename.\n");
diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h
index c013ba5..57d06a5 100644
--- a/tools/lib/h5diff.h
+++ b/tools/lib/h5diff.h
@@ -38,6 +38,7 @@ typedef struct {
int cmn_objs; /* do we have comparable objects */
int not_cmp; /* are the objects comparable */
int contents; /* equal contents */
+ int do_nans; /* consider Nans while diffing floats */
} diff_opt_t;
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 5d187cd..e5f065c 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -141,10 +141,10 @@ static hbool_t all_zero(const void *_mem, size_t size);
static int ull2float(unsigned long_long ull_value, float *f_value);
static hsize_t character_compare(unsigned char *mem1,unsigned char *mem2,hsize_t i,unsigned u,int rank,hsize_t *dims,hsize_t *acc,hsize_t *pos,diff_opt_t *options,const char *obj1,const char *obj2,int *ph);
static hsize_t character_compare_opt(unsigned char *mem1,unsigned char *mem2,hsize_t i,int rank,hsize_t *dims,hsize_t *acc,hsize_t *pos,diff_opt_t *options,const char *obj1,const char *obj2,int *ph);
-static hbool_t equal_float(float value, float expected);
-static hbool_t equal_double(double value, double expected);
+static hbool_t equal_float(float value, float expected, diff_opt_t *options);
+static hbool_t equal_double(double value, double expected, diff_opt_t *options);
#if H5_SIZEOF_LONG_DOUBLE !=0
-static hbool_t equal_ldouble(long double value, long double expected);
+static hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *options);
#endif
static int print_data(diff_opt_t *options);
static void print_pos(int *ph,int pp,hsize_t curr_pos,hsize_t *acc,hsize_t *pos,int rank,hsize_t *dims,const char *obj1,const char *obj2 );
@@ -1970,7 +1970,7 @@ hsize_t diff_datum(void *_mem1,
* no -d and -p
*-------------------------------------------------------------------------
*/
- else if (equal_float(temp1_float,temp2_float)==FALSE)
+ else if (equal_float(temp1_float,temp2_float,options)==FALSE)
{
if ( print_data(options) )
@@ -2139,7 +2139,7 @@ hsize_t diff_datum(void *_mem1,
* no -d and -p
*-------------------------------------------------------------------------
*/
- else if (equal_double(temp1_double,temp2_double)==FALSE)
+ else if (equal_double(temp1_double,temp2_double,options)==FALSE)
{
if ( print_data(options) )
{
@@ -2310,7 +2310,7 @@ hsize_t diff_datum(void *_mem1,
* no -d and -p
*-------------------------------------------------------------------------
*/
- else if (equal_ldouble(temp1_double,temp2_double)==FALSE)
+ else if (equal_ldouble(temp1_double,temp2_double,options)==FALSE)
{
if ( print_data(options) )
{
@@ -2931,7 +2931,7 @@ hsize_t diff_float(unsigned char *mem1,
memcpy(&temp2_float, mem2, sizeof(float));
- if (equal_float(temp1_float,temp2_float)==FALSE)
+ if (equal_float(temp1_float,temp2_float,options)==FALSE)
{
if ( print_data(options) )
{
@@ -3114,7 +3114,7 @@ hsize_t diff_double(unsigned char *mem1,
memcpy(&temp1_double, mem1, sizeof(double));
memcpy(&temp2_double, mem2, sizeof(double));
- if (equal_double(temp1_double,temp2_double)==FALSE)
+ if (equal_double(temp1_double,temp2_double,options)==FALSE)
{
if ( print_data(options) )
{
@@ -3293,7 +3293,7 @@ hsize_t diff_ldouble(unsigned char *mem1,
memcpy(&temp1_double, mem1, sizeof(long double));
memcpy(&temp2_double, mem2, sizeof(long double));
- if (equal_ldouble(temp1_double,temp2_double)==FALSE)
+ if (equal_ldouble(temp1_double,temp2_double,options)==FALSE)
{
if ( print_data(options) )
{
@@ -5183,48 +5183,53 @@ error:
*-------------------------------------------------------------------------
*/
static
-hbool_t equal_double(double value, double expected)
+hbool_t equal_double(double value, double expected, diff_opt_t *options)
{
int both_zero;
int is_zero;
-/*-------------------------------------------------------------------------
- * detect NaNs
- *-------------------------------------------------------------------------
- */
- int isnan1 = my_isnan(FLT_DOUBLE,&value);
- int isnan2 = my_isnan(FLT_DOUBLE,&expected);
-
- /*-------------------------------------------------------------------------
- * we consider NaN == NaN to be true
- *-------------------------------------------------------------------------
- */
- if ( isnan1 && isnan2 )
- {
- return TRUE;
- }
- /*-------------------------------------------------------------------------
- * one is a NaN, do not compare but assume difference
- *-------------------------------------------------------------------------
- */
- if ( (isnan1 && !isnan2) || ( !isnan1 && isnan2 ) )
+ if ( options->do_nans )
{
- return FALSE;
+
+ /*-------------------------------------------------------------------------
+ * detect NaNs
+ *-------------------------------------------------------------------------
+ */
+ int isnan1 = my_isnan(FLT_DOUBLE,&value);
+ int isnan2 = my_isnan(FLT_DOUBLE,&expected);
+
+ /*-------------------------------------------------------------------------
+ * we consider NaN == NaN to be true
+ *-------------------------------------------------------------------------
+ */
+ if ( isnan1 && isnan2 )
+ {
+ return TRUE;
+ }
+
+ /*-------------------------------------------------------------------------
+ * one is a NaN, do not compare but assume difference
+ *-------------------------------------------------------------------------
+ */
+ if ( (isnan1 && !isnan2) || ( !isnan1 && isnan2 ) )
+ {
+ return FALSE;
+ }
+
+ /*-------------------------------------------------------------------------
+ * both are not NaNs, compare
+ *-------------------------------------------------------------------------
+ */
}
- /*-------------------------------------------------------------------------
- * both are not NaNs, compare
- *-------------------------------------------------------------------------
- */
-
BOTH_ZERO(value,expected)
if (both_zero)
return TRUE;
IS_ZERO(expected)
if (is_zero)
- return(equal_double(expected,value));
+ return(equal_double(expected,value,options));
if ( ABS( (value-expected) / expected) < H5DIFF_DBL_EPSILON)
return TRUE;
@@ -5244,48 +5249,54 @@ hbool_t equal_double(double value, double expected)
#if H5_SIZEOF_LONG_DOUBLE !=0
static
-hbool_t equal_ldouble(long double value, long double expected)
+hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *options)
{
int both_zero;
int is_zero;
-/*-------------------------------------------------------------------------
- * detect NaNs
- *-------------------------------------------------------------------------
- */
- int isnan1 = my_isnan(FLT_LDOUBLE,&value);
- int isnan2 = my_isnan(FLT_LDOUBLE,&expected);
-
- /*-------------------------------------------------------------------------
- * we consider NaN == NaN to be true
- *-------------------------------------------------------------------------
- */
- if ( isnan1 && isnan2 )
- {
- return TRUE;
- }
-
- /*-------------------------------------------------------------------------
- * one is a NaN, do not compare but assume difference
- *-------------------------------------------------------------------------
- */
- if ( (isnan1 && !isnan2) || ( !isnan1 && isnan2 ) )
+
+ if ( options->do_nans )
{
- return FALSE;
+
+ /*-------------------------------------------------------------------------
+ * detect NaNs
+ *-------------------------------------------------------------------------
+ */
+ int isnan1 = my_isnan(FLT_LDOUBLE,&value);
+ int isnan2 = my_isnan(FLT_LDOUBLE,&expected);
+
+ /*-------------------------------------------------------------------------
+ * we consider NaN == NaN to be true
+ *-------------------------------------------------------------------------
+ */
+ if ( isnan1 && isnan2 )
+ {
+ return TRUE;
+ }
+
+ /*-------------------------------------------------------------------------
+ * one is a NaN, do not compare but assume difference
+ *-------------------------------------------------------------------------
+ */
+ if ( (isnan1 && !isnan2) || ( !isnan1 && isnan2 ) )
+ {
+ return FALSE;
+ }
+
+ /*-------------------------------------------------------------------------
+ * both are not NaNs, compare
+ *-------------------------------------------------------------------------
+ */
+
}
- /*-------------------------------------------------------------------------
- * both are not NaNs, compare
- *-------------------------------------------------------------------------
- */
-
BOTH_ZERO(value,expected)
if (both_zero)
return TRUE;
IS_ZERO(expected)
if (is_zero)
- return(equal_ldouble(expected,value));
+ return(equal_ldouble(expected,value,options));
if ( ABS( (value-expected) / expected) < H5DIFF_DBL_EPSILON)
return TRUE;
@@ -5309,48 +5320,53 @@ hbool_t equal_ldouble(long double value, long double expected)
*-------------------------------------------------------------------------
*/
static
-hbool_t equal_float(float value, float expected)
+hbool_t equal_float(float value, float expected, diff_opt_t *options)
{
int both_zero;
int is_zero;
-/*-------------------------------------------------------------------------
- * detect NaNs
- *-------------------------------------------------------------------------
- */
- int isnan1 = my_isnan(FLT_FLOAT,&value);
- int isnan2 = my_isnan(FLT_FLOAT,&expected);
-
- /*-------------------------------------------------------------------------
- * we consider NaN == NaN to be true
- *-------------------------------------------------------------------------
- */
- if ( isnan1 && isnan2 )
+ if ( options->do_nans )
{
- return TRUE;
- }
-
- /*-------------------------------------------------------------------------
- * one is a NaN, do not compare but assume difference
- *-------------------------------------------------------------------------
- */
- if ( (isnan1 && !isnan2) || ( !isnan1 && isnan2 ) )
- {
- return FALSE;
+
+ /*-------------------------------------------------------------------------
+ * detect NaNs
+ *-------------------------------------------------------------------------
+ */
+ int isnan1 = my_isnan(FLT_FLOAT,&value);
+ int isnan2 = my_isnan(FLT_FLOAT,&expected);
+
+ /*-------------------------------------------------------------------------
+ * we consider NaN == NaN to be true
+ *-------------------------------------------------------------------------
+ */
+ if ( isnan1 && isnan2 )
+ {
+ return TRUE;
+ }
+
+ /*-------------------------------------------------------------------------
+ * one is a NaN, do not compare but assume difference
+ *-------------------------------------------------------------------------
+ */
+ if ( (isnan1 && !isnan2) || ( !isnan1 && isnan2 ) )
+ {
+ return FALSE;
+ }
+
+ /*-------------------------------------------------------------------------
+ * both are not NaNs, compare
+ *-------------------------------------------------------------------------
+ */
+
}
- /*-------------------------------------------------------------------------
- * both are not NaNs, compare
- *-------------------------------------------------------------------------
- */
-
BOTH_ZERO(value,expected)
if (both_zero)
return TRUE;
IS_ZERO(expected)
if (is_zero)
- return(equal_float(expected,value));
+ return(equal_float(expected,value,options));
if ( ABS( (value-expected) / expected) < H5DIFF_FLT_EPSILON)
return TRUE;
diff --git a/tools/testfiles/tdatareg.ls b/tools/testfiles/tdatareg.ls
new file mode 100644
index 0000000..b07b274
--- /dev/null
+++ b/tools/testfiles/tdatareg.ls
@@ -0,0 +1,14 @@
+#############################
+ output for 'h5ls -v tdatareg.h5'
+#############################
+Opened "tdatareg.h5" with sec2 driver.
+Dataset1 Dataset {4/4}
+ Location: 1:1284
+ Links: 1
+ Storage: information not available
+ Type: dataset region reference
+Dataset2 Dataset {10/10, 10/10}
+ Location: 1:744
+ Links: 1
+ Storage: 100 logical bytes, 100 allocated bytes, 100.00% utilization
+ Type: 8-bit unsigned integer
diff --git a/tools/testfiles/tvldtypes2.ls b/tools/testfiles/tvldtypes2.ls
new file mode 100644
index 0000000..62dfa61
--- /dev/null
+++ b/tools/testfiles/tvldtypes2.ls
@@ -0,0 +1,22 @@
+#############################
+ output for 'h5ls -v tvldtypes1.h5'
+#############################
+Opened "tvldtypes1.h5" with sec2 driver.
+Dataset1.0 Dataset {4/4}
+ Location: 1:976
+ Links: 1
+ Storage: information not available
+ Type: variable length of
+ native int
+Dataset2.0 Dataset {4/4}
+ Location: 1:1576
+ Links: 1
+ Storage: information not available
+ Type: variable length of
+ native float
+Dataset3.0 Dataset {SCALAR}
+ Location: 1:6272
+ Links: 1
+ Storage: information not available
+ Type: variable length of
+ native int