From c63f96d6e78cfe98de8001b662ec685467fd65df Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Wed, 20 Apr 2016 15:53:47 -0500 Subject: [PATCH] [svn-r29755] test/ohdr.c apply fix for HDFFV-9713 to not open test file in source with write permission. config/linux-gnulibc1 reapply filx for HDFFV-9439 which was partially removed, probably by merge from revise_chunks branch. Tested with h5committest.new on kituo, ostrich, osx1010dev and platypus. --- config/linux-gnulibc1 | 1 + test/ohdr.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/config/linux-gnulibc1 b/config/linux-gnulibc1 index 967cb4eafb..1b4785e71d 100644 --- a/config/linux-gnulibc1 +++ b/config/linux-gnulibc1 @@ -200,6 +200,7 @@ case $FC in *mpif90*) fc_version_info=`$FC $FCFLAGS $H5_FCFLAGS -v 2>&1 | grep 'version' |\ sed 's/^[a-z0-9]* for //' |\ + sed 's/\"/\\\"/g' |\ sed 's/^\([a-z]* \)/ built with \1/1'` fc_version_info=`echo $fc_version_info` ;; diff --git a/test/ohdr.c b/test/ohdr.c index 8dbe05e349..ad7c746e0b 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -322,7 +322,18 @@ test_unknown(unsigned bogus_id, char *filename, hid_t fapl) hid_t fid_bogus = -1; /* bogus file ID */ hid_t gid_bogus = -1; /* bogus group ID */ hid_t loc_bogus = -1; /* location: bogus file or group ID */ - const char *testfile = H5_get_srcdir_filename(FILE_BOGUS); + char testfile[256]; + + /* create a different name for a local copy of the data file to be + opened with rd/wr file permissions in case build and test are + done in the source directory. */ + HDstrncpy(testfile, FILE_BOGUS, strlen(FILE_BOGUS)); + testfile[strlen(FILE_BOGUS)]='\0'; + HDstrncat(testfile, ".copy", 5); + + /* Make a copy of the data file from svn. */ + if(h5_make_local_copy(FILE_BOGUS, testfile) < 0) + FAIL_STACK_ERROR TESTING("object with unknown header message and no flags set");