From 7de24aa706e7d283a36d7bbbaf57edba0296d4bc Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Thu, 11 Mar 2004 22:43:23 -0500 Subject: [svn-r8255] Purpose: bug fix Description: the added binary files to read did not have the construction of the "srcdir" path Solution: add it Platforms tested: linux Misc. update: --- test/dsets.c | 26 ++++++++++++++++++++++++-- 1 file 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 */ -- cgit v0.12