summaryrefslogtreecommitdiffstats
path: root/test/fillval.c
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2002-04-12 21:08:48 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2002-04-12 21:08:48 (GMT)
commit55486f1418fcb636fc37a81b65f1c59d3ea4f4f0 (patch)
treed8cba56b8183a0076fab88f8fcb8c868ef47935d /test/fillval.c
parent48f1fde29e21ff5a84808d55ded555e79679af92 (diff)
downloadhdf5-55486f1418fcb636fc37a81b65f1c59d3ea4f4f0.zip
hdf5-55486f1418fcb636fc37a81b65f1c59d3ea4f4f0.tar.gz
hdf5-55486f1418fcb636fc37a81b65f1c59d3ea4f4f0.tar.bz2
[svn-r5180]
Purpose: Bug Fix Description: Reading fill_old.h5 from fillval.c has problem to find from building directory. Solution: prepend source directory into file name. Platforms tested: Linux 2.2
Diffstat (limited to 'test/fillval.c')
-rw-r--r--test/fillval.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/fillval.c b/test/fillval.c
index c966005..100180f 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -1251,9 +1251,20 @@ test_compatible(void)
hsize_t dims[2], one[2]={1,1};
hssize_t hs_offset[2]={3,4};
H5D_fill_value_t status;
+ char *srcdir = getenv("srcdir"); /*where the src code is located*/
+ char testfile[512]=""; /* test file name */
TESTING("contiguous dataset compatibility with v. 1.5");
- if((file=H5Fopen(FILE_COMPATIBLE, H5F_ACC_RDONLY, H5P_DEFAULT))<0) goto error;
+
+ /* Generate correct name for test file by prepending the source path */
+ if(srcdir && ((strlen(srcdir) + strlen(FILE_COMPATIBLE) + 1) <
+ sizeof(testfile))) {
+ strcpy(testfile, srcdir);
+ strcat(testfile, "/");
+ }
+ strcat(testfile, FILE_COMPATIBLE);
+
+ if((file=H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT))<0) goto error;
if((dset1=H5Dopen(file, "dset1"))<0) goto error;
if ((dcpl1=H5Dget_create_plist(dset1))<0) goto error;