summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/testh5repack_main.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2004-01-26 23:20:20 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2004-01-26 23:20:20 (GMT)
commitafc3563b76badc2345ca955d7d48fe16cceaf0c8 (patch)
treea691cf56cc1246acb05f7fc23a050c93f0d7bf6d /tools/h5repack/testh5repack_main.c
parent2a4253ceb8757c935304be24db989bd0f72effe8 (diff)
downloadhdf5-afc3563b76badc2345ca955d7d48fe16cceaf0c8.zip
hdf5-afc3563b76badc2345ca955d7d48fe16cceaf0c8.tar.gz
hdf5-afc3563b76badc2345ca955d7d48fe16cceaf0c8.tar.bz2
[svn-r8113] Purpose:
new library function H5Pdelete_filter deletes one or all filters from a dataset creation property list this was done for the NONE option of h5repack, added tests for this feature added a test for the new function in /test/dsets.c Description: Solution: Platforms tested: linux solaris AIX Misc. update:
Diffstat (limited to 'tools/h5repack/testh5repack_main.c')
-rw-r--r--tools/h5repack/testh5repack_main.c87
1 files changed, 81 insertions, 6 deletions
diff --git a/tools/h5repack/testh5repack_main.c b/tools/h5repack/testh5repack_main.c
index d81f311..fc7d571 100644
--- a/tools/h5repack/testh5repack_main.c
+++ b/tools/h5repack/testh5repack_main.c
@@ -96,6 +96,82 @@ error:
}
/*-------------------------------------------------------------------------
+ * Function: test_filter_none
+ *
+ * Purpose:
+ *
+ * 1) delete filters form the filter pipeline
+ * 2) use the h5diff utility to compare the input and output file;
+ * it returns RET==0 if the objects have the same data
+ * 3) use API functions to verify the compression/chunking input on the output file
+ *
+ * Return: Success: zero
+ * Failure: 1
+ *
+ * Programmer: Pedro Vicente <pvn@ncsa.uiuc.edu>
+ * September, 19, 2003
+ *
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+test_filter_none(void)
+{
+ pack_opt_t pack_options;
+ diff_opt_t diff_options;
+ memset(&diff_options, 0, sizeof (diff_opt_t));
+ memset(&pack_options, 0, sizeof (pack_opt_t));
+
+ TESTING(" delete filters");
+
+/*-------------------------------------------------------------------------
+ * test the NONE global option
+ *-------------------------------------------------------------------------
+ */
+
+ if (h5repack_init (&pack_options, 0)<0)
+ TEST_ERROR;
+ if (h5repack_addfilter("dset_gzip:NONE",&pack_options)<0)
+ TEST_ERROR;
+ if (h5repack(FNAME4,FNAME4OUT,&pack_options)<0)
+ TEST_ERROR;
+ if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) == 1)
+ TEST_ERROR;
+ if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
+ TEST_ERROR;
+ if (h5repack_end (&pack_options)<0)
+ TEST_ERROR;
+
+/*-------------------------------------------------------------------------
+ * test the NONE specific option; uncompress a dataset
+ *-------------------------------------------------------------------------
+ */
+
+ if (h5repack_init (&pack_options, 0)<0)
+ TEST_ERROR;
+ if (h5repack_addfilter("dset_gzip:NONE",&pack_options)<0)
+ TEST_ERROR;
+ if (h5repack_addfilter("dset1:NONE",&pack_options)<0)
+ TEST_ERROR;
+ if (h5repack(FNAME4,FNAME4OUT,&pack_options)<0)
+ TEST_ERROR;
+ if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) == 1)
+ TEST_ERROR;
+ if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
+ TEST_ERROR;
+ if (h5repack_end (&pack_options)<0)
+ TEST_ERROR;
+
+ PASSED();
+ return 0;
+
+error:
+ return 1;
+
+
+}
+
+/*-------------------------------------------------------------------------
* Function: test_filter_deflate
*
* Purpose:
@@ -182,7 +258,8 @@ test_filter_deflate(void)
TEST_ERROR;
if (h5repack_end (&pack_options)<0)
TEST_ERROR;
-
+
+
PASSED();
#else
SKIPPED();
@@ -193,11 +270,8 @@ test_filter_deflate(void)
error:
return 1;
#endif
-
-
}
-
/*-------------------------------------------------------------------------
* Function: test_filter_szip
*
@@ -347,10 +421,8 @@ error:
return 1;
#endif
-
}
-
/*-------------------------------------------------------------------------
* Function: test_filter_checksum
*
@@ -743,6 +815,9 @@ int main (void)
/* test a copy with no filters */
nerrors += test_copy();
+ /* test a copy with the delete filters option */
+ nerrors += test_filter_none();
+
/* test a copy with the deflate filter */
nerrors += test_filter_deflate();