diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2003-01-24 18:09:57 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2003-01-24 18:09:57 (GMT) |
commit | a6542d06b12340af99731eacb1d9687cdc8738ed (patch) | |
tree | 4852a2c3f1ac831c522a776bc3bfa95faa922a27 /test/tmisc.c | |
parent | e4dc71bbee2d38d01adb4a39bdf52a4c79e2d746 (diff) | |
download | hdf5-a6542d06b12340af99731eacb1d9687cdc8738ed.zip hdf5-a6542d06b12340af99731eacb1d9687cdc8738ed.tar.gz hdf5-a6542d06b12340af99731eacb1d9687cdc8738ed.tar.bz2 |
[svn-r6330] Purpose:
Bug Fix
Description:
When calling H5Fopen with the core VFL driver, but without the
H5F_ACC_CREAT flag goes ahead and creates a memory file.
Solution:
Check for the H5F_ACC_CREAT flag before allowing the memory file to be
created.
Platforms tested:
FreeBSD 4.7 (sleipnir)
Diffstat (limited to 'test/tmisc.c')
-rw-r--r-- | test/tmisc.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/tmisc.c b/test/tmisc.c index 6d86983..303aa17 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -137,6 +137,9 @@ typedef struct #define MISC8_CHUNK_DIM0 10 #define MISC8_CHUNK_DIM1 10 +/* Definitions for misc. test #9 */ +#define MISC9_FILE "tmisc9.h5" + /**************************************************************** ** ** test_misc1(): test unlinking a dataset from a group and immediately @@ -1538,6 +1541,34 @@ test_misc8(void) /**************************************************************** ** +** test_misc9(): Test that H5Fopen() does not succeed for core +** files, H5Fcreate() must be used to open them. +** +****************************************************************/ +static void +test_misc9(void) +{ + hid_t fapl, fid; + herr_t ret; + + /* Output message about test being performed */ + MESSAGE(5, ("Testing core file opening\n")); + + fapl = H5Pcreate(H5P_FILE_ACCESS); + CHECK(fapl, FAIL, "H5Pcreate"); + + ret=H5Pset_fapl_core(fapl, 1024, 0); + CHECK(ret, FAIL, "H5Pset_fapl_core"); + + fid = H5Fopen(MISC9_FILE, H5F_ACC_RDWR, fapl); + VERIFY(fid,FAIL,"H5Fopen"); + + ret=H5Pclose(fapl); + CHECK(ret, FAIL, "H5Pset_fapl_core"); +} /* end test_misc9() */ + +/**************************************************************** +** ** test_misc(): Main misc. test routine. ** ****************************************************************/ @@ -1555,6 +1586,7 @@ test_misc(void) test_misc6(); /* Test object header continuation code */ test_misc7(); /* Test for sensible datatypes stored on disk */ test_misc8(); /* Test storage sizes of various types of dataset storage */ + test_misc9(); /* Test for opening (not creating) core files */ } /* test_misc() */ @@ -1586,4 +1618,5 @@ cleanup_misc(void) remove(MISC6_FILE); remove(MISC7_FILE); remove(MISC8_FILE); + remove(MISC9_FILE); } |