summaryrefslogtreecommitdiffstats
path: root/hl/test
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2015-04-21 14:58:43 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2015-04-21 14:58:43 (GMT)
commit65b3bc2a937337239ceede5e39261c6b2ba4dc69 (patch)
treec6139980f34978fefe3fad3c756d4916f4d7d389 /hl/test
parent3f36df51d845a93e94fff264fa22ad60a71db754 (diff)
downloadhdf5-65b3bc2a937337239ceede5e39261c6b2ba4dc69.zip
hdf5-65b3bc2a937337239ceede5e39261c6b2ba4dc69.tar.gz
hdf5-65b3bc2a937337239ceede5e39261c6b2ba4dc69.tar.bz2
[svn-r26861] Bring revisions #26401 - #26459 from trunk to revise_chunks.
h5committested.
Diffstat (limited to 'hl/test')
-rw-r--r--hl/test/h5hltest.h2
-rw-r--r--hl/test/test_ds.c2
-rw-r--r--hl/test/test_dset_opt.c12
-rw-r--r--hl/test/test_lite.c18
-rw-r--r--hl/test/test_packet.c4
-rw-r--r--hl/test/test_table.c46
6 files changed, 42 insertions, 42 deletions
diff --git a/hl/test/h5hltest.h b/hl/test/h5hltest.h
index 809c4ec..e8292d2 100644
--- a/hl/test/h5hltest.h
+++ b/hl/test/h5hltest.h
@@ -33,7 +33,7 @@
#define TESTING2(WHAT) {printf("%-70s", "Testing " WHAT); fflush(stdout);}
#define TESTING3(WHAT) {printf("%-70s", "" WHAT); fflush(stdout);}
-/* Implrements verbose 'assert' with 'goto error' exit */
+/* Implements verbose 'assert' with 'goto error' exit */
#define VERIFY(condition, string) do { if (!(condition)) FAIL_PUTS_ERROR(string) } while(0)
#endif /* _H5HLTEST_H */
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index 77d2b71..7b6fb82 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -3126,7 +3126,7 @@ static int test_simple(void)
if(H5DSget_scale_name(dsid, name_out, (size_t)name_len+1) < 0)
goto out;
- if(HDstrncmp("Latitude set 0",name_out, name_len)!=0)
+ if(HDstrncmp("Latitude set 0",name_out, (size_t)name_len)!=0)
goto out;
if(name_out) {
HDfree(name_out);
diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c
index b0800a0..95ce535 100644
--- a/hl/test/test_dset_opt.c
+++ b/hl/test/test_dset_opt.c
@@ -501,20 +501,20 @@ filter_bogus1(unsigned int flags, size_t UNUSED cd_nelmts,
size_t *buf_size, void **buf)
{
int *int_ptr=(int *)*buf; /* Pointer to the data values */
- ssize_t buf_left=*buf_size; /* Amount of data buffer left to process */
+ ssize_t buf_left=(ssize_t)*buf_size; /* Amount of data buffer left to process */
if(flags & H5Z_FLAG_REVERSE) { /* read */
/* Substract the "add on" value to all the data values */
while(buf_left>0) {
*int_ptr++ -= (int)ADD_ON;
- buf_left -= sizeof(int);
+ buf_left -= (ssize_t)sizeof(int);
} /* end while */
} /* end if */
else { /* write */
/* Add the "add on" value to all the data values */
while(buf_left>0) {
*int_ptr++ += (int)ADD_ON;
- buf_left -= sizeof(int);
+ buf_left -= (ssize_t)sizeof(int);
} /* end while */
} /* end else */
@@ -538,20 +538,20 @@ filter_bogus2(unsigned int flags, size_t UNUSED cd_nelmts,
size_t *buf_size, void **buf)
{
int *int_ptr=(int *)*buf; /* Pointer to the data values */
- ssize_t buf_left=*buf_size; /* Amount of data buffer left to process */
+ ssize_t buf_left=(ssize_t)*buf_size; /* Amount of data buffer left to process */
if(flags & H5Z_FLAG_REVERSE) { /* read */
/* Substract the "add on" value to all the data values */
while(buf_left>0) {
*int_ptr++ /= (int)FACTOR;
- buf_left -= sizeof(int);
+ buf_left -= (ssize_t)sizeof(int);
} /* end while */
} /* end if */
else { /* write */
/* Add the "add on" value to all the data values */
while(buf_left>0) {
*int_ptr++ *= (int)FACTOR;
- buf_left -= sizeof(int);
+ buf_left -= (ssize_t)sizeof(int);
} /* end while */
} /* end else */
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c
index 19d3759..2337610 100644
--- a/hl/test/test_lite.c
+++ b/hl/test/test_lite.c
@@ -300,7 +300,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
- if ( data_float_in[i] != data_float_out[i] ) {
+ if(!FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
goto out;
}
}
@@ -311,7 +311,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
- if ( data_float_in[i] != data_float_out[i] ) {
+ if(!FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
goto out;
}
}
@@ -336,7 +336,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
- if ( data_double_in[i] != data_double_out[i] ) {
+ if(!DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
goto out;
}
}
@@ -347,7 +347,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
- if ( data_double_in[i] != data_double_out[i] ) {
+ if(!DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
goto out;
}
}
@@ -959,7 +959,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
- if ( attr_float_in[i] != attr_float_out[i] ) {
+ if(!FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
return -1;
}
}
@@ -970,7 +970,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
- if ( attr_float_in[i] != attr_float_out[i] ) {
+ if(!FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
return -1;
}
}
@@ -1003,7 +1003,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
- if ( attr_double_in[i] != attr_double_out[i] ) {
+ if(!DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
return -1;
}
}
@@ -1014,7 +1014,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
- if ( attr_double_in[i] != attr_double_out[i] ) {
+ if(!DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
return -1;
}
}
@@ -1046,7 +1046,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
TESTING("H5LTget_attribute_info");
- if(NULL==(dims_out = (hsize_t*) HDmalloc( sizeof(hsize_t) * rank_out ))) return -1;
+ if(NULL==(dims_out = (hsize_t*) HDmalloc( sizeof(hsize_t) * (size_t)rank_out ))) return -1;
if ( H5LTget_attribute_info( loc_id, obj_name, ATTR2_NAME, dims_out, &type_class, &type_size) < 0 ) {
HDfree( dims_out );
diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c
index 62e9ae3..256892b 100644
--- a/hl/test/test_packet.c
+++ b/hl/test/test_packet.c
@@ -75,8 +75,8 @@ static int cmp_par(size_t i, size_t j, particle_t *rbuf, particle_t *wbuf )
if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi ||
- rbuf[i].pressure != wbuf[j].pressure ||
- rbuf[i].temperature != wbuf[j].temperature ) {
+ !FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
+ !DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) ) {
return -1;
}
return 0;
diff --git a/hl/test/test_table.c b/hl/test/test_table.c
index 8af6d28..3bc5e5f 100644
--- a/hl/test/test_table.c
+++ b/hl/test/test_table.c
@@ -166,14 +166,14 @@ static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf )
if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi ||
- rbuf[i].pressure != wbuf[j].pressure ||
- rbuf[i].temperature != wbuf[j].temperature )
+ !FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
+ !DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) )
{
HDfprintf(stderr,"read and write buffers have differences\n");
HDfprintf(stderr,"%s %ld %f %f %d\n",
- rbuf[i].name,rbuf[i].longi,rbuf[i].pressure,rbuf[i].temperature,rbuf[i].lati);
+ rbuf[i].name,rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].temperature,rbuf[i].lati);
HDfprintf(stderr,"%s %ld %f %f %d\n",
- wbuf[j].name,wbuf[j].longi,wbuf[j].pressure,wbuf[j].temperature,wbuf[j].lati);
+ wbuf[j].name,wbuf[j].longi,(double)wbuf[j].pressure,wbuf[j].temperature,wbuf[j].lati);
return -1;
}
return 0;
@@ -1138,14 +1138,14 @@ static int test_table(hid_t fid, int do_write)
{
if ( i >= 2 && i <= 4 )
{
- if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati ||
+ if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati ||
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
- rbuf[i].pressure != pressure_in[i-NRECORDS_ADD+1] )
+ !FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
{
HDfprintf(stderr,"%ld %f %d\n",
- rbuf[i].longi,rbuf[i].pressure,rbuf[i].lati);
+ rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].lati);
HDfprintf(stderr,"%ld %f %d\n",
- position_in[i].longi,pressure_in[i],position_in[i].lati);
+ position_in[i].longi,(double)pressure_in[i],position_in[i].lati);
goto out;
}
}
@@ -1200,9 +1200,9 @@ static int test_table(hid_t fid, int do_write)
goto out;
/* Compare the extracted table with the initial values */
- for( i = 0; i < NRECORDS; i++ )
+ for ( i = 0; i < NRECORDS; i++ )
{
- if ( pressure_out[i] != pressure_in[i] ) {
+ if ( !FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
goto out;
}
}
@@ -1265,7 +1265,7 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < NRECORDS; i++ )
{
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
- namepre_out[i].pressure != namepre_in[i].pressure ) {
+ !FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
goto out;
}
}
@@ -1294,7 +1294,7 @@ static int test_table(hid_t fid, int do_write)
{
hsize_t iistart = start;
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[iistart+i].name ) != 0 ) ||
- namepre_out[i].pressure != namepre_in[iistart+i].pressure ) {
+ !FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart+i].pressure) ) {
goto out;
}
}
@@ -1353,7 +1353,7 @@ static int test_table(hid_t fid, int do_write)
{
if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati ||
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
- rbuf[i].pressure != pressure_in[i-NRECORDS_ADD+1] )
+ !FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
goto out;
}
}
@@ -1406,7 +1406,7 @@ static int test_table(hid_t fid, int do_write)
/* compare the extracted table with the initial values */
for( i = 0; i < NRECORDS; i++ )
{
- if ( pressure_out[i] != pressure_in[i] ) {
+ if ( !FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
goto out;
}
}
@@ -1471,10 +1471,10 @@ static int test_table(hid_t fid, int do_write)
/* compare the extracted table with the initial values */
for( i = 0; i < NRECORDS; i++ )
{
- if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
- namepre_out[i].pressure != namepre_in[i].pressure ) {
- goto out;
- }
+ if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
+ !FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
+ goto out;
+ }
}
/* reset buffer */
@@ -1502,8 +1502,8 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < 3; i++ )
{
int iistart = (int) start;
- if ( ( HDstrcmp( namepre_out[i].name, wbuf[iistart+i].name ) != 0 ) ||
- namepre_out[i].pressure != wbuf[iistart+i].pressure ) {
+ if ( ( HDstrcmp( namepre_out[i].name, wbuf[iistart+(int)i].name ) != 0 ) ||
+ !FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart+(int)i].pressure) ) {
goto out;
}
}
@@ -1546,8 +1546,8 @@ static int test_table(hid_t fid, int do_write)
if ( ( HDstrcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) ||
rbuf2[i].lati != wbuf[i].lati ||
rbuf2[i].longi != wbuf[i].longi ||
- rbuf2[i].pressure != wbuf[i].pressure ||
- rbuf2[i].temperature != wbuf[i].temperature ||
+ !FLT_ABS_EQUAL(rbuf2[i].pressure,wbuf[i].pressure) ||
+ !DBL_ABS_EQUAL(rbuf2[i].temperature,wbuf[i].temperature) ||
rbuf2[i].new_field != buf_new[i] ) {
goto out;
}
@@ -1587,7 +1587,7 @@ static int test_table(hid_t fid, int do_write)
if ( ( HDstrcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) ||
rbuf3[i].lati != wbuf[i].lati ||
rbuf3[i].longi != wbuf[i].longi ||
- rbuf3[i].temperature != wbuf[i].temperature ) {
+ !DBL_ABS_EQUAL(rbuf3[i].temperature,wbuf[i].temperature) ) {
goto out;
}
}