summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2002-04-12 21:38:57 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2002-04-12 21:38:57 (GMT)
commitb0d1790d6a238835085ac2e37e1858a5ce3a4106 (patch)
treead84b30d277a955c3a84cbc5d15a7e897444fb19
parent7a5a24f081f02f4ecc5c4ab49b6809589a88e67b (diff)
downloadhdf5-b0d1790d6a238835085ac2e37e1858a5ce3a4106.zip
hdf5-b0d1790d6a238835085ac2e37e1858a5ce3a4106.tar.gz
hdf5-b0d1790d6a238835085ac2e37e1858a5ce3a4106.tar.bz2
[svn-r5181]
Purpose: Bug fix Description: fillval.c doesn't know how to find fill_new.h5 in source directory. Solution: Prepend source directory to file name in fillval.c Platforms tested: Linux 2.2
-rw-r--r--test/fillval.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/fillval.c b/test/fillval.c
index c8ecf2e..424fd2c 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -708,9 +708,19 @@ test_compatible(void)
int rd_fill=0, fill_val1=4444, val_rd=0, fill_val2=5555;
hsize_t dims[2], one[2]={1,1};
hssize_t hs_offset[2]={3,4};
+ 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;