summaryrefslogtreecommitdiffstats
path: root/test/external.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2006-07-31 19:46:16 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2006-07-31 19:46:16 (GMT)
commitbeb04ae817268a49656b5abe043627dcbba15e5d (patch)
tree557b0c0908867dbb7185c3954626b2a2da3bcaf4 /test/external.c
parent70b46a1d89e7f9f4a82748a9e1cc21fb4f121ebe (diff)
downloadhdf5-beb04ae817268a49656b5abe043627dcbba15e5d.zip
hdf5-beb04ae817268a49656b5abe043627dcbba15e5d.tar.gz
hdf5-beb04ae817268a49656b5abe043627dcbba15e5d.tar.bz2
[svn-r12519] Fixed "make check-vfd"
"make check-vfd" will now run all tests in the test directory with different file drivers (at least, all of those tests that use the testing framework's FAPL). Tests that fail will be skipped. This is not a perfect fix, but is better than nothing. Along with this change, check-vfd should be added to the Daily Tests.
Diffstat (limited to 'test/external.c')
-rw-r--r--test/external.c95
1 files changed, 52 insertions, 43 deletions
diff --git a/test/external.c b/test/external.c
index e5e57af..a84b06b 100644
--- a/test/external.c
+++ b/test/external.c
@@ -105,7 +105,6 @@ test_1a(hid_t file)
hsize_t file_size; /*sizeof external file segment */
TESTING("fixed-size data space, exact storage");
-
/* Create the dataset */
if((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
cur_size[0] = max_size[0] = 100;
@@ -152,7 +151,6 @@ test_1a(hid_t file)
if (H5Dclose (dset)<0) goto error;
PASSED();
return 0;
-
error:
H5E_BEGIN_TRY {
H5Pclose(dcpl);
@@ -600,7 +598,7 @@ test_2 (hid_t fapl)
int temparray[10] = {0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f};
TESTING("read external dataset");
-
+
/* Write the data to external files directly */
for (i=0; i<4; i++) {
for (j=0; j<25; j++) {
@@ -833,48 +831,59 @@ main (void)
char filename[1024]; /*file name for test_1* funcs */
hid_t grp=-1; /*group to emit diagnostics */
int nerrors=0; /*number of errors */
-
- h5_reset();
- fapl = h5_fileaccess();
- h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) {
- goto error;
+ const char *envval = NULL;
+
+ /* Don't run this test using the split file driver */
+ envval = HDgetenv("HDF5_DRIVER");
+ if (envval == NULL)
+ envval = "nomatch";
+ if (HDstrcmp(envval, "split")) {
+ h5_reset();
+ fapl = h5_fileaccess();
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) {
+ goto error;
+ }
+ if ((grp=H5Gcreate(file, "emit-diagnostics", 8))<0) goto error;
+ if (H5Gclose (grp)<0) goto error;
+
+ nerrors += test_1a(file);
+ nerrors += test_1b(file);
+ nerrors += test_1c(file);
+ nerrors += test_1d(file);
+ nerrors += test_1e(file);
+ nerrors += test_1f(file);
+ nerrors += test_1g();
+ nerrors += test_1h();
+ nerrors += test_2(fapl);
+ nerrors += test_3(fapl);
+ if (nerrors>0) goto error;
+
+ if (H5Fclose(file)<0) goto error;
+ puts("All external storage tests passed.");
+ if (h5_cleanup(FILENAME, fapl)) {
+ remove("extern_1a.raw");
+ remove("extern_1b.raw");
+ remove("extern_2a.raw");
+ remove("extern_2b.raw");
+ remove("extern_3a.raw");
+ remove("extern_3b.raw");
+ remove("extern_4a.raw");
+ remove("extern_4b.raw");
+ }
}
- if ((grp=H5Gcreate(file, "emit-diagnostics", 8))<0) goto error;
- if (H5Gclose (grp)<0) goto error;
-
- nerrors += test_1a(file);
- nerrors += test_1b(file);
- nerrors += test_1c(file);
- nerrors += test_1d(file);
- nerrors += test_1e(file);
- nerrors += test_1f(file);
- nerrors += test_1g();
- nerrors += test_1h();
- nerrors += test_2(fapl);
- nerrors += test_3(fapl);
- if (nerrors>0) goto error;
-
- if (H5Fclose(file)<0) goto error;
- puts("All external storage tests passed.");
- if (h5_cleanup(FILENAME, fapl)) {
- remove("extern_1a.raw");
- remove("extern_1b.raw");
- remove("extern_2a.raw");
- remove("extern_2b.raw");
- remove("extern_3a.raw");
- remove("extern_3b.raw");
- remove("extern_4a.raw");
- remove("extern_4b.raw");
+ else
+ {
+ puts("All external storage tests skipped - Incompatible with current Virtual File Driver");
}
return 0;
- error:
- H5E_BEGIN_TRY {
- H5Fclose(file);
- H5Pclose(fapl);
- } H5E_END_TRY;
- nerrors = MAX(1, nerrors);
- printf ("%d TEST%s FAILED.\n", nerrors, 1==nerrors?"":"s");
- return 1;
+ error:
+ H5E_BEGIN_TRY {
+ H5Fclose(file);
+ H5Pclose(fapl);
+ } H5E_END_TRY;
+ nerrors = MAX(1, nerrors);
+ printf ("%d TEST%s FAILED.\n", nerrors, 1==nerrors?"":"s");
+ return 1;
}