summaryrefslogtreecommitdiffstats
path: root/test/lheap.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-06-15 19:11:59 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-06-15 19:11:59 (GMT)
commitd0a9cf9ffaf0d62d8e793f4a89189a7a01eda7f5 (patch)
tree288c1956e2d23398652b07b76e3fb3c081b09888 /test/lheap.c
parent40160d4d740ff706520b396fd9367089e8e4e2a2 (diff)
downloadhdf5-d0a9cf9ffaf0d62d8e793f4a89189a7a01eda7f5.zip
hdf5-d0a9cf9ffaf0d62d8e793f4a89189a7a01eda7f5.tar.gz
hdf5-d0a9cf9ffaf0d62d8e793f4a89189a7a01eda7f5.tar.bz2
[svn-r13871] Description:
Fix problems with 'check-vfd' target, that were [mostly] introduced with the recent "unique, but sharable" ISOHM optimization. The problems were mostly with using the 'core' VFD, so the H5Pset_fapl_core() API call was changed to re-open existing files (therefore operating more list the sec2, stdio, etc. VFDs). This allows many more of the tests to run using the 'core' VFD, so those were enabled also. Tested on: Linux/64 2.6 (chicago2) w/check-vfd
Diffstat (limited to 'test/lheap.c')
-rw-r--r--test/lheap.c96
1 files changed, 42 insertions, 54 deletions
diff --git a/test/lheap.c b/test/lheap.c
index abf1bc0..537d42d 100644
--- a/test/lheap.c
+++ b/test/lheap.c
@@ -63,7 +63,6 @@ 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();
@@ -115,62 +114,51 @@ main(void)
* Test reading from the heap...
*/
- /* 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();
- H5Eprint2(H5E_DEFAULT, stdout);
- goto error;
- }
- for (i=0; i<NOBJS; i++) {
- 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, H5AC_READ))) {
- H5_FAILED();
- H5Eprint2(H5E_DEFAULT, stdout);
- goto error;
- }
-
- if (NULL == (s = H5HL_offset_into(f, heap, obj[i]))) {
- H5_FAILED();
- H5Eprint2(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) < 0) {
- H5_FAILED();
- H5Eprint2(H5E_DEFAULT, stdout);
- goto error;
- }
- }
-
- if (H5Fclose(file)<0) goto error;
- PASSED();
- puts("All local heap tests passed.");
- h5_cleanup(FILENAME, fapl);
+ 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();
+ H5Eprint2(H5E_DEFAULT, stdout);
+ goto error;
}
- else
- {
- SKIPPED();
- puts(" Test not compatible with current Virtual File Driver");
+ for (i=0; i<NOBJS; i++) {
+ 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, H5AC_READ))) {
+ H5_FAILED();
+ H5Eprint2(H5E_DEFAULT, stdout);
+ goto error;
+ }
+
+ if (NULL == (s = H5HL_offset_into(f, heap, obj[i]))) {
+ H5_FAILED();
+ H5Eprint2(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) < 0) {
+ H5_FAILED();
+ H5Eprint2(H5E_DEFAULT, stdout);
+ goto error;
+ }
}
+ if (H5Fclose(file)<0) goto error;
+ PASSED();
+ puts("All local heap tests passed.");
+ h5_cleanup(FILENAME, fapl);
+
return 0;
error: