summaryrefslogtreecommitdiffstats
path: root/test/lheap.c
diff options
context:
space:
mode:
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: