diff options
author | Quincey Koziol <koziol@koziol.gov> | 2020-01-04 04:16:38 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-05-20 14:20:23 (GMT) |
commit | d1d4635550d989a887db98791213c455894b48eb (patch) | |
tree | d5211375925133398e500dc157819b289b737566 /test/ohdr.c | |
parent | d459e350a57464945d6645a36dc420a160ed1aee (diff) | |
download | hdf5-d1d4635550d989a887db98791213c455894b48eb.zip hdf5-d1d4635550d989a887db98791213c455894b48eb.tar.gz hdf5-d1d4635550d989a887db98791213c455894b48eb.tar.bz2 |
Small changes from the token_refactoring branch, to reduce the delta to develop
Diffstat (limited to 'test/ohdr.c')
-rw-r--r-- | test/ohdr.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/ohdr.c b/test/ohdr.c index f526c87..2634563 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -50,7 +50,8 @@ const char *FILENAME[] = { * To get this data file, define H5O_ENABLE_BOGUS in src/H5Oprivate, rebuild * the library and simply compile gen_bogus.c with that HDF5 library and run it. */ -#define FILE_BOGUS "tbogus.h5" +#define FILE_BOGUS "tbogus.h5" +#define TESTFILE_LEN 256 /* */ #define FILE_OHDR_SWMR "ohdr_swmr.h5" @@ -473,10 +474,14 @@ 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 */ + char testfile[TESTFILE_LEN]; + /* 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. */ - const char testfile[] = FILE_BOGUS ".copy"; + HDstrncpy(testfile, FILE_BOGUS, TESTFILE_LEN); + testfile[TESTFILE_LEN - 1]='\0'; + HDstrncat(testfile, ".copy", 5); /* Make a copy of the data file from svn. */ if(h5_make_local_copy(FILE_BOGUS, testfile) < 0) @@ -755,7 +760,7 @@ count_attributes(hid_t dset_id) { H5O_info_t info; - if(H5Oget_info2(dset_id, &info, H5O_INFO_ALL) < 0) + if(H5Oget_info2(dset_id, &info, H5O_INFO_NUM_ATTRS) < 0) return -1; else return (int)info.num_attrs; /* should never exceed int bounds */ |