summaryrefslogtreecommitdiffstats
path: root/test/dsets.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/dsets.c')
-rw-r--r--test/dsets.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/test/dsets.c b/test/dsets.c
index 9ce6604..58c315d 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -3316,6 +3316,8 @@ test_filters_endianess(void)
int buf[2];
int rank=1;
int i;
+ char *srcdir = getenv("srcdir"); /* the source directory */
+ char data_file[512]=""; /* buffer to hold name of existing file */
for (i=0; i<2; i++){
buf[i]=1;
@@ -3356,8 +3358,18 @@ test_filters_endianess(void)
* step 2: open a file written on a little-endian machine in step 1
*-------------------------------------------------------------------------
*/
+
+ /* compose the name of the file to open, using the srcdir, if appropriate */
+ strcpy(data_file, "");
+ if ( srcdir )
+ {
+ strcpy(data_file, srcdir);
+ strcat(data_file, "/");
+ }
+ strcat( data_file, "test_filters_le.hdf5");
+
/* open */
- if ((fid=H5Fopen("test_filters_le.hdf5",H5F_ACC_RDONLY,H5P_DEFAULT))<0)
+ if ((fid=H5Fopen(data_file,H5F_ACC_RDONLY,H5P_DEFAULT))<0)
goto error;
/* read */
@@ -3369,8 +3381,18 @@ test_filters_endianess(void)
* step 3: open a file written on a big-endian machine in step 1
*-------------------------------------------------------------------------
*/
+
+ /* compose the name of the file to open, using the srcdir, if appropriate */
+ strcpy(data_file, "");
+ if ( srcdir )
+ {
+ strcpy(data_file, srcdir);
+ strcat(data_file, "/");
+ }
+ strcat( data_file, "test_filters_be.hdf5");
+
/* open */
- if ((fid=H5Fopen("test_filters_be.hdf5",H5F_ACC_RDONLY,H5P_DEFAULT))<0)
+ if ((fid=H5Fopen(data_file,H5F_ACC_RDONLY,H5P_DEFAULT))<0)
goto error;
/* read */