summaryrefslogtreecommitdiffstats
path: root/test/lheap.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/lheap.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/lheap.c')
-rw-r--r--test/lheap.c89
1 files changed, 51 insertions, 38 deletions
diff --git a/test/lheap.c b/test/lheap.c
index 33b5210..42d6bce 100644
--- a/test/lheap.c
+++ b/test/lheap.c
@@ -61,6 +61,7 @@ main(void)
int i, j; /*miscellaneous counters */
char buf[1024]; /*the value to store */
const char *s; /*value to read */
+ const char *envval = NULL; /*value from environment */
/* Reset library */
h5_reset();
@@ -103,52 +104,64 @@ main(void)
* Test reading from the heap...
*/
- TESTING("local heap read");
- h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- if ((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0) goto error;
- if (NULL==(f=H5I_object(file))) {
- H5_FAILED();
- H5Eprint_stack(H5E_DEFAULT, stdout);
- goto error;
- }
- for (i=0; i<NOBJS; i++) {
- const H5HL_t *heap = NULL;
-
- sprintf(buf, "%03d-", i);
- for (j=4; j<i; j++) buf[j] = '0' + j%10;
- if (j>4) buf[j] = '\0';
-
- if (NULL == (heap = H5HL_protect(f, H5P_DATASET_XFER_DEFAULT, heap_addr))) {
+ /* Don't run this test using the core file driver */
+ envval = HDgetenv("HDF5_DRIVER");
+ if (envval == NULL)
+ envval = "nomatch";
+ if (HDstrcmp(envval, "core")) {
+ TESTING("local heap read");
+ h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
+ if ((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0) goto error;
+ if (NULL==(f=H5I_object(file))) {
H5_FAILED();
H5Eprint_stack(H5E_DEFAULT, stdout);
goto error;
}
-
- if (NULL == (s = H5HL_offset_into(f, heap, obj[i]))) {
- H5_FAILED();
- H5Eprint_stack(H5E_DEFAULT, stdout);
- goto error;
- }
-
- if (strcmp(s, buf)) {
- H5_FAILED();
- printf(" i=%d, heap offset=%lu\n", i, (unsigned long)(obj[i]));
- printf(" got: \"%s\"\n", s);
- printf(" ans: \"%s\"\n", buf);
- goto error;
+ for (i=0; i<NOBJS; i++) {
+ const H5HL_t *heap = NULL;
+
+ sprintf(buf, "%03d-", i);
+ for (j=4; j<i; j++) buf[j] = '0' + j%10;
+ if (j>4) buf[j] = '\0';
+
+ if (NULL == (heap = H5HL_protect(f, H5P_DATASET_XFER_DEFAULT, heap_addr))) {
+ H5_FAILED();
+ H5Eprint_stack(H5E_DEFAULT, stdout);
+ goto error;
+ }
+
+ if (NULL == (s = H5HL_offset_into(f, heap, obj[i]))) {
+ H5_FAILED();
+ H5Eprint_stack(H5E_DEFAULT, stdout);
+ goto error;
+ }
+
+ if (strcmp(s, buf)) {
+ H5_FAILED();
+ printf(" i=%d, heap offset=%lu\n", i, (unsigned long)(obj[i]));
+ printf(" got: \"%s\"\n", s);
+ printf(" ans: \"%s\"\n", buf);
+ goto error;
+ }
+
+ if (H5HL_unprotect(f, H5P_DATASET_XFER_DEFAULT, heap, heap_addr, H5AC__NO_FLAGS_SET) < 0) {
+ H5_FAILED();
+ H5Eprint_stack(H5E_DEFAULT, stdout);
+ goto error;
+ }
}
- if (H5HL_unprotect(f, H5P_DATASET_XFER_DEFAULT, heap, heap_addr, H5AC__NO_FLAGS_SET) < 0) {
- H5_FAILED();
- H5Eprint_stack(H5E_DEFAULT, stdout);
- goto error;
- }
+ if (H5Fclose(file)<0) goto error;
+ PASSED();
+ puts("All local heap tests passed.");
+ h5_cleanup(FILENAME, fapl);
+ }
+ else
+ {
+ SKIPPED();
+ puts(" Test not compatible with current Virtual File Driver");
}
- if (H5Fclose(file)<0) goto error;
- PASSED();
- puts("All local heap tests passed.");
- h5_cleanup(FILENAME, fapl);
return 0;
error: