summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-08-06 16:01:44 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-08-06 16:01:44 (GMT)
commit41529d180ebc129f831d9bfea162e377d598fe92 (patch)
tree8df90e91eecd382f91c7b6e81aff192db208bc31 /test
parent2a39beb49bed12fa0385fbae4c2f118f5809e842 (diff)
downloadhdf5-41529d180ebc129f831d9bfea162e377d598fe92.zip
hdf5-41529d180ebc129f831d9bfea162e377d598fe92.tar.gz
hdf5-41529d180ebc129f831d9bfea162e377d598fe92.tar.bz2
[svn-r4312] Purpose:
Feature shift Description: Take out the v1.2.x compatibility stubs and put in the hooks for v1.4.x compatibility when needed. Platforms tested: FreeBSD 4.3 (hawkwind)
Diffstat (limited to 'test')
-rw-r--r--test/big.c8
-rw-r--r--test/h5test.c98
-rw-r--r--test/istore.c4
-rw-r--r--test/tarray.c104
4 files changed, 0 insertions, 214 deletions
diff --git a/test/big.c b/test/big.c
index a35d974..42819de 100644
--- a/test/big.c
+++ b/test/big.c
@@ -120,11 +120,7 @@ enough_room(hid_t fapl)
for (i=0; i<NELMTS(fd); i++) fd[i] = -1;
/* Get file name template */
-#ifdef H5_WANT_H5_V1_2_COMPAT
- assert(H5F_LOW_FAMILY==H5Pget_driver(fapl));
-#else /* H5_WANT_H5_V1_2_COMPAT */
assert(H5FD_FAMILY==H5Pget_driver(fapl));
-#endif /* H5_WANT_H5_V1_2_COMPAT */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
/* Create files */
@@ -370,11 +366,7 @@ main (void)
fapl = h5_fileaccess();
/* The file driver must be the family driver */
-#ifdef H5_WANT_H5_V1_2_COMPAT
- if (H5F_LOW_FAMILY!=H5Pget_driver(fapl)) {
-#else /* H5_WANT_H5_V1_2_COMPAT */
if (H5FD_FAMILY!=H5Pget_driver(fapl)) {
-#endif /* H5_WANT_H5_V1_2_COMPAT */
printf("Changing file drivers to the family driver, %lu bytes each\n",
(unsigned long)FAMILY_SIZE);
if (H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT)<0) goto error;
diff --git a/test/h5test.c b/test/h5test.c
index 0571493..c647a21 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -126,45 +126,13 @@ h5_cleanup(const char *base_name[], hid_t fapl)
char temp[2048];
int i, j;
int retval=0;
-#ifndef H5_WANT_H5_V1_2_COMPAT
hid_t driver;
-#endif /* H5_WANT_H5_V1_2_COMPAT */
if (!HDgetenv("HDF5_NOCLEANUP")) {
for (i = 0; base_name[i]; i++) {
if (h5_fixname(base_name[i], fapl, filename, sizeof(filename)) == NULL)
continue;
-#ifdef H5_WANT_H5_V1_2_COMPAT
- switch (H5Pget_driver(fapl)) {
- case H5F_LOW_CORE:
- break; /*nothing to remove*/
-
- case H5F_LOW_SPLIT:
- HDsnprintf(temp, sizeof(temp), "%s.raw", filename);
- HDremove(temp);
- HDsnprintf(temp, sizeof(temp), "%s.meta", filename);
- HDremove(temp);
- break;
-
- case H5F_LOW_FAMILY:
- for (j = 0; /*void*/; j++) {
- HDsnprintf(temp, sizeof(temp), filename, j);
-
- if (HDaccess(temp, F_OK) < 0)
- break;
-
- HDremove(temp);
- }
-
- break;
-
- default:
- HDremove(filename);
- break;
- }
-#else /* H5_WANT_H5_V1_2_COMPAT */
-
driver = H5Pget_driver(fapl);
if (driver == H5FD_FAMILY) {
@@ -190,7 +158,6 @@ h5_cleanup(const char *base_name[], hid_t fapl)
} else {
HDremove(filename);
}
-#endif /* H5_WANT_H5_V1_2_COMPAT */
}
retval = 1;
@@ -276,54 +243,13 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
const char *suffix = ".h5"; /* suffix has default */
char *ptr, last = '\0';
size_t i, j;
-#ifdef H5_WANT_H5_V1_2_COMPAT
- H5F_driver_t driver;
-#else
hid_t driver;
-#endif /* H5_WANT_H5_V1_2_COMPAT */
if (!base_name || !fullname || size < 1)
return NULL;
memset(fullname, 0, size);
-#ifdef H5_WANT_H5_V1_2_COMPAT
- /* figure out the suffix */
- if (H5P_DEFAULT != fapl){
- if ((driver = H5Pget_driver(fapl)) < 0)
- return NULL;
-
- if (H5F_LOW_FAMILY == driver) {
- suffix = "%05d.h5";
- } else if (H5F_LOW_CORE == driver) {
- suffix = NULL;
- }
- }
-
- /* Use different ones depending on parallel or serial driver used. */
- if (H5P_DEFAULT != fapl && H5F_LOW_MPIO == driver){
- /* For parallel:
- * First use command line option, then the environment variable,
- * then try the constant
- */
- prefix = (paraprefix ? paraprefix : getenv("HDF5_PARAPREFIX"));
-
-#ifdef HDF5_PARAPREFIX
- if (!prefix)
- prefix = HDF5_PARAPREFIX;
-#endif /* HDF5_PARAPREFIX */
- }else{
- /* For serial:
- * First use the environment variable, then try the constant
- */
- prefix = HDgetenv("HDF5_PREFIX");
-
-#ifdef HDF5_PREFIX
- if (!prefix)
- prefix = HDF5_PREFIX;
-#endif /* HDF5_PREFIX */
- }
-#else /* H5_WANT_H5_V1_2_COMPAT */
/* figure out the suffix */
if (H5P_DEFAULT != fapl){
if ((driver = H5Pget_driver(fapl)) < 0)
@@ -358,15 +284,10 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
prefix = HDF5_PREFIX;
#endif /* HDF5_PREFIX */
}
-#endif /* H5_WANT_H5_V1_2_COMPAT */
/* Prepend the prefix value to the base name */
if (prefix && *prefix) {
-#ifdef H5_WANT_H5_V1_2_COMPAT
- if (H5P_DEFAULT != fapl && H5F_LOW_MPIO == driver) {
-#else
if (H5P_DEFAULT != fapl && H5FD_MPIO == driver) {
-#endif /* H5_WANT_H5_V1_2_COMPAT */
/* This is a parallel system */
char *subdir;
@@ -426,25 +347,6 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
HDstrcpy(fullname, base_name);
}
-#ifdef H5_WANT_H5_V1_2_COMPAT
- /* 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:
- suffix = "%05d.h5";
- break;
- default:
- suffix = ".h5";
- break;
- }
-#endif /* H5_WANT_H5_V1_2_COMPAT */
-
/* Append a suffix */
if (suffix) {
if (HDstrlen(fullname) + HDstrlen(suffix) >= size)
diff --git a/test/istore.c b/test/istore.c
index 0961bc8..78142f7 100644
--- a/test/istore.c
+++ b/test/istore.c
@@ -562,11 +562,7 @@ main(int argc, char *argv[])
* For testing file families, fool the library into thinking it already
* allocated a whole bunch of data.
*/
-#ifdef H5_WANT_H5_V1_2_COMPAT
- if (H5F_LOW_FAMILY==H5Pget_driver(fapl)) {
-#else /* H5_WANT_H5_V1_2_COMPAT */
if (H5FD_FAMILY==H5Pget_driver(fapl)) {
-#endif /* H5_WANT_H5_V1_2_COMPAT */
haddr_t addr;
addr = 8 * ((uint64_t)1<<30); /*8 GB */
if (H5FDset_eoa(f->shared->lf, addr)<0) {
diff --git a/test/tarray.c b/test/tarray.c
index 4175d9f..9e5853b 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -695,9 +695,6 @@ test_array_compound_array(void)
typedef struct { /* Typedef for compound datatype */
int i;
float f[ARRAY1_DIM1];
-#ifdef WANT_H5_V1_2_COMPAT
- double d[ARRAY1_DIM1];
-#endif /* WANT_H5_V1_2_COMPAT */
} s1_t;
s1_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */
s1_t rdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information read in */
@@ -709,16 +706,8 @@ test_array_compound_array(void)
hid_t tid3; /* Nested Array Datatype ID */
hsize_t sdims1[] = {SPACE1_DIM1};
hsize_t tdims1[] = {ARRAY1_DIM1};
-#ifdef WANT_H5_V1_2_COMPAT
- size_t msize;
- size_t otdims1[] = {ARRAY1_DIM1};
-#endif /* WANT_H5_V1_2_COMPAT */
int ndims; /* Array rank for reading */
hsize_t rdims1[H5S_MAX_RANK]; /* Array dimensions for reading */
-#ifdef WANT_H5_V1_2_COMPAT
- size_t rdims2[H5S_MAX_RANK]; /* Array dimensions for reading */
- size_t ordims1[H5S_MAX_RANK]; /* Array dimensions for reading */
-#endif /* WANT_H5_V1_2_COMPAT */
int nmemb; /* Number of compound members */
char *mname; /* Name of compound field */
size_t off; /* Offset of compound field */
@@ -736,10 +725,6 @@ test_array_compound_array(void)
wdata[i][j].i=i*10+j;
for(k=0; k<ARRAY1_DIM1; k++)
wdata[i][j].f[k]=i*10+j*2.5+k;
-#ifdef WANT_H5_V1_2_COMPAT
- for(k=0; k<ARRAY1_DIM1; k++)
- wdata[i][j].d[k]=i*15+j*7.5+k;
-#endif /* WANT_H5_V1_2_COMPAT */
} /* end for */
/* Create file */
@@ -770,13 +755,6 @@ test_array_compound_array(void)
ret=H5Tclose(tid3);
CHECK(ret, FAIL, "H5Tclose");
-/* Compatibility code to verify that the old API functions are still working */
-#ifdef WANT_H5_V1_2_COMPAT
- /* Insert double array field */
- ret = H5Tinsert_array (tid2, "d", HOFFSET(s1_t,d), ARRAY1_RANK,otdims1,NULL,H5T_NATIVE_DOUBLE);
- CHECK(ret, FAIL, "H5Tinsert_array");
-#endif /* WANT_H5_V1_2_COMPAT */
-
/* Create an array datatype to refer to */
tid1 = H5Tarray_create (tid2,ARRAY1_RANK,tdims1,NULL);
CHECK(tid1, FAIL, "H5Tarray_create");
@@ -844,11 +822,7 @@ test_array_compound_array(void)
/* Check the number of members */
nmemb=H5Tget_nmembers(tid2);
-#ifdef WANT_H5_V1_2_COMPAT
- VERIFY(nmemb,3,"H5Tget_nmembers");
-#else /* WANT_H5_V1_2_COMPAT */
VERIFY(nmemb,2,"H5Tget_nmembers");
-#endif /* WANT_H5_V1_2_COMPAT */
/* Check the 1st field's name */
mname=H5Tget_member_name(tid2,0);
@@ -890,29 +864,6 @@ test_array_compound_array(void)
mtid=H5Tget_member_type(tid2,1);
CHECK(mtid, FAIL, "H5Tget_member_type");
-#ifdef WANT_H5_V1_2_COMPAT
- /* H5Tget_member_type() returns the base type in v1.2 */
- /* Get the 2nd field's class */
- mclass=H5Tget_class(mtid);
- VERIFY(mclass, H5T_FLOAT, "H5Tget_class");
-
- /* Get the 2nd field's size */
- msize=H5Tget_size(mtid);
- VERIFY(msize, sizeof(float), "H5Tget_size");
-
- /* Get the array dimensions */
- ndims=H5Tget_member_dims(tid2,1,rdims2,NULL);
- VERIFY(ndims, ARRAY1_RANK, "H5Tget_member_dims");
- VERIFY(rdims2[0], ARRAY1_DIM1, "H5Tget_member_dims");
-
- /* Check the array dimensions */
- for(i=0; i<ndims; i++)
- if(rdims2[i]!=tdims1[i]) {
- num_errs++;
- printf("Nested array dimension information doesn't match!, rdims2[%d]=%d, tdims1[%d]=%d\n",(int)i,(int)rdims2[i],(int)i,(int)tdims1[i]);
- continue;
- } /* end if */
-#else /* WANT_H5_V1_2_COMPAT */
/* Get the 2nd field's class */
mclass=H5Tget_class(mtid);
VERIFY(mclass, H5T_ARRAY, "H5Tget_class");
@@ -945,58 +896,11 @@ test_array_compound_array(void)
/* Close the array's base type datatype */
ret=H5Tclose(tid3);
CHECK(mtid, FAIL, "H5Tclose");
-#endif /* WANT_H5_V1_2_COMPAT */
/* Close the member datatype */
ret=H5Tclose(mtid);
CHECK(mtid, FAIL, "H5Tclose");
-/* Compatibility code to verify that the old API functions are still working */
-#ifdef WANT_H5_V1_2_COMPAT
- /* Check the 3rd field's name */
- mname=H5Tget_member_name(tid2,2);
- CHECK(mname, NULL, "H5Tget_member_name");
- if(HDstrcmp(mname,"d")!=0) {
- num_errs++;
- printf("Compound field name doesn't match!, mname=%s\n",mname);
- } /* end if */
- free(mname);
-
- /* Check the 3rd field's offset */
- off=H5Tget_member_offset(tid2,2);
- VERIFY(off, HOFFSET(s1_t,d), "H5Tget_member_offset");
-
- /* Check the 2nd field's datatype */
- mtid=H5Tget_member_type(tid2,2);
- CHECK(mtid, FAIL, "H5Tget_member_type");
-
- /* H5Tget_member_type() returns the base type in v1.2 */
- /* Get the 3rd field's class */
- mclass=H5Tget_class(mtid);
- VERIFY(mclass, H5T_FLOAT, "H5Tget_class");
-
- /* Get the 3rd field's size */
- msize=H5Tget_size(mtid);
- VERIFY(msize, sizeof(double), "H5Tget_size");
-
- /* Check the array rank */
- ndims=H5Tget_member_dims(tid2,2,ordims1,NULL);
- VERIFY(ndims,ARRAY1_RANK,"H5Tget_member_dims");
-
- /* Check the array dimensions */
- for(i=0; i<ndims; i++)
- if(ordims1[i]!=otdims1[i]) {
- num_errs++;
- printf("Nested array dimension information doesn't match!, ordims1[%d]=%d, otdims1[%d]=%d\n",(int)i,(int)ordims1[i],(int)i,(int)otdims1[i]);
- continue;
- } /* end if */
-
- /* Close the member datatype */
- ret=H5Tclose(mtid);
- CHECK(mtid, FAIL, "H5Tclose");
-
-#endif /* WANT_H5_V1_2_COMPAT */
-
/* Close Compound Datatype */
ret = H5Tclose(tid2);
CHECK(ret, FAIL, "H5Tclose");
@@ -1875,20 +1779,16 @@ test_compat(void)
hid_t fid1; /* HDF5 File IDs */
hid_t dataset; /* Dataset ID */
hid_t tid1; /* Array Datatype ID */
-#ifndef WANT_H5_V1_2_COMPAT
hid_t tid2; /* Datatype ID */
hsize_t tdims1[] = {ARRAY1_DIM1};
int ndims; /* Array rank for reading */
hsize_t rdims1[H5S_MAX_RANK]; /* Array dimensions for reading */
-#endif /* !WANT_H5_V1_2_COMPAT */
H5T_class_t mclass; /* Datatype class for VL */
int nmemb; /* Number of compound members */
char *mname; /* Name of compound field */
size_t off; /* Offset of compound field */
hid_t mtid; /* Datatype ID for field */
-#ifndef WANT_H5_V1_2_COMPAT
intn i; /* Index variables */
-#endif /* !WANT_H5_V1_2_COMPAT */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -2062,7 +1962,6 @@ test_compat(void)
off=H5Tget_member_offset(tid1,1);
VERIFY(off, 4, "H5Tget_member_offset");
-#ifndef WANT_H5_V1_2_COMPAT
/* Check the 2nd field's datatype */
mtid=H5Tget_member_type(tid1,1);
CHECK(mtid, FAIL, "H5Tget_member_type");
@@ -2099,7 +1998,6 @@ test_compat(void)
CHECK(ret, FAIL, "H5Tclose");
ret=H5Tclose(mtid);
CHECK(ret, FAIL, "H5Tclose");
-#endif /* !WANT_H5_V1_2_COMPAT */
/* Check the 3rd field's name */
mname=H5Tget_member_name(tid1,2);
@@ -2114,7 +2012,6 @@ test_compat(void)
off=H5Tget_member_offset(tid1,2);
VERIFY(off, 20, "H5Tget_member_offset");
-#ifndef WANT_H5_V1_2_COMPAT
/* Check the 3rd field's datatype */
mtid=H5Tget_member_type(tid1,2);
CHECK(mtid, FAIL, "H5Tget_member_type");
@@ -2151,7 +2048,6 @@ test_compat(void)
CHECK(ret, FAIL, "H5Tclose");
ret=H5Tclose(mtid);
CHECK(ret, FAIL, "H5Tclose");
-#endif /* !WANT_H5_V1_2_COMPAT */
/* Check the 4th field's name */
mname=H5Tget_member_name(tid1,3);