diff options
Diffstat (limited to 'tools/h5repack/h5repacktst.c')
-rw-r--r-- | tools/h5repack/h5repacktst.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 5d72ce4..5c6f87b 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -171,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 @@ -1561,18 +1563,36 @@ int main (void) /*------------------------------------------------------------------------- * 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. *------------------------------------------------------------------------- */ TESTING(" metadata block size option"); if (h5repack_init (&pack_options, 0, fs_type, fs_size) < 0) GOERROR; + /* 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(FNAME1, FNAME1OUT, &pack_options) < 0) + GOERROR; + if (HDstat(FNAME1OUT, &file_stat) < 0) + GOERROR; + fsize1 = file_stat.st_size; + /* run it again with metadata option */ pack_options.meta_block_size = 8192; if(h5repack(FNAME1, FNAME1OUT, &pack_options) < 0) GOERROR; if(h5diff(FNAME1, FNAME1OUT, NULL, NULL, &diff_options) > 0) GOERROR; + /* record the file size of the output file */ + if (HDstat(FNAME1OUT, &file_stat) < 0) + GOERROR; + fsize2 = file_stat.st_size; if(h5repack_verify(FNAME1, FNAME1OUT, &pack_options) <= 0) GOERROR; + /* verify second file size is larger than the first one */ + if(fsize2 <= fsize1) + GOERROR; if(h5repack_end(&pack_options) < 0) GOERROR; PASSED(); |