summaryrefslogtreecommitdiffstats
path: root/test/istore.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2012-03-26 21:11:50 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2012-03-26 21:11:50 (GMT)
commit2b3a190501b005be08ce8d4ffeb0b59f10ec5c1a (patch)
tree222af2b35e7458fd32f65bbf9f68e52ac31c478c /test/istore.c
parent086035bedefa3b318a18a34eaf3c2a3873af0822 (diff)
downloadhdf5-2b3a190501b005be08ce8d4ffeb0b59f10ec5c1a.zip
hdf5-2b3a190501b005be08ce8d4ffeb0b59f10ec5c1a.tar.gz
hdf5-2b3a190501b005be08ce8d4ffeb0b59f10ec5c1a.tar.bz2
[svn-r22152] Added a "skipped" message to the istore sparse test function.
Minor change: tested on jam (test not skipped) and Mac OS-X Lion (test skipped due to HFS not supporting sparse files).
Diffstat (limited to 'test/istore.c')
-rw-r--r--test/istore.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/test/istore.c b/test/istore.c
index 0c970bc..81d7eb6 100644
--- a/test/istore.c
+++ b/test/istore.c
@@ -467,7 +467,7 @@ error:
*/
static herr_t
test_sparse(hid_t f, const char *prefix, size_t nblocks,
- size_t nx, size_t ny, size_t nz)
+ size_t nx, size_t ny, size_t nz, int skip_test)
{
hid_t dataset; /* Dataset ID */
hid_t fspace; /* Dataset's file dataspace */
@@ -499,6 +499,10 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks,
sprintf(s, "istore sparse: %s", dims);
TESTING(s);
+ if(skip_test){
+ SKIPPED()
+ return SUCCEED;
+ }
buf = (uint8_t *)HDmalloc(nx * ny * nz);
HDmemset(buf, 128, nx * ny * nz);
@@ -601,6 +605,7 @@ main(int argc, char *argv[])
unsigned size_of_test;
unsigned u; /* Local index variable */
char filename[1024];
+ int skip_test = 0;
int has_sparse_support = 0;
/* Parse arguments or assume these tests (`small', `medium' ) */
@@ -683,27 +688,29 @@ main(int argc, char *argv[])
status = test_extend(file, "extend", (size_t)10, (size_t)400, (size_t)10);
nerrors += status < 0 ? 1 : 0;
}
+ skip_test = 0;
if (size_of_test & TEST_SMALL) {
- status = test_sparse(file, "sparse", (size_t)100, (size_t)5, (size_t)0, (size_t)0);
+ status = test_sparse(file, "sparse", (size_t)100, (size_t)5, (size_t)0, (size_t)0, skip_test);
nerrors += status < 0 ? 1 : 0;
- status = test_sparse(file, "sparse", (size_t)100, (size_t)3, (size_t)4, (size_t)0);
+ status = test_sparse(file, "sparse", (size_t)100, (size_t)3, (size_t)4, (size_t)0, skip_test);
nerrors += status < 0 ? 1 : 0;
- status = test_sparse(file, "sparse", (size_t)100, (size_t)2, (size_t)3, (size_t)4);
+ status = test_sparse(file, "sparse", (size_t)100, (size_t)2, (size_t)3, (size_t)4, skip_test);
nerrors += status < 0 ? 1 : 0;
}
if (size_of_test & TEST_MEDIUM) {
- status = test_sparse(file, "sparse", (size_t)1000, (size_t)30, (size_t)0, (size_t)0);
+ status = test_sparse(file, "sparse", (size_t)1000, (size_t)30, (size_t)0, (size_t)0, skip_test);
nerrors += status < 0 ? 1 : 0;
- status = test_sparse(file, "sparse", (size_t)2000, (size_t)7, (size_t)3, (size_t)0);
+ status = test_sparse(file, "sparse", (size_t)2000, (size_t)7, (size_t)3, (size_t)0, skip_test);
nerrors += status < 0 ? 1 : 0;
- status = test_sparse(file, "sparse", (size_t)2000, (size_t)4, (size_t)2, (size_t)3);
+ status = test_sparse(file, "sparse", (size_t)2000, (size_t)4, (size_t)2, (size_t)3, skip_test);
nerrors += status < 0 ? 1 : 0;
}
- if (has_sparse_support && size_of_test & TEST_LARGE) {
+ skip_test = !has_sparse_support;
+ if (size_of_test & TEST_LARGE) {
/* This test is skipped if there is no POSIX-style sparse file support
* e.g.: Windows NTFS filesystems
*/
- status = test_sparse(file, "sparse", (size_t)800, (size_t)50, (size_t)50, (size_t)50);
+ status = test_sparse(file, "sparse", (size_t)800, (size_t)50, (size_t)50, (size_t)50, skip_test);
nerrors += status < 0 ? 1 : 0;
}