diff options
Diffstat (limited to 'tools/h5repack/h5repacktst.c')
-rw-r--r-- | tools/h5repack/h5repacktst.c | 181 |
1 files changed, 113 insertions, 68 deletions
diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 05eac2f..0caf72a 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -78,7 +78,6 @@ #define FNAME17OUT "h5repack_named_dtypes_out.h5" #define FNAME18 "h5repack_layout2.h5" -#define FNAME18OUT "h5repack_layout2_out.h5" #define FNAME_UB "ublock.bin" @@ -172,6 +171,8 @@ int main (void) diff_opt_t diff_options; hsize_t fs_size = 0; /* free space section threshold */ H5F_file_space_type_t fs_type = H5F_FILE_SPACE_DEFAULT; /* file space handling strategy */ + h5_stat_t file_stat; + h5_stat_size_t fsize1, fsize2; /* file sizes */ #if defined (H5_HAVE_FILTER_SZIP) int szip_can_encode = 0; #endif @@ -212,7 +213,7 @@ int main (void) TESTING(" copy of datasets (fill values)"); /* fs_type = 0; fs_size = 0 */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME0,FNAME0OUT,&pack_options) < 0) GOERROR; @@ -232,7 +233,7 @@ int main (void) *------------------------------------------------------------------------- */ TESTING(" copy of datasets (all datatypes)"); - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME1,FNAME1OUT,&pack_options) < 0) GOERROR; @@ -252,7 +253,7 @@ int main (void) *------------------------------------------------------------------------- */ TESTING(" copy of datasets (attributes)"); - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME2,FNAME2OUT,&pack_options) < 0) GOERROR; @@ -271,7 +272,7 @@ int main (void) *------------------------------------------------------------------------- */ TESTING(" copy of datasets (hardlinks)"); - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME3,FNAME3OUT,&pack_options) < 0) GOERROR; @@ -291,7 +292,7 @@ int main (void) *------------------------------------------------------------------------- */ TESTING(" copy of allocation early file"); - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME5,FNAME5OUT,&pack_options) < 0) GOERROR; @@ -321,7 +322,7 @@ int main (void) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset1:GZIP=9",&pack_options) < 0) GOERROR; @@ -348,7 +349,7 @@ int main (void) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 1, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, TRUE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset1:GZIP=9",&pack_options) < 0) GOERROR; @@ -376,7 +377,7 @@ int main (void) #ifdef H5_HAVE_FILTER_DEFLATE - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("GZIP=1",&pack_options) < 0) GOERROR; @@ -414,7 +415,7 @@ int main (void) */ if (szip_can_encode) { - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset2:SZIP=8,EC",&pack_options) < 0) GOERROR; @@ -446,7 +447,7 @@ int main (void) #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("SZIP=8,NN",&pack_options) < 0) GOERROR; @@ -477,7 +478,7 @@ int main (void) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset1:SHUF",&pack_options) < 0) GOERROR; @@ -507,7 +508,7 @@ int main (void) #ifdef H5_HAVE_FILTER_SHUFFLE /* fs_type = H5F_FILE_SPACE_ALL_PERSIST; fs_size = 1 */ - if (h5repack_init (&pack_options, 0, 0, H5_INC_ENUM(H5F_file_space_type_t, fs_type), ++fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, H5_INC_ENUM(H5F_file_space_type_t, fs_type), ++fs_size) < 0) GOERROR; if (h5repack_addfilter("SHUF",&pack_options) < 0) GOERROR; @@ -536,7 +537,7 @@ int main (void) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset1:FLET",&pack_options) < 0) GOERROR; @@ -566,7 +567,7 @@ int main (void) #ifdef H5_HAVE_FILTER_FLETCHER32 - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("FLET",&pack_options) < 0) GOERROR; @@ -594,7 +595,7 @@ int main (void) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset1:CHUNK 20x10",&pack_options) < 0) GOERROR; @@ -640,7 +641,7 @@ int main (void) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0) GOERROR; @@ -662,7 +663,7 @@ int main (void) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 1, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, TRUE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0) GOERROR; @@ -682,7 +683,7 @@ int main (void) */ TESTING(" adding layout chunked to all"); - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("CHUNK=20x10",&pack_options) < 0) GOERROR; @@ -703,7 +704,7 @@ int main (void) * test an individual object option *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset1:CONTI",&pack_options) < 0) GOERROR; @@ -724,7 +725,7 @@ int main (void) * test all objects option *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("CONTI",&pack_options) < 0) GOERROR; @@ -741,7 +742,7 @@ int main (void) * do the same test for a file with filters (chunked) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("CONTI",&pack_options) < 0) GOERROR; @@ -763,7 +764,7 @@ int main (void) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset1:COMPA",&pack_options) < 0) GOERROR; @@ -785,7 +786,7 @@ int main (void) */ /* fs_type = H5F_FILE_SPACE_ALL; fs_size = 2 */ - if (h5repack_init (&pack_options, 0, 0, H5_INC_ENUM(H5F_file_space_type_t, fs_type), ++fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, H5_INC_ENUM(H5F_file_space_type_t, fs_type), ++fs_size) < 0) GOERROR; if (h5repack_addlayout("COMPA",&pack_options) < 0) GOERROR; @@ -807,7 +808,7 @@ int main (void) * layout compact to contiguous conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_compact:CONTI",&pack_options) < 0) GOERROR; @@ -827,7 +828,7 @@ int main (void) * layout compact to chunk conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_compact:CHUNK=2x5",&pack_options) < 0) GOERROR; @@ -847,7 +848,7 @@ int main (void) * layout compact to compact conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_compact:COMPA",&pack_options) < 0) GOERROR; @@ -866,7 +867,7 @@ int main (void) * layout contiguous to compact conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_contiguous:COMPA",&pack_options) < 0) GOERROR; @@ -885,7 +886,7 @@ int main (void) * layout contiguous to chunk conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_contiguous:CHUNK=3x6",&pack_options) < 0) GOERROR; @@ -905,7 +906,7 @@ int main (void) * layout contiguous to contiguous conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_contiguous:CONTI",&pack_options) < 0) GOERROR; @@ -924,7 +925,7 @@ int main (void) * layout chunked to compact conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_chunk:COMPA",&pack_options) < 0) GOERROR; @@ -944,7 +945,7 @@ int main (void) * layout chunked to contiguous conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_chunk:CONTI",&pack_options) < 0) GOERROR; @@ -963,7 +964,7 @@ int main (void) * layout chunked to chunked conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_chunk:CHUNK=18x13",&pack_options) < 0) GOERROR; @@ -994,7 +995,7 @@ int main (void) #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { /* fs_type = H5F_FILE_SPACE_AGGR_VFD; fs_size = 3 */ - if (h5repack_init (&pack_options, 0, 0, H5_INC_ENUM(H5F_file_space_type_t, fs_type), ++fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, H5_INC_ENUM(H5F_file_space_type_t, fs_type), ++fs_size) < 0) GOERROR; if (h5repack(FNAME7,FNAME7OUT,&pack_options) < 0) GOERROR; @@ -1019,7 +1020,7 @@ int main (void) #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_szip:NONE",&pack_options) < 0) GOERROR; @@ -1044,7 +1045,7 @@ int main (void) TESTING(" copy of deflate filter"); #ifdef H5_HAVE_FILTER_DEFLATE - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME8,FNAME8OUT,&pack_options) < 0) GOERROR; @@ -1064,7 +1065,7 @@ int main (void) TESTING(" removing deflate filter"); #ifdef H5_HAVE_FILTER_DEFLATE - if (h5repack_init (&pack_options, 0, 0, fs_type, ++fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, ++fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_deflate:NONE",&pack_options) < 0) GOERROR; @@ -1087,7 +1088,7 @@ int main (void) TESTING(" copy of shuffle filter"); #ifdef H5_HAVE_FILTER_SHUFFLE - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME9,FNAME9OUT,&pack_options) < 0) GOERROR; @@ -1106,7 +1107,7 @@ int main (void) TESTING(" removing shuffle filter"); #ifdef H5_HAVE_FILTER_SHUFFLE - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_shuffle:NONE",&pack_options) < 0) GOERROR; @@ -1127,7 +1128,7 @@ int main (void) TESTING(" copy of fletcher filter"); #ifdef H5_HAVE_FILTER_FLETCHER32 - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME10,FNAME10OUT,&pack_options) < 0) GOERROR; @@ -1146,7 +1147,7 @@ int main (void) TESTING(" removing fletcher filter"); #ifdef H5_HAVE_FILTER_FLETCHER32 - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_fletcher32:NONE",&pack_options) < 0) GOERROR; @@ -1168,7 +1169,7 @@ int main (void) TESTING(" copy of nbit filter"); #ifdef H5_HAVE_FILTER_NBIT - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME12,FNAME12OUT,&pack_options) < 0) GOERROR; @@ -1187,7 +1188,7 @@ int main (void) TESTING(" removing nbit filter"); #ifdef H5_HAVE_FILTER_NBIT - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_nbit:NONE",&pack_options) < 0) GOERROR; @@ -1209,7 +1210,7 @@ int main (void) TESTING(" adding nbit filter"); #ifdef H5_HAVE_FILTER_NBIT - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_int31:NBIT",&pack_options) < 0) GOERROR; @@ -1231,7 +1232,7 @@ int main (void) TESTING(" copy of scaleoffset filter"); #ifdef H5_HAVE_FILTER_SCALEOFFSET - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME13,FNAME13OUT,&pack_options) < 0) GOERROR; @@ -1250,7 +1251,7 @@ int main (void) TESTING(" removing scaleoffset filter"); #ifdef H5_HAVE_FILTER_SCALEOFFSET - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_scaleoffset:NONE",&pack_options) < 0) GOERROR; @@ -1272,7 +1273,7 @@ int main (void) TESTING(" adding scaleoffset filter"); #ifdef H5_HAVE_FILTER_SCALEOFFSET - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_none:SOFF=31,IN",&pack_options) < 0) GOERROR; @@ -1311,7 +1312,7 @@ int main (void) if (szip_can_encode) { /* fs_type = H5F_FILE_SPACE_VFD; fs_size = 4 */ - if (h5repack_init (&pack_options, 0, 0, H5_INC_ENUM(H5F_file_space_type_t, fs_type), ++fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, H5_INC_ENUM(H5F_file_space_type_t, fs_type), ++fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_deflate:SZIP=8,NN",&pack_options) < 0) GOERROR; @@ -1339,7 +1340,7 @@ int main (void) && defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_szip:GZIP=1",&pack_options) < 0) GOERROR; @@ -1371,7 +1372,7 @@ int main (void) #if defined (H5_HAVE_FILTER_SZIP) && defined (H5_HAVE_FILTER_DEFLATE) \ && defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE) - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("NONE",&pack_options) < 0) GOERROR; @@ -1395,7 +1396,7 @@ int main (void) */ TESTING(" big file"); - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME14,FNAME14OUT,&pack_options) < 0) GOERROR; @@ -1412,7 +1413,7 @@ int main (void) *------------------------------------------------------------------------- */ TESTING(" external datasets"); - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME15,FNAME15OUT,&pack_options) < 0) GOERROR; @@ -1429,7 +1430,7 @@ int main (void) *------------------------------------------------------------------------- */ TESTING(" file with userblock"); - if(h5repack_init(&pack_options, 0, 0, fs_type, fs_size) < 0) + if(h5repack_init(&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if(h5repack(FNAME16, FNAME16OUT, &pack_options) < 0) GOERROR; @@ -1448,7 +1449,7 @@ int main (void) *------------------------------------------------------------------------- */ TESTING(" latest file format options"); - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; pack_options.latest=1; pack_options.grp_compact=10; @@ -1478,7 +1479,7 @@ int main (void) #if defined (H5_HAVE_FILTER_DEFLATE) && defined (H5_HAVE_FILTER_SHUFFLE) - if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) + if (h5repack_init (&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("GZIP=1",&pack_options) < 0) GOERROR; @@ -1507,7 +1508,7 @@ int main (void) #ifdef H5_HAVE_FILTER_DEFLATE - if(h5repack_init(&pack_options, 0, 0, fs_type, fs_size) < 0) + if(h5repack_init(&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; /* add the options for a user block size and user block filename */ @@ -1540,7 +1541,7 @@ int main (void) #ifdef H5_HAVE_FILTER_DEFLATE - if(h5repack_init(&pack_options, 0, 0, fs_type, fs_size) < 0) + if(h5repack_init(&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; /* add the options for aligment */ @@ -1594,7 +1595,7 @@ int main (void) */ TESTING(" file with committed datatypes"); - if(h5repack_init(&pack_options, 0, 0, fs_type, fs_size) < 0) + if(h5repack_init(&pack_options, 0, FALSE, fs_type, fs_size) < 0) GOERROR; if(h5repack(FNAME17, FNAME17OUT, &pack_options) < 0) @@ -1610,6 +1611,50 @@ int main (void) PASSED(); /*------------------------------------------------------------------------- + * test --metadata_block_size option + * Also verify that output file using the metadata_block_size option is + * larger than the output file one not using it. + * FNAME4 is used because it is the same as the test file used for the + * shell script version of this test (h5repack.sh). + *------------------------------------------------------------------------- + */ + TESTING(" metadata block size option"); + /* First run without metadata option. No need to verify the correctness */ + /* since this has been verified by earlier tests. Just record the file */ + /* size of the output file. */ + if(h5repack_init(&pack_options, 0, FALSE, H5F_FILE_SPACE_DEFAULT, (hsize_t)0) < 0) + GOERROR; + if(h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) + GOERROR; + if(HDstat(FNAME4OUT, &file_stat) < 0) + GOERROR; + fsize1 = file_stat.st_size; + if(h5repack_end(&pack_options) < 0) + GOERROR; + + /* run it again with metadata option */ + if(h5repack_init(&pack_options, 0, FALSE, H5F_FILE_SPACE_DEFAULT, (hsize_t)0) < 0) + GOERROR; + pack_options.meta_block_size = 8192; + if(h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) + GOERROR; + if(h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) + GOERROR; + if(h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) + GOERROR; + /* record the file size of the output file */ + if(HDstat(FNAME4OUT, &file_stat) < 0) + GOERROR; + fsize2 = file_stat.st_size; + /* verify second file size is larger than the first one */ + if(fsize2 <= fsize1) + GOERROR; + if(h5repack_end(&pack_options) < 0) + GOERROR; + PASSED(); + + + /*------------------------------------------------------------------------- * clean temporary test files *------------------------------------------------------------------------- */ @@ -3302,7 +3347,7 @@ make_userblock(void) /* Initialize userblock data */ for(u = 0; u < USERBLOCK_SIZE; u++) - ub[u] = 'a' + (u % 26); + ub[u] = 'a' + (char)(u % 26); /* Re-open HDF5 file, as "plain" file */ if((fd = HDopen(FNAME16, O_WRONLY, 0644)) < 0) @@ -3415,7 +3460,7 @@ make_userblock_file(void) /* initialize userblock data */ for(u = 0; u < USERBLOCK_SIZE; u++) - ub[u] = 'a' + (u % 26); + ub[u] = 'a' + (char)(u % 26); /* open file */ if((fd = HDopen(FNAME_UB,O_WRONLY|O_CREAT|O_TRUNC, 0644 )) < 0) @@ -3891,7 +3936,7 @@ int write_dset_in(hid_t loc_id, int l; buf52[i][j].p = malloc((i + 1) * sizeof(int)); - buf52[i][j].len = i + 1; + buf52[i][j].len = (size_t)(i + 1); for(l = 0; l < i + 1; l++) { if(make_diffs) @@ -4112,7 +4157,7 @@ int write_dset_in(hid_t loc_id, int l; buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); - buf53[i][j][k].len = i + 1; + buf53[i][j][k].len = (size_t)(i + 1); for(l = 0; l < i + 1; l++) { if(make_diffs) @@ -4903,7 +4948,7 @@ int write_attr_in(hid_t loc_id, { int l; buf52[i][j].p = malloc((i + 1) * sizeof(int)); - buf52[i][j].len = i + 1; + buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) if (make_diffs)((int *)buf52[i][j].p)[l] = 0; else ((int *)buf52[i][j].p)[l] = n++; @@ -5369,7 +5414,7 @@ int write_attr_in(hid_t loc_id, { int l; buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); - buf53[i][j][k].len = i + 1; + buf53[i][j][k].len = (size_t)i + 1; for (l = 0; l < i + 1; l++) if (make_diffs) { @@ -5868,7 +5913,7 @@ static herr_t add_attr_with_regref(hid_t file_id, hid_t obj_id) } /* select elements space for reference */ - status = H5Sselect_elements (sid_regrefed_dset, H5S_SELECT_SET, 3, coords_regrefed_dset[0]); + status = H5Sselect_elements (sid_regrefed_dset, H5S_SELECT_SET, (size_t)3, coords_regrefed_dset[0]); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); @@ -6190,7 +6235,7 @@ static herr_t gen_region_ref(hid_t loc_id) } /* select elements space for reference */ - status = H5Sselect_elements (sid_trg, H5S_SELECT_SET, 4, coords[0]); + status = H5Sselect_elements (sid_trg, H5S_SELECT_SET, (size_t)4, coords[0]); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); @@ -6557,7 +6602,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) /* * create the region reference */ - status = H5Sselect_elements (objsid, H5S_SELECT_SET, 4, coords[0]); + status = H5Sselect_elements (objsid, H5S_SELECT_SET, (size_t)4, coords[0]); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); @@ -6668,7 +6713,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) /* * create region reference */ - status = H5Sselect_elements(objsid, H5S_SELECT_SET, 4, coords[0]); + status = H5Sselect_elements(objsid, H5S_SELECT_SET, (size_t)4, coords[0]); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); |