diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2012-07-25 19:56:18 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2012-07-25 19:56:18 (GMT) |
commit | 434643dd4d14a841abdcc73ad7b3a0a8e06e4438 (patch) | |
tree | 24ba05d5c24bc4845bcb5c0051d9fcafbfc5afd6 /test | |
parent | f0e0137b6110fb4f0c3ffe40a9bb5d43111874a7 (diff) | |
download | hdf5-434643dd4d14a841abdcc73ad7b3a0a8e06e4438.zip hdf5-434643dd4d14a841abdcc73ad7b3a0a8e06e4438.tar.gz hdf5-434643dd4d14a841abdcc73ad7b3a0a8e06e4438.tar.bz2 |
[svn-r22600] Description:
Bring r22251:22599 from trunk to revise_chunks branch.
Tested on:
Mac OSX/64 10.7.4 (amazon) w/gcc 4.7.1, C++ & FORTRAN
(Not h5committested yet, as this branch doesn't require it)
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 13 | ||||
-rw-r--r-- | test/Makefile.in | 40 | ||||
-rw-r--r-- | test/bittests.c | 104 | ||||
-rw-r--r-- | test/cmpd_dset.c | 2 | ||||
-rw-r--r-- | test/dsets.c | 40 | ||||
-rw-r--r-- | test/dt_arith.c | 114 | ||||
-rw-r--r-- | test/dtypes.c | 5 | ||||
-rw-r--r-- | test/external.c | 6 | ||||
-rw-r--r-- | test/file_image.c | 48 | ||||
-rw-r--r-- | test/mf.c | 50 | ||||
-rw-r--r-- | test/objcopy.c | 2 | ||||
-rw-r--r-- | test/testfiles/error_test_1 | 6 | ||||
-rw-r--r-- | test/tgenprop.c | 42 | ||||
-rw-r--r-- | test/tid.c | 18 | ||||
-rw-r--r-- | test/tmisc.c | 84 | ||||
-rw-r--r-- | test/vfd.c | 3 |
16 files changed, 333 insertions, 244 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index d5cd2b5..244bb28 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -115,11 +115,11 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 \ huge_chunks.h5 chunk_cache.h5 big_chunk.h5 chunk_fast.h5 \ chunk_expand.h5 \ copy_dcpl_newfile.h5 extend.h5 istore.h5 extlinks*.h5 frspace.h5 links*.h5 \ - sys_file1 tfile[1-5].h5 th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 \ + sys_file1 tfile[1-6].h5 th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 \ stab.h5 extern_[1-3].h5 extern_[1-4][ab].raw gheap[0-4].h5 \ dt_arith[1-2] links.h5 links[0-6]*.h5 extlinks[0-15].h5 tmp \ big.data big[0-9][0-9][0-9][0-9][0-9].h5 \ - stdio.h5 sec2.h5 dtypes[0-9].h5 dt_arith[1-2].h5 tattr.h5 \ + stdio.h5 sec2.h5 dtypes[0-9].h5 dtypes1[0].h5 dt_arith[1-2].h5 tattr.h5 \ tselect.h5 mtime.h5 unlink.h5 unicode.h5 coord.h5 \ fillval_[0-9].h5 fillval.raw mount_[0-9].h5 testmeta.h5 ttime.h5 \ trefer[1-3].h5 tvltypes.h5 tvlstr.h5 tvlstr2.h5 flush.h5 \ @@ -132,9 +132,12 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 \ dtransform.h5 test_filters.h5 get_file_name.h5 tstint[1-2].h5 \ unlink_chunked.h5 btree2.h5 objcopy_src.h5 objcopy_dst.h5 \ objcopy_ext.dat trefer1.h5 trefer2.h5 app_ref.h5 farray.h5 \ - earray.h5 efc[0-5].h5 log_vfd_out.log new_multi_file_v16-r.h5 \ - new_multi_file_v16-s.h5 swmr_data.h5 \ - flushrefresh.h5 flushrefresh_VERIFICATION_START \ + earray.h5 efc[0-5].h5 log_vfd_out.log \ + new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 \ + split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \ + file_image_core_test.h5.copy \ + swmr_data.h5 \ + flushrefresh.h5 flushrefresh_VERIFICATION_START \ flushrefresh_VERIFICATION_CHECKPOINT1 flushrefresh_VERIFICATION_CHECKPOINT2 \ flushrefresh_VERIFICATION_DONE diff --git a/test/Makefile.in b/test/Makefile.in index d7467f1..de5de82 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -803,27 +803,31 @@ TRACE = perl $(top_srcdir)/bin/trace CHECK_CLEANFILES = *.chkexe *.chklog *.clog accum.h5 cmpd_dset.h5 \ compact_dataset.h5 dataset.h5 dset_offset.h5 \ max_compact_dataset.h5 simple.h5 set_local.h5 random_chunks.h5 \ - huge_chunks.h5 chunk_cache.h5 big_chunk.h5 chunk_fast.h5 \ - chunk_expand.h5 copy_dcpl_newfile.h5 extend.h5 istore.h5 \ - extlinks*.h5 frspace.h5 links*.h5 sys_file1 tfile[1-5].h5 \ - th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 stab.h5 extern_[1-3].h5 \ + huge_chunks.h5 chunk_cache.h5 big_chunk.h5 chunk_expand.h5 \ + chunk_fast.h5 \ + copy_dcpl_newfile.h5 extend.h5 istore.h5 extlinks*.h5 \ + frspace.h5 links*.h5 sys_file1 tfile[1-6].h5 th5s[1-4].h5 \ + lheap.h5 fheap.h5 ohdr.h5 stab.h5 extern_[1-3].h5 \ extern_[1-4][ab].raw gheap[0-4].h5 dt_arith[1-2] links.h5 \ links[0-6]*.h5 extlinks[0-15].h5 tmp big.data \ big[0-9][0-9][0-9][0-9][0-9].h5 stdio.h5 sec2.h5 \ - dtypes[0-9].h5 dt_arith[1-2].h5 tattr.h5 tselect.h5 mtime.h5 \ - unlink.h5 unicode.h5 coord.h5 fillval_[0-9].h5 fillval.raw \ - mount_[0-9].h5 testmeta.h5 ttime.h5 trefer[1-3].h5 tvltypes.h5 \ - tvlstr.h5 tvlstr2.h5 flush.h5 enum1.h5 titerate.h5 ttsafe.h5 \ - tarray1.h5 tgenprop.h5 tmisc[0-9]*.h5 set_extent[1-5].h5 \ - ext[12].bin getname.h5 getname[1-3].h5 sec2_file.h5 \ - direct_file.h5 family_file000[0-3][0-9].h5 \ - new_family_v16_000[0-3][0-9].h5 multi_file-[rs].h5 core_file \ - new_move_[ab].h5 ntypes.h5 dangle.h5 error_test.h5 \ - err_compat.h5 dtransform.h5 test_filters.h5 get_file_name.h5 \ - tstint[1-2].h5 unlink_chunked.h5 btree2.h5 objcopy_src.h5 \ - objcopy_dst.h5 objcopy_ext.dat trefer1.h5 trefer2.h5 \ - app_ref.h5 farray.h5 earray.h5 efc[0-5].h5 log_vfd_out.log \ - new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 swmr_data.h5 \ + dtypes[0-9].h5 dtypes1[0].h5 dt_arith[1-2].h5 tattr.h5 \ + tselect.h5 mtime.h5 unlink.h5 unicode.h5 coord.h5 \ + fillval_[0-9].h5 fillval.raw mount_[0-9].h5 testmeta.h5 \ + ttime.h5 trefer[1-3].h5 tvltypes.h5 tvlstr.h5 tvlstr2.h5 \ + flush.h5 enum1.h5 titerate.h5 ttsafe.h5 tarray1.h5 tgenprop.h5 \ + tmisc[0-9]*.h5 set_extent[1-5].h5 ext[12].bin getname.h5 \ + getname[1-3].h5 sec2_file.h5 direct_file.h5 \ + family_file000[0-3][0-9].h5 new_family_v16_000[0-3][0-9].h5 \ + multi_file-[rs].h5 core_file new_move_[ab].h5 ntypes.h5 \ + dangle.h5 error_test.h5 err_compat.h5 dtransform.h5 \ + test_filters.h5 get_file_name.h5 tstint[1-2].h5 \ + unlink_chunked.h5 btree2.h5 objcopy_src.h5 objcopy_dst.h5 \ + objcopy_ext.dat trefer1.h5 trefer2.h5 app_ref.h5 farray.h5 \ + earray.h5 efc[0-5].h5 log_vfd_out.log new_multi_file_v16-r.h5 \ + new_multi_file_v16-s.h5 split_get_file_image_test-m.h5 \ + split_get_file_image_test-r.h5 file_image_core_test.h5.copy \ + swmr_data.h5 \ flushrefresh.h5 flushrefresh_VERIFICATION_START \ flushrefresh_VERIFICATION_CHECKPOINT1 \ flushrefresh_VERIFICATION_CHECKPOINT2 \ diff --git a/test/bittests.c b/test/bittests.c index f063cee..c527bb8 100644 --- a/test/bittests.c +++ b/test/bittests.c @@ -56,13 +56,13 @@ test_find (void) /* The zero length buffer */ HDmemset(v1, 0xaa, sizeof v1); - n = H5T_bit_find(v1, (size_t)0, (size_t)0, H5T_BIT_LSB, TRUE); + n = H5T__bit_find(v1, (size_t)0, (size_t)0, H5T_BIT_LSB, TRUE); if(-1 != n) { H5_FAILED(); puts (" Zero length test failed (lsb)!"); goto failed; } - n = H5T_bit_find(v1, (size_t)0, (size_t)0, H5T_BIT_MSB, TRUE); + n = H5T__bit_find(v1, (size_t)0, (size_t)0, H5T_BIT_MSB, TRUE); if(-1 != n) { H5_FAILED(); puts (" Zero length test failed (msb)!"); @@ -72,13 +72,13 @@ test_find (void) /* The zero buffer */ HDmemset(v1, 0, sizeof v1); - n = H5T_bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, TRUE); + n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, TRUE); if(-1 != n) { H5_FAILED(); puts (" Zero buffer test failed (lsb)!"); goto failed; } - n = H5T_bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, TRUE); + n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, TRUE); if(-1 != n) { H5_FAILED(); puts (" Zero buffer test failed (msb)!"); @@ -89,13 +89,13 @@ test_find (void) for(i = 0; i < 8 * (int)sizeof(v1); i++) { HDmemset(v1, 0, sizeof v1); v1[i / 8] = 1 << (i % 8); - n = H5T_bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, TRUE); + n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, TRUE); if((ssize_t)i != n) { H5_FAILED(); printf (" Test for set bit %d failed (lsb)!\n", i); goto failed; } - n = H5T_bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, TRUE); + n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, TRUE); if((ssize_t)i != n) { H5_FAILED(); printf (" Test for set bit %d failed (msb)!\n", i); @@ -105,13 +105,13 @@ test_find (void) /* The one buffer */ HDmemset(v1, 0xff, sizeof v1); - n = H5T_bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, FALSE); + n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, FALSE); if(-1 != n) { H5_FAILED(); puts (" One buffer test failed (lsb)!"); goto failed; } - n = H5T_bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, FALSE); + n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, FALSE); if(-1 != n) { H5_FAILED(); puts (" One buffer test failed (msb)!"); @@ -122,13 +122,13 @@ test_find (void) for (i=0; i<8*(int)sizeof(v1); i++) { memset (v1, 0xff, sizeof v1); v1[i/8] &= ~(1<<(i%8)); - n = H5T_bit_find (v1, (size_t)0, 8*sizeof(v1), H5T_BIT_LSB, FALSE); + n = H5T__bit_find (v1, (size_t)0, 8*sizeof(v1), H5T_BIT_LSB, FALSE); if ((ssize_t)i!=n) { H5_FAILED(); printf (" Test for clear bit %d failed (lsb)!\n", i); goto failed; } - n = H5T_bit_find (v1, (size_t)0, 8*sizeof(v1), H5T_BIT_MSB, FALSE); + n = H5T__bit_find (v1, (size_t)0, 8*sizeof(v1), H5T_BIT_MSB, FALSE); if ((ssize_t)i!=n) { H5_FAILED(); printf (" Test for clear bit %d failed (lsb)!\n", i); @@ -183,7 +183,7 @@ test_copy (void) memset (v2, 0x00, sizeof v2); /* Copy some bits to v2 and make sure something was copied */ - H5T_bit_copy (v2, d_offset, v1, s_offset, size); + H5T__bit_copy (v2, d_offset, v1, s_offset, size); for (j=0; j<(int)sizeof(v2); j++) if (v2[j]) break; if (size>0 && j>=(int)sizeof(v2)) { H5_FAILED(); @@ -198,7 +198,7 @@ test_copy (void) /* Look for the zeros and ones */ - n = H5T_bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 1); + n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 1); if (size>0 && n!=(ssize_t)d_offset) { H5_FAILED(); printf (" Unable to find first copied bit in destination " @@ -210,7 +210,7 @@ test_copy (void) puts (" Found copied bits and shouldn't have!"); goto failed; } - n = H5T_bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 0); + n = H5T__bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 0); if (d_offset+size<8*sizeof(v2) && n!=(ssize_t)size) { H5_FAILED(); printf (" Unable to find last copied bit in destination " @@ -227,7 +227,7 @@ test_copy (void) * Look for zeros and ones in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 1); + n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 1); if (size>0 && (size_t)(n+1)!=d_offset+size) { H5_FAILED(); printf (" Unable to find last copied bit in destination " @@ -239,7 +239,7 @@ test_copy (void) puts (" Found copied bits but shouldn't have (reverse)!"); goto failed; } - n = H5T_bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 0); + n = H5T__bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 0); if (d_offset>0 && n+1!=(ssize_t)d_offset) { H5_FAILED(); printf (" Unable to find beginning of copied data " @@ -305,12 +305,12 @@ test_shift (void) /*-------- LEFT-shift some bits and make sure something was shifted --------*/ memset (vector, 0x00, sizeof vector); - H5T_bit_set (vector, offset, size, 1); + H5T__bit_set (vector, offset, size, 1); - H5T_bit_shift (vector, shift_dist, offset, size); + H5T__bit_shift (vector, shift_dist, offset, size); /* Look for the ones */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); if ((size_t)n!=offset+shift_dist) { H5_FAILED(); printf (" Unable to find first bit in destination " @@ -322,7 +322,7 @@ test_shift (void) * Look for zeros and ones in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); if (n!=(ssize_t)(offset+size-1)) { H5_FAILED(); printf (" Unable to find last bit in destination " @@ -332,12 +332,12 @@ test_shift (void) /*-------- RIGHT-shift some bits and make sure something was shifted --------*/ memset (vector, 0x00, sizeof vector); - H5T_bit_set (vector, offset, size, 1); + H5T__bit_set (vector, offset, size, 1); - H5T_bit_shift (vector, -shift_dist, offset, size); + H5T__bit_shift (vector, -shift_dist, offset, size); /* Look for the ones */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); if ((size_t)n!=offset) { H5_FAILED(); printf (" Unable to find first bit in destination " @@ -349,7 +349,7 @@ test_shift (void) * Look for zeros and ones in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); if (n!=(ssize_t)(offset+size-shift_dist-1)) { H5_FAILED(); printf (" Unable to find last bit in destination " @@ -367,12 +367,12 @@ test_shift (void) shift_dist = -((ssize_t)size); memset (vector, 0x00, sizeof vector); - H5T_bit_set (vector, offset, size, 1); + H5T__bit_set (vector, offset, size, 1); - H5T_bit_shift (vector, shift_dist, offset, size); + H5T__bit_shift (vector, shift_dist, offset, size); /* Supposed to fail to find any ones */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); if (n >= 0) { H5_FAILED(); printf (" Unable to verify all bits are zero in destination(LSB) " @@ -381,7 +381,7 @@ test_shift (void) } /* Look from the other direction */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); if (n >= 0) { H5_FAILED(); printf (" Unable to verify all bits are zero in destination(MSB) " @@ -437,15 +437,15 @@ test_increment (void) memset (vector, 0x00, sizeof vector); if(size>1) /* if size=6, make a sequence like 011111 */ - H5T_bit_set (vector, offset, size-1, 1); + H5T__bit_set (vector, offset, size-1, 1); else /* if size=1, just set this one bit to 1 */ - H5T_bit_set (vector, offset, size, 1); + H5T__bit_set (vector, offset, size, 1); /* Increment the sequence by one */ - H5T_bit_inc (vector, offset, size); + H5T__bit_inc (vector, offset, size); /* Look for the one */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); if (size!=1 && (size_t)n!=offset+size-1) { H5_FAILED(); printf (" Unable to find first bit in destination " @@ -463,7 +463,7 @@ test_increment (void) * Look for one in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); if (size!=1 && n!=(ssize_t)(offset+size-1)) { H5_FAILED(); printf (" Unable to find last bit in destination " @@ -526,10 +526,10 @@ test_decrement (void) memset (vector, 0x00, sizeof vector); /* decrement the sequence by one */ - H5T_bit_dec (vector, offset, size); + H5T__bit_dec (vector, offset, size); /* Look for the ones */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); if ((size_t)n!=offset) { H5_FAILED(); printf (" Unable to find first bit in destination " @@ -541,7 +541,7 @@ test_decrement (void) * Look for zeros and ones in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); if (n!=(ssize_t)(offset+size-1)) { H5_FAILED(); printf (" Unable to find last bit in destination " @@ -598,10 +598,10 @@ test_negate (void) memset (vector, 0x00, sizeof vector); /* negate the sequence */ - H5T_bit_neg (vector, offset, size); + H5T__bit_neg (vector, offset, size); /* Look for the ones */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); if ((size_t)n!=offset) { H5_FAILED(); printf (" Unable to find first bit in destination " @@ -613,7 +613,7 @@ test_negate (void) * Look for zeros and ones in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); if (n!=(ssize_t)(offset+size-1)) { H5_FAILED(); printf (" Unable to find last bit in destination " @@ -623,13 +623,13 @@ test_negate (void) /* All-one sequence will become 000000(size=6) after negating */ memset (vector, 0x00, sizeof vector); - H5T_bit_set (vector, offset, size, 1); + H5T__bit_set (vector, offset, size, 1); /* negate the sequence */ - H5T_bit_neg (vector, offset, size); + H5T__bit_neg (vector, offset, size); /* Look for the ones */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); if (n>=0) { H5_FAILED(); printf (" Unable to verify all-zero bits in destination " @@ -641,7 +641,7 @@ test_negate (void) * Look for ones in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); if (n>=0) { H5_FAILED(); printf (" Unable to verify all-zero bits in destination " @@ -695,7 +695,7 @@ test_set (void) memset (v2, 0x00, sizeof v2); /* Set some bits in v2 */ - H5T_bit_set (v2, d_offset, size, TRUE); + H5T__bit_set (v2, d_offset, size, TRUE); for (j=0; j<(int)sizeof(v2); j++) if (v2[j]) break; if (size>0 && j>=(int)sizeof(v2)) { H5_FAILED(); @@ -710,7 +710,7 @@ test_set (void) /* Look for the zeros and ones */ - n = H5T_bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 1); + n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 1); if (size>0 && n!=(ssize_t)d_offset) { H5_FAILED(); printf (" Unable to find first set bit in destination " @@ -722,7 +722,7 @@ test_set (void) puts (" Found set bits and shouldn't have!"); goto failed; } - n = H5T_bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 0); + n = H5T__bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 0); if (d_offset+size<8*sizeof(v2) && n!=(ssize_t)size) { H5_FAILED(); printf (" Unable to find last set bit in destination " @@ -739,7 +739,7 @@ test_set (void) * Look for zeros and ones in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 1); + n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 1); if (size>0 && (size_t)(n+1)!=d_offset+size) { H5_FAILED(); printf (" Unable to find last set bit in destination " @@ -751,7 +751,7 @@ test_set (void) puts (" Found set bits but shouldn't have (reverse)!"); goto failed; } - n = H5T_bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 0); + n = H5T__bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 0); if (d_offset>0 && n+1!=(ssize_t)d_offset) { H5_FAILED(); printf (" Unable to find beginning of set bit region " @@ -812,7 +812,7 @@ test_clear (void) memset (v2, 0xff, sizeof v2); /* Clear some bits in v2 */ - H5T_bit_set (v2, d_offset, size, FALSE); + H5T__bit_set (v2, d_offset, size, FALSE); for (j=0; j<(int)sizeof(v2); j++) if (0xff!=v2[j]) break; if (size>0 && j>=(int)sizeof(v2)) { H5_FAILED(); @@ -827,7 +827,7 @@ test_clear (void) /* Look for the zeros and ones */ - n = H5T_bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 0); + n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 0); if (size>0 && n!=(ssize_t)d_offset) { H5_FAILED(); printf (" Unable to find first cleared bit in destination " @@ -839,7 +839,7 @@ test_clear (void) puts (" Found cleared bits and shouldn't have!"); goto failed; } - n = H5T_bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 1); + n = H5T__bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 1); if (d_offset+size<8*sizeof(v2) && n!=(ssize_t)size) { H5_FAILED(); printf (" Unable to find last cleared bit in destination " @@ -856,7 +856,7 @@ test_clear (void) * Look for zeros and ones in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 0); + n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 0); if (size>0 && (size_t)(n+1)!=d_offset+size) { H5_FAILED(); printf (" Unable to find last cleared bit in destination " @@ -868,7 +868,7 @@ test_clear (void) puts (" Found cleared bits but shouldn't have (reverse)!"); goto failed; } - n = H5T_bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 1); + n = H5T__bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 1); if (d_offset>0 && n+1!=(ssize_t)d_offset) { H5_FAILED(); printf (" Unable to find beginning of cleared bit region " diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index d7f7842..433c488 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -2183,7 +2183,7 @@ main (int argc, char *argv[]) fprintf(stderr, "usage: %s [--noopt]\n", argv[0]); exit(1); } - H5Tunregister(H5T_PERS_DONTCARE, NULL, -1, -1, H5T_conv_struct_opt); + H5Tunregister(H5T_PERS_DONTCARE, NULL, -1, -1, H5T__conv_struct_opt); } /* Create the file */ diff --git a/test/dsets.c b/test/dsets.c index 898782d..88e41f7 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -6779,7 +6779,7 @@ test_zero_dims(hid_t file) if((d = H5Dcreate2(file, ZERODIM_DATASET, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Get the chunk index type */ - if(H5D_layout_idx_type_test(d, &idx_type) < 0) FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(d, &idx_type) < 0) FAIL_STACK_ERROR /* Verify index type */ if(low == H5F_LIBVER_LATEST) { @@ -6829,7 +6829,7 @@ test_zero_dims(hid_t file) if((d2 = H5Dcreate2(file, ZERODIM_DATASET2, H5T_NATIVE_INT, s2, H5P_DEFAULT, dcpl2, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Get the chunk index type */ - if(H5D_layout_idx_type_test(d2, &idx_type) < 0) FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(d2, &idx_type) < 0) FAIL_STACK_ERROR /* Verify index type */ if(low == H5F_LIBVER_LATEST) { @@ -6948,8 +6948,8 @@ test_missing_chunk(hid_t file) if((did2 = H5Dcreate2(file, MISSING_CHUNK_DATASET2, H5T_NATIVE_INT, sid2, H5P_DEFAULT, dcpl2, H5P_DEFAULT)) < 0) TEST_ERROR; /* Get the chunk index types */ - if(H5D_layout_idx_type_test(d, &idx_type) < 0) TEST_ERROR; - if(H5D_layout_idx_type_test(did2, &idx_type2) < 0) TEST_ERROR; + if(H5D__layout_idx_type_test(d, &idx_type) < 0) TEST_ERROR; + if(H5D__layout_idx_type_test(did2, &idx_type2) < 0) TEST_ERROR; /* Verify index type */ if(low == H5F_LIBVER_LATEST) { @@ -7149,7 +7149,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl) if((d = H5Dopen2(file, dname, H5P_DEFAULT)) < 0) TEST_ERROR; /* Get the chunk index type */ - if(H5D_layout_idx_type_test(d, &idx_type) < 0) TEST_ERROR; + if(H5D__layout_idx_type_test(d, &idx_type) < 0) TEST_ERROR; /* Verify index type */ if(low == H5F_LIBVER_LATEST) { @@ -7211,7 +7211,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl) if((d = H5Dcreate2(file, dname, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR; /* Get the chunk index type */ - if(H5D_layout_idx_type_test(d, &idx_type) < 0) TEST_ERROR; + if(H5D__layout_idx_type_test(d, &idx_type) < 0) TEST_ERROR; /* Verify index type */ if(low == H5F_LIBVER_LATEST) { @@ -7311,7 +7311,7 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl) if((d = H5Dcreate2(file, dname, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR; /* Get the chunk index type */ - if(H5D_layout_idx_type_test(d, &idx_type) < 0) TEST_ERROR; + if(H5D__layout_idx_type_test(d, &idx_type) < 0) TEST_ERROR; /* Verify index type */ if(low == H5F_LIBVER_LATEST) { @@ -8080,8 +8080,8 @@ test_big_chunks_bypass_cache(hid_t fapl) FAIL_STACK_ERROR /* Get the chunk index types for 1-D and 2-d datasets */ - if(H5D_layout_idx_type_test(dsid, &idx_type) < 0) FAIL_STACK_ERROR - if(H5D_layout_idx_type_test(t_dsid, &t_idx_type) < 0) FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(dsid, &idx_type) < 0) FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(t_dsid, &t_idx_type) < 0) FAIL_STACK_ERROR /* Chunk index type expected depends on whether we are using the latest version of the format */ if(low == H5F_LIBVER_LATEST) { @@ -8392,7 +8392,7 @@ test_chunk_fast(hid_t fapl) FAIL_STACK_ERROR /* Get the chunk index type */ - if(H5D_layout_idx_type_test(dsid, &idx_type) < 0) FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(dsid, &idx_type) < 0) FAIL_STACK_ERROR /* Chunk index type expected depends on whether we are using the latest version of the format */ if(low == H5F_LIBVER_LATEST) { @@ -8501,7 +8501,7 @@ test_chunk_fast(hid_t fapl) if((dsid = H5Dopen2(fid, "dset", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Get the chunk index type */ - if(H5D_layout_idx_type_test(dsid, &idx_type) < 0) FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(dsid, &idx_type) < 0) FAIL_STACK_ERROR /* Chunk index tyepe expected depends on whether we are using the latest version of the format */ if(low == H5F_LIBVER_LATEST) { @@ -9000,8 +9000,8 @@ test_chunk_expand(hid_t fapl) FAIL_STACK_ERROR /* Get the chunk index type */ - if(H5D_layout_idx_type_test(dsid, &idx_type) < 0) FAIL_STACK_ERROR - if(H5D_layout_idx_type_test(dsid2, &idx_type2) < 0) FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(dsid, &idx_type) < 0) FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(dsid2, &idx_type2) < 0) FAIL_STACK_ERROR /* Chunk index type expected depends on whether we are using the latest version of the format */ if(low == H5F_LIBVER_LATEST) { @@ -9164,8 +9164,8 @@ test_chunk_expand(hid_t fapl) if((dsid2 = H5Dopen2(fid, "dset2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Get the chunk index type for the two datasets */ - if(H5D_layout_idx_type_test(dsid, &idx_type) < 0) FAIL_STACK_ERROR - if(H5D_layout_idx_type_test(dsid2, &idx_type2) < 0) FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(dsid, &idx_type) < 0) FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(dsid2, &idx_type2) < 0) FAIL_STACK_ERROR /* Chunk index type expected depends on whether we are using the latest version of the format */ if(low == H5F_LIBVER_LATEST) { @@ -9436,7 +9436,7 @@ test_fixed_array(hid_t fapl) FAIL_PUTS_ERROR(" Creating Chunked Dataset with maximum dimensions.") /* Get the chunk index type */ - if(H5D_layout_idx_type_test(dsid_max, &idx_type) < 0) FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(dsid_max, &idx_type) < 0) FAIL_STACK_ERROR /* Chunk index type depends on whether we are using the latest version of the format */ if(low == H5F_LIBVER_LATEST) { @@ -9474,7 +9474,7 @@ test_fixed_array(hid_t fapl) FAIL_PUTS_ERROR(" Creating Chunked Dataset.") /* Get the chunk index type */ - if(H5D_layout_idx_type_test(dsid, &idx_type) < 0) FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(dsid, &idx_type) < 0) FAIL_STACK_ERROR /* Chunk index type depends on whether we are using the latest version of the format */ if(low == H5F_LIBVER_LATEST) { @@ -9510,7 +9510,7 @@ test_fixed_array(hid_t fapl) FAIL_PUTS_ERROR(" Creating Big Chunked Dataset.") /* Get the chunk index type */ - if(H5D_layout_idx_type_test(dsid_big, &idx_type) < 0) FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(dsid_big, &idx_type) < 0) FAIL_STACK_ERROR /* Chunk index type depends on whether we are using the latest version of the format */ if(low == H5F_LIBVER_LATEST) { @@ -9712,7 +9712,7 @@ test_idx_compatible(void) TEST_ERROR /* Get the chunk index type */ - if(H5D_layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR /* Verify index type */ if(idx_type != H5D_CHUNK_IDX_BTREE) @@ -9725,7 +9725,7 @@ test_idx_compatible(void) TEST_ERROR /* Get the chunk index type */ - if(H5D_layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR + if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR /* Verify index type */ if(idx_type != H5D_CHUNK_IDX_BTREE) diff --git a/test/dt_arith.c b/test/dt_arith.c index 054f069..0001755 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -306,9 +306,9 @@ static int without_hardware_g = 0; *00000111,..., until 11111111.*/ \ memset(tmp1, 0, SRC_SIZE); \ memset(tmp2, 0, SRC_SIZE); \ - H5T_bit_set (tmp2, SRC_PREC-1, (size_t)1, TRUE); /*the negative value*/ \ + H5T__bit_set (tmp2, SRC_PREC-1, (size_t)1, TRUE); /*the negative value*/ \ for(n=0; n<SRC_MANT_DIG-1; n++) { \ - H5T_bit_set (tmp1, n, (size_t)1, TRUE); /*turn on 1 bit each time*/ \ + H5T__bit_set (tmp1, n, (size_t)1, TRUE); /*turn on 1 bit each time*/ \ CHANGE_ORDER(tmp1, SRC_ORDR, SRC_SIZE); /*change order for big endian*/ \ memcpy(buf_p, tmp1, SRC_SIZE); \ memcpy(saved_p, tmp1, SRC_SIZE); \ @@ -317,7 +317,7 @@ static int without_hardware_g = 0; saved_p += SRC_SIZE; \ \ /*negative values*/ \ - H5T_bit_set (tmp2, n, (size_t)1, TRUE); \ + H5T__bit_set (tmp2, n, (size_t)1, TRUE); \ CHANGE_ORDER(tmp2, SRC_ORDR, SRC_SIZE); \ memcpy(buf_p, tmp2, SRC_SIZE); \ memcpy(saved_p, tmp2, SRC_SIZE); \ @@ -353,7 +353,7 @@ static int without_hardware_g = 0; buf_p = BUF; \ \ /* +0 */ \ - H5T_bit_set(value, (size_t)0, SRC_PREC, FALSE); \ + H5T__bit_set(value, (size_t)0, SRC_PREC, FALSE); \ memcpy(buf_p, value, SRC_SIZE*sizeof(unsigned char)); \ buf_p += SRC_SIZE; \ \ @@ -361,7 +361,7 @@ static int without_hardware_g = 0; if(n==1) { \ memset(value, 0, SRC_SIZE*sizeof(unsigned char)); \ /* -0 */ \ - H5T_bit_set(value, (size_t)(SRC_PREC - 1), (size_t)1, TRUE); \ + H5T__bit_set(value, (size_t)(SRC_PREC - 1), (size_t)1, TRUE); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE);/*change order for big endian*/ \ HDmemcpy(buf_p, value, SRC_SIZE*sizeof(unsigned char)); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE);/*change back the order for bit operation*/ \ @@ -369,21 +369,21 @@ static int without_hardware_g = 0; } \ \ /* +/-infinity */ \ - H5T_bit_set(value, (size_t)(SRC_MANT_DIG - 1), SRC_PREC-SRC_MANT_DIG, TRUE); \ + H5T__bit_set(value, (size_t)(SRC_MANT_DIG - 1), SRC_PREC-SRC_MANT_DIG, TRUE); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change order for big endian*/ \ HDmemcpy(buf_p, value, SRC_SIZE*sizeof(unsigned char)); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change back the order for bit operation*/ \ buf_p += SRC_SIZE; \ \ /* +/-SNaN */ \ - H5T_bit_set(value, (size_t)0, (size_t)1, TRUE); \ + H5T__bit_set(value, (size_t)0, (size_t)1, TRUE); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change order for big endian*/ \ HDmemcpy(buf_p, value, SRC_SIZE * sizeof(unsigned char)); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change back the order for bit operation*/ \ buf_p += SRC_SIZE; \ \ /* +/-QNaN */ \ - H5T_bit_set(value, (size_t)(SRC_MANT_DIG - 2), (size_t)1, TRUE); \ + H5T__bit_set(value, (size_t)(SRC_MANT_DIG - 2), (size_t)1, TRUE); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change order for big endian*/ \ HDmemcpy(buf_p, value, SRC_SIZE*sizeof(unsigned char)); \ CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change back the order for bit operation*/ \ @@ -634,7 +634,7 @@ test_hard_query(void) /* Unregister the hard conversion from int to float. Verify the conversion * is a soft conversion. */ - H5Tunregister(H5T_PERS_HARD, NULL, H5T_NATIVE_INT, H5T_NATIVE_FLOAT, H5T_conv_int_float); + H5Tunregister(H5T_PERS_HARD, NULL, H5T_NATIVE_INT, H5T_NATIVE_FLOAT, H5T__conv_int_float); if(H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != FALSE) { H5_FAILED(); printf("Can't query conversion function\n"); @@ -643,7 +643,7 @@ test_hard_query(void) /* Register the hard conversion from int to float. Verify the conversion * is a hard conversion. */ - H5Tregister(H5T_PERS_HARD, "int_flt", H5T_NATIVE_INT, H5T_NATIVE_FLOAT, H5T_conv_int_float); + H5Tregister(H5T_PERS_HARD, "int_flt", H5T_NATIVE_INT, H5T_NATIVE_FLOAT, H5T__conv_int_float); if(H5Tcompiler_conv(H5T_NATIVE_INT, H5T_NATIVE_FLOAT) != TRUE) { H5_FAILED(); printf("Can't query conversion function\n"); @@ -2337,92 +2337,92 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) */ if (H5T_SGN_2==src_sign && H5T_SGN_2==dst_sign) { if (src_nbits>dst_nbits) { - if(0==H5T_bit_get_d(src_bits, src_nbits-1, (size_t)1) && - H5T_bit_find(src_bits, dst_nbits-1, (src_nbits-dst_nbits), + if(0==H5T__bit_get_d(src_bits, src_nbits-1, (size_t)1) && + H5T__bit_find(src_bits, dst_nbits-1, (src_nbits-dst_nbits), H5T_BIT_MSB, 1)>=0) { /* * Source is positive and the magnitude is too large for * the destination. The destination should be set to the * maximum possible value: 0x7f...f */ - if (0==H5T_bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && - H5T_bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 0) < 0) + if (0==H5T__bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && + H5T__bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 0) < 0) continue; /*no error*/ - } else if (1==H5T_bit_get_d(src_bits, src_nbits-1, (size_t)1) && - H5T_bit_find(src_bits, (size_t)0, src_nbits-1, H5T_BIT_MSB, + } else if (1==H5T__bit_get_d(src_bits, src_nbits-1, (size_t)1) && + H5T__bit_find(src_bits, (size_t)0, src_nbits-1, H5T_BIT_MSB, 0)+1>=(ssize_t)dst_nbits) { /* * Source is negative but the magnitude is too large for * the destination. The destination should be set to the * smallest possible value: 0x80...0 */ - if (1==H5T_bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && - H5T_bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 1) < 0) + if (1==H5T__bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && + H5T__bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 1) < 0) continue; /*no error*/ } } else if(src_nbits<dst_nbits) { /* Source is smaller than the destination */ - if(0==H5T_bit_get_d(src_bits, src_nbits-1, (size_t)1)) { + if(0==H5T__bit_get_d(src_bits, src_nbits-1, (size_t)1)) { /* * Source is positive, so the excess bits in the * destination should be set to 0's. */ - if (0==H5T_bit_get_d(dst_bits, src_nbits-1, (size_t)1) && - H5T_bit_find(dst_bits, src_nbits, dst_nbits-src_nbits, H5T_BIT_LSB, 1) < 0) + if (0==H5T__bit_get_d(dst_bits, src_nbits-1, (size_t)1) && + H5T__bit_find(dst_bits, src_nbits, dst_nbits-src_nbits, H5T_BIT_LSB, 1) < 0) continue; /*no error*/ } else { /* * Source is negative, so the excess bits in the * destination should be set to 1's. */ - if (1==H5T_bit_get_d(dst_bits, src_nbits-1, (size_t)1) && - H5T_bit_find(dst_bits, src_nbits, dst_nbits-src_nbits, H5T_BIT_LSB, 0) < 0) + if (1==H5T__bit_get_d(dst_bits, src_nbits-1, (size_t)1) && + H5T__bit_find(dst_bits, src_nbits, dst_nbits-src_nbits, H5T_BIT_LSB, 0) < 0) continue; /*no error*/ } } } else if (H5T_SGN_2==src_sign && H5T_SGN_NONE==dst_sign) { - if (H5T_bit_get_d(src_bits, src_nbits-1, (size_t)1)) { + if (H5T__bit_get_d(src_bits, src_nbits-1, (size_t)1)) { /* * The source is negative so the result should be zero. * The source is negative if the most significant bit is * set. The destination is zero if all bits are zero. */ - if (H5T_bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 1) < 0) + if (H5T__bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 1) < 0) continue; /*no error*/ } else if (src_nbits>dst_nbits && - H5T_bit_find(src_bits, dst_nbits-1, + H5T__bit_find(src_bits, dst_nbits-1, src_nbits-dst_nbits, H5T_BIT_LSB, 1)>=0) { /* * The source is a value with a magnitude too large for * the destination. The destination should be the * largest possible value: 0xff...f */ - if (H5T_bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 0) < 0) + if (H5T__bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 0) < 0) continue; /*no error*/ } } else if (H5T_SGN_NONE==src_sign && H5T_SGN_2==dst_sign) { if (src_nbits>=dst_nbits && - H5T_bit_find(src_bits, dst_nbits-1, (src_nbits-dst_nbits)+1, + H5T__bit_find(src_bits, dst_nbits-1, (src_nbits-dst_nbits)+1, H5T_BIT_LSB, 1)>=0) { /* * The source value has a magnitude that is larger than * the destination can handle. The destination should be * set to the largest possible positive value: 0x7f...f */ - if (0==H5T_bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && - H5T_bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 0) < 0) + if (0==H5T__bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && + H5T__bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 0) < 0) continue; /*no error*/ } } else { if (src_nbits>dst_nbits && - H5T_bit_find(src_bits, dst_nbits, src_nbits-dst_nbits, + H5T__bit_find(src_bits, dst_nbits, src_nbits-dst_nbits, H5T_BIT_LSB, 1)>=0) { /* * The unsigned source has a value which is too large for * the unsigned destination. The destination should be * set to the largest possible value: 0xff...f */ - if (H5T_bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 0) < 0) + if (H5T__bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 0) < 0) continue; /*no error*/ } } @@ -2610,8 +2610,8 @@ error: /*------------------------------------------------------------------------- * Function: test_conv_int_2 * - * Purpose: Tests overlap calculates in H5T_conv_i_i(), which should be - * the same as for H5T_conv_f_f() and H5T_conv_s_s(). + * Purpose: Tests overlap calculates in H5T__conv_i_i(), which should be + * the same as for H5T__conv_f_f() and H5T__conv_s_s(). * * Return: Success: 0 * @@ -2648,7 +2648,7 @@ test_conv_int_2(void) /* * Conversion. If overlap calculations aren't right then an - * assertion will fail in H5T_conv_i_i() + * assertion will fail in H5T__conv_i_i() */ H5Tconvert(src_type, dst_type, (size_t)100, buf, NULL, H5P_DEFAULT); H5Tclose(src_type); @@ -2788,8 +2788,8 @@ my_isinf(int endian, unsigned char *val, size_t size, bits[size-(i+1)] = *(val + ENDIAN(size, i, endian)); #endif /*H5_VMS*/ - if(H5T_bit_find(bits, mpos, msize, H5T_BIT_LSB, 1) < 0 && - H5T_bit_find(bits, epos, esize, H5T_BIT_LSB, 0) < 0) + if(H5T__bit_find(bits, mpos, msize, H5T_BIT_LSB, 1) < 0 && + H5T__bit_find(bits, epos, esize, H5T_BIT_LSB, 0) < 0) retval = 1; free(bits); @@ -3321,7 +3321,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) } } - expo = H5T_bit_get_d(tmp, src_epos, src_esize); + expo = H5T__bit_get_d(tmp, src_epos, src_esize); if(expo==0) continue; /* Denormalized floating-point value detected */ else { @@ -3341,7 +3341,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) } } - expo = H5T_bit_get_d(tmp, dst_epos, dst_esize); + expo = H5T__bit_get_d(tmp, dst_epos, dst_esize); if(expo==0) continue; /* Denormalized floating-point value detected */ else { @@ -4348,7 +4348,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) ) && (INT_SCHAR==dst_type || INT_SHORT==dst_type || INT_INT==dst_type || INT_LONG==dst_type || INT_LLONG==dst_type)) { - if(0==H5T_bit_get_d(src_bits, src_nbits-1, (size_t)1) && + if(0==H5T__bit_get_d(src_bits, src_nbits-1, (size_t)1) && overflows(src_bits, src, dst_nbits-1)) { /* * Source is positive and the magnitude is too large for @@ -4356,15 +4356,15 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) * maximum possible value: 0x7f...f */ if(!except_set) { - if (0==H5T_bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && - H5T_bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 0) < 0) + if (0==H5T__bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && + H5T__bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 0) < 0) continue; /*no error*/ } else { /* fill_value is small so we know only the 1st byte is set */ if (dst_bits[0] == fill_value) continue; /*no error*/ } - } else if (1==H5T_bit_get_d(src_bits, src_nbits-1, (size_t)1) && + } else if (1==H5T__bit_get_d(src_bits, src_nbits-1, (size_t)1) && overflows(src_bits, src, dst_nbits-1)) { /* * Source is negative but the magnitude is too large for @@ -4372,8 +4372,8 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) * smallest possible value: 0x80...0 */ if(!except_set) { - if (1==H5T_bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && - H5T_bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 1) < 0) + if (1==H5T__bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && + H5T__bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 1) < 0) continue; /*no error*/ } else { if (dst_bits[0] == fill_value) @@ -4389,14 +4389,14 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) ) && (INT_UCHAR==dst_type || INT_USHORT==dst_type || INT_UINT==dst_type || INT_ULONG==dst_type || INT_ULLONG==dst_type)) { - if (H5T_bit_get_d(src_bits, src_nbits-1, (size_t)1)) { + if (H5T__bit_get_d(src_bits, src_nbits-1, (size_t)1)) { /* * The source is negative so the result should be zero. * The source is negative if the most significant bit is * set. The destination is zero if all bits are zero. */ if(!except_set) { - if (H5T_bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 1) < 0) + if (H5T__bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 1) < 0) continue; /*no error*/ } else { if (dst_bits[0] == fill_value) @@ -4409,7 +4409,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) * largest possible value: 0xff...f */ if(!except_set) { - if (H5T_bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 0) < 0) + if (H5T__bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 0) < 0) continue; /*no error*/ } else { if (dst_bits[0] == fill_value) @@ -4757,13 +4757,13 @@ overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits) HDmemcpy(bits, origin_bits, src_prec/8+1); /*Check for special cases: +Inf, -Inf*/ - if (H5T_bit_find (bits, mpos, mant_digits, H5T_BIT_LSB, TRUE) < 0) { - if (H5T_bit_find (bits, epos, expt_digits, H5T_BIT_LSB, FALSE) < 0) { + if (H5T__bit_find (bits, mpos, mant_digits, H5T_BIT_LSB, TRUE) < 0) { + if (H5T__bit_find (bits, epos, expt_digits, H5T_BIT_LSB, FALSE) < 0) { ret_value=TRUE; goto done; } - } else if (H5T_NORM_NONE==norm && H5T_bit_find (bits, mpos, mant_digits-1, - H5T_BIT_LSB, TRUE) < 0 && H5T_bit_find (bits, epos, expt_digits, + } else if (H5T_NORM_NONE==norm && H5T__bit_find (bits, mpos, mant_digits-1, + H5T_BIT_LSB, TRUE) < 0 && H5T__bit_find (bits, epos, expt_digits, H5T_BIT_LSB, FALSE) < 0) { /*This is a special case for the source of no implied mantissa bit. *If the exponent bits are all 1s and only the 1st bit of mantissa @@ -4773,7 +4773,7 @@ overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits) } /* get exponent */ - expt = H5T_bit_get_d(bits, mant_digits, expt_digits) - bias; + expt = H5T__bit_get_d(bits, mant_digits, expt_digits) - bias; if(expt>=(dst_num_bits-1)) { ret_value=TRUE; @@ -4781,19 +4781,19 @@ overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits) } /* get significand */ - H5T_bit_copy (mant_bits, (size_t)0, bits, (size_t)0, mant_digits); + H5T__bit_copy (mant_bits, (size_t)0, bits, (size_t)0, mant_digits); /* restore implicit bit if normalization is implied*/ if(norm == H5T_NORM_IMPLIED) { - H5T_bit_inc(mant_bits, mant_digits, (size_t)1); + H5T__bit_inc(mant_bits, mant_digits, (size_t)1); mant_digits++; } /* shift significand */ - H5T_bit_shift (mant_bits, (ssize_t)(expt-expt_digits), (size_t)0, (size_t)(32 * 8)); + H5T__bit_shift (mant_bits, (ssize_t)(expt-expt_digits), (size_t)0, (size_t)(32 * 8)); - indx = H5T_bit_find(mant_bits, (size_t)0, (size_t)(32 * 8), H5T_BIT_MSB, 1); + indx = H5T__bit_find(mant_bits, (size_t)0, (size_t)(32 * 8), H5T_BIT_MSB, 1); if((size_t)indx>=dst_num_bits) ret_value=TRUE; diff --git a/test/dtypes.c b/test/dtypes.c index 23a7bac..3db9bf8 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -3964,6 +3964,9 @@ test_str_create(void) if((query_size = H5Tget_size(fixed_str2)) == 0) goto error; if(query_size != str_size) goto error; + if(H5Tclose(fixed_str1) < 0) goto error; + if(H5Tclose(fixed_str2) < 0) goto error; + /* Create variable-length string in two ways and make sure they are the same */ if((vlen_str1 = mkstr((size_t)H5T_VARIABLE, H5T_STR_NULLTERM)) < 0) goto error; @@ -3978,6 +3981,8 @@ test_str_create(void) if((is_vl_str = H5Tis_variable_str(vlen_str2)) < 0) goto error; if(!is_vl_str) goto error; + if(H5Tclose(vlen_str1) < 0) goto error; + if(H5Tclose(vlen_str2) < 0) goto error; PASSED(); return 0; diff --git a/test/external.c b/test/external.c index 1dedeab..ae1008c 100644 --- a/test/external.c +++ b/test/external.c @@ -111,6 +111,7 @@ test_1a(hid_t file) char name[256]; /*external file name */ off_t file_offset; /*external file offset */ hsize_t file_size; /*sizeof external file segment */ + haddr_t dset_addr; /*address of dataset */ TESTING("fixed-size data space, exact storage"); @@ -130,7 +131,10 @@ test_1a(hid_t file) if((dset = H5Dopen2(file, "dset1", H5P_DEFAULT)) < 0) goto error; /* Test dataset address. Should be undefined. */ - if(H5Dget_offset(dset) != HADDR_UNDEF) goto error; + H5E_BEGIN_TRY { + dset_addr = H5Dget_offset(dset); + } H5E_END_TRY; + if(dset_addr != HADDR_UNDEF) goto error; if((dcpl = H5Dget_create_plist(dset)) < 0) goto error; if((n = H5Pget_external_count(dcpl)) < 0) goto error; diff --git a/test/file_image.c b/test/file_image.c index 7c2c3ff..73c901e 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -108,7 +108,7 @@ test_properties(void) buffer = (char *)HDmalloc(size); for(i = 0; i < count - 1; i++) buffer[i] = (char)(65 + i); - buffer[count] = '\0'; + buffer[count - 1] = '\0'; /* Create fapl */ if((fapl_1 = H5Pcreate(H5P_FILE_ACCESS)) < 0) FAIL_STACK_ERROR @@ -324,7 +324,7 @@ static int test_callbacks(void) { H5FD_file_image_callbacks_t real_callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb, - &free_cb, &udata_copy_cb, &udata_free_cb, NULL}; + &free_cb, &udata_copy_cb, &udata_free_cb, NULL}; H5FD_file_image_callbacks_t null_callbacks = {NULL, NULL, NULL, NULL, NULL, NULL, NULL}; H5FD_file_image_callbacks_t callbacks; hid_t fapl_1; @@ -351,7 +351,7 @@ test_callbacks(void) file_image = (char *)HDmalloc(size); for(i = 0; i < count - 1; i++) file_image[i] = (char)(65 + i); - file_image[count] = '\0'; + file_image[count - 1] = '\0'; /* Create fapl */ if((fapl_1 = H5Pcreate(H5P_FILE_ACCESS)) < 0) FAIL_STACK_ERROR @@ -519,7 +519,7 @@ test_core(void) udata_t *udata; unsigned char *file_image; char filename[1024]; - char src_dir_filename[1024]; + char copied_filename[1024]; const char *tmp = NULL; size_t size; hsize_t dims[2]; @@ -527,7 +527,7 @@ test_core(void) h5_stat_t sb; herr_t ret; H5FD_file_image_callbacks_t callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb, - &free_cb, &udata_copy_cb, &udata_free_cb, NULL}; + &free_cb, &udata_copy_cb, &udata_free_cb, NULL}; TESTING("Initial file image and callbacks in Core VFD"); @@ -542,16 +542,15 @@ test_core(void) tmp = h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); VERIFY(tmp != NULL, "h5_fixname failed"); - /* convert file name to srcdir file name. Make a copy as - * H5_get_srcdir_filename() simply sets up the file name in its - * own buffer each time it is called -- overwriting the previous - * value. - */ - tmp = H5_get_srcdir_filename(filename); - VERIFY(tmp != NULL, "H5_get_srcdir_filename failed"); - VERIFY(strlen(tmp) < 1023, "srcdir file name too long."); - HDstrncpy(src_dir_filename, tmp, 1023); - src_dir_filename[1023] = '\0'; + /* Append ".copy" to the filename from the source directory */ + VERIFY(HDstrlen(filename) < (1023 - 5), "file name too long."); + HDstrncpy(copied_filename, filename, 1023); + copied_filename[1023] = '\0'; + HDstrcat(copied_filename, ".copy"); + + /* Make a copy of the data file from svn. */ + ret = h5_make_local_copy(filename, copied_filename); + VERIFY(ret >= 0, "h5_make_local_copy"); /* Allocate and initialize udata */ udata = (udata_t *)HDmalloc(sizeof(udata_t)); @@ -566,7 +565,7 @@ test_core(void) /* Test open (no file image) */ reset_udata(udata); - file = H5Fopen(src_dir_filename, H5F_ACC_RDWR, fapl); + file = H5Fopen(copied_filename, H5F_ACC_RDONLY, fapl); VERIFY(file >= 0, "H5Fopen failed"); VERIFY(udata->used_callbacks == MALLOC, "opening a core file used the wrong callbacks"); VERIFY(udata->malloc_src == H5FD_FILE_IMAGE_OP_FILE_OPEN, "Malloc callback came from wrong sourc in core open"); @@ -579,7 +578,7 @@ test_core(void) VERIFY(udata->free_src == H5FD_FILE_IMAGE_OP_FILE_CLOSE, "Free callback came from wrong sourc in core close"); /* Reopen file */ - file = H5Fopen(src_dir_filename, H5F_ACC_RDWR, fapl); + file = H5Fopen(copied_filename, H5F_ACC_RDWR, fapl); VERIFY(file >= 0, "H5Fopen failed"); /* Set up a new dset */ @@ -613,7 +612,7 @@ test_core(void) VERIFY(udata->free_src == H5FD_FILE_IMAGE_OP_FILE_CLOSE, "Free callback came from wrong sourc in core close"); /* Create file image buffer */ - fd = HDopen(src_dir_filename, O_RDONLY, 0666); + fd = HDopen(copied_filename, O_RDONLY, 0666); VERIFY(fd > 0, "open failed"); ret = HDfstat(fd, &sb); VERIFY(ret == 0, "fstat failed"); @@ -627,13 +626,14 @@ test_core(void) if(H5Pset_file_image(fapl, file_image, size) < 0) FAIL_STACK_ERROR /* Test open with file image */ - if((file = H5Fopen("dne.h5", H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + if((file = H5Fopen("dne.h5", H5F_ACC_RDONLY, fapl)) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Release resources */ h5_cleanup(FILENAME, fapl); HDfree(udata); HDfree(file_image); + HDremove(copied_filename); PASSED(); @@ -786,10 +786,10 @@ test_get_file_image(const char * test_banner, VERIFY(fd >= 0, "HDopen() failed."); if(size_remaining >= FAMILY_SIZE ){ - bytes_to_read = FAMILY_SIZE; + bytes_to_read = FAMILY_SIZE; size_remaining -= FAMILY_SIZE; } else { - bytes_to_read = size_remaining; + bytes_to_read = size_remaining; size_remaining = 0; } @@ -816,7 +816,7 @@ test_get_file_image(const char * test_banner, */ file_size = (ssize_t)stat_buf.st_size; - /* with latest mods to truncate call in core file drive, + /* with latest mods to truncate call in core file drive, * file size should match image size */ VERIFY(file_size == image_size, "file size != image size."); @@ -940,9 +940,9 @@ test_get_file_image_error_rejection(void) * Since we have already done the necessary setup, verify that * H5Fget_file_image() will fail with: * - * bad file id, or + * bad file id, or * - * good id, but not a file id + * good id, but not a file id */ @@ -3184,8 +3184,13 @@ error: * To verify that a block can be extended from the aggregator * * Test 1: Allocate block A from meta_aggr which is at end of file - * Try to extend a block which adjoins the aggregator - * H5MF_try_extend() succeeds: meta_aggr is extended by extended-request and meta_aggr's info is updated + * Try to extend the block which adjoins the aggregator that is at end of file + * a. block size < (% * aggr->alloc_size) + * The block is allocated from the aggregator + * b. block size > (% * aggr->alloc_size) but block size < aggr->alloc_size + * The block is extended by aggr->alloc_size and the block is allocated from the aggregator + * c. block size > (% * aggr->alloc_size) but block size > aggr->alloc_size + * The block is extended by extended-request and the block is allocated from the aggregator * * Test 2: Allocate block A from meta_aggr * Allocate block B from sdata_aggr so that meta_aggr is not at end of file @@ -3252,7 +3257,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) new_addr = addr - 10; - /* Try to extend the block */ + /* Try to extend the block by an amount < (% * aggr->alloc_size) */ extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE50)); /* should succeed */ @@ -3263,15 +3268,42 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) if (new_ma_addr != (addr+TEST_BLOCK_SIZE50)) TEST_ERROR - if (new_ma_size != f->shared->meta_aggr.alloc_size) TEST_ERROR + if (new_ma_size != (f->shared->meta_aggr.alloc_size - TEST_BLOCK_SIZE50)) TEST_ERROR - /* Restore info for meta_aggr */ - f->shared->meta_aggr.addr = ma_addr; - f->shared->meta_aggr.size = ma_size; + /* Free the allocated blocks */ + H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE50); + + /* Try to extend the block by an amount > (% * aggr->alloc_size) but amount < aggr->alloc_size */ + extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE700)); + + /* should succeed */ + if(!extended) + TEST_ERROR + + H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + + if (new_ma_addr != (addr + TEST_BLOCK_SIZE700)) + TEST_ERROR + if (new_ma_size != (f->shared->meta_aggr.alloc_size * 2 - TEST_BLOCK_SIZE700)) TEST_ERROR /* Free the allocated blocks */ - H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30); - H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, (ma_addr+ma_size), (hsize_t)TEST_BLOCK_SIZE50); + H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE700); + + /* Try to extend the block by an amount > (% * aggr->alloc_size) but amount > aggr->alloc_size */ + extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE2058)); + + /* should succeed */ + if(!extended) + TEST_ERROR + + H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + + if (new_ma_addr != (addr + TEST_BLOCK_SIZE2058)) + TEST_ERROR + if (new_ma_size != f->shared->meta_aggr.size) TEST_ERROR + + /* Free the allocated blocks */ + H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE2058); if(H5Fclose(file) < 0) FAIL_STACK_ERROR diff --git a/test/objcopy.c b/test/objcopy.c index f5555e8..2270d19 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -1567,7 +1567,7 @@ compare_idx_type(hid_t fapl, hid_t did, H5D_chunk_index_t new_type, H5D_chunk_in H5F_libver_t low; /* File format low bound */ /* Get the chunk index type */ - if(H5D_layout_idx_type_test(did, &idx_type) < 0) + if(H5D__layout_idx_type_test(did, &idx_type) < 0) FAIL_STACK_ERROR /* Check if we are using the latest version of the format */ diff --git a/test/testfiles/error_test_1 b/test/testfiles/error_test_1 index 8d6e208..b322460 100644 --- a/test/testfiles/error_test_1 +++ b/test/testfiles/error_test_1 @@ -44,13 +44,13 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Dread(): can't read data major: Dataset minor: Read failed - #001: (file name) line (number) in H5D_read(): can't read data + #001: (file name) line (number) in H5D__read(): can't read data major: Dataset minor: Read failed - #002: (file name) line (number) in H5D_chunk_read(): unable to read raw data chunk + #002: (file name) line (number) in H5D__chunk_read(): unable to read raw data chunk major: Low-level I/O minor: Read failed - #003: (file name) line (number) in H5D_chunk_lock(): data pipeline read failed + #003: (file name) line (number) in H5D__chunk_lock(): data pipeline read failed major: Data filters minor: Filter operation failed #004: (file name) line (number) in H5Z_pipeline(): required filter 'bogus' is not registered diff --git a/test/tgenprop.c b/test/tgenprop.c index 5f9a69b..3dbaa14 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -1575,6 +1575,46 @@ test_genprop_class_addprop(void) /**************************************************************** ** +** test_genprop_list_add_remove_prop(): Test adding then removing the +** same properties to a standard HDF5 property list. This is testing +** also for a memory leak that could be caused by not freeing the +** removed property resources from the property list. +** +****************************************************************/ +static void +test_genprop_list_add_remove_prop(void) +{ + hid_t pid; /* Property List ID */ + herr_t ret; /* Generic return value */ + + /* Create a dataset creation property list */ + pid = H5Pcreate(H5P_DATASET_CREATE); + CHECK(pid, FAIL, "H5Pcreate"); + + /* Insert temporary property into class (with no callbacks) */ + ret = H5Pinsert2(pid, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL); + CHECK_I(ret, "H5Pinsert2"); + + /* Delete added property */ + ret = H5Premove(pid, PROP1_NAME); + CHECK_I(ret, "H5Premove"); + + /* Insert temporary property into class (with no callbacks) */ + ret = H5Pinsert2(pid, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL); + CHECK_I(ret, "H5Pinsert2"); + + /* Delete added property */ + ret = H5Premove(pid, PROP1_NAME); + CHECK_I(ret, "H5Premove"); + + /* Close property list */ + ret = H5Pclose(pid); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_genprop_list_add_remove_prop() */ + +/**************************************************************** +** ** test_genprop_equal(): Test basic generic property list code. ** More tests for H5Pequal() ** @@ -1990,6 +2030,8 @@ test_genprop(void) test_genprop_list_addprop(); /* Test adding properties to HDF5 property list */ test_genprop_class_addprop(); /* Test adding properties to HDF5 property class */ + test_genprop_list_add_remove_prop(); /* Test adding and removing the same property several times to HDF5 property list */ + test_genprop_equal(); /* Tests for more H5Pequal verification */ test_genprop_path(); /* Tests for class path verification */ test_genprop_refcount(); /* Tests for class reference counting */ @@ -451,11 +451,11 @@ out: /* Test boundary cases with lots of types */ -/* Type IDs range from H5I_NTYPES to MAX_NUM_TYPES. The system will assign */ -/* IDs in sequential order until MAX_NUM_TYPES IDs have been given out, at which */ +/* Type IDs range from H5I_NTYPES to H5I_MAX_NUM_TYPES. The system will assign */ +/* IDs in sequential order until H5I_MAX_NUM_TYPES IDs have been given out, at which */ /* point it will search for type IDs that were allocated but have since been */ /* deleted. */ -/* This test will allocate IDs up to MAX_NUM_TYPES, ensure that IDs wrap around */ +/* This test will allocate IDs up to H5I_MAX_NUM_TYPES, ensure that IDs wrap around */ /* to low values successfully, ensure that an error is thrown when all possible */ /* type IDs are taken, then ensure that deleting types frees up their IDs. */ /* Note that this test depends on the implementation of IDs, so may break */ @@ -463,7 +463,7 @@ out: /* Also note that if someone else registered a user-defined type and forgot to */ /* destroy it, this test will mysteriously fail (because it will expect there to */ /* be one more "free" type ID than there is). */ -/* H5I_NTYPES is defined in h5public.h, MAX_NUM_TYPES is defined in h5pkg.h */ +/* H5I_NTYPES is defined in h5public.h, H5I_MAX_NUM_TYPES is defined in h5pkg.h */ static int test_id_type_list(void) { H5I_type_t startType; /* The first type ID we were assigned in this test */ @@ -477,14 +477,14 @@ static int test_id_type_list(void) goto out; /* Sanity check */ - if(startType >= MAX_NUM_TYPES || startType < H5I_NTYPES) + if(startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES) { /* Error condition, throw an error */ CHECK(1, 1, "H5Iregister_type"); goto out; } - /* Create types up to MAX_NUM_TYPES */ - for(i = startType + 1; i < MAX_NUM_TYPES; i++) + /* Create types up to H5I_MAX_NUM_TYPES */ + for(i = startType + 1; i < H5I_MAX_NUM_TYPES; i++) { currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); CHECK(currentType, H5I_BADID, "H5Iregister_type"); @@ -519,7 +519,7 @@ static int test_id_type_list(void) goto out; /* Cleanup. Destroy all types. */ - for(i = H5I_NTYPES; i < MAX_NUM_TYPES; i++) + for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++) H5Idestroy_type((H5I_type_t) i); return 0; @@ -527,7 +527,7 @@ static int test_id_type_list(void) out: /* Cleanup. For simplicity, just destroy all types and ignore errors. */ H5E_BEGIN_TRY - for(i = H5I_NTYPES; i < MAX_NUM_TYPES; i++) + for(i = H5I_NTYPES; i < H5I_MAX_NUM_TYPES; i++) H5Idestroy_type((H5I_type_t) i); H5E_END_TRY return -1; diff --git a/test/tmisc.c b/test/tmisc.c index 5539cee..6fcf557 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -3460,14 +3460,14 @@ test_misc20(void) CHECK(did, FAIL, "H5Dopen2"); /* Get the layout version */ - ret = H5D_layout_version_test(did,&version); - CHECK(ret, FAIL, "H5D_layout_version_test"); - VERIFY(version, 3, "H5D_layout_version_test"); + ret = H5D__layout_version_test(did,&version); + CHECK(ret, FAIL, "H5D__layout_version_test"); + VERIFY(version, 3, "H5D__layout_version_test"); /* Get the layout contiguous storage size */ - ret = H5D_layout_contig_size_test(did,&contig_size); - CHECK(ret, FAIL, "H5D_layout_contig_size_test"); - VERIFY(contig_size, (MISC20_SPACE_DIM0 * MISC20_SPACE_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5D_layout_contig_size_test"); + ret = H5D__layout_contig_size_test(did,&contig_size); + CHECK(ret, FAIL, "H5D__layout_contig_size_test"); + VERIFY(contig_size, (MISC20_SPACE_DIM0 * MISC20_SPACE_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5D__layout_contig_size_test"); /* Close datasset */ ret = H5Dclose(did); @@ -3478,14 +3478,14 @@ test_misc20(void) CHECK(did, FAIL, "H5Dopen2"); /* Get the layout version */ - ret = H5D_layout_version_test(did,&version); - CHECK(ret, FAIL, "H5D_layout_version_test"); - VERIFY(version, 3, "H5D_layout_version_test"); + ret = H5D__layout_version_test(did,&version); + CHECK(ret, FAIL, "H5D__layout_version_test"); + VERIFY(version, 3, "H5D__layout_version_test"); /* Get the layout contiguous storage size */ - ret = H5D_layout_contig_size_test(did,&contig_size); - CHECK(ret, FAIL, "H5D_layout_contig_size_test"); - VERIFY(contig_size, (MISC20_SPACE2_DIM0 * MISC20_SPACE2_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5D_layout_contig_size_test"); + ret = H5D__layout_contig_size_test(did,&contig_size); + CHECK(ret, FAIL, "H5D__layout_contig_size_test"); + VERIFY(contig_size, (MISC20_SPACE2_DIM0 * MISC20_SPACE2_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5D__layout_contig_size_test"); /* Close datasset */ ret = H5Dclose(did); @@ -3508,14 +3508,14 @@ test_misc20(void) CHECK(did, FAIL, "H5Dopen2"); /* Get the layout version */ - ret = H5D_layout_version_test(did,&version); - CHECK(ret, FAIL, "H5D_layout_version_test"); - VERIFY(version, 2, "H5D_layout_version_test"); + ret = H5D__layout_version_test(did,&version); + CHECK(ret, FAIL, "H5D__layout_version_test"); + VERIFY(version, 2, "H5D__layout_version_test"); /* Get the layout contiguous storage size */ - ret = H5D_layout_contig_size_test(did,&contig_size); - CHECK(ret, FAIL, "H5D_layout_contig_size_test"); - VERIFY(contig_size, (MISC20_SPACE_DIM0 * MISC20_SPACE_DIM1 * H5Tget_size(H5T_STD_I32LE)), "H5D_layout_contig_size_test"); + ret = H5D__layout_contig_size_test(did,&contig_size); + CHECK(ret, FAIL, "H5D__layout_contig_size_test"); + VERIFY(contig_size, (MISC20_SPACE_DIM0 * MISC20_SPACE_DIM1 * H5Tget_size(H5T_STD_I32LE)), "H5D__layout_contig_size_test"); /* Close datasset */ ret = H5Dclose(did); @@ -4963,10 +4963,10 @@ test_misc28(void) CHECK(did, FAIL, "H5Dcreate2"); /* Verify that the chunk cache is empty */ - ret = H5D_current_cache_size_test(did, &nbytes_used, &nused); - CHECK(ret, FAIL, "H5D_current_cache_size_test"); - VERIFY(nbytes_used, (size_t) 0, "H5D_current_cache_size_test"); - VERIFY(nused, 0, "H5D_current_cache_size_test"); + ret = H5D__current_cache_size_test(did, &nbytes_used, &nused); + CHECK(ret, FAIL, "H5D__current_cache_size_test"); + VERIFY(nbytes_used, (size_t) 0, "H5D__current_cache_size_test"); + VERIFY(nused, 0, "H5D__current_cache_size_test"); /* Initialize write buffer */ for(i=0; i<MISC28_SIZE; i++) @@ -4984,10 +4984,10 @@ test_misc28(void) CHECK(ret, FAIL, "H5Dwrite"); /* Verify that all 10 chunks written have been cached */ - ret = H5D_current_cache_size_test(did, &nbytes_used, &nused); - CHECK(ret, FAIL, "H5D_current_cache_size_test"); - VERIFY(nbytes_used, (size_t) MISC28_SIZE, "H5D_current_cache_size_test"); - VERIFY(nused, MISC28_SIZE, "H5D_current_cache_size_test"); + ret = H5D__current_cache_size_test(did, &nbytes_used, &nused); + CHECK(ret, FAIL, "H5D__current_cache_size_test"); + VERIFY(nbytes_used, (size_t) MISC28_SIZE, "H5D__current_cache_size_test"); + VERIFY(nused, MISC28_SIZE, "H5D__current_cache_size_test"); /* Initialize write buffer */ for(i=0; i<MISC28_SIZE; i++) @@ -5003,10 +5003,10 @@ test_misc28(void) CHECK(ret, FAIL, "H5Dwrite"); /* Verify that the size of the cache remains at 10 */ - ret = H5D_current_cache_size_test(did, &nbytes_used, &nused); - CHECK(ret, FAIL, "H5D_current_cache_size_test"); - VERIFY(nbytes_used, (size_t) MISC28_SIZE, "H5D_current_cache_size_test"); - VERIFY(nused, MISC28_SIZE, "H5D_current_cache_size_test"); + ret = H5D__current_cache_size_test(did, &nbytes_used, &nused); + CHECK(ret, FAIL, "H5D__current_cache_size_test"); + VERIFY(nbytes_used, (size_t) MISC28_SIZE, "H5D__current_cache_size_test"); + VERIFY(nused, MISC28_SIZE, "H5D__current_cache_size_test"); /* Close dataset */ ret = H5Dclose(did); @@ -5018,10 +5018,10 @@ test_misc28(void) CHECK(did, FAIL, "H5Dopen2"); /* Verify that the chunk cache is empty */ - ret = H5D_current_cache_size_test(did, &nbytes_used, &nused); - CHECK(ret, FAIL, "H5D_current_cache_size_test"); - VERIFY(nbytes_used, (size_t) 0, "H5D_current_cache_size_test"); - VERIFY(nused, 0, "H5D_current_cache_size_test"); + ret = H5D__current_cache_size_test(did, &nbytes_used, &nused); + CHECK(ret, FAIL, "H5D__current_cache_size_test"); + VERIFY(nbytes_used, (size_t) 0, "H5D__current_cache_size_test"); + VERIFY(nused, 0, "H5D__current_cache_size_test"); /* Select hyperslabe for reading */ start[1] = 0; @@ -5037,10 +5037,10 @@ test_misc28(void) VERIFY(buf[i], i, "H5Dread"); /* Verify that all 10 chunks read have been cached */ - ret = H5D_current_cache_size_test(did, &nbytes_used, &nused); - CHECK(ret, FAIL, "H5D_current_cache_size_test"); - VERIFY(nbytes_used, (size_t) MISC28_SIZE, "H5D_current_cache_size_test"); - VERIFY(nused, MISC28_SIZE, "H5D_current_cache_size_test"); + ret = H5D__current_cache_size_test(did, &nbytes_used, &nused); + CHECK(ret, FAIL, "H5D__current_cache_size_test"); + VERIFY(nbytes_used, (size_t) MISC28_SIZE, "H5D__current_cache_size_test"); + VERIFY(nused, MISC28_SIZE, "H5D__current_cache_size_test"); /* Select new hyperslab */ start[1] = 1; @@ -5056,10 +5056,10 @@ test_misc28(void) VERIFY(buf[i], MISC28_SIZE - 1 - i, "H5Dread"); /* Verify that the size of the cache remains at 10 */ - ret = H5D_current_cache_size_test(did, &nbytes_used, &nused); - CHECK(ret, FAIL, "H5D_current_cache_size_test"); - VERIFY(nbytes_used, (size_t) MISC28_SIZE, "H5D_current_cache_size_test"); - VERIFY(nused, MISC28_SIZE, "H5D_current_cache_size_test"); + ret = H5D__current_cache_size_test(did, &nbytes_used, &nused); + CHECK(ret, FAIL, "H5D__current_cache_size_test"); + VERIFY(nbytes_used, (size_t) MISC28_SIZE, "H5D__current_cache_size_test"); + VERIFY(nused, MISC28_SIZE, "H5D__current_cache_size_test"); /* Close dataset */ ret = H5Dclose(did); @@ -1148,11 +1148,10 @@ test_multi_compat(void) { hid_t file=(-1), fapl, fapl2=(-1), dset=(-1), space=(-1); hid_t access_fapl = -1; - char filename[1024], newname[1024], tmp[1024]; + char newname[1024]; char filename_s[1024], newname_s[1024]; char filename_r[1024], newname_r[1024]; int *fhandle2=NULL, *fhandle=NULL; - hsize_t file_size; H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES]; hid_t memb_fapl[H5FD_MEM_NTYPES]; haddr_t memb_addr[H5FD_MEM_NTYPES]; |