mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-30 15:32:37 +08:00
[svn-r2725] Purpose:
Bug fix. Description: Could not find the pre-created file for the H5S_MAX_RANK test when --srcdir option is used. testhdf5 was looking for it in the currect directory only. Solution: Make use of the value of the environment variable srcdir that is passed to the tests. Compose the real location of the testfile in order to open it even from a remote build directory. Platforms tested: Modi4, arabica, eirene
This commit is contained in:
parent
810d2979cc
commit
493f90f74a
24
test/th5s.c
24
test/th5s.c
@ -168,12 +168,26 @@ test_h5s_basic(void)
|
||||
* If this test fails and the H5S_MAX_RANK variable has changed, follow
|
||||
* the instructions in space_overflow.c for regenating the th5s.h5 file.
|
||||
*/
|
||||
fid1 = H5Fopen(TESTFILE, H5F_ACC_RDONLY, H5P_DEFAULT);
|
||||
{
|
||||
char testfile[512]="";
|
||||
char *srcdir = getenv("srcdir");
|
||||
if (srcdir && ((strlen(srcdir) + strlen(TESTFILE) + 1) < sizeof(testfile))){
|
||||
strcpy(testfile, srcdir);
|
||||
strcat(testfile, "/");
|
||||
}
|
||||
strcat(testfile, TESTFILE);
|
||||
fid1 = H5Fopen(testfile, H5F_ACC_RDONLY, H5P_DEFAULT);
|
||||
CHECK_I(fid1, "H5Fopen");
|
||||
dset1 = H5Dopen(fid1, "dset");
|
||||
VERIFY(dset1, FAIL, "H5Dopen");
|
||||
ret = H5Fclose(fid1);
|
||||
CHECK_I(ret, "H5Fclose");
|
||||
if (fid1 >= 0){
|
||||
dset1 = H5Dopen(fid1, "dset");
|
||||
VERIFY(dset1, FAIL, "H5Dopen");
|
||||
ret = H5Fclose(fid1);
|
||||
CHECK_I(ret, "H5Fclose");
|
||||
}
|
||||
else
|
||||
printf("***cannot open the pre-created H5S_MAX_RANK test file (%s)\n",
|
||||
testfile);
|
||||
}
|
||||
|
||||
/* Verify that incorrect dimensions don't work */
|
||||
dims1[0]=0;
|
||||
|
Loading…
Reference in New Issue
Block a user