summaryrefslogtreecommitdiffstats
path: root/test/h5test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/h5test.c')
-rw-r--r--test/h5test.c80
1 files changed, 48 insertions, 32 deletions
diff --git a/test/h5test.c b/test/h5test.c
index 09b2f06..88a45a9 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -82,6 +82,7 @@ h5_cleanup(hid_t fapl)
char temp[2048];
int i, j;
int retval=0;
+ hid_t driver;
if (!getenv("HDF5_NOCLEANUP")) {
for (i=0; FILENAME[i]; i++) {
@@ -90,29 +91,31 @@ h5_cleanup(hid_t fapl)
continue;
}
- switch (H5Pget_driver(fapl)) {
- case H5F_LOW_CORE:
- break; /*nothing to remove*/
-
- case H5F_LOW_SPLIT:
- HDsnprintf(temp, sizeof temp, "%s.raw", filename);
- remove(temp);
- HDsnprintf(temp, sizeof temp, "%s.meta", filename);
- remove(temp);
- break;
-
- case H5F_LOW_FAMILY:
+ driver = H5Pget_driver(fapl);
+ if (H5FD_FAMILY==driver) {
for (j=0; /*void*/; j++) {
HDsnprintf(temp, sizeof temp, filename, j);
if (access(temp, F_OK)<0) break;
remove(temp);
}
- break;
-
- default:
+ } else if (H5FD_CORE==driver) {
+ /*void*/
+ } else {
remove(filename);
- break;
}
+
+
+#ifndef ROBB_VFL
+#warning "H5F_LOW_SPLIT not implemented"
+#else
+ switch (H5Pget_driver(fapl)) {
+ case H5F_LOW_SPLIT:
+ HDsnprintf(temp, sizeof temp, "%s.raw", filename);
+ remove(temp);
+ HDsnprintf(temp, sizeof temp, "%s.meta", filename);
+ remove(temp);
+ break;
+#endif
}
retval=1;
}
@@ -181,14 +184,15 @@ h5_reset(void)
* Thursday, November 19, 1998
*
* Modifications:
- *
+ * Robb Matzke, 1999-08-03
+ * Modified to use the virtual file layer.
*-------------------------------------------------------------------------
*/
char *
h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
{
- const char *prefix=NULL, *suffix=NULL;
- H5F_driver_t driver;
+ const char *prefix=NULL, *suffix=NULL;
+ hid_t driver;
if (!base_name || !fullname || size<1) return NULL;
@@ -211,18 +215,22 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
/* Append a suffix */
if ((driver=H5Pget_driver(fapl))<0) return NULL;
- switch (driver) {
- case H5F_LOW_SPLIT:
- case H5F_LOW_CORE:
- suffix = NULL;
- break;
- case H5F_LOW_FAMILY:
+ if (H5FD_FAMILY==driver) {
suffix = "%05d.h5";
- break;
- default:
+ } else if (H5FD_CORE==driver) {
+ suffix = NULL;
+ } else {
suffix = ".h5";
- break;
}
+
+#ifndef RPM_VFL
+#warning "H5FD_SPLIT not implemented"
+#else
+ if (H5FD_SPLIT==driver) {
+ suffix = NULL;
+ }
+#endif
+
if (suffix) {
if (strlen(fullname)+strlen(suffix)>=size) return NULL;
strcat(fullname, suffix);
@@ -257,7 +265,7 @@ h5_fileaccess(void)
const char *name;
char s[1024];
hid_t fapl = -1;
- hsize_t fam_size = 1024*1024;
+ hsize_t fam_size = 100*1024*1024; /*100 MB*/
/* First use the environment variable, then the constant */
val = getenv("HDF5_DRIVER");
@@ -274,23 +282,31 @@ h5_fileaccess(void)
if (!strcmp(name, "sec2")) {
/* Unix read() and write() system calls */
- if (H5Pset_sec2(fapl)<0) return -1;
+ if (H5Pset_fapl_sec2(fapl)<0) return -1;
} else if (!strcmp(name, "stdio")) {
/* C standard I/O library */
+#ifndef RPM_VFL
+#warning "H5FD_STDIO not implemented"
+#else
if (H5Pset_stdio(fapl)<0) return -1;
+#endif
} else if (!strcmp(name, "core")) {
/* In-core temporary file with 1MB increment */
- if (H5Pset_core(fapl, 1024*1024)<0) return -1;
+ if (H5Pset_fapl_core(fapl, 1024*1024)<0) return -1;
} else if (!strcmp(name, "split")) {
/* Split meta data and raw data each using default driver */
+#ifndef RPM_VFL
+#warning "H5FD_SPLIT not implemented"
+#else
if (H5Pset_split(fapl, NULL, H5P_DEFAULT, NULL, H5P_DEFAULT)<0)
return -1;
+#endif
} else if (!strcmp(name, "family")) {
/* Family of files, each 1MB and using the default driver */
if ((val=strtok(NULL, " \t\n\r"))) {
fam_size = strtod(val, NULL) * 1024*1024;
}
- if (H5Pset_family(fapl, fam_size, H5P_DEFAULT)<0) return -1;
+ if (H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT)<0) return -1;
} else {
/* Unknown driver */
return -1;