2003-04-01 01:59:04 +08:00
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2007-02-07 22:56:24 +08:00
* Copyright by The HDF Group . *
2003-04-01 01:59:04 +08:00
* Copyright by the Board of Trustees of the University of Illinois . *
* All rights reserved . *
* *
* This file is part of HDF5 . The full HDF5 copyright notice , including *
* terms governing use , modification , and redistribution , is contained in *
* the files COPYING and Copyright . html . COPYING can be found at the root *
* of the source code distribution tree ; Copyright . html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top - level documents page . It can also be found at *
2007-02-07 22:56:24 +08:00
* http : //hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file , you may request a copy from help @ hdfgroup . org . *
2003-04-01 01:59:04 +08:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
1997-07-31 05:17:56 +08:00
/***********************************************************
*
1998-04-09 05:43:02 +08:00
* Test program : tfile
1997-07-31 05:17:56 +08:00
*
* Test the low - level file I / O features .
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2001-11-21 02:47:15 +08:00
# include "hdf5.h"
2001-04-04 02:09:16 +08:00
# include "testhdf5.h"
2010-03-18 20:23:04 +08:00
# include "H5srcdir.h"
1997-07-31 05:17:56 +08:00
2001-04-04 02:09:16 +08:00
# include "H5Bprivate.h"
# include "H5Pprivate.h"
1997-08-16 00:53:11 +08:00
2009-04-09 05:53:31 +08:00
/*
* This file needs to access private information from the H5F package .
* This file also needs to access the file testing code .
*/
# define H5F_PACKAGE
# define H5F_TESTING
# include "H5Fpkg.h" /* File access */
[svn-r17459] Description:
Correct bad interaction between non-zero userblocks with non-zero
alignments.
Also add some additional range checking and tests for invalid userblock
sizes.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-09 04:15:37 +08:00
# define BAD_USERBLOCK_SIZE1 (hsize_t)1
# define BAD_USERBLOCK_SIZE2 (hsize_t)2
# define BAD_USERBLOCK_SIZE3 (hsize_t)3
# define BAD_USERBLOCK_SIZE4 (hsize_t)64
# define BAD_USERBLOCK_SIZE5 (hsize_t)511
# define BAD_USERBLOCK_SIZE6 (hsize_t)513
# define BAD_USERBLOCK_SIZE7 (hsize_t)6144
1998-04-09 05:43:02 +08:00
# define F1_USERBLOCK_SIZE (hsize_t)0
1999-08-18 03:12:59 +08:00
# define F1_OFFSET_SIZE sizeof(haddr_t)
1998-04-09 05:43:02 +08:00
# define F1_LENGTH_SIZE sizeof(hsize_t)
# define F1_SYM_LEAF_K 4
# define F1_SYM_INTERN_K 16
# define FILE1 "tfile1.h5"
2009-09-25 02:26:42 +08:00
# define SFILE1 "sys_file1"
1998-04-09 05:43:02 +08:00
# define F2_USERBLOCK_SIZE (hsize_t)512
# define F2_OFFSET_SIZE 8
# define F2_LENGTH_SIZE 8
# define F2_SYM_LEAF_K 8
# define F2_SYM_INTERN_K 32
2001-04-24 04:05:15 +08:00
# define F2_RANK 2
# define F2_DIM0 4
# define F2_DIM1 6
2005-08-14 04:53:35 +08:00
# define F2_DSET "dset"
1998-04-09 05:43:02 +08:00
# define FILE2 "tfile2.h5"
# define F3_USERBLOCK_SIZE (hsize_t)0
# define F3_OFFSET_SIZE F2_OFFSET_SIZE
# define F3_LENGTH_SIZE F2_LENGTH_SIZE
# define F3_SYM_LEAF_K F2_SYM_LEAF_K
# define F3_SYM_INTERN_K F2_SYM_INTERN_K
# define FILE3 "tfile3.h5"
1997-07-31 05:17:56 +08:00
2003-12-18 00:39:17 +08:00
# define GRP_NAME " / group"
2003-11-01 02:48:42 +08:00
# define DSET_NAME "dataset"
2003-10-30 01:04:58 +08:00
# define ATTR_NAME "attr"
2003-10-30 02:27:37 +08:00
# define TYPE_NAME "type"
2003-10-30 01:04:58 +08:00
# define FILE4 "tfile4.h5"
2001-12-12 03:53:44 +08:00
# define OBJ_ID_COUNT_0 0
2005-08-14 04:53:35 +08:00
# define OBJ_ID_COUNT_1 1
2001-12-12 03:53:44 +08:00
# define OBJ_ID_COUNT_2 2
2005-08-14 04:53:35 +08:00
# define OBJ_ID_COUNT_3 3
# define OBJ_ID_COUNT_4 4
# define OBJ_ID_COUNT_6 6
# define OBJ_ID_COUNT_8 8
2001-12-12 03:53:44 +08:00
2005-06-02 05:20:10 +08:00
# define GROUP1 "Group1"
# define DSET1 "Dataset1"
# define DSET2 " / Group1 / Dataset2"
2005-07-21 22:48:26 +08:00
# define TESTA_GROUPNAME "group"
# define TESTA_DSETNAME "dataset"
# define TESTA_ATTRNAME "attribute"
# define TESTA_DTYPENAME "compound"
# define TESTA_NAME_BUF_SIZE 64
# define TESTA_RANK 2
# define TESTA_NX 4
# define TESTA_NY 5
2009-03-26 23:12:48 +08:00
# define USERBLOCK_SIZE ((hsize_t) 512)
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
/* Declarations for test_filespace_*() */
# define FILENAME_LEN 1024 /* length of file name */
# define CORE_INCREMENT 1024 /* core file */
# define FAMILY_SIZE 1024 /* family file */
# define DSETNAME "dset" /* Name of dataset */
# define NELMTS(X) (sizeof(X) / sizeof(X[0])) /* # of elements */
# define READ_OLD_BUFSIZE 1024 /* Buffer for holding file data */
# define FILE5 "tfile5.h5" /* Test file */
# define TEST_THRESHOLD10 10 /* Free space section threshold */
2011-03-16 04:55:05 +08:00
/* Declaration for test_libver_macros2() */
# define FILE6 "tfile6.h5" /* Test file */
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
const char * OLD_FILENAME [ ] = { /* Files created under 1.6 branch and 1.8 branch */
" filespace_1_6.h5 " , /* 1.6 HDF5 file */
" filespace_1_8.h5 " /* 1.8 HDF5 file */
} ;
const char * FILESPACE_NAME [ ] = {
" tfilespace " ,
NULL
} ;
const char * FILENAME [ ] = {
" sec2_tfile " ,
" split_tfile " ,
" stdio_tfile " ,
" core_tfile " ,
" family_tfile " ,
NULL
} ;
2001-12-12 03:53:44 +08:00
static void
create_objects ( hid_t , hid_t , hid_t * , hid_t * , hid_t * , hid_t * ) ;
static void
test_obj_count_and_id ( hid_t , hid_t , hid_t , hid_t , hid_t , hid_t ) ;
2005-08-14 04:53:35 +08:00
static void
2003-11-01 02:48:42 +08:00
check_file_id ( hid_t , hid_t ) ;
2001-12-12 03:53:44 +08:00
1997-07-31 05:17:56 +08:00
/****************************************************************
* *
* * test_file_create ( ) : Low - level file creation I / O test routine .
2005-08-14 04:53:35 +08:00
* *
1997-07-31 05:17:56 +08:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2005-08-14 04:53:35 +08:00
static void
1998-01-17 06:23:43 +08:00
test_file_create ( void )
1997-07-31 05:17:56 +08:00
{
1998-04-09 05:43:02 +08:00
hid_t fid1 , fid2 , fid3 ; /* HDF5 File IDs */
hid_t tmpl1 , tmpl2 ; /*file creation templates */
hsize_t ublock ; /*sizeof userblock */
size_t parm ; /*file-creation parameters */
size_t parm2 ; /*file-creation parameters */
2003-07-11 03:39:04 +08:00
unsigned iparm ;
2001-11-04 06:27:54 +08:00
unsigned iparm2 ;
1998-04-09 05:43:02 +08:00
herr_t ret ; /*generic return value */
1997-07-31 05:17:56 +08:00
/* Output message about test being performed */
1997-08-30 00:59:28 +08:00
MESSAGE ( 5 , ( " Testing Low-Level File Creation I/O \n " ) ) ;
1997-07-31 05:17:56 +08:00
2005-12-09 03:35:34 +08:00
/* First ensure the file does not exist */
2006-03-10 05:34:34 +08:00
HDremove ( FILE1 ) ;
2005-12-09 03:35:34 +08:00
/* Try opening a non-existant file */
fid1 = H5Fopen ( FILE1 , H5F_ACC_RDWR , H5P_DEFAULT ) ;
VERIFY ( fid1 , FAIL , " H5Fopen " ) ;
1998-04-24 06:08:16 +08:00
/* Test create with various sequences of H5F_ACC_EXCL and */
/* H5F_ACC_TRUNC flags */
/* Create with H5F_ACC_EXCL */
fid1 = H5Fcreate ( FILE1 , H5F_ACC_EXCL , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( fid1 , FAIL , " H5Fcreate " ) ;
1999-08-11 04:21:32 +08:00
/*
* try to create the same file with H5F_ACC_TRUNC . This should fail
* because fid1 is the same file and is currently open .
*/
2006-03-10 05:34:34 +08:00
# ifndef H5_HAVE_FILE_VERSIONS
1998-04-24 06:08:16 +08:00
fid2 = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
VERIFY ( fid2 , FAIL , " H5Fcreate " ) ;
2006-03-10 05:34:34 +08:00
# endif /*H5_DONT_HAVE_FILE_VERSIONS*/
1998-04-24 06:08:16 +08:00
1999-08-11 04:21:32 +08:00
/* Close all files */
1998-04-24 06:08:16 +08:00
ret = H5Fclose ( fid1 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
2006-03-10 05:34:34 +08:00
# ifndef H5_HAVE_FILE_VERSIONS
1999-08-11 04:21:32 +08:00
ret = H5Fclose ( fid2 ) ;
2001-01-17 02:11:54 +08:00
VERIFY ( ret , FAIL , " H5Fclose " ) ; /*file should not have been open */
2006-03-10 05:34:34 +08:00
# endif /*H5_HAVE_FILE_VERSIONS*/
1998-04-24 06:08:16 +08:00
1999-08-11 04:21:32 +08:00
/*
* Try again with H5F_ACC_EXCL . This should fail because the file already
* exists from the previous steps .
*/
1998-04-24 06:08:16 +08:00
fid1 = H5Fcreate ( FILE1 , H5F_ACC_EXCL , H5P_DEFAULT , H5P_DEFAULT ) ;
VERIFY ( fid1 , FAIL , " H5Fcreate " ) ;
1999-08-11 04:21:32 +08:00
/* Test create with H5F_ACC_TRUNC. This will truncate the existing file. */
1998-02-26 03:13:49 +08:00
fid1 = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
1998-01-17 06:23:43 +08:00
CHECK ( fid1 , FAIL , " H5Fcreate " ) ;
1997-07-31 05:17:56 +08:00
2006-03-10 05:34:34 +08:00
# ifndef H5_HAVE_FILE_VERSIONS
1999-08-11 04:21:32 +08:00
/*
* Try to truncate first file again . This should fail because fid1 is the
* same file and is currently open .
*/
1998-02-26 03:13:49 +08:00
fid2 = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
1998-01-17 06:23:43 +08:00
VERIFY ( fid2 , FAIL , " H5Fcreate " ) ;
1997-07-31 05:17:56 +08:00
1999-08-11 04:21:32 +08:00
/*
* Try with H5F_ACC_EXCL . This should fail too because the file already
* exists .
*/
1998-04-24 06:08:16 +08:00
fid2 = H5Fcreate ( FILE1 , H5F_ACC_EXCL , H5P_DEFAULT , H5P_DEFAULT ) ;
VERIFY ( fid2 , FAIL , " H5Fcreate " ) ;
2006-03-10 05:34:34 +08:00
# endif /*H5_HAVE_FILE_VERSIONS*/
1998-04-24 06:08:16 +08:00
1997-07-31 05:17:56 +08:00
/* Get the file-creation template */
1998-09-09 03:15:44 +08:00
tmpl1 = H5Fget_create_plist ( fid1 ) ;
CHECK ( tmpl1 , FAIL , " H5Fget_create_plist " ) ;
1997-07-31 05:17:56 +08:00
/* Get the file-creation parameters */
1998-04-09 05:43:02 +08:00
ret = H5Pget_userblock ( tmpl1 , & ublock ) ;
1998-02-26 03:13:49 +08:00
CHECK ( ret , FAIL , " H5Pget_userblock " ) ;
1998-04-09 05:43:02 +08:00
VERIFY ( ublock , F1_USERBLOCK_SIZE , " H5Pget_userblock " ) ;
1997-07-31 05:17:56 +08:00
1998-02-26 03:13:49 +08:00
ret = H5Pget_sizes ( tmpl1 , & parm , & parm2 ) ;
CHECK ( ret , FAIL , " H5Pget_sizes " ) ;
VERIFY ( parm , F1_OFFSET_SIZE , " H5Pget_sizes " ) ;
VERIFY ( parm2 , F1_LENGTH_SIZE , " H5Pget_sizes " ) ;
1997-07-31 05:17:56 +08:00
1998-02-26 03:13:49 +08:00
ret = H5Pget_sym_k ( tmpl1 , & iparm , & iparm2 ) ;
CHECK ( ret , FAIL , " H5Pget_sym_k " ) ;
VERIFY ( iparm , F1_SYM_INTERN_K , " H5Pget_sym_k " ) ;
VERIFY ( iparm2 , F1_SYM_LEAF_K , " H5Pget_sym_k " ) ;
1997-07-31 05:17:56 +08:00
/* Release file-creation template */
1998-03-13 05:04:53 +08:00
ret = H5Pclose ( tmpl1 ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
1998-01-17 06:23:43 +08:00
1998-02-20 02:26:49 +08:00
# ifdef LATER
1997-07-31 05:17:56 +08:00
/* Double-check that the atom has been vaporized */
1998-03-13 05:04:53 +08:00
ret = H5Pclose ( tmpl1 ) ;
VERIFY ( ret , FAIL , " H5Pclose " ) ;
1998-02-20 02:26:49 +08:00
# endif
1997-07-31 05:17:56 +08:00
/* Create a new file with a non-standard file-creation template */
1998-02-26 03:13:49 +08:00
tmpl1 = H5Pcreate ( H5P_FILE_CREATE ) ;
2005-01-29 01:32:44 +08:00
CHECK ( tmpl1 , FAIL , " H5Pcreate " ) ;
1997-07-31 05:17:56 +08:00
[svn-r17459] Description:
Correct bad interaction between non-zero userblocks with non-zero
alignments.
Also add some additional range checking and tests for invalid userblock
sizes.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-09 04:15:37 +08:00
/* Try setting some bad userblock sizes */
H5E_BEGIN_TRY {
ret = H5Pset_userblock ( tmpl1 , BAD_USERBLOCK_SIZE1 ) ;
} H5E_END_TRY ;
VERIFY ( ret , FAIL , " H5Pset_userblock " ) ;
H5E_BEGIN_TRY {
ret = H5Pset_userblock ( tmpl1 , BAD_USERBLOCK_SIZE2 ) ;
} H5E_END_TRY ;
VERIFY ( ret , FAIL , " H5Pset_userblock " ) ;
H5E_BEGIN_TRY {
ret = H5Pset_userblock ( tmpl1 , BAD_USERBLOCK_SIZE3 ) ;
} H5E_END_TRY ;
VERIFY ( ret , FAIL , " H5Pset_userblock " ) ;
H5E_BEGIN_TRY {
ret = H5Pset_userblock ( tmpl1 , BAD_USERBLOCK_SIZE4 ) ;
} H5E_END_TRY ;
VERIFY ( ret , FAIL , " H5Pset_userblock " ) ;
H5E_BEGIN_TRY {
ret = H5Pset_userblock ( tmpl1 , BAD_USERBLOCK_SIZE5 ) ;
} H5E_END_TRY ;
VERIFY ( ret , FAIL , " H5Pset_userblock " ) ;
H5E_BEGIN_TRY {
ret = H5Pset_userblock ( tmpl1 , BAD_USERBLOCK_SIZE6 ) ;
} H5E_END_TRY ;
VERIFY ( ret , FAIL , " H5Pset_userblock " ) ;
H5E_BEGIN_TRY {
ret = H5Pset_userblock ( tmpl1 , BAD_USERBLOCK_SIZE7 ) ;
} H5E_END_TRY ;
VERIFY ( ret , FAIL , " H5Pset_userblock " ) ;
1997-07-31 05:17:56 +08:00
/* Set the new file-creation parameters */
1998-02-26 03:13:49 +08:00
ret = H5Pset_userblock ( tmpl1 , F2_USERBLOCK_SIZE ) ;
CHECK ( ret , FAIL , " H5Pset_userblock " ) ;
1997-07-31 05:17:56 +08:00
2005-06-02 05:20:10 +08:00
ret = H5Pset_sizes ( tmpl1 , ( size_t ) F2_OFFSET_SIZE , ( size_t ) F2_LENGTH_SIZE ) ;
1998-02-26 03:13:49 +08:00
CHECK ( ret , FAIL , " H5Pset_sizes " ) ;
1997-07-31 05:17:56 +08:00
1998-02-26 03:13:49 +08:00
ret = H5Pset_sym_k ( tmpl1 , F2_SYM_INTERN_K , F2_SYM_LEAF_K ) ;
CHECK ( ret , FAIL , " H5Pset_sym_k " ) ;
1997-08-13 23:37:09 +08:00
1998-01-08 01:14:26 +08:00
/*
* Try to create second file , with non - standard file - creation template
* params .
*/
1998-02-26 03:13:49 +08:00
fid2 = H5Fcreate ( FILE2 , H5F_ACC_TRUNC , tmpl1 , H5P_DEFAULT ) ;
1998-01-17 06:23:43 +08:00
CHECK ( fid2 , FAIL , " H5Fcreate " ) ;
1997-07-31 05:17:56 +08:00
/* Release file-creation template */
1998-03-13 05:04:53 +08:00
ret = H5Pclose ( tmpl1 ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
1998-01-17 06:23:43 +08:00
2001-04-24 04:05:15 +08:00
/* Make certain we can create a dataset properly in the file with the userblock */
{
hid_t dataset_id , dataspace_id ; /* identifiers */
hsize_t dims [ F2_RANK ] ;
[svn-r17146] Description:
Bring a bunch of misc. improvements & tweaks from the revise_chunks
branch back to the trunk, so that future merges won't be so painful.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.7 (amazon) in debug mode
Mac OS X/32 10.5.7 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-07-03 05:10:35 +08:00
unsigned data [ F2_DIM0 ] [ F2_DIM1 ] ;
2001-10-06 06:27:58 +08:00
unsigned i , j ;
2001-04-24 04:05:15 +08:00
/* Create the data space for the dataset. */
2005-08-14 04:53:35 +08:00
dims [ 0 ] = F2_DIM0 ;
dims [ 1 ] = F2_DIM1 ;
2001-04-24 04:05:15 +08:00
dataspace_id = H5Screate_simple ( F2_RANK , dims , NULL ) ;
CHECK ( dataspace_id , FAIL , " H5Screate_simple " ) ;
/* Create the dataset. */
[svn-r17146] Description:
Bring a bunch of misc. improvements & tweaks from the revise_chunks
branch back to the trunk, so that future merges won't be so painful.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.7 (amazon) in debug mode
Mac OS X/32 10.5.7 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-07-03 05:10:35 +08:00
dataset_id = H5Dcreate2 ( fid2 , F2_DSET , H5T_NATIVE_UINT , dataspace_id , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
CHECK ( dataset_id , FAIL , " H5Dcreate2 " ) ;
2001-04-24 04:05:15 +08:00
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
for ( i = 0 ; i < F2_DIM0 ; i + + )
for ( j = 0 ; j < F2_DIM1 ; j + + )
data [ i ] [ j ] = i * 10 + j ;
2001-10-06 06:27:58 +08:00
2001-04-24 04:05:15 +08:00
/* Write data to the new dataset */
[svn-r17146] Description:
Bring a bunch of misc. improvements & tweaks from the revise_chunks
branch back to the trunk, so that future merges won't be so painful.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.7 (amazon) in debug mode
Mac OS X/32 10.5.7 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-07-03 05:10:35 +08:00
ret = H5Dwrite ( dataset_id , H5T_NATIVE_UINT , H5S_ALL , H5S_ALL , H5P_DEFAULT , data ) ;
2001-04-24 04:05:15 +08:00
CHECK ( ret , FAIL , " H5Dwrite " ) ;
/* End access to the dataset and release resources used by it. */
ret = H5Dclose ( dataset_id ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
2005-08-14 04:53:35 +08:00
/* Terminate access to the data space. */
2001-04-24 04:05:15 +08:00
ret = H5Sclose ( dataspace_id ) ;
CHECK ( ret , FAIL , " H5Sclose " ) ;
}
1997-07-31 05:17:56 +08:00
/* Get the file-creation template */
1998-09-09 03:15:44 +08:00
tmpl1 = H5Fget_create_plist ( fid2 ) ;
CHECK ( tmpl1 , FAIL , " H5Fget_create_plist " ) ;
1997-07-31 05:17:56 +08:00
/* Get the file-creation parameters */
1998-04-09 05:43:02 +08:00
ret = H5Pget_userblock ( tmpl1 , & ublock ) ;
1998-02-26 03:13:49 +08:00
CHECK ( ret , FAIL , " H5Pget_userblock " ) ;
1998-04-09 05:43:02 +08:00
VERIFY ( ublock , F2_USERBLOCK_SIZE , " H5Pget_userblock " ) ;
1997-07-31 05:17:56 +08:00
1998-02-26 03:13:49 +08:00
ret = H5Pget_sizes ( tmpl1 , & parm , & parm2 ) ;
CHECK ( ret , FAIL , " H5Pget_sizes " ) ;
VERIFY ( parm , F2_OFFSET_SIZE , " H5Pget_sizes " ) ;
VERIFY ( parm2 , F2_LENGTH_SIZE , " H5Pget_sizes " ) ;
1997-08-13 23:37:09 +08:00
1998-02-26 03:13:49 +08:00
ret = H5Pget_sym_k ( tmpl1 , & iparm , & iparm2 ) ;
CHECK ( ret , FAIL , " H5Pget_sym_k " ) ;
VERIFY ( iparm , F2_SYM_INTERN_K , " H5Pget_sym_k " ) ;
VERIFY ( iparm2 , F2_SYM_LEAF_K , " H5Pget_sym_k " ) ;
1997-07-31 05:17:56 +08:00
/* Clone the file-creation template */
1998-03-13 05:04:53 +08:00
tmpl2 = H5Pcopy ( tmpl1 ) ;
CHECK ( tmpl2 , FAIL , " H5Pcopy " ) ;
1997-07-31 05:17:56 +08:00
/* Release file-creation template */
1998-03-13 05:04:53 +08:00
ret = H5Pclose ( tmpl1 ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
1997-07-31 05:17:56 +08:00
/* Set the new file-creation parameter */
1998-02-26 03:13:49 +08:00
ret = H5Pset_userblock ( tmpl2 , F3_USERBLOCK_SIZE ) ;
CHECK ( ret , FAIL , " H5Pset_userblock " ) ;
1997-07-31 05:17:56 +08:00
1998-01-08 01:14:26 +08:00
/*
* Try to create second file , with non - standard file - creation template
* params
*/
1998-02-26 03:13:49 +08:00
fid3 = H5Fcreate ( FILE3 , H5F_ACC_TRUNC , tmpl2 , H5P_DEFAULT ) ;
1998-01-17 06:23:43 +08:00
CHECK ( fid3 , FAIL , " H5Fcreate " ) ;
1997-07-31 05:17:56 +08:00
/* Release file-creation template */
1998-03-13 05:04:53 +08:00
ret = H5Pclose ( tmpl2 ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
1997-07-31 05:17:56 +08:00
/* Get the file-creation template */
1998-09-09 03:15:44 +08:00
tmpl1 = H5Fget_create_plist ( fid3 ) ;
CHECK ( tmpl1 , FAIL , " H5Fget_create_plist " ) ;
1997-07-31 05:17:56 +08:00
/* Get the file-creation parameters */
1998-04-09 05:43:02 +08:00
ret = H5Pget_userblock ( tmpl1 , & ublock ) ;
1998-02-26 03:13:49 +08:00
CHECK ( ret , FAIL , " H5Pget_userblock " ) ;
1998-04-09 05:43:02 +08:00
VERIFY ( ublock , F3_USERBLOCK_SIZE , " H5Pget_userblock " ) ;
1997-07-31 05:17:56 +08:00
1998-02-26 03:13:49 +08:00
ret = H5Pget_sizes ( tmpl1 , & parm , & parm2 ) ;
CHECK ( ret , FAIL , " H5Pget_sizes " ) ;
VERIFY ( parm , F3_OFFSET_SIZE , " H5Pget_sizes " ) ;
VERIFY ( parm2 , F3_LENGTH_SIZE , " H5Pget_sizes " ) ;
1997-07-31 05:17:56 +08:00
1998-02-26 03:13:49 +08:00
ret = H5Pget_sym_k ( tmpl1 , & iparm , & iparm2 ) ;
CHECK ( ret , FAIL , " H5Pget_sym_k " ) ;
VERIFY ( iparm , F3_SYM_INTERN_K , " H5Pget_sym_k " ) ;
VERIFY ( iparm2 , F3_SYM_LEAF_K , " H5Pget_sym_k " ) ;
1997-07-31 05:17:56 +08:00
/* Release file-creation template */
1998-03-13 05:04:53 +08:00
ret = H5Pclose ( tmpl1 ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
1997-07-31 05:17:56 +08:00
/* Close first file */
1998-01-17 06:23:43 +08:00
ret = H5Fclose ( fid1 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
1997-07-31 05:17:56 +08:00
/* Close second file */
1998-01-17 06:23:43 +08:00
ret = H5Fclose ( fid2 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
1997-07-31 05:17:56 +08:00
/* Close third file */
1998-01-17 06:23:43 +08:00
ret = H5Fclose ( fid3 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
1998-04-09 05:43:02 +08:00
} /* test_file_create() */
1997-07-31 05:17:56 +08:00
/****************************************************************
* *
* * test_file_open ( ) : Low - level file open I / O test routine .
2005-08-14 04:53:35 +08:00
* *
1997-07-31 05:17:56 +08:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2005-08-14 04:53:35 +08:00
static void
1998-01-17 06:23:43 +08:00
test_file_open ( void )
1997-07-31 05:17:56 +08:00
{
2003-04-26 04:55:10 +08:00
hid_t fid1 , fid2 ; /*HDF5 File IDs */
hid_t did ; /*dataset ID */
hid_t fapl_id ; /*file access property list ID */
1998-04-09 05:43:02 +08:00
hid_t tmpl1 ; /*file creation templates */
hsize_t ublock ; /*sizeof user block */
size_t parm ; /*file-creation parameters */
size_t parm2 ; /*file-creation parameters */
2003-07-11 03:39:04 +08:00
unsigned iparm ;
2001-11-04 06:27:54 +08:00
unsigned iparm2 ;
2006-08-24 08:52:21 +08:00
unsigned intent ;
1998-04-09 05:43:02 +08:00
herr_t ret ; /*generic return value */
1997-07-31 05:17:56 +08:00
2003-04-26 04:55:10 +08:00
/*
2005-08-14 04:53:35 +08:00
* Test single file open
2003-04-26 04:55:10 +08:00
*/
2005-08-14 04:53:35 +08:00
1997-07-31 05:17:56 +08:00
/* Output message about test being performed */
1997-08-30 00:59:28 +08:00
MESSAGE ( 5 , ( " Testing Low-Level File Opening I/O \n " ) ) ;
1997-07-31 05:17:56 +08:00
1997-09-25 00:30:22 +08:00
/* Open first file */
1998-02-26 03:13:49 +08:00
fid1 = H5Fopen ( FILE2 , H5F_ACC_RDWR , H5P_DEFAULT ) ;
1998-01-17 06:23:43 +08:00
CHECK ( fid1 , FAIL , " H5Fopen " ) ;
1997-07-31 05:17:56 +08:00
2006-08-24 08:52:21 +08:00
/* Get the intent */
ret = H5Fget_intent ( fid1 , & intent ) ;
CHECK ( ret , FAIL , " H5Fget_intent " ) ;
VERIFY ( intent , H5F_ACC_RDWR , " H5Fget_intent " ) ;
1997-07-31 05:17:56 +08:00
/* Get the file-creation template */
1998-09-09 03:15:44 +08:00
tmpl1 = H5Fget_create_plist ( fid1 ) ;
CHECK ( tmpl1 , FAIL , " H5Fget_create_plist " ) ;
1997-07-31 05:17:56 +08:00
/* Get the file-creation parameters */
1998-04-09 05:43:02 +08:00
ret = H5Pget_userblock ( tmpl1 , & ublock ) ;
1998-02-26 03:13:49 +08:00
CHECK ( ret , FAIL , " H5Pget_userblock " ) ;
1998-04-09 05:43:02 +08:00
VERIFY ( ublock , F2_USERBLOCK_SIZE , " H5Pget_userblock " ) ;
1998-02-26 03:13:49 +08:00
ret = H5Pget_sizes ( tmpl1 , & parm , & parm2 ) ;
CHECK ( ret , FAIL , " H5Pget_sizes " ) ;
VERIFY ( parm , F2_OFFSET_SIZE , " H5Pget_sizes " ) ;
VERIFY ( parm2 , F2_LENGTH_SIZE , " H5Pget_sizes " ) ;
ret = H5Pget_sym_k ( tmpl1 , & iparm , & iparm2 ) ;
CHECK ( ret , FAIL , " H5Pget_sym_k " ) ;
VERIFY ( iparm , F2_SYM_INTERN_K , " H5Pget_sym_k " ) ;
VERIFY ( iparm2 , F2_SYM_LEAF_K , " H5Pget_sym_k " ) ;
1997-07-31 05:17:56 +08:00
/* Release file-creation template */
1998-03-13 05:04:53 +08:00
ret = H5Pclose ( tmpl1 ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
1997-07-31 05:17:56 +08:00
1998-01-17 06:23:43 +08:00
/* Close first file */
ret = H5Fclose ( fid1 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
2003-04-26 04:55:10 +08:00
/*
2005-08-14 04:53:35 +08:00
* Test two file opens : one is opened H5F_ACC_RDONLY and H5F_CLOSE_WEAK .
* It ' s closed with an object left open . Then another is opened
2003-04-26 04:55:10 +08:00
* H5F_ACC_RDWR , which should fail .
*/
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing 2 File Openings \n " ) ) ;
/* Create file access property list */
fapl_id = H5Pcreate ( H5P_FILE_ACCESS ) ;
CHECK ( fapl_id , FAIL , " H5Pcreate " ) ;
2005-08-14 04:53:35 +08:00
2003-04-26 04:55:10 +08:00
/* Set file close mode to H5F_CLOSE_WEAK */
ret = H5Pset_fclose_degree ( fapl_id , H5F_CLOSE_WEAK ) ;
CHECK ( ret , FAIL , " H5Pset_fclose_degree " ) ;
/* Open file for first time */
fid1 = H5Fopen ( FILE2 , H5F_ACC_RDONLY , fapl_id ) ;
CHECK ( fid1 , FAIL , " H5Fopen " ) ;
2005-08-14 04:53:35 +08:00
2006-08-24 08:52:21 +08:00
/* Check the intent */
ret = H5Fget_intent ( fid1 , & intent ) ;
CHECK ( ret , FAIL , " H5Fget_intent " ) ;
VERIFY ( intent , H5F_ACC_RDONLY , " H5Fget_intent " ) ;
2003-04-26 04:55:10 +08:00
/* Open dataset */
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
did = H5Dopen2 ( fid1 , F2_DSET , H5P_DEFAULT ) ;
CHECK ( did , FAIL , " H5Dopen2 " ) ;
2003-04-26 04:55:10 +08:00
2006-08-24 08:52:21 +08:00
/* Check that the intent works even if NULL is passed in */
ret = H5Fget_intent ( fid1 , NULL ) ;
CHECK ( ret , FAIL , " H5Fget_intent " ) ;
2003-04-26 04:55:10 +08:00
/* Close first open */
ret = H5Fclose ( fid1 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Open file for second time, which should fail. */
fid2 = H5Fopen ( FILE2 , H5F_ACC_RDWR , fapl_id ) ;
VERIFY ( fid2 , FAIL , " H5Fopen " ) ;
2006-08-24 08:52:21 +08:00
/* Check that the intent fails for an invalid ID */
ret = H5Fget_intent ( fid1 , & intent ) ;
VERIFY ( ret , FAIL , " H5Fget_intent " ) ;
2003-04-26 04:55:10 +08:00
/* Close dataset from first open */
ret = H5Dclose ( did ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
2013-03-02 04:09:40 +08:00
ret = H5Pclose ( fapl_id ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
2003-04-26 04:55:10 +08:00
} /* test_file_open() */
1997-07-31 05:17:56 +08:00
2001-12-12 03:53:44 +08:00
/****************************************************************
* *
2005-08-14 04:53:35 +08:00
* * test_file_close ( ) : low - level file close test routine .
2001-12-12 03:53:44 +08:00
* * It mainly tests behavior with close degree .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2005-08-14 04:53:35 +08:00
static void
2001-12-13 02:40:09 +08:00
test_file_close ( void )
2001-12-12 03:53:44 +08:00
{
hid_t fid1 , fid2 ;
hid_t fapl_id , access_id ;
hid_t dataset_id , group_id1 , group_id2 , group_id3 ;
H5F_close_degree_t fc_degree ;
herr_t ret ;
/* Test behavior while opening file multiple times with different
* file close degree value
*/
fid1 = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( fid1 , FAIL , " H5Fcreate " ) ;
2005-08-14 04:53:35 +08:00
2001-12-12 03:53:44 +08:00
fapl_id = H5Pcreate ( H5P_FILE_ACCESS ) ;
CHECK ( fapl_id , FAIL , " H5Pcreate " ) ;
ret = H5Pset_fclose_degree ( fapl_id , H5F_CLOSE_STRONG ) ;
CHECK ( ret , FAIL , " H5Pset_fclose_degree " ) ;
ret = H5Pget_fclose_degree ( fapl_id , & fc_degree ) ;
VERIFY ( fc_degree , H5F_CLOSE_STRONG , " H5Pget_fclose_degree " ) ;
/* should fail */
fid2 = H5Fopen ( FILE1 , H5F_ACC_RDWR , fapl_id ) ;
VERIFY ( fid2 , FAIL , " H5Fopen " ) ;
ret = H5Pset_fclose_degree ( fapl_id , H5F_CLOSE_DEFAULT ) ;
CHECK ( ret , FAIL , " H5Pset_fclose_degree " ) ;
2005-08-14 04:53:35 +08:00
/* should succeed */
2001-12-12 03:53:44 +08:00
fid2 = H5Fopen ( FILE1 , H5F_ACC_RDWR , fapl_id ) ;
CHECK ( fid2 , FAIL , " H5Fopen " ) ;
/* Close first open */
ret = H5Fclose ( fid1 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Close second open */
ret = H5Fclose ( fid2 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
2005-08-14 04:53:35 +08:00
/* Test behavior while opening file multiple times with different file
2002-10-01 22:35:01 +08:00
* close degree
*/
fid1 = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( fid1 , FAIL , " H5Fcreate " ) ;
ret = H5Pset_fclose_degree ( fapl_id , H5F_CLOSE_WEAK ) ;
CHECK ( ret , FAIL , " H5Pset_fclose_degree " ) ;
ret = H5Pget_fclose_degree ( fapl_id , & fc_degree ) ;
VERIFY ( fc_degree , H5F_CLOSE_WEAK , " H5Pget_fclose_degree " ) ;
/* should succeed */
fid2 = H5Fopen ( FILE1 , H5F_ACC_RDWR , fapl_id ) ;
CHECK ( fid2 , FAIL , " H5Fopen " ) ;
/* Close first open */
ret = H5Fclose ( fid1 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Close second open */
ret = H5Fclose ( fid2 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
2005-08-14 04:53:35 +08:00
/* Test behavior while opening file multiple times with file close
2001-12-12 03:53:44 +08:00
* degree STRONG */
ret = H5Pset_fclose_degree ( fapl_id , H5F_CLOSE_STRONG ) ;
CHECK ( ret , FAIL , " H5Pset_fclose_degree " ) ;
fid1 = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , fapl_id ) ;
CHECK ( fid1 , FAIL , " H5Fcreate " ) ;
ret = H5Pset_fclose_degree ( fapl_id , H5F_CLOSE_WEAK ) ;
CHECK ( ret , FAIL , " H5Pset_fclose_degree " ) ;
/* should fail */
fid2 = H5Fopen ( FILE1 , H5F_ACC_RDWR , fapl_id ) ;
VERIFY ( fid2 , FAIL , " H5Fopen " ) ;
ret = H5Pset_fclose_degree ( fapl_id , H5F_CLOSE_STRONG ) ;
CHECK ( ret , FAIL , " H5Pset_fclose_degree " ) ;
/* should succeed */
fid2 = H5Fopen ( FILE1 , H5F_ACC_RDWR , fapl_id ) ;
CHECK ( fid2 , FAIL , " H5Fopen " ) ;
/* Create a dataset and a group in each file open respectively */
create_objects ( fid1 , fid2 , NULL , NULL , NULL , NULL ) ;
/* Close first open */
ret = H5Fclose ( fid1 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Close second open */
ret = H5Fclose ( fid2 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Test behavior while opening file multiple times with file close
* degree SEMI */
ret = H5Pset_fclose_degree ( fapl_id , H5F_CLOSE_SEMI ) ;
CHECK ( ret , FAIL , " H5Pset_fclose_degree " ) ;
fid1 = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , fapl_id ) ;
CHECK ( fid1 , FAIL , " H5Fcreate " ) ;
ret = H5Pset_fclose_degree ( fapl_id , H5F_CLOSE_DEFAULT ) ;
CHECK ( ret , FAIL , " H5Pset_fclose_degree " ) ;
/* should fail */
fid2 = H5Fopen ( FILE1 , H5F_ACC_RDWR , fapl_id ) ;
VERIFY ( fid2 , FAIL , " H5Fopen " ) ;
ret = H5Pset_fclose_degree ( fapl_id , H5F_CLOSE_SEMI ) ;
CHECK ( ret , FAIL , " H5Pset_fclose_degree " ) ;
/* should succeed */
fid2 = H5Fopen ( FILE1 , H5F_ACC_RDWR , fapl_id ) ;
CHECK ( fid2 , FAIL , " H5Fopen " ) ;
/* Create a dataset and a group in each file open respectively */
create_objects ( fid1 , fid2 , & dataset_id , & group_id1 , & group_id2 , & group_id3 ) ;
2005-08-14 04:53:35 +08:00
/* Close first open, should fail since it is SEMI and objects are
2005-06-02 05:20:10 +08:00
* still open . */
2001-12-12 03:53:44 +08:00
ret = H5Fclose ( fid1 ) ;
2005-06-02 05:20:10 +08:00
VERIFY ( ret , FAIL , " H5Fclose " ) ;
2001-12-12 03:53:44 +08:00
2005-08-14 04:53:35 +08:00
/* Close second open, should fail since it is SEMI and objects are
2001-12-12 03:53:44 +08:00
* still open . */
ret = H5Fclose ( fid2 ) ;
VERIFY ( ret , FAIL , " H5Fclose " ) ;
ret = H5Dclose ( dataset_id ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
2005-08-14 04:53:35 +08:00
2005-06-02 05:20:10 +08:00
/* Close first open */
ret = H5Fclose ( fid1 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
2001-12-12 03:53:44 +08:00
ret = H5Gclose ( group_id1 ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
ret = H5Gclose ( group_id2 ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
2005-08-14 04:53:35 +08:00
/* Close second open, should fail since it is SEMI and one group ID is
2001-12-12 03:53:44 +08:00
* still open . */
ret = H5Fclose ( fid2 ) ;
VERIFY ( ret , FAIL , " H5Fclose " ) ;
2005-08-09 02:41:35 +08:00
/* Same check with H5Idec_ref() (should fail also) */
ret = H5Idec_ref ( fid2 ) ;
VERIFY ( ret , FAIL , " H5Idec_ref " ) ;
2001-12-12 03:53:44 +08:00
ret = H5Gclose ( group_id3 ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
/* Close second open again. Should succeed. */
ret = H5Fclose ( fid2 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Test behavior while opening file multiple times with file close
* degree WEAK */
ret = H5Pset_fclose_degree ( fapl_id , H5F_CLOSE_WEAK ) ;
CHECK ( ret , FAIL , " H5Pset_fclose_degree " ) ;
fid1 = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , fapl_id ) ;
CHECK ( fid1 , FAIL , " H5Fcreate " ) ;
ret = H5Pset_fclose_degree ( fapl_id , H5F_CLOSE_SEMI ) ;
CHECK ( ret , FAIL , " H5Pset_fclose_degree " ) ;
/* should fail */
fid2 = H5Fopen ( FILE1 , H5F_ACC_RDWR , fapl_id ) ;
VERIFY ( fid2 , FAIL , " H5Fopen " ) ;
2002-10-01 05:51:05 +08:00
ret = H5Pset_fclose_degree ( fapl_id , H5F_CLOSE_DEFAULT ) ;
2001-12-12 03:53:44 +08:00
CHECK ( ret , FAIL , " H5Pset_fclose_degree " ) ;
/* should succeed */
fid2 = H5Fopen ( FILE1 , H5F_ACC_RDWR , fapl_id ) ;
CHECK ( fid2 , FAIL , " H5Fopen " ) ;
/* Create a dataset and a group in each file open respectively */
create_objects ( fid1 , fid2 , & dataset_id , & group_id1 , & group_id2 , & group_id3 ) ;
/* Create more new files and test object count and ID list functions */
2005-08-14 04:53:35 +08:00
test_obj_count_and_id ( fid1 , fid2 , dataset_id , group_id1 ,
2001-12-12 03:53:44 +08:00
group_id2 , group_id3 ) ;
2005-08-14 04:53:35 +08:00
2001-12-12 03:53:44 +08:00
/* Close first open */
ret = H5Fclose ( fid1 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
2005-08-14 04:53:35 +08:00
/* Close second open. File will be finally closed after all objects
2001-12-12 03:53:44 +08:00
* are closed . */
ret = H5Fclose ( fid2 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
ret = H5Dclose ( dataset_id ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
ret = H5Gclose ( group_id1 ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
ret = H5Gclose ( group_id2 ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
ret = H5Gclose ( group_id3 ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
/* Test behavior while opening file multiple times with file close
* degree DEFAULT */
ret = H5Pset_fclose_degree ( fapl_id , H5F_CLOSE_DEFAULT ) ;
CHECK ( ret , FAIL , " H5Pset_fclose_degree " ) ;
fid1 = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , fapl_id ) ;
CHECK ( fid1 , FAIL , " H5Fcreate " ) ;
ret = H5Pset_fclose_degree ( fapl_id , H5F_CLOSE_SEMI ) ;
CHECK ( ret , FAIL , " H5Pset_fclose_degree " ) ;
/* should fail */
fid2 = H5Fopen ( FILE1 , H5F_ACC_RDWR , fapl_id ) ;
VERIFY ( fid2 , FAIL , " H5Fopen " ) ;
ret = H5Pset_fclose_degree ( fapl_id , H5F_CLOSE_DEFAULT ) ;
CHECK ( ret , FAIL , " H5Pset_fclose_degree " ) ;
/* should succeed */
fid2 = H5Fopen ( FILE1 , H5F_ACC_RDWR , fapl_id ) ;
CHECK ( fid2 , FAIL , " H5Fopen " ) ;
/* Create a dataset and a group in each file open respectively */
create_objects ( fid1 , fid2 , & dataset_id , & group_id1 , & group_id2 , & group_id3 ) ;
2005-08-14 04:53:35 +08:00
2001-12-12 03:53:44 +08:00
access_id = H5Fget_access_plist ( fid1 ) ;
CHECK ( access_id , FAIL , " H5Fget_access_plist " ) ;
ret = H5Pget_fclose_degree ( access_id , & fc_degree ) ;
CHECK ( ret , FAIL , " H5Pget_fclose_degree " ) ;
switch ( fc_degree ) {
case H5F_CLOSE_STRONG :
/* Close first open */
ret = H5Fclose ( fid1 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Close second open */
ret = H5Fclose ( fid2 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
break ;
case H5F_CLOSE_SEMI :
/* Close first open */
ret = H5Fclose ( fid1 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
ret = H5Dclose ( dataset_id ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
ret = H5Gclose ( group_id1 ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
ret = H5Gclose ( group_id2 ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
ret = H5Gclose ( group_id3 ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
/* Close second open */
ret = H5Fclose ( fid2 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
break ;
case H5F_CLOSE_WEAK :
/* Close first open */
ret = H5Fclose ( fid1 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Close second open */
ret = H5Fclose ( fid2 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
ret = H5Dclose ( dataset_id ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
ret = H5Gclose ( group_id1 ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
ret = H5Gclose ( group_id2 ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
ret = H5Gclose ( group_id3 ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
break ;
2001-12-13 02:40:09 +08:00
default :
CHECK ( fc_degree , H5F_CLOSE_DEFAULT , " H5Pget_fclose_degree " ) ;
break ;
2001-12-12 03:53:44 +08:00
}
/* Close file access property list */
ret = H5Pclose ( fapl_id ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
ret = H5Pclose ( access_id ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
}
/****************************************************************
* *
* * create_objects ( ) : routine called by test_file_close to create
* * a dataset and a group in file .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
2005-08-14 04:53:35 +08:00
create_objects ( hid_t fid1 , hid_t fid2 , hid_t * ret_did , hid_t * ret_gid1 ,
2001-12-12 03:53:44 +08:00
hid_t * ret_gid2 , hid_t * ret_gid3 )
{
2008-09-27 02:55:32 +08:00
ssize_t oid_count ;
2001-12-12 03:53:44 +08:00
herr_t ret ;
/* Check reference counts of file IDs and opened object IDs.
* The verification is hard - coded . If in any case , this testing
* is changed , remember to check this part and update the macros .
*/
{
2003-06-19 04:52:54 +08:00
oid_count = H5Fget_obj_count ( fid1 , H5F_OBJ_ALL ) ;
CHECK ( oid_count , FAIL , " H5Fget_obj_count " ) ;
2001-12-12 03:53:44 +08:00
VERIFY ( oid_count , OBJ_ID_COUNT_2 , " H5Fget_obj_count " ) ;
2003-06-19 04:52:54 +08:00
oid_count = H5Fget_obj_count ( fid1 , H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_DATATYPE | H5F_OBJ_ATTR ) ;
CHECK ( oid_count , FAIL , " H5Fget_obj_count " ) ;
2001-12-12 03:53:44 +08:00
VERIFY ( oid_count , OBJ_ID_COUNT_0 , " H5Fget_obj_count " ) ;
2003-06-19 04:52:54 +08:00
oid_count = H5Fget_obj_count ( fid2 , H5F_OBJ_ALL ) ;
CHECK ( oid_count , FAIL , " H5Fget_obj_count " ) ;
2001-12-12 03:53:44 +08:00
VERIFY ( oid_count , OBJ_ID_COUNT_2 , " H5Fget_obj_count " ) ;
2003-06-19 04:52:54 +08:00
oid_count = H5Fget_obj_count ( fid2 , H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_DATATYPE | H5F_OBJ_ATTR ) ;
CHECK ( oid_count , FAIL , " H5Fget_obj_count " ) ;
2001-12-12 03:53:44 +08:00
VERIFY ( oid_count , OBJ_ID_COUNT_0 , " H5Fget_obj_count " ) ;
}
/* create a dataset in the first file open */
{
hid_t dataset_id , dataspace_id ; /* identifiers */
hsize_t dims [ F2_RANK ] ;
[svn-r17146] Description:
Bring a bunch of misc. improvements & tweaks from the revise_chunks
branch back to the trunk, so that future merges won't be so painful.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.7 (amazon) in debug mode
Mac OS X/32 10.5.7 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-07-03 05:10:35 +08:00
unsigned data [ F2_DIM0 ] [ F2_DIM1 ] ;
2001-12-12 03:53:44 +08:00
unsigned i , j ;
/* Create the data space for the dataset. */
dims [ 0 ] = F2_DIM0 ;
dims [ 1 ] = F2_DIM1 ;
dataspace_id = H5Screate_simple ( F2_RANK , dims , NULL ) ;
CHECK ( dataspace_id , FAIL , " H5Screate_simple " ) ;
/* Create the dataset. */
[svn-r17146] Description:
Bring a bunch of misc. improvements & tweaks from the revise_chunks
branch back to the trunk, so that future merges won't be so painful.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.7 (amazon) in debug mode
Mac OS X/32 10.5.7 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-07-03 05:10:35 +08:00
dataset_id = H5Dcreate2 ( fid1 , " /dset " , H5T_NATIVE_UINT , dataspace_id , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
CHECK ( dataset_id , FAIL , " H5Dcreate2 " ) ;
2001-12-12 03:53:44 +08:00
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
for ( i = 0 ; i < F2_DIM0 ; i + + )
for ( j = 0 ; j < F2_DIM1 ; j + + )
data [ i ] [ j ] = i * 10 + j ;
2001-12-12 03:53:44 +08:00
/* Write data to the new dataset */
[svn-r17146] Description:
Bring a bunch of misc. improvements & tweaks from the revise_chunks
branch back to the trunk, so that future merges won't be so painful.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.7 (amazon) in debug mode
Mac OS X/32 10.5.7 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-07-03 05:10:35 +08:00
ret = H5Dwrite ( dataset_id , H5T_NATIVE_UINT , H5S_ALL , H5S_ALL , H5P_DEFAULT , data ) ;
2001-12-12 03:53:44 +08:00
CHECK ( ret , FAIL , " H5Dwrite " ) ;
if ( ret_did ! = NULL )
* ret_did = dataset_id ;
/* Terminate access to the data space. */
ret = H5Sclose ( dataspace_id ) ;
CHECK ( ret , FAIL , " H5Sclose " ) ;
}
/* Create a group in the second file open */
{
hid_t gid1 , gid2 , gid3 ;
2007-08-24 04:25:25 +08:00
gid1 = H5Gcreate2 ( fid2 , " /group " , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( gid1 , FAIL , " H5Gcreate2 " ) ;
2001-12-12 03:53:44 +08:00
if ( ret_gid1 ! = NULL )
* ret_gid1 = gid1 ;
2007-08-28 23:02:54 +08:00
gid2 = H5Gopen2 ( fid2 , " /group " , H5P_DEFAULT ) ;
CHECK ( gid2 , FAIL , " H5Gopen2 " ) ;
2001-12-12 03:53:44 +08:00
if ( ret_gid2 ! = NULL )
* ret_gid2 = gid2 ;
2007-08-28 23:02:54 +08:00
gid3 = H5Gopen2 ( fid2 , " /group " , H5P_DEFAULT ) ;
CHECK ( gid3 , FAIL , " H5Gopen2 " ) ;
2001-12-12 03:53:44 +08:00
if ( ret_gid3 ! = NULL )
* ret_gid3 = gid3 ;
}
/* Check reference counts of file IDs and opened object IDs.
* The verification is hard - coded . If in any case , this testing
* is changed , remember to check this part and update the macros .
*/
{
2003-06-19 04:52:54 +08:00
oid_count = H5Fget_obj_count ( fid1 , H5F_OBJ_ALL ) ;
CHECK ( oid_count , FAIL , " H5Fget_obj_count " ) ;
2001-12-12 03:53:44 +08:00
VERIFY ( oid_count , OBJ_ID_COUNT_6 , " H5Fget_obj_count " ) ;
2003-06-19 04:52:54 +08:00
oid_count = H5Fget_obj_count ( fid1 , H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_DATATYPE | H5F_OBJ_ATTR ) ;
CHECK ( oid_count , FAIL , " H5Fget_obj_count " ) ;
2001-12-12 03:53:44 +08:00
VERIFY ( oid_count , OBJ_ID_COUNT_4 , " H5Fget_obj_count " ) ;
2003-06-19 04:52:54 +08:00
oid_count = H5Fget_obj_count ( fid2 , H5F_OBJ_ALL ) ;
CHECK ( oid_count , FAIL , " H5Fget_obj_count " ) ;
2001-12-12 03:53:44 +08:00
VERIFY ( oid_count , OBJ_ID_COUNT_6 , " H5Fget_obj_count " ) ;
2003-06-19 04:52:54 +08:00
oid_count = H5Fget_obj_count ( fid2 , H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_DATATYPE | H5F_OBJ_ATTR ) ;
CHECK ( oid_count , FAIL , " H5Fget_obj_count " ) ;
2001-12-12 03:53:44 +08:00
VERIFY ( oid_count , OBJ_ID_COUNT_4 , " H5Fget_obj_count " ) ;
}
}
2003-10-30 01:04:58 +08:00
/****************************************************************
* *
2005-08-14 04:53:35 +08:00
* * test_get_file_id ( ) : Test H5Iget_file_id ( )
2003-10-30 01:04:58 +08:00
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2005-08-14 04:53:35 +08:00
static void
2003-10-30 01:04:58 +08:00
test_get_file_id ( void )
{
2003-11-01 02:48:42 +08:00
hid_t fid , fid2 , fid3 ;
2003-10-30 02:27:37 +08:00
hid_t datatype_id , dataset_id , dataspace_id , group_id , attr_id ;
2003-10-30 01:04:58 +08:00
hid_t plist ;
hsize_t dims [ F2_RANK ] ;
2006-08-24 08:52:21 +08:00
unsigned intent ;
2003-10-30 01:04:58 +08:00
herr_t ret ;
/* Create a file */
2003-11-01 02:48:42 +08:00
fid = H5Fcreate ( FILE4 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( fid , FAIL , " H5Fcreate " ) ;
2003-10-30 01:04:58 +08:00
2006-08-24 08:52:21 +08:00
/* Check the intent */
ret = H5Fget_intent ( fid , & intent ) ;
CHECK ( ret , FAIL , " H5Fget_intent " ) ;
VERIFY ( intent , H5F_ACC_RDWR , " H5Fget_intent " ) ;
2003-11-01 02:48:42 +08:00
/* Test H5Iget_file_id() */
check_file_id ( fid , fid ) ;
2003-10-30 01:04:58 +08:00
/* Create a group in the file. Make a duplicated file ID from the group.
* And close this duplicated ID
*/
2007-08-24 04:25:25 +08:00
group_id = H5Gcreate2 ( fid , GRP_NAME , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( group_id , FAIL , " H5Gcreate2 " ) ;
2005-08-14 04:53:35 +08:00
2003-11-01 02:48:42 +08:00
/* Test H5Iget_file_id() */
check_file_id ( fid , group_id ) ;
2003-10-30 01:04:58 +08:00
2003-11-01 02:48:42 +08:00
/* Close the file and get file ID from the group ID */
ret = H5Fclose ( fid ) ;
2003-10-30 01:04:58 +08:00
CHECK ( ret , FAIL , " H5Fclose " ) ;
2003-11-01 02:48:42 +08:00
/* Test H5Iget_file_id() */
check_file_id ( - 1 , group_id ) ;
ret = H5Gclose ( group_id ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
2005-08-14 04:53:35 +08:00
2003-11-01 02:48:42 +08:00
/* Open the file again. Test H5Iget_file_id() */
2005-08-14 04:53:35 +08:00
fid = H5Fopen ( FILE4 , H5F_ACC_RDWR , H5P_DEFAULT ) ;
2003-11-01 02:48:42 +08:00
CHECK ( fid , FAIL , " H5Fcreate " ) ;
2005-08-14 04:53:35 +08:00
2007-08-28 23:02:54 +08:00
group_id = H5Gopen2 ( fid , GRP_NAME , H5P_DEFAULT ) ;
CHECK ( group_id , FAIL , " H5Gopen2 " ) ;
2005-08-14 04:53:35 +08:00
2003-11-01 02:48:42 +08:00
/* Test H5Iget_file_id() */
check_file_id ( fid , group_id ) ;
/* Open the file for second time. Test H5Iget_file_id() */
fid3 = H5Freopen ( fid ) ;
CHECK ( fid3 , FAIL , " H5Freopen " ) ;
2005-08-14 04:53:35 +08:00
2003-11-01 02:48:42 +08:00
/* Test H5Iget_file_id() */
check_file_id ( fid3 , fid3 ) ;
2005-08-14 04:53:35 +08:00
2003-11-01 02:48:42 +08:00
ret = H5Fclose ( fid3 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
2005-08-14 04:53:35 +08:00
/* Create a dataset in the group. Make a duplicated file ID from the
* dataset . And close this duplicated ID .
2003-10-30 01:04:58 +08:00
*/
dims [ 0 ] = F2_DIM0 ;
dims [ 1 ] = F2_DIM1 ;
dataspace_id = H5Screate_simple ( F2_RANK , dims , NULL ) ;
CHECK ( dataspace_id , FAIL , " H5Screate_simple " ) ;
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
dataset_id = H5Dcreate2 ( group_id , DSET_NAME , H5T_NATIVE_INT , dataspace_id , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( dataset_id , FAIL , " H5Dcreate2 " ) ;
2005-08-14 04:53:35 +08:00
2003-11-01 02:48:42 +08:00
/* Test H5Iget_file_id() */
check_file_id ( fid , dataset_id ) ;
2005-08-14 04:53:35 +08:00
2003-10-30 01:04:58 +08:00
/* Create an attribute for the dataset. Make a duplicated file ID from
* this attribute . And close it .
*/
[svn-r14218] Description:
Changed H5Acreate2 -> H5Acreate_by_name, to be more consistent with
other new API routines.
Re-added simpler form of H5Acreate2, which creates attributes directly
on an object.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 02:13:48 +08:00
attr_id = H5Acreate2 ( dataset_id , ATTR_NAME , H5T_NATIVE_INT , dataspace_id , H5P_DEFAULT , H5P_DEFAULT ) ;
[svn-r14187] Description:
Put H5Acreate() under API versioning, with all internal usage shifted
to H5Acreate2().
Add regression tests for H5Acreate1().
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-05 06:19:07 +08:00
CHECK ( ret , FAIL , " H5Acreate2 " ) ;
2003-10-30 01:04:58 +08:00
2003-11-01 02:48:42 +08:00
/* Test H5Iget_file_id() */
check_file_id ( fid , attr_id ) ;
2003-10-30 01:04:58 +08:00
2003-10-30 02:27:37 +08:00
/* Create a named datatype. Make a duplicated file ID from
* this attribute . And close it .
*/
[svn-r14187] Description:
Put H5Acreate() under API versioning, with all internal usage shifted
to H5Acreate2().
Add regression tests for H5Acreate1().
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-05 06:19:07 +08:00
datatype_id = H5Tcopy ( H5T_NATIVE_INT ) ;
CHECK ( ret , FAIL , " H5Tcopy " ) ;
2005-08-14 04:53:35 +08:00
[svn-r14156] Description:
Add API versioning to H5Tcommit()
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 10:50:31 +08:00
ret = H5Tcommit2 ( fid , TYPE_NAME , datatype_id , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( ret , FAIL , " H5Tcommit2 " ) ;
2005-08-14 04:53:35 +08:00
2003-11-01 02:48:42 +08:00
/* Test H5Iget_file_id() */
check_file_id ( fid , datatype_id ) ;
2003-10-30 02:27:37 +08:00
2003-10-30 01:04:58 +08:00
/* Create a property list and try to get file ID from it.
* Supposed to fail .
*/
plist = H5Pcreate ( H5P_FILE_ACCESS ) ;
CHECK ( plist , FAIL , " H5Pcreate " ) ;
2005-08-14 04:53:35 +08:00
2003-10-30 01:04:58 +08:00
H5E_BEGIN_TRY {
fid2 = H5Iget_file_id ( plist ) ;
} H5E_END_TRY ;
VERIFY ( fid2 , FAIL , " H5Iget_file_id " ) ;
2005-08-14 04:53:35 +08:00
/* Close objects */
2013-03-02 04:09:40 +08:00
ret = H5Pclose ( plist ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
2003-10-30 02:27:37 +08:00
ret = H5Tclose ( datatype_id ) ;
CHECK ( ret , FAIL , " H5Tclose " ) ;
2003-10-30 01:04:58 +08:00
ret = H5Aclose ( attr_id ) ;
CHECK ( ret , FAIL , " H5Aclose " ) ;
2005-08-14 04:53:35 +08:00
2003-10-30 01:04:58 +08:00
ret = H5Sclose ( dataspace_id ) ;
CHECK ( ret , FAIL , " H5Sclose " ) ;
ret = H5Dclose ( dataset_id ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
2005-08-14 04:53:35 +08:00
2003-10-30 01:04:58 +08:00
ret = H5Gclose ( group_id ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
2005-08-14 04:53:35 +08:00
2003-11-01 02:48:42 +08:00
ret = H5Fclose ( fid ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
}
/****************************************************************
* *
2005-08-14 04:53:35 +08:00
* * check_file_id ( ) : Internal function of test_get_file_id ( )
2003-11-01 02:48:42 +08:00
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2005-08-14 04:53:35 +08:00
static void
2003-11-01 02:48:42 +08:00
check_file_id ( hid_t fid , hid_t object_id )
{
hid_t new_fid ;
herr_t ret ;
/* Return a duplicated file ID even not expecting user to do it.
* And close this duplicated ID
*/
new_fid = H5Iget_file_id ( object_id ) ;
if ( fid > = 0 )
VERIFY ( new_fid , fid , " H5Iget_file_id " ) ;
else
CHECK ( new_fid , FAIL , " H5Iget_file_id " ) ;
ret = H5Fclose ( new_fid ) ;
2003-10-30 01:04:58 +08:00
CHECK ( ret , FAIL , " H5Fclose " ) ;
}
2001-12-12 03:53:44 +08:00
/****************************************************************
* *
2005-08-14 04:53:35 +08:00
* * test_obj_count_and_id ( ) : test object count and ID list functions .
2001-12-12 03:53:44 +08:00
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2005-08-14 04:53:35 +08:00
static void
test_obj_count_and_id ( hid_t fid1 , hid_t fid2 , hid_t did , hid_t gid1 ,
2001-12-12 03:53:44 +08:00
hid_t gid2 , hid_t gid3 )
{
hid_t fid3 , fid4 ;
2008-09-27 02:55:32 +08:00
ssize_t oid_count , ret_count ;
2001-12-12 03:53:44 +08:00
herr_t ret ;
/* Create two new files */
fid3 = H5Fcreate ( FILE2 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( fid3 , FAIL , " H5Fcreate " ) ;
fid4 = H5Fcreate ( FILE3 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( fid4 , FAIL , " H5Fcreate " ) ;
/* test object count of all files IDs open */
2003-06-19 04:52:54 +08:00
oid_count = H5Fget_obj_count ( H5F_OBJ_ALL , H5F_OBJ_FILE ) ;
CHECK ( oid_count , FAIL , " H5Fget_obj_count " ) ;
2001-12-12 03:53:44 +08:00
VERIFY ( oid_count , OBJ_ID_COUNT_4 , " H5Fget_obj_count " ) ;
2003-06-19 04:52:54 +08:00
/* test object count of all datasets open */
oid_count = H5Fget_obj_count ( H5F_OBJ_ALL , H5F_OBJ_DATASET ) ;
CHECK ( oid_count , FAIL , " H5Fget_obj_count " ) ;
2001-12-12 03:53:44 +08:00
VERIFY ( oid_count , OBJ_ID_COUNT_1 , " H5Fget_obj_count " ) ;
2003-06-19 04:52:54 +08:00
/* test object count of all groups open */
oid_count = H5Fget_obj_count ( H5F_OBJ_ALL , H5F_OBJ_GROUP ) ;
CHECK ( oid_count , FAIL , " H5Fget_obj_count " ) ;
2001-12-12 03:53:44 +08:00
VERIFY ( oid_count , OBJ_ID_COUNT_3 , " H5Fget_obj_count " ) ;
2003-06-19 04:52:54 +08:00
/* test object count of all named datatypes open */
oid_count = H5Fget_obj_count ( H5F_OBJ_ALL , H5F_OBJ_DATATYPE ) ;
CHECK ( oid_count , FAIL , " H5Fget_obj_count " ) ;
VERIFY ( oid_count , OBJ_ID_COUNT_0 , " H5Fget_obj_count " ) ;
/* test object count of all attributes open */
oid_count = H5Fget_obj_count ( H5F_OBJ_ALL , H5F_OBJ_ATTR ) ;
CHECK ( oid_count , FAIL , " H5Fget_obj_count " ) ;
2001-12-12 03:53:44 +08:00
VERIFY ( oid_count , OBJ_ID_COUNT_0 , " H5Fget_obj_count " ) ;
/* test object count of all objects currently open */
2003-06-19 04:52:54 +08:00
oid_count = H5Fget_obj_count ( H5F_OBJ_ALL , H5F_OBJ_ALL ) ;
CHECK ( oid_count , FAIL , " H5Fget_obj_count " ) ;
2001-12-12 03:53:44 +08:00
VERIFY ( oid_count , OBJ_ID_COUNT_8 , " H5Fget_obj_count " ) ;
2010-02-10 06:32:28 +08:00
if ( oid_count > 0 ) {
hid_t * oid_list ;
2001-12-12 03:53:44 +08:00
2010-02-10 06:32:28 +08:00
oid_list = ( hid_t * ) HDcalloc ( ( size_t ) oid_count , sizeof ( hid_t ) ) ;
2001-12-12 03:53:44 +08:00
if ( oid_list ! = NULL ) {
2010-02-10 06:32:28 +08:00
int i ;
2008-09-27 02:55:32 +08:00
ret_count = H5Fget_obj_ids ( H5F_OBJ_ALL , H5F_OBJ_ALL , ( size_t ) oid_count , oid_list ) ;
CHECK ( ret_count , FAIL , " H5Fget_obj_ids " ) ;
2010-02-10 06:32:28 +08:00
for ( i = 0 ; i < oid_count ; i + + ) {
H5I_type_t id_type ;
id_type = H5Iget_type ( oid_list [ i ] ) ;
switch ( id_type ) {
case H5I_FILE :
if ( oid_list [ i ] ! = fid1 & & oid_list [ i ] ! = fid2
& & oid_list [ i ] ! = fid3 & & oid_list [ i ] ! = fid4 )
ERROR ( " H5Fget_obj_ids " ) ;
break ;
case H5I_GROUP :
if ( oid_list [ i ] ! = gid1 & & oid_list [ i ] ! = gid2
& & oid_list [ i ] ! = gid3 )
ERROR ( " H5Fget_obj_ids " ) ;
break ;
case H5I_DATASET :
VERIFY ( oid_list [ i ] , did , " H5Fget_obj_ids " ) ;
break ;
default :
ERROR ( " H5Fget_obj_ids " ) ;
} /* end switch */
} /* end for */
HDfree ( oid_list ) ;
} /* end if */
} /* end if */
2001-12-12 03:53:44 +08:00
/* close the two new files */
ret = H5Fclose ( fid3 ) ;
2002-01-24 05:28:24 +08:00
CHECK ( ret , FAIL , " H5Fclose " ) ;
2001-12-12 03:53:44 +08:00
ret = H5Fclose ( fid4 ) ;
2002-01-24 05:28:24 +08:00
CHECK ( ret , FAIL , " H5Fclose " ) ;
2001-12-12 03:53:44 +08:00
}
2003-09-11 02:32:28 +08:00
/****************************************************************
* *
2005-08-14 04:53:35 +08:00
* * test_file_perm ( ) : low - level file test routine .
* * This test verifies that a file can be opened for both
2003-09-11 02:32:28 +08:00
* * read - only and read - write access and things will be handled
* * appropriately .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2005-08-14 04:53:35 +08:00
static void
2003-09-11 02:32:28 +08:00
test_file_perm ( void )
{
hid_t file ; /* File opened with read-write permission */
hid_t filero ; /* Same file opened with read-only permission */
hid_t dspace ; /* Dataspace ID */
hid_t dset ; /* Dataset ID */
herr_t ret ;
2005-08-14 04:53:35 +08:00
2003-09-11 02:32:28 +08:00
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing Low-Level File Permissions \n " ) ) ;
dspace = H5Screate ( H5S_SCALAR ) ;
CHECK ( dspace , FAIL , " H5Screate " ) ;
/* Create the file (with read-write permission) */
file = H5Fcreate ( FILE2 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( file , FAIL , " H5Fcreate " ) ;
/* Create a dataset with the read-write file handle */
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
dset = H5Dcreate2 ( file , F2_DSET , H5T_NATIVE_INT , dspace , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( dset , FAIL , " H5Dcreate2 " ) ;
2003-09-11 02:32:28 +08:00
ret = H5Dclose ( dset ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
2006-03-10 05:34:34 +08:00
# ifndef H5_CANNOT_OPEN_TWICE
2003-09-11 02:32:28 +08:00
/* Open the file (with read-only permission) */
filero = H5Fopen ( FILE2 , H5F_ACC_RDONLY , H5P_DEFAULT ) ;
CHECK ( filero , FAIL , " H5Fopen " ) ;
/* Create a dataset with the read-only file handle (should fail) */
H5E_BEGIN_TRY {
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
dset = H5Dcreate2 ( filero , F2_DSET , H5T_NATIVE_INT , dspace , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
2003-09-11 02:32:28 +08:00
} H5E_END_TRY ;
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
VERIFY ( dset , FAIL , " H5Dcreate2 " ) ;
2003-09-11 02:32:28 +08:00
if ( dset ! = FAIL ) {
ret = H5Dclose ( dset ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
} /* end if */
ret = H5Fclose ( filero ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
2006-03-10 05:34:34 +08:00
# endif /*H5_CANNOT_OPEN_TWICE*/
2003-09-11 02:32:28 +08:00
ret = H5Fclose ( file ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
ret = H5Sclose ( dspace ) ;
CHECK ( ret , FAIL , " H5Sclose " ) ;
} /* end test_file_perm() */
2012-01-26 04:06:09 +08:00
/****************************************************************
* *
* * test_file_perm2 ( ) : low - level file test routine .
* * This test verifies that no object can be created in a
* * file that is opened for read - only .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
test_file_perm2 ( void )
{
hid_t file ; /* File opened with read-write permission */
hid_t filero ; /* Same file opened with read-only permission */
hid_t dspace ; /* Dataspace ID */
hid_t group ; /* Group ID */
hid_t dset ; /* Dataset ID */
hid_t type ; /* Datatype ID */
hid_t attr ; /* Attribute ID */
herr_t ret ;
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing Low-Level File Permissions again \n " ) ) ;
dspace = H5Screate ( H5S_SCALAR ) ;
CHECK ( dspace , FAIL , " H5Screate " ) ;
/* Create the file (with read-write permission) */
file = H5Fcreate ( FILE2 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( file , FAIL , " H5Fcreate " ) ;
ret = H5Fclose ( file ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Open the file (with read-only permission) */
filero = H5Fopen ( FILE2 , H5F_ACC_RDONLY , H5P_DEFAULT ) ;
CHECK ( filero , FAIL , " H5Fopen " ) ;
/* Create a group with the read-only file handle (should fail) */
H5E_BEGIN_TRY {
group = H5Gcreate2 ( filero , " MY_GROUP " , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
} H5E_END_TRY ;
VERIFY ( group , FAIL , " H5Gcreate2 " ) ;
/* Create a dataset with the read-only file handle (should fail) */
H5E_BEGIN_TRY {
dset = H5Dcreate2 ( filero , F2_DSET , H5T_NATIVE_INT , dspace , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
} H5E_END_TRY ;
VERIFY ( dset , FAIL , " H5Dcreate2 " ) ;
/* Create an attribute with the read-only file handle (should fail) */
H5E_BEGIN_TRY {
attr = H5Acreate2 ( filero , " MY_ATTR " , H5T_NATIVE_INT , dspace , H5P_DEFAULT , H5P_DEFAULT ) ;
} H5E_END_TRY ;
VERIFY ( attr , FAIL , " H5Acreate2 " ) ;
type = H5Tcopy ( H5T_NATIVE_SHORT ) ;
CHECK ( type , FAIL , " H5Tcopy " ) ;
/* Commit a datatype with the read-only file handle (should fail) */
H5E_BEGIN_TRY {
ret = H5Tcommit2 ( filero , " MY_DTYPE " , type , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
} H5E_END_TRY ;
VERIFY ( ret , FAIL , " H5Tcommit2 " ) ;
2012-02-03 01:02:28 +08:00
ret = H5Tclose ( type ) ;
CHECK ( ret , FAIL , " H5Tclose " ) ;
2012-01-26 04:06:09 +08:00
ret = H5Fclose ( filero ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
ret = H5Sclose ( dspace ) ;
CHECK ( ret , FAIL , " H5Sclose " ) ;
} /* end test_file_perm2() */
2003-10-07 21:32:32 +08:00
/****************************************************************
* *
2005-08-14 04:53:35 +08:00
* * test_file_freespace ( ) : low - level file test routine .
2003-10-07 21:32:32 +08:00
* * This test checks the free space available in a file in various
* * situations .
* *
2012-08-14 04:04:20 +08:00
* * Modifications :
* * Vailin Choi ; July 2012
* * Remove datasets in reverse order so that all file spaces are shrunk .
* * ( A change due to H5FD_FLMAP_DICHOTOMY . )
* *
2003-10-07 21:32:32 +08:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2005-08-14 04:53:35 +08:00
static void
2003-10-07 21:32:32 +08:00
test_file_freespace ( void )
{
hid_t file ; /* File opened with read-write permission */
[svn-r15800] Description:
Bring file free space branch changes through r15795 into trunk, which
includes a fair bit of code cleanup & rearrangement along with a couple of
bug fixes also.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-07 12:17:35 +08:00
h5_stat_size_t empty_filesize ; /* Size of file when empty */
h5_stat_size_t mod_filesize ; /* Size of file after being modified */
2003-10-07 21:32:32 +08:00
hssize_t free_space ; /* Amount of free space in file */
hid_t dspace ; /* Dataspace ID */
hid_t dset ; /* Dataset ID */
hid_t dcpl ; /* Dataset creation property list */
2012-08-14 04:04:20 +08:00
int k ; /* Local index variable */
2003-10-07 21:32:32 +08:00
unsigned u ; /* Local index variable */
char name [ 32 ] ; /* Dataset name */
herr_t ret ;
2005-08-14 04:53:35 +08:00
2003-10-07 21:32:32 +08:00
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing Low-Level File Free Space \n " ) ) ;
[svn-r15800] Description:
Bring file free space branch changes through r15795 into trunk, which
includes a fair bit of code cleanup & rearrangement along with a couple of
bug fixes also.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-07 12:17:35 +08:00
/* Create an "empty" file */
2003-10-07 21:32:32 +08:00
file = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( file , FAIL , " H5Fcreate " ) ;
[svn-r15800] Description:
Bring file free space branch changes through r15795 into trunk, which
includes a fair bit of code cleanup & rearrangement along with a couple of
bug fixes also.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-07 12:17:35 +08:00
ret = H5Fclose ( file ) ;
CHECK_I ( ret , " H5Fclose " ) ;
/* Get the "empty" file size */
[svn-r15825] Description:
Fix various problems with a the core & sec2 VFDs.
Improve the h5_get_file_size() routine to handle files created with
VFDs that use multiple files.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-09 11:44:22 +08:00
empty_filesize = h5_get_file_size ( FILE1 , H5P_DEFAULT ) ;
[svn-r15800] Description:
Bring file free space branch changes through r15795 into trunk, which
includes a fair bit of code cleanup & rearrangement along with a couple of
bug fixes also.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-07 12:17:35 +08:00
/* Re-open the file (with read-write permission) */
file = H5Fopen ( FILE1 , H5F_ACC_RDWR , H5P_DEFAULT ) ;
CHECK_I ( file , " H5Fopen " ) ;
2003-10-07 21:32:32 +08:00
/* Check that the free space is 0 */
free_space = H5Fget_freespace ( file ) ;
CHECK ( free_space , FAIL , " H5Fget_freespace " ) ;
VERIFY ( free_space , 0 , " H5Fget_freespace " ) ;
/* Create dataspace for datasets */
dspace = H5Screate ( H5S_SCALAR ) ;
CHECK ( dspace , FAIL , " H5Screate " ) ;
/* Create a dataset creation property list */
dcpl = H5Pcreate ( H5P_DATASET_CREATE ) ;
2005-08-14 04:53:35 +08:00
CHECK ( dcpl , FAIL , " H5Pcreate " ) ;
2003-10-07 21:32:32 +08:00
/* Set the space allocation time to early */
2006-10-02 18:24:03 +08:00
ret = H5Pset_alloc_time ( dcpl , H5D_ALLOC_TIME_EARLY ) ;
2005-08-14 04:53:35 +08:00
CHECK ( ret , FAIL , " H5Pset_alloc_time " ) ;
2003-10-07 21:32:32 +08:00
/* Create datasets in file */
2006-10-02 18:24:03 +08:00
for ( u = 0 ; u < 10 ; u + + ) {
sprintf ( name , " Dataset %u " , u ) ;
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
dset = H5Dcreate2 ( file , name , H5T_STD_U32LE , dspace , H5P_DEFAULT , dcpl , H5P_DEFAULT ) ;
CHECK ( dset , FAIL , " H5Dcreate2 " ) ;
2003-10-07 21:32:32 +08:00
ret = H5Dclose ( dset ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
} /* end for */
/* Close dataspace */
ret = H5Sclose ( dspace ) ;
CHECK ( ret , FAIL , " H5Sclose " ) ;
/* Close dataset creation property list */
2006-10-02 18:24:03 +08:00
ret = H5Pclose ( dcpl ) ;
2003-10-07 21:32:32 +08:00
CHECK ( ret , FAIL , " H5Pclose " ) ;
/* Check that there is the right amount of free space in the file */
free_space = H5Fget_freespace ( file ) ;
CHECK ( free_space , FAIL , " H5Fget_freespace " ) ;
2012-08-14 04:04:20 +08:00
VERIFY ( free_space , 2360 , " H5Fget_freespace " ) ;
2007-09-13 23:44:56 +08:00
2003-10-07 21:32:32 +08:00
/* Delete datasets in file */
2012-08-14 04:04:20 +08:00
for ( k = 9 ; k > = 0 ; k - - ) {
sprintf ( name , " Dataset %u " , ( unsigned ) k ) ;
2007-08-30 04:44:19 +08:00
ret = H5Ldelete ( file , name , H5P_DEFAULT ) ;
CHECK ( ret , FAIL , " H5Ldelete " ) ;
2003-10-07 21:32:32 +08:00
} /* end for */
/* Check that there is the right amount of free space in the file */
free_space = H5Fget_freespace ( file ) ;
CHECK ( free_space , FAIL , " H5Fget_freespace " ) ;
2007-03-09 04:10:12 +08:00
VERIFY ( free_space , 0 , " H5Fget_freespace " ) ;
2003-10-07 21:32:32 +08:00
/* Close file */
ret = H5Fclose ( file ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
[svn-r15800] Description:
Bring file free space branch changes through r15795 into trunk, which
includes a fair bit of code cleanup & rearrangement along with a couple of
bug fixes also.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-07 12:17:35 +08:00
/* Get the file size after modifications*/
[svn-r15825] Description:
Fix various problems with a the core & sec2 VFDs.
Improve the h5_get_file_size() routine to handle files created with
VFDs that use multiple files.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-09 11:44:22 +08:00
mod_filesize = h5_get_file_size ( FILE1 , H5P_DEFAULT ) ;
[svn-r15800] Description:
Bring file free space branch changes through r15795 into trunk, which
includes a fair bit of code cleanup & rearrangement along with a couple of
bug fixes also.
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2008-10-07 12:17:35 +08:00
/* Check that the file reverted to empty size */
VERIFY ( mod_filesize , empty_filesize , " H5Fget_freespace " ) ;
2003-10-07 21:32:32 +08:00
} /* end test_file_freespace() */
2005-01-29 01:32:44 +08:00
/****************************************************************
* *
2005-08-14 04:53:35 +08:00
* * test_file_ishdf5 ( ) : low - level file test routine .
2005-01-29 01:32:44 +08:00
* * This test checks whether the H5Fis_hdf5 ( ) routine is working
* * correctly in variuous situations .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2005-08-14 04:53:35 +08:00
static void
2005-01-29 01:32:44 +08:00
test_file_ishdf5 ( void )
{
hid_t file ; /* File opened with read-write permission */
hid_t fcpl ; /* File creation property list */
int fd ; /* File Descriptor */
ssize_t nbytes ; /* Number of bytes written */
unsigned u ; /* Local index variable */
unsigned char buf [ 1024 ] ; /* Buffer of data to write */
htri_t status ; /* Whether a file is an HDF5 file */
herr_t ret ;
2005-08-14 04:53:35 +08:00
2005-01-29 01:32:44 +08:00
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing Detection of HDF5 Files \n " ) ) ;
/* Create a file */
file = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( file , FAIL , " H5Fcreate " ) ;
/* Close file */
ret = H5Fclose ( file ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Verify that the file is an HDF5 file */
status = H5Fis_hdf5 ( FILE1 ) ;
VERIFY ( status , TRUE , " H5Fis_hdf5 " ) ;
/* Create a file creation property list with a non-default user block size */
fcpl = H5Pcreate ( H5P_FILE_CREATE ) ;
CHECK ( fcpl , FAIL , " H5Pcreate " ) ;
ret = H5Pset_userblock ( fcpl , ( hsize_t ) 2048 ) ;
CHECK ( ret , FAIL , " H5Pset_userblock " ) ;
/* Create file with non-default user block */
file = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , fcpl , H5P_DEFAULT ) ;
CHECK ( file , FAIL , " H5Fcreate " ) ;
/* Release file-creation property list */
ret = H5Pclose ( fcpl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
/* Close file */
ret = H5Fclose ( file ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Verify that the file is an HDF5 file */
status = H5Fis_hdf5 ( FILE1 ) ;
VERIFY ( status , TRUE , " H5Fis_hdf5 " ) ;
/* Create non-HDF5 file and check it */
fd = HDopen ( FILE1 , O_RDWR | O_CREAT | O_TRUNC , 0666 ) ;
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
CHECK ( fd , FAIL , " HDopen " ) ;
2005-01-29 01:32:44 +08:00
/* Initialize information to write */
for ( u = 0 ; u < 1024 ; u + + )
buf [ u ] = ( unsigned char ) u ;
/* Write some information */
2005-06-02 05:20:10 +08:00
nbytes = HDwrite ( fd , buf , ( size_t ) 1024 ) ;
2005-01-29 01:32:44 +08:00
VERIFY ( nbytes , 1024 , " HDwrite " ) ;
/* Close the file */
ret = HDclose ( fd ) ;
CHECK ( ret , FAIL , " HDclose " ) ;
/* Verify that the file is not an HDF5 file */
status = H5Fis_hdf5 ( FILE1 ) ;
VERIFY ( status , FALSE , " H5Fis_hdf5 " ) ;
} /* end test_file_ishdf5() */
2005-04-17 00:22:16 +08:00
/****************************************************************
* *
2005-08-14 04:53:35 +08:00
* * test_file_open_dot ( ) : low - level file test routine .
2005-04-17 00:22:16 +08:00
* * This test checks whether opening objects with " . " for a name
* * works correctly in variuous situations .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2005-08-14 04:53:35 +08:00
static void
2005-04-17 00:22:16 +08:00
test_file_open_dot ( void )
{
hid_t fid ; /* File ID */
hid_t gid , gid2 ; /* Group IDs */
hid_t did ; /* Dataset ID */
hid_t sid ; /* Dataspace ID */
hid_t tid , tid2 ; /* Datatype IDs */
herr_t ret ;
2005-08-14 04:53:35 +08:00
2005-04-17 00:22:16 +08:00
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing opening objects with \" . \" for a name \n " ) ) ;
/* Create a new HDF5 file to work with */
fid = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( fid , FAIL , " H5Fcreate " ) ;
/* Create a group in the HDF5 file */
2007-08-24 04:25:25 +08:00
gid = H5Gcreate2 ( fid , GRP_NAME , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( gid , FAIL , " H5Gcreate2 " ) ;
2005-04-17 00:22:16 +08:00
/* Create a dataspace for creating datasets */
sid = H5Screate ( H5S_SCALAR ) ;
CHECK ( sid , FAIL , " H5Screate " ) ;
/* Create a dataset with no name using the file ID */
H5E_BEGIN_TRY {
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
did = H5Dcreate2 ( fid , " . " , H5T_NATIVE_INT , sid , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
2005-04-17 00:22:16 +08:00
} H5E_END_TRY ;
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
VERIFY ( did , FAIL , " H5Dcreate2 " ) ;
2005-04-17 00:22:16 +08:00
/* Create a dataset with no name using the group ID */
H5E_BEGIN_TRY {
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
did = H5Dcreate2 ( gid , " . " , H5T_NATIVE_INT , sid , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
2005-04-17 00:22:16 +08:00
} H5E_END_TRY ;
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
VERIFY ( did , FAIL , " H5Dcreate2 " ) ;
2005-04-17 00:22:16 +08:00
/* Open a dataset with no name using the file ID */
H5E_BEGIN_TRY {
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
did = H5Dopen2 ( fid , " . " , H5P_DEFAULT ) ;
2005-04-17 00:22:16 +08:00
} H5E_END_TRY ;
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
VERIFY ( did , FAIL , " H5Dopen2 " ) ;
2005-04-17 00:22:16 +08:00
/* Open a dataset with no name using the group ID */
H5E_BEGIN_TRY {
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
did = H5Dopen2 ( gid , " . " , H5P_DEFAULT ) ;
2005-04-17 00:22:16 +08:00
} H5E_END_TRY ;
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
VERIFY ( did , FAIL , " H5Dopen2 " ) ;
2005-04-17 00:22:16 +08:00
/* Make a copy of a datatype to use for creating a named datatype */
tid = H5Tcopy ( H5T_NATIVE_INT ) ;
CHECK ( tid , FAIL , " H5Tcopy " ) ;
/* Create a named datatype with no name using the file ID */
H5E_BEGIN_TRY {
[svn-r14156] Description:
Add API versioning to H5Tcommit()
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 10:50:31 +08:00
ret = H5Tcommit2 ( fid , " . " , tid , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
2005-04-17 00:22:16 +08:00
} H5E_END_TRY ;
[svn-r14156] Description:
Add API versioning to H5Tcommit()
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 10:50:31 +08:00
VERIFY ( ret , FAIL , " H5Tcommit2 " ) ;
2005-04-17 00:22:16 +08:00
/* Create a named datatype with no name using the group ID */
H5E_BEGIN_TRY {
[svn-r14156] Description:
Add API versioning to H5Tcommit()
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 10:50:31 +08:00
ret = H5Tcommit2 ( gid , " . " , tid , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
2005-04-17 00:22:16 +08:00
} H5E_END_TRY ;
[svn-r14156] Description:
Add API versioning to H5Tcommit()
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 10:50:31 +08:00
VERIFY ( ret , FAIL , " H5Tcommit2 " ) ;
2005-04-17 00:22:16 +08:00
/* Open a named datatype with no name using the file ID */
H5E_BEGIN_TRY {
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
tid2 = H5Topen2 ( fid , " . " , H5P_DEFAULT ) ;
2005-04-17 00:22:16 +08:00
} H5E_END_TRY ;
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
VERIFY ( tid2 , FAIL , " H5Topen2 " ) ;
2005-04-17 00:22:16 +08:00
/* Open a named datatype with no name using the group ID */
H5E_BEGIN_TRY {
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
tid2 = H5Topen2 ( gid , " . " , H5P_DEFAULT ) ;
2005-04-17 00:22:16 +08:00
} H5E_END_TRY ;
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
VERIFY ( tid2 , FAIL , " H5Topen2 " ) ;
2005-04-17 00:22:16 +08:00
/* Create a group with no name using the file ID */
H5E_BEGIN_TRY {
2007-08-24 04:25:25 +08:00
gid2 = H5Gcreate2 ( fid , " . " , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
2005-04-17 00:22:16 +08:00
} H5E_END_TRY ;
2007-08-24 04:25:25 +08:00
VERIFY ( gid2 , FAIL , " H5Gcreate2 " ) ;
2005-04-17 00:22:16 +08:00
/* Create a group with no name using the group ID */
H5E_BEGIN_TRY {
2007-08-24 04:25:25 +08:00
gid2 = H5Gcreate2 ( gid , " . " , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
2005-04-17 00:22:16 +08:00
} H5E_END_TRY ;
2007-08-24 04:25:25 +08:00
VERIFY ( gid2 , FAIL , " H5Gcreate2 " ) ;
2005-04-17 00:22:16 +08:00
/* Open a group with no name using the file ID (should open the root group) */
2007-08-28 23:02:54 +08:00
gid2 = H5Gopen2 ( fid , " . " , H5P_DEFAULT ) ;
CHECK ( gid2 , FAIL , " H5Gopen2 " ) ;
2005-04-17 00:22:16 +08:00
ret = H5Gclose ( gid2 ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
/* Open a group with no name using the group ID (should open the group again) */
2007-08-28 23:02:54 +08:00
gid2 = H5Gopen2 ( gid , " . " , H5P_DEFAULT ) ;
CHECK ( gid2 , FAIL , " H5Gopen2 " ) ;
2005-04-17 00:22:16 +08:00
ret = H5Gclose ( gid2 ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
/* Close everything */
ret = H5Sclose ( sid ) ;
CHECK ( ret , FAIL , " H5Sclose " ) ;
ret = H5Gclose ( gid ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
ret = H5Fclose ( fid ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
} /* end test_file_open_dot() */
2005-06-02 05:20:10 +08:00
/****************************************************************
* *
2005-08-14 04:53:35 +08:00
* * test_file_open_overlap ( ) : low - level file test routine .
2005-06-02 05:20:10 +08:00
* * This test checks whether opening files in an overlapping way
* * ( as opposed to a nested manner ) works correctly .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2005-08-14 04:53:35 +08:00
static void
2005-06-02 05:20:10 +08:00
test_file_open_overlap ( void )
{
hid_t fid1 , fid2 ;
hid_t did1 , did2 ;
hid_t gid ;
hid_t sid ;
int nobjs ; /* # of open objects */
2006-08-24 08:52:21 +08:00
unsigned intent ;
2005-06-02 05:20:10 +08:00
herr_t ret ; /* Generic return value */
2005-08-14 04:53:35 +08:00
2005-06-02 05:20:10 +08:00
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing opening overlapping file opens \n " ) ) ;
/* Create file */
fid1 = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
2005-07-21 22:48:26 +08:00
CHECK ( fid1 , FAIL , " H5Fcreate " ) ;
2005-06-02 05:20:10 +08:00
/* Open file also */
fid2 = H5Fopen ( FILE1 , H5F_ACC_RDWR , H5P_DEFAULT ) ;
2005-07-21 22:48:26 +08:00
CHECK ( fid2 , FAIL , " H5Fopen " ) ;
2005-06-02 05:20:10 +08:00
2006-08-24 08:52:21 +08:00
/* Check the intent */
ret = H5Fget_intent ( fid1 , & intent ) ;
CHECK ( ret , FAIL , " H5Fget_intent " ) ;
VERIFY ( intent , H5F_ACC_RDWR , " H5Fget_intent " ) ;
2005-06-02 05:20:10 +08:00
/* Create a group in file */
2007-08-24 04:25:25 +08:00
gid = H5Gcreate2 ( fid1 , GROUP1 , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( gid , FAIL , " H5Gcreate2 " ) ;
2005-06-02 05:20:10 +08:00
/* Create dataspace for dataset */
sid = H5Screate ( H5S_SCALAR ) ;
2005-07-21 22:48:26 +08:00
CHECK ( sid , FAIL , " H5Screate " ) ;
2005-06-02 05:20:10 +08:00
/* Create dataset in group w/first file ID */
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
did1 = H5Dcreate2 ( gid , DSET1 , H5T_NATIVE_INT , sid , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( did1 , FAIL , " H5Dcreate2 " ) ;
2005-06-02 05:20:10 +08:00
/* Check number of objects opened in first file */
nobjs = H5Fget_obj_count ( fid1 , H5F_OBJ_LOCAL | H5F_OBJ_ALL ) ;
2005-07-21 22:48:26 +08:00
VERIFY ( nobjs , 3 , " H5Fget_obj_count " ) ; /* 3 == file, dataset & group */
2005-06-02 05:20:10 +08:00
/* Close dataset */
ret = H5Dclose ( did1 ) ;
2005-07-21 22:48:26 +08:00
CHECK ( ret , FAIL , " H5Dclose " ) ;
2005-06-02 05:20:10 +08:00
/* Close group */
ret = H5Gclose ( gid ) ;
2005-07-21 22:48:26 +08:00
CHECK ( ret , FAIL , " H5Gclose " ) ;
2005-06-02 05:20:10 +08:00
/* Close first file ID */
ret = H5Fclose ( fid1 ) ;
2005-07-21 22:48:26 +08:00
CHECK ( ret , FAIL , " H5Fclose " ) ;
2005-06-02 05:20:10 +08:00
/* Create dataset with second file ID */
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
did2 = H5Dcreate2 ( fid2 , DSET2 , H5T_NATIVE_INT , sid , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( did2 , FAIL , " H5Dcreate2 " ) ;
2005-06-02 05:20:10 +08:00
/* Check number of objects opened in first file */
nobjs = H5Fget_obj_count ( fid2 , H5F_OBJ_ALL ) ;
2005-07-21 22:48:26 +08:00
VERIFY ( nobjs , 2 , " H5Fget_obj_count " ) ; /* 3 == file & dataset */
2005-06-02 05:20:10 +08:00
/* Close dataspace */
ret = H5Sclose ( sid ) ;
2005-07-21 22:48:26 +08:00
CHECK ( ret , FAIL , " H5Sclose " ) ;
2005-06-02 05:20:10 +08:00
/* Close second dataset */
ret = H5Dclose ( did2 ) ;
2005-07-21 22:48:26 +08:00
CHECK ( ret , FAIL , " H5Dclose " ) ;
2005-06-02 05:20:10 +08:00
/* Close second file */
ret = H5Fclose ( fid2 ) ;
2005-07-21 22:48:26 +08:00
CHECK ( ret , FAIL , " H5Fclose " ) ;
2005-06-02 05:20:10 +08:00
} /* end test_file_open_overlap() */
2005-07-21 22:48:26 +08:00
/****************************************************************
* *
2005-08-14 04:53:35 +08:00
* * test_file_getname ( ) : low - level file test routine .
2005-07-21 22:48:26 +08:00
* * This test checks whether H5Fget_name works correctly .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2005-08-14 04:53:35 +08:00
static void
2005-07-21 22:48:26 +08:00
test_file_getname ( void )
{
/* Compound datatype */
typedef struct s1_t {
unsigned int a ;
float b ;
} s1_t ;
hid_t file_id ;
hid_t group_id ;
hid_t dataset_id ;
2005-08-14 04:53:35 +08:00
hid_t space_id ;
2005-07-21 22:48:26 +08:00
hid_t type_id ;
hid_t attr_id ;
hsize_t dims [ TESTA_RANK ] = { TESTA_NX , TESTA_NY } ;
char name [ TESTA_NAME_BUF_SIZE ] ;
ssize_t name_len ;
herr_t ret ; /* Generic return value */
2005-08-14 04:53:35 +08:00
2005-07-21 22:48:26 +08:00
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing H5Fget_name() functionality \n " ) ) ;
/* Create a new file_id using default properties. */
file_id = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
2005-08-14 04:53:35 +08:00
CHECK ( file_id , FAIL , " H5Fcreate " ) ;
2005-07-21 22:48:26 +08:00
/* Get and verify file name */
2006-10-24 04:40:14 +08:00
name_len = H5Fget_name ( file_id , name , ( size_t ) TESTA_NAME_BUF_SIZE ) ;
2005-07-21 22:48:26 +08:00
CHECK ( name_len , FAIL , " H5Fget_name " ) ;
VERIFY_STR ( name , FILE1 , " H5Fget_name " ) ;
/* Create a group in the root group */
2007-08-24 04:25:25 +08:00
group_id = H5Gcreate2 ( file_id , TESTA_GROUPNAME , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( group_id , FAIL , " H5Gcreate2 " ) ;
2005-07-21 22:48:26 +08:00
/* Get and verify file name */
2006-10-24 04:40:14 +08:00
name_len = H5Fget_name ( group_id , name , ( size_t ) TESTA_NAME_BUF_SIZE ) ;
2005-07-21 22:48:26 +08:00
CHECK ( name_len , FAIL , " H5Fget_name " ) ;
VERIFY_STR ( name , FILE1 , " H5Fget_name " ) ;
/* Create the data space */
space_id = H5Screate_simple ( TESTA_RANK , dims , NULL ) ;
2005-08-14 04:53:35 +08:00
CHECK ( space_id , FAIL , " H5Screate_simple " ) ;
2005-07-21 22:48:26 +08:00
2005-08-14 04:53:35 +08:00
/* Try get file name from data space. Supposed to fail because
2005-07-21 22:48:26 +08:00
* it ' s illegal operation . */
H5E_BEGIN_TRY {
2006-10-24 04:40:14 +08:00
name_len = H5Fget_name ( space_id , name , ( size_t ) TESTA_NAME_BUF_SIZE ) ;
2005-07-21 22:48:26 +08:00
} H5E_END_TRY ;
VERIFY ( name_len , FAIL , " H5Fget_name " ) ;
/* Create a new dataset */
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
dataset_id = H5Dcreate2 ( file_id , TESTA_DSETNAME , H5T_NATIVE_INT , space_id , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( dataset_id , FAIL , " H5Dcreate2 " ) ;
2005-07-21 22:48:26 +08:00
/* Get and verify file name */
2006-10-24 04:40:14 +08:00
name_len = H5Fget_name ( dataset_id , name , ( size_t ) TESTA_NAME_BUF_SIZE ) ;
2005-07-21 22:48:26 +08:00
CHECK ( name_len , FAIL , " H5Fget_name " ) ;
VERIFY_STR ( name , FILE1 , " H5Fget_name " ) ;
/* Create an attribute for the dataset */
[svn-r14218] Description:
Changed H5Acreate2 -> H5Acreate_by_name, to be more consistent with
other new API routines.
Re-added simpler form of H5Acreate2, which creates attributes directly
on an object.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 02:13:48 +08:00
attr_id = H5Acreate2 ( dataset_id , TESTA_ATTRNAME , H5T_NATIVE_INT , space_id , H5P_DEFAULT , H5P_DEFAULT ) ;
[svn-r14187] Description:
Put H5Acreate() under API versioning, with all internal usage shifted
to H5Acreate2().
Add regression tests for H5Acreate1().
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-05 06:19:07 +08:00
CHECK ( attr_id , FAIL , " H5Acreate2 " ) ;
2005-07-21 22:48:26 +08:00
/* Get and verify file name */
2006-10-24 04:40:14 +08:00
name_len = H5Fget_name ( attr_id , name , ( size_t ) TESTA_NAME_BUF_SIZE ) ;
2005-07-21 22:48:26 +08:00
CHECK ( name_len , FAIL , " H5Fget_name " ) ;
VERIFY_STR ( name , FILE1 , " H5Fget_name " ) ;
/* Create a compound datatype */
type_id = H5Tcreate ( H5T_COMPOUND , sizeof ( s1_t ) ) ;
2005-08-14 04:53:35 +08:00
CHECK ( type_id , FAIL , " H5Tcreate " ) ;
2005-07-21 22:48:26 +08:00
/* Insert fields */
ret = H5Tinsert ( type_id , " a " , HOFFSET ( s1_t , a ) , H5T_NATIVE_INT ) ;
2005-08-14 04:53:35 +08:00
CHECK ( ret , FAIL , " H5Tinsert " ) ;
2005-07-21 22:48:26 +08:00
ret = H5Tinsert ( type_id , " b " , HOFFSET ( s1_t , b ) , H5T_NATIVE_FLOAT ) ;
2005-08-14 04:53:35 +08:00
CHECK ( ret , FAIL , " H5Tinsert " ) ;
2005-07-21 22:48:26 +08:00
/* Save it on file */
[svn-r14156] Description:
Add API versioning to H5Tcommit()
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 10:50:31 +08:00
ret = H5Tcommit2 ( file_id , TESTA_DTYPENAME , type_id , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( ret , FAIL , " H5Tcommit2 " ) ;
2005-07-21 22:48:26 +08:00
/* Get and verify file name */
2006-10-24 04:40:14 +08:00
name_len = H5Fget_name ( type_id , name , ( size_t ) TESTA_NAME_BUF_SIZE ) ;
2005-07-21 22:48:26 +08:00
CHECK ( name_len , FAIL , " H5Fget_name " ) ;
VERIFY_STR ( name , FILE1 , " H5Fget_name " ) ;
/* Close things down */
ret = H5Tclose ( type_id ) ;
CHECK ( ret , FAIL , " H5Tclose " ) ;
ret = H5Aclose ( attr_id ) ;
CHECK ( ret , FAIL , " H5Aclose " ) ;
ret = H5Dclose ( dataset_id ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
ret = H5Sclose ( space_id ) ;
CHECK ( ret , FAIL , " H5Sclose " ) ;
ret = H5Gclose ( group_id ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
ret = H5Fclose ( file_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
} /* end test_file_getname() */
2005-10-03 13:50:05 +08:00
/****************************************************************
* *
* * test_file_double_root_open ( ) : low - level file test routine .
* * This test checks whether opening the root group from two
* * different files works correctly .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
test_file_double_root_open ( void )
{
2006-06-27 22:45:06 +08:00
hid_t file1_id , file2_id ;
hid_t grp1_id , grp2_id ;
2005-10-03 13:50:05 +08:00
herr_t ret ; /* Generic return value */
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing double root group open \n " ) ) ;
file1_id = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( file1_id , FAIL , " H5Fcreate " ) ;
file2_id = H5Fopen ( FILE1 , H5F_ACC_RDONLY , H5P_DEFAULT ) ;
CHECK ( file2_id , FAIL , " H5Fopen " ) ;
2007-08-28 23:02:54 +08:00
grp1_id = H5Gopen2 ( file1_id , " / " , H5P_DEFAULT ) ;
CHECK ( grp1_id , FAIL , " H5Gopen2 " ) ;
grp2_id = H5Gopen2 ( file2_id , " / " , H5P_DEFAULT ) ;
CHECK ( grp2_id , FAIL , " H5Gopen2 " ) ;
2005-10-03 13:50:05 +08:00
/* Note "assymetric" close order */
ret = H5Gclose ( grp1_id ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
ret = H5Gclose ( grp2_id ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
ret = H5Fclose ( file1_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
ret = H5Fclose ( file2_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
} /* end test_file_double_root_open() */
/****************************************************************
* *
* * test_file_double_group_open ( ) : low - level file test routine .
* * This test checks whether opening the same group from two
* * different files works correctly .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
test_file_double_group_open ( void )
{
2006-06-27 22:45:06 +08:00
hid_t file1_id , file2_id ;
hid_t grp1_id , grp2_id ;
2005-10-03 13:50:05 +08:00
herr_t ret ; /* Generic return value */
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing double non-root group open \n " ) ) ;
file1_id = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( file1_id , FAIL , " H5Fcreate " ) ;
file2_id = H5Fopen ( FILE1 , H5F_ACC_RDONLY , H5P_DEFAULT ) ;
CHECK ( file2_id , FAIL , " H5Fopen " ) ;
2007-08-24 04:25:25 +08:00
grp1_id = H5Gcreate2 ( file1_id , GRP_NAME , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( grp1_id , FAIL , " H5Gcreate2 " ) ;
2007-08-28 23:02:54 +08:00
grp2_id = H5Gopen2 ( file2_id , GRP_NAME , H5P_DEFAULT ) ;
CHECK ( grp2_id , FAIL , " H5Gopen2 " ) ;
2005-10-03 13:50:05 +08:00
/* Note "assymetric" close order */
ret = H5Gclose ( grp1_id ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
ret = H5Gclose ( grp2_id ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
ret = H5Fclose ( file1_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
ret = H5Fclose ( file2_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
} /* end test_file_double_group_open() */
/****************************************************************
* *
* * test_file_double_dataset_open ( ) : low - level file test routine .
* * This test checks whether opening the same dataset from two
* * different files works correctly .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
test_file_double_dataset_open ( void )
{
2006-06-27 22:45:06 +08:00
hid_t file1_id , file2_id ;
hid_t dset1_id , dset2_id ;
hid_t space_id ;
2005-10-03 13:50:05 +08:00
herr_t ret ; /* Generic return value */
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing double dataset open \n " ) ) ;
file1_id = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( file1_id , FAIL , " H5Fcreate " ) ;
file2_id = H5Fopen ( FILE1 , H5F_ACC_RDONLY , H5P_DEFAULT ) ;
CHECK ( file2_id , FAIL , " H5Fopen " ) ;
/* Create dataspace for dataset */
space_id = H5Screate ( H5S_SCALAR ) ;
CHECK ( space_id , FAIL , " H5Screate " ) ;
[svn-r14199] Description:
Add H5Dcreate to API versioned routines, replacing internal usage with
H5Dcreate2
Fix thread-safe error stack initialization for API versioned error
stack printing routines.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-12 00:24:11 +08:00
dset1_id = H5Dcreate2 ( file1_id , DSET_NAME , H5T_NATIVE_INT , space_id , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( dset1_id , FAIL , " H5Dcreate2 " ) ;
[svn-r14193] Description:
Make H5Dopen versioned and change all internal usage to use H5Dopen2
Add simple regression test for H5Dopen1
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-09 03:59:36 +08:00
dset2_id = H5Dopen2 ( file2_id , DSET_NAME , H5P_DEFAULT ) ;
CHECK ( dset2_id , FAIL , " H5Dopen2 " ) ;
2005-10-03 13:50:05 +08:00
/* Close "supporting" dataspace */
ret = H5Sclose ( space_id ) ;
CHECK ( ret , FAIL , " H5Sclose " ) ;
/* Note "assymetric" close order */
ret = H5Dclose ( dset1_id ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
ret = H5Dclose ( dset2_id ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
ret = H5Fclose ( file1_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
ret = H5Fclose ( file2_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
} /* end test_file_double_dataset_open() */
/****************************************************************
* *
* * test_file_double_datatype_open ( ) : low - level file test routine .
* * This test checks whether opening the same named datatype from two
* * different files works correctly .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
test_file_double_datatype_open ( void )
{
2006-06-27 22:45:06 +08:00
hid_t file1_id , file2_id ;
hid_t type1_id , type2_id ;
2005-10-03 13:50:05 +08:00
herr_t ret ; /* Generic return value */
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing double dataset open \n " ) ) ;
file1_id = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( file1_id , FAIL , " H5Fcreate " ) ;
file2_id = H5Fopen ( FILE1 , H5F_ACC_RDONLY , H5P_DEFAULT ) ;
CHECK ( file2_id , FAIL , " H5Fopen " ) ;
type1_id = H5Tcopy ( H5T_NATIVE_INT ) ;
CHECK ( type1_id , FAIL , " H5Tcopy " ) ;
[svn-r14156] Description:
Add API versioning to H5Tcommit()
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-26 10:50:31 +08:00
ret = H5Tcommit2 ( file1_id , TYPE_NAME , type1_id , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( ret , FAIL , " H5Tcommit2 " ) ;
[svn-r14160] Description:
Make H5Topen versioned, and add regression test for H5Topen1.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
AIX/32 5.3 (copper) w/FORTRAN, w/parallel, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-09-28 04:28:27 +08:00
type2_id = H5Topen2 ( file2_id , TYPE_NAME , H5P_DEFAULT ) ;
CHECK ( type2_id , FAIL , " H5Topen2 " ) ;
2005-10-03 13:50:05 +08:00
/* Note "assymetric" close order */
ret = H5Tclose ( type1_id ) ;
CHECK ( ret , FAIL , " H5Tclose " ) ;
ret = H5Tclose ( type2_id ) ;
CHECK ( ret , FAIL , " H5Tclose " ) ;
ret = H5Fclose ( file1_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
ret = H5Fclose ( file2_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
} /* end test_file_double_dataset_open() */
2009-03-26 23:12:48 +08:00
/****************************************************************
* *
* * test_userblock_file_size ( ) : low - level file test routine .
* * This test checks that the presence of a userblock
* * affects the file size in the expected manner , and that
* * the filesize is not changed by reopening the file . It
* * creates two files which are identical except that one
* * contains a userblock , and verifies that their file sizes
* * differ exactly by the userblock size .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
test_userblock_file_size ( void )
{
hid_t file1_id , file2_id ;
hid_t group1_id , group2_id ;
hid_t dset1_id , dset2_id ;
hid_t space_id ;
hid_t fcpl2_id ;
hsize_t dims [ 2 ] = { 3 , 4 } ;
hsize_t filesize1 , filesize2 , filesize ;
herr_t ret ; /* Generic return value */
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing file size with user block \n " ) ) ;
/* Create property list with userblock size set */
fcpl2_id = H5Pcreate ( H5P_FILE_CREATE ) ;
CHECK ( fcpl2_id , FAIL , " H5Pcreate " ) ;
ret = H5Pset_userblock ( fcpl2_id , USERBLOCK_SIZE ) ;
CHECK ( ret , FAIL , " H5Pset_userblock " ) ;
/* Create files. Onyl file2 with have a userblock. */
file1_id = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( file1_id , FAIL , " H5Fcreate " ) ;
file2_id = H5Fcreate ( FILE2 , H5F_ACC_TRUNC , fcpl2_id , H5P_DEFAULT ) ;
CHECK ( file2_id , FAIL , " H5Fcreate " ) ;
/* Create groups */
group1_id = H5Gcreate2 ( file1_id , GROUP1 , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( group1_id , FAIL , " H5Gcreate2 " ) ;
group2_id = H5Gcreate2 ( file2_id , GROUP1 , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( group2_id , FAIL , " H5Gcreate2 " ) ;
/* Create dataspace */
space_id = H5Screate_simple ( 2 , dims , NULL ) ;
CHECK ( space_id , FAIL , " H5Screate_simple " ) ;
/* Create datasets */
dset1_id = H5Dcreate2 ( file1_id , DSET2 , H5T_NATIVE_INT , space_id , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( dset1_id , FAIL , " H5Dcreate2 " ) ;
dset2_id = H5Dcreate2 ( file2_id , DSET2 , H5T_NATIVE_INT , space_id , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( dset2_id , FAIL , " H5Dcreate2 " ) ;
/* Close IDs */
ret = H5Dclose ( dset1_id ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
ret = H5Dclose ( dset2_id ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
ret = H5Sclose ( space_id ) ;
CHECK ( ret , FAIL , " H5Sclose " ) ;
ret = H5Gclose ( group1_id ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
ret = H5Gclose ( group2_id ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
ret = H5Pclose ( fcpl2_id ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
/* Close files */
ret = H5Fclose ( file1_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
ret = H5Fclose ( file2_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Reopen files */
file1_id = H5Fopen ( FILE1 , H5F_ACC_RDWR , H5P_DEFAULT ) ;
2009-04-09 05:53:31 +08:00
CHECK ( file1_id , FAIL , " H5Fopen " ) ;
2009-03-26 23:12:48 +08:00
file2_id = H5Fopen ( FILE2 , H5F_ACC_RDWR , H5P_DEFAULT ) ;
2009-04-09 05:53:31 +08:00
CHECK ( file2_id , FAIL , " H5Fopen " ) ;
2009-03-26 23:12:48 +08:00
/* Check file sizes */
ret = H5Fget_filesize ( file1_id , & filesize1 ) ;
CHECK ( ret , FAIL , " H5Fget_filesize " ) ;
ret = H5Fget_filesize ( file2_id , & filesize2 ) ;
CHECK ( ret , FAIL , " H5Fget_filesize " ) ;
/* Verify that the file sizes differ exactly by the userblock size */
[svn-r17461] Description:
Fix a few more problems when the user block is not aligned properly.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 03:02:40 +08:00
VERIFY_TYPE ( ( unsigned long long ) filesize2 , ( unsigned long long ) ( filesize1 + USERBLOCK_SIZE ) , unsigned long long , " %llu " , " H5Fget_filesize " ) ;
2009-03-26 23:12:48 +08:00
/* Close files */
ret = H5Fclose ( file1_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
ret = H5Fclose ( file2_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Reopen files */
file1_id = H5Fopen ( FILE1 , H5F_ACC_RDWR , H5P_DEFAULT ) ;
2009-04-09 05:53:31 +08:00
CHECK ( file1_id , FAIL , " H5Fopen " ) ;
2009-03-26 23:12:48 +08:00
file2_id = H5Fopen ( FILE2 , H5F_ACC_RDWR , H5P_DEFAULT ) ;
2009-04-09 05:53:31 +08:00
CHECK ( file2_id , FAIL , " H5Fopen " ) ;
2009-03-26 23:12:48 +08:00
/* Verify file sizes did not change */
ret = H5Fget_filesize ( file1_id , & filesize ) ;
CHECK ( ret , FAIL , " H5Fget_filesize " ) ;
VERIFY ( filesize , filesize1 , " H5Fget_filesize " ) ;
ret = H5Fget_filesize ( file2_id , & filesize ) ;
CHECK ( ret , FAIL , " H5Fget_filesize " ) ;
VERIFY ( filesize , filesize2 , " H5Fget_filesize " ) ;
/* Close files */
ret = H5Fclose ( file1_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
ret = H5Fclose ( file2_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
} /* end test_userblock_file_size() */
2009-04-09 05:53:31 +08:00
/****************************************************************
* *
* * test_cached_stab_info ( ) : low - level file test routine .
* * This test checks that new files are created with cached
* * symbol table information in the superblock ( when using
* * the old format ) . This is necessary to ensure backwards
* * compatibility with versions from 1.3 .0 to 1.6 .3 .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
test_cached_stab_info ( void )
{
hid_t file_id ;
hid_t group_id ;
herr_t ret ; /* Generic return value */
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing cached symbol table information \n " ) ) ;
/* Create file */
file_id = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( file_id , FAIL , " H5Fcreate " ) ;
/* Create group */
group_id = H5Gcreate2 ( file_id , GROUP1 , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( group_id , FAIL , " H5Gcreate2 " ) ;
/* Close file and group */
ret = H5Gclose ( group_id ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
ret = H5Fclose ( file_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Reopen file */
file_id = H5Fopen ( FILE1 , H5F_ACC_RDONLY , H5P_DEFAULT ) ;
[svn-r17146] Description:
Bring a bunch of misc. improvements & tweaks from the revise_chunks
branch back to the trunk, so that future merges won't be so painful.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.7 (amazon) in debug mode
Mac OS X/32 10.5.7 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-07-03 05:10:35 +08:00
CHECK ( file_id , FAIL , " H5Fopen " ) ;
2009-04-09 05:53:31 +08:00
/* Verify the cached symbol table information */
ret = H5F_check_cached_stab_test ( file_id ) ;
CHECK ( ret , FAIL , " H5F_check_cached_stab_test " ) ;
/* Close file */
ret = H5Fclose ( file_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
} /* end test_cached_stab_info() */
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
/****************************************************************
* *
* * test_rw_noupdate ( ) : low - level file test routine .
2010-01-30 12:29:13 +08:00
* * This test checks to ensure that opening and closing a file
* * with read / write permissions does not write anything to the
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
* * file if the file does not change .
* *
* * Programmer : Mike McGreevy
* * mamcgree @ hdfgroup . org
* * June 29 , 2009
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
test_rw_noupdate ( void )
{
2009-09-25 07:10:20 +08:00
int fd ; /* File Descriptor */
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
h5_stat_t sb1 , sb2 ; /* Info from 'stat' call */
double diff ; /* Difference in modification times */
herr_t ret ; /* Generic return value */
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing to verify that nothing is written if nothing is changed. \n " ) ) ;
2009-09-25 02:26:42 +08:00
/* First make sure the stat function behaves as we expect - the modification time
* is the time that the file was modified last time . */
2009-09-25 07:10:20 +08:00
fd = HDopen ( SFILE1 , O_RDWR | O_CREAT | O_TRUNC , 0666 ) ;
CHECK ( fd , FAIL , " HDopen " ) ;
ret = HDclose ( fd ) ;
CHECK ( ret , FAIL , " HDclose " ) ;
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
/* Determine File's Initial Timestamp */
2009-09-25 07:10:20 +08:00
ret = HDstat ( SFILE1 , & sb1 ) ;
VERIFY ( ret , 0 , " HDstat " ) ;
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
/* Wait for 2 seconds */
2009-09-25 07:10:20 +08:00
/* (This ensures a system time difference between the two file accesses) */
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
HDsleep ( 2 ) ;
2009-09-25 07:10:20 +08:00
fd = HDopen ( SFILE1 , O_RDWR , 0666 ) ;
CHECK ( fd , FAIL , " HDopen " ) ;
ret = HDclose ( fd ) ;
CHECK ( ret , FAIL , " HDclose " ) ;
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
/* Determine File's New Timestamp */
2009-09-25 07:10:20 +08:00
ret = HDstat ( SFILE1 , & sb2 ) ;
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
VERIFY ( ret , 0 , " HDstat " ) ;
2009-09-25 07:10:20 +08:00
/* Get difference between timestamps */
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
diff = HDdifftime ( sb2 . st_mtime , sb1 . st_mtime ) ;
2009-09-25 02:26:42 +08:00
2009-09-25 07:10:20 +08:00
/* Check That Timestamps Are Equal */
if ( diff > 0.0 ) {
/* Output message about test being performed */
MESSAGE ( 1 , ( " Testing to verify that nothing is written if nothing is changed: This test is skipped on this system because the modification time from stat is the same as the last access time (We know OpenVMS behaves in this way). \n " ) ) ;
} /* end if */
else {
hid_t file_id ; /* HDF5 File ID */
/* Create and Close a HDF5 File */
file_id = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( file_id , FAIL , " H5Fcreate " ) ;
ret = H5Fclose ( file_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Determine File's Initial Timestamp */
ret = HDstat ( FILE1 , & sb1 ) ;
VERIFY ( ret , 0 , " HDfstat " ) ;
/* Wait for 2 seconds */
/* (This ensures a system time difference between the two file accesses) */
HDsleep ( 2 ) ;
/* Open and Close File With Read/Write Permission */
file_id = H5Fopen ( FILE1 , H5F_ACC_RDWR , H5P_DEFAULT ) ;
CHECK ( file_id , FAIL , " H5Fopen " ) ;
ret = H5Fclose ( file_id ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Determine File's New Timestamp */
ret = HDstat ( FILE1 , & sb2 ) ;
VERIFY ( ret , 0 , " HDstat " ) ;
/* Ensure That Timestamps Are Equal */
diff = HDdifftime ( sb2 . st_mtime , sb1 . st_mtime ) ;
ret = ( diff > 0.0 ) ;
VERIFY ( ret , 0 , " Timestamp " ) ;
} /* end else */
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
} /* end test_rw_noupdate() */
[svn-r17461] Description:
Fix a few more problems when the user block is not aligned properly.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 03:02:40 +08:00
/****************************************************************
* *
[svn-r17463] Description:
Add another regression test for userblock+alignment usage, and correct
[another] issue with the combination. *sigh*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 20:19:45 +08:00
* * test_userblock_alignment_helper1 ( ) : helper routine for
[svn-r17461] Description:
Fix a few more problems when the user block is not aligned properly.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 03:02:40 +08:00
* * test_userblock_alignment ( ) test , to handle common testing
* *
* * Programmer : Quincey Koziol
* * koziol @ hdfgroup . org
* * Septmber 10 , 2009
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static int
[svn-r17463] Description:
Add another regression test for userblock+alignment usage, and correct
[another] issue with the combination. *sigh*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 20:19:45 +08:00
test_userblock_alignment_helper1 ( hid_t fcpl , hid_t fapl )
[svn-r17461] Description:
Fix a few more problems when the user block is not aligned properly.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 03:02:40 +08:00
{
hid_t fid ; /* File ID */
int curr_num_errs = GetTestNumErrs ( ) ; /* Retrieve the current # of errors */
herr_t ret ; /* Generic return value */
/* Create a file with FAPL & FCPL */
fid = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , fcpl , fapl ) ;
CHECK ( fid , FAIL , " H5Fcreate " ) ;
/* Only proceed further if file ID is OK */
if ( fid > 0 ) {
hid_t gid ; /* Group ID */
hid_t sid ; /* Dataspace ID */
hid_t did ; /* Dataset ID */
int val = 2 ; /* Dataset value */
/* Create a group */
gid = H5Gcreate2 ( fid , " group1 " , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( gid , FAIL , " H5Gcreate2 " ) ;
/* Create a dataset */
sid = H5Screate ( H5S_SCALAR ) ;
CHECK ( sid , FAIL , " H5Screate " ) ;
did = H5Dcreate2 ( gid , " dataset " , H5T_NATIVE_INT , sid , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( did , FAIL , " H5Dcreate2 " ) ;
/* Close dataspace */
ret = H5Sclose ( sid ) ;
CHECK ( ret , FAIL , " H5Sclose " ) ;
/* Write value to dataset */
ret = H5Dwrite ( did , H5T_NATIVE_INT , H5S_ALL , H5S_ALL , H5P_DEFAULT , & val ) ;
CHECK ( ret , FAIL , " H5Dwrite " ) ;
/* Close dataset */
ret = H5Dclose ( did ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
/* Close group */
ret = H5Gclose ( gid ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
/* Close file */
ret = H5Fclose ( fid ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
} /* end if */
[svn-r17463] Description:
Add another regression test for userblock+alignment usage, and correct
[another] issue with the combination. *sigh*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 20:19:45 +08:00
return ( ( GetTestNumErrs ( ) = = curr_num_errs ) ? 0 : - 1 ) ;
} /* end test_userblock_alignment_helper1() */
/****************************************************************
* *
* * test_userblock_alignment_helper2 ( ) : helper routine for
* * test_userblock_alignment ( ) test , to handle common testing
* *
* * Programmer : Quincey Koziol
* * koziol @ hdfgroup . org
* * Septmber 10 , 2009
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static int
test_userblock_alignment_helper2 ( hid_t fapl , hbool_t open_rw )
{
hid_t fid ; /* File ID */
int curr_num_errs = GetTestNumErrs ( ) ; /* Retrieve the current # of errors */
herr_t ret ; /* Generic return value */
[svn-r17461] Description:
Fix a few more problems when the user block is not aligned properly.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 03:02:40 +08:00
/* Re-open file */
[svn-r17463] Description:
Add another regression test for userblock+alignment usage, and correct
[another] issue with the combination. *sigh*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 20:19:45 +08:00
fid = H5Fopen ( FILE1 , ( open_rw ? H5F_ACC_RDWR : H5F_ACC_RDONLY ) , fapl ) ;
[svn-r17461] Description:
Fix a few more problems when the user block is not aligned properly.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 03:02:40 +08:00
CHECK ( fid , FAIL , " H5Fopen " ) ;
/* Only proceed further if file ID is OK */
if ( fid > 0 ) {
[svn-r17463] Description:
Add another regression test for userblock+alignment usage, and correct
[another] issue with the combination. *sigh*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 20:19:45 +08:00
hid_t gid ; /* Group ID */
hid_t did ; /* Dataset ID */
int val = - 1 ; /* Dataset value */
[svn-r17461] Description:
Fix a few more problems when the user block is not aligned properly.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 03:02:40 +08:00
/* Open group */
gid = H5Gopen2 ( fid , " group1 " , H5P_DEFAULT ) ;
CHECK ( gid , FAIL , " H5Gopen2 " ) ;
/* Open dataset */
did = H5Dopen2 ( gid , " dataset " , H5P_DEFAULT ) ;
CHECK ( did , FAIL , " H5Dopen2 " ) ;
/* Read value from dataset */
ret = H5Dread ( did , H5T_NATIVE_INT , H5S_ALL , H5S_ALL , H5P_DEFAULT , & val ) ;
CHECK ( ret , FAIL , " H5Dread " ) ;
VERIFY ( val , 2 , " H5Dread " ) ;
/* Close dataset */
ret = H5Dclose ( did ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
[svn-r17463] Description:
Add another regression test for userblock+alignment usage, and correct
[another] issue with the combination. *sigh*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 20:19:45 +08:00
/* Only create new objects if file is open R/W */
if ( open_rw ) {
hid_t gid2 ; /* Group ID */
[svn-r17461] Description:
Fix a few more problems when the user block is not aligned properly.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 03:02:40 +08:00
[svn-r17463] Description:
Add another regression test for userblock+alignment usage, and correct
[another] issue with the combination. *sigh*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 20:19:45 +08:00
/* Create a new group */
gid2 = H5Gcreate2 ( gid , " group2 " , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( gid , FAIL , " H5Gcreate2 " ) ;
/* Close new group */
ret = H5Gclose ( gid2 ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
} /* end if */
[svn-r17461] Description:
Fix a few more problems when the user block is not aligned properly.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 03:02:40 +08:00
/* Close group */
ret = H5Gclose ( gid ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
/* Close file */
ret = H5Fclose ( fid ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
} /* end if */
return ( ( GetTestNumErrs ( ) = = curr_num_errs ) ? 0 : - 1 ) ;
[svn-r17463] Description:
Add another regression test for userblock+alignment usage, and correct
[another] issue with the combination. *sigh*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 20:19:45 +08:00
} /* end test_userblock_alignment_helper2() */
[svn-r17461] Description:
Fix a few more problems when the user block is not aligned properly.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 03:02:40 +08:00
[svn-r17459] Description:
Correct bad interaction between non-zero userblocks with non-zero
alignments.
Also add some additional range checking and tests for invalid userblock
sizes.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-09 04:15:37 +08:00
/****************************************************************
* *
* * test_userblock_alignment ( ) : low - level file test routine .
* * This test checks to ensure that files with both a userblock and a
* * object [ allocation ] alignment size set interact properly .
* *
* * Programmer : Quincey Koziol
* * koziol @ hdfgroup . org
* * Septmber 8 , 2009
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
test_userblock_alignment ( void )
{
hid_t fid ; /* File ID */
hid_t fcpl ; /* File creation property list ID */
hid_t fapl ; /* File access property list ID */
herr_t ret ; /* Generic return value */
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing that non-zero userblocks and object alignment interact correctly. \n " ) ) ;
/* Case 1:
* Userblock size = 0 , alignment ! = 0
* Outcome :
* Should succeed
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate ( H5P_FILE_CREATE ) ;
CHECK ( fcpl , FAIL , " H5Pcreate " ) ;
ret = H5Pset_userblock ( fcpl , ( hsize_t ) 0 ) ;
CHECK ( ret , FAIL , " H5Pset_userblock " ) ;
/* Create file access property list with alignment */
fapl = H5Pcreate ( H5P_FILE_ACCESS ) ;
CHECK ( fapl , FAIL , " H5Pcreate " ) ;
ret = H5Pset_alignment ( fapl , ( hsize_t ) 1 , ( hsize_t ) 3 ) ;
CHECK ( ret , FAIL , " H5Pset_alignment " ) ;
[svn-r17463] Description:
Add another regression test for userblock+alignment usage, and correct
[another] issue with the combination. *sigh*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 20:19:45 +08:00
/* Call helper routines to perform file manipulations */
ret = test_userblock_alignment_helper1 ( fcpl , fapl ) ;
CHECK ( ret , FAIL , " test_userblock_alignment_helper1 " ) ;
ret = test_userblock_alignment_helper2 ( fapl , TRUE ) ;
CHECK ( ret , FAIL , " test_userblock_alignment_helper2 " ) ;
[svn-r17459] Description:
Correct bad interaction between non-zero userblocks with non-zero
alignments.
Also add some additional range checking and tests for invalid userblock
sizes.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-09 04:15:37 +08:00
/* Release property lists */
ret = H5Pclose ( fcpl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
ret = H5Pclose ( fapl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
/* Case 2:
* Userblock size = 512 , alignment = 16
* ( userblock is integral mult . of alignment )
* Outcome :
* Should succeed
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate ( H5P_FILE_CREATE ) ;
CHECK ( fcpl , FAIL , " H5Pcreate " ) ;
ret = H5Pset_userblock ( fcpl , ( hsize_t ) 512 ) ;
CHECK ( ret , FAIL , " H5Pset_userblock " ) ;
/* Create file access property list with alignment */
fapl = H5Pcreate ( H5P_FILE_ACCESS ) ;
CHECK ( fapl , FAIL , " H5Pcreate " ) ;
ret = H5Pset_alignment ( fapl , ( hsize_t ) 1 , ( hsize_t ) 16 ) ;
CHECK ( ret , FAIL , " H5Pset_alignment " ) ;
[svn-r17463] Description:
Add another regression test for userblock+alignment usage, and correct
[another] issue with the combination. *sigh*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 20:19:45 +08:00
/* Call helper routines to perform file manipulations */
ret = test_userblock_alignment_helper1 ( fcpl , fapl ) ;
CHECK ( ret , FAIL , " test_userblock_alignment_helper1 " ) ;
ret = test_userblock_alignment_helper2 ( fapl , TRUE ) ;
CHECK ( ret , FAIL , " test_userblock_alignment_helper2 " ) ;
[svn-r17459] Description:
Correct bad interaction between non-zero userblocks with non-zero
alignments.
Also add some additional range checking and tests for invalid userblock
sizes.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-09 04:15:37 +08:00
/* Release property lists */
ret = H5Pclose ( fcpl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
ret = H5Pclose ( fapl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
/* Case 3:
* Userblock size = 512 , alignment = 512
* ( userblock is equal to alignment )
* Outcome :
* Should succeed
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate ( H5P_FILE_CREATE ) ;
CHECK ( fcpl , FAIL , " H5Pcreate " ) ;
ret = H5Pset_userblock ( fcpl , ( hsize_t ) 512 ) ;
CHECK ( ret , FAIL , " H5Pset_userblock " ) ;
/* Create file access property list with alignment */
fapl = H5Pcreate ( H5P_FILE_ACCESS ) ;
CHECK ( fapl , FAIL , " H5Pcreate " ) ;
ret = H5Pset_alignment ( fapl , ( hsize_t ) 1 , ( hsize_t ) 512 ) ;
CHECK ( ret , FAIL , " H5Pset_alignment " ) ;
[svn-r17463] Description:
Add another regression test for userblock+alignment usage, and correct
[another] issue with the combination. *sigh*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 20:19:45 +08:00
/* Call helper routines to perform file manipulations */
ret = test_userblock_alignment_helper1 ( fcpl , fapl ) ;
CHECK ( ret , FAIL , " test_userblock_alignment_helper1 " ) ;
ret = test_userblock_alignment_helper2 ( fapl , TRUE ) ;
CHECK ( ret , FAIL , " test_userblock_alignment_helper2 " ) ;
[svn-r17459] Description:
Correct bad interaction between non-zero userblocks with non-zero
alignments.
Also add some additional range checking and tests for invalid userblock
sizes.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-09 04:15:37 +08:00
/* Release property lists */
ret = H5Pclose ( fcpl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
ret = H5Pclose ( fapl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
/* Case 4:
* Userblock size = 512 , alignment = 3
* ( userblock & alignment each individually valid , but userblock is
* non - integral multiple of alignment )
* Outcome :
* Should fail at file creation
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate ( H5P_FILE_CREATE ) ;
CHECK ( fcpl , FAIL , " H5Pcreate " ) ;
ret = H5Pset_userblock ( fcpl , ( hsize_t ) 512 ) ;
CHECK ( ret , FAIL , " H5Pset_userblock " ) ;
/* Create file access property list with alignment */
fapl = H5Pcreate ( H5P_FILE_ACCESS ) ;
CHECK ( fapl , FAIL , " H5Pcreate " ) ;
ret = H5Pset_alignment ( fapl , ( hsize_t ) 1 , ( hsize_t ) 3 ) ;
CHECK ( ret , FAIL , " H5Pset_alignment " ) ;
/* Create a file with FAPL & FCPL */
H5E_BEGIN_TRY {
fid = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , fcpl , fapl ) ;
} H5E_END_TRY ;
VERIFY ( fid , FAIL , " H5Fcreate " ) ;
/* Release property lists */
ret = H5Pclose ( fcpl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
ret = H5Pclose ( fapl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
[svn-r17461] Description:
Fix a few more problems when the user block is not aligned properly.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 03:02:40 +08:00
[svn-r17459] Description:
Correct bad interaction between non-zero userblocks with non-zero
alignments.
Also add some additional range checking and tests for invalid userblock
sizes.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-09 04:15:37 +08:00
/* Case 5:
* Userblock size = 512 , alignment = 1024
* ( userblock & alignment each individually valid , but userblock is
* less than alignment )
* Outcome :
* Should fail at file creation
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate ( H5P_FILE_CREATE ) ;
CHECK ( fcpl , FAIL , " H5Pcreate " ) ;
ret = H5Pset_userblock ( fcpl , ( hsize_t ) 512 ) ;
CHECK ( ret , FAIL , " H5Pset_userblock " ) ;
/* Create file access property list with alignment */
fapl = H5Pcreate ( H5P_FILE_ACCESS ) ;
CHECK ( fapl , FAIL , " H5Pcreate " ) ;
ret = H5Pset_alignment ( fapl , ( hsize_t ) 1 , ( hsize_t ) 1024 ) ;
CHECK ( ret , FAIL , " H5Pset_alignment " ) ;
/* Create a file with FAPL & FCPL */
H5E_BEGIN_TRY {
fid = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , fcpl , fapl ) ;
} H5E_END_TRY ;
VERIFY ( fid , FAIL , " H5Fcreate " ) ;
/* Release property lists */
ret = H5Pclose ( fcpl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
ret = H5Pclose ( fapl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
[svn-r17463] Description:
Add another regression test for userblock+alignment usage, and correct
[another] issue with the combination. *sigh*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-11 20:19:45 +08:00
/* Case 6:
* File created with :
* Userblock size = 512 , alignment = 512
* File re - opened for read - only & read - write access with :
* Userblock size = 512 , alignment = 1024
* Outcome :
* Should succeed
*/
/* Create file creation property list with user block */
fcpl = H5Pcreate ( H5P_FILE_CREATE ) ;
CHECK ( fcpl , FAIL , " H5Pcreate " ) ;
ret = H5Pset_userblock ( fcpl , ( hsize_t ) 512 ) ;
CHECK ( ret , FAIL , " H5Pset_userblock " ) ;
/* Create file access property list with alignment */
fapl = H5Pcreate ( H5P_FILE_ACCESS ) ;
CHECK ( fapl , FAIL , " H5Pcreate " ) ;
ret = H5Pset_alignment ( fapl , ( hsize_t ) 1 , ( hsize_t ) 512 ) ;
CHECK ( ret , FAIL , " H5Pset_alignment " ) ;
/* Call helper routines to perform file manipulations */
ret = test_userblock_alignment_helper1 ( fcpl , fapl ) ;
CHECK ( ret , FAIL , " test_userblock_alignment_helper1 " ) ;
/* Change alignment in FAPL */
ret = H5Pset_alignment ( fapl , ( hsize_t ) 1 , ( hsize_t ) 1024 ) ;
CHECK ( ret , FAIL , " H5Pset_alignment " ) ;
/* Call helper routines to perform file manipulations */
ret = test_userblock_alignment_helper2 ( fapl , FALSE ) ;
CHECK ( ret , FAIL , " test_userblock_alignment_helper2 " ) ;
ret = test_userblock_alignment_helper2 ( fapl , TRUE ) ;
CHECK ( ret , FAIL , " test_userblock_alignment_helper2 " ) ;
/* Release property lists */
ret = H5Pclose ( fcpl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
ret = H5Pclose ( fapl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
[svn-r17459] Description:
Correct bad interaction between non-zero userblocks with non-zero
alignments.
Also add some additional range checking and tests for invalid userblock
sizes.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-09 04:15:37 +08:00
} /* end test_userblock_alignment() */
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
/****************************************************************
* *
2010-01-30 12:29:13 +08:00
* * test_free_sections ( ) :
* * This routine does the actual work of checking information for
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
* * free space sections available in a file in various situations .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
test_free_sections ( hid_t fapl , char * fname )
{
hid_t file ; /* File ID */
hid_t fcpl ; /* File creation property list template */
hssize_t free_space ; /* Amount of free space in file */
hid_t dspace ; /* Dataspace ID */
hid_t dset ; /* Dataset ID */
hid_t dcpl ; /* Dataset creation property list */
unsigned u ; /* Local index variable */
char name [ 32 ] ; /* Dataset name */
hssize_t nsects ; /* # of free-space sections */
hssize_t saved_nsects ; /* saved copy for the # of free-space sections */
int i ; /* local index variable */
hsize_t total ; /* sum of the free-space section sizes */
hsize_t last_size ; /* size of last free-space section */
H5F_sect_info_t * sect_info ; /* array to hold the free-space information */
H5F_sect_info_t * saved_sect_info ; /* array to hold the free-space information */
herr_t ret ; /* return value */
/* Create file-creation template */
fcpl = H5Pcreate ( H5P_FILE_CREATE ) ;
CHECK ( fcpl , FAIL , " H5Pcreate " ) ;
/* Set file space strategy and free space section threshold */
ret = H5Pset_file_space ( fcpl , H5F_FILE_SPACE_ALL_PERSIST , ( hsize_t ) 0 ) ;
CHECK ( ret , FAIL , " H5Pget_file_space " ) ;
/* Create the file */
file = H5Fcreate ( fname , H5F_ACC_TRUNC , fcpl , fapl ) ;
CHECK ( file , FAIL , " H5Fcreate " ) ;
/* Create dataspace for datasets */
dspace = H5Screate ( H5S_SCALAR ) ;
CHECK ( dspace , FAIL , " H5Screate " ) ;
/* Create a dataset creation property list */
dcpl = H5Pcreate ( H5P_DATASET_CREATE ) ;
CHECK ( dcpl , FAIL , " H5Pcreate " ) ;
/* Set the space allocation time to early */
ret = H5Pset_alloc_time ( dcpl , H5D_ALLOC_TIME_EARLY ) ;
CHECK ( ret , FAIL , " H5Pset_alloc_time " ) ;
/* Create datasets in file */
for ( u = 0 ; u < 10 ; u + + ) {
sprintf ( name , " Dataset %u " , u ) ;
dset = H5Dcreate2 ( file , name , H5T_STD_U32LE , dspace , H5P_DEFAULT , dcpl , H5P_DEFAULT ) ;
CHECK ( dset , FAIL , " H5Dcreate2 " ) ;
ret = H5Dclose ( dset ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
} /* end for */
/* Close dataspace */
ret = H5Sclose ( dspace ) ;
CHECK ( ret , FAIL , " H5Sclose " ) ;
/* Close dataset creation property list */
ret = H5Pclose ( dcpl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
/* Delete odd-numbered datasets in file */
for ( u = 0 ; u < 10 ; u + + ) {
sprintf ( name , " Dataset %u " , u ) ;
if ( u % 2 ) {
ret = H5Ldelete ( file , name , H5P_DEFAULT ) ;
CHECK ( ret , FAIL , " H5Ldelete " ) ;
} /* end if */
} /* end for */
/* Close file */
ret = H5Fclose ( file ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Re-open the file with read-only permission */
file = H5Fopen ( fname , H5F_ACC_RDONLY , fapl ) ;
CHECK_I ( file , " H5Fopen " ) ;
/* Get the amount of free space in the file */
free_space = H5Fget_freespace ( file ) ;
CHECK ( free_space , FAIL , " H5Fget_freespace " ) ;
/* Get the # of free-space sections in the file */
saved_nsects = H5Fget_free_sections ( file , H5FD_MEM_DEFAULT , ( size_t ) 0 , NULL ) ;
CHECK ( saved_nsects , FAIL , " H5Fget_free_sections " ) ;
/* Allocate storage for the free space section information */
saved_sect_info = ( H5F_sect_info_t * ) HDcalloc ( ( size_t ) saved_nsects , sizeof ( H5F_sect_info_t ) ) ;
CHECK ( saved_sect_info , NULL , " HDcalloc " ) ;
/* Should return failure when nsects is 0 with a nonnull sect_info */
nsects = H5Fget_free_sections ( file , H5FD_MEM_DEFAULT , ( size_t ) 0 , saved_sect_info ) ;
VERIFY ( nsects , FAIL , " H5Fget_free_sections " ) ;
/* Verify the correct # of free-space sections */
nsects = H5Fget_free_sections ( file , H5FD_MEM_DEFAULT , ( size_t ) saved_nsects , saved_sect_info ) ;
VERIFY ( nsects , saved_nsects , " H5Fget_free_sections " ) ;
2010-01-30 12:29:13 +08:00
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
/* Verify the amount of free-space is correct */
total = 0 ;
for ( i = 0 ; i < nsects ; i + + )
total + = saved_sect_info [ i ] . size ;
VERIFY ( free_space , total , " H5Fget_free_sections " ) ;
/* save the last section's size */
last_size = saved_sect_info [ nsects - 1 ] . size ;
/* Allocate storage for -1 free space section information */
sect_info = ( H5F_sect_info_t * ) HDcalloc ( ( size_t ) ( saved_nsects - 1 ) , sizeof ( H5F_sect_info_t ) ) ;
CHECK ( sect_info , NULL , " HDcalloc " ) ;
/* Retrieve free space info for -1 sections */
nsects = H5Fget_free_sections ( file , H5FD_MEM_DEFAULT , ( size_t ) ( saved_nsects - 1 ) , sect_info ) ;
VERIFY ( nsects , saved_nsects , " H5Fget_free_sections " ) ;
/* Verify the amount of free-space is correct */
total = 0 ;
for ( i = 0 ; i < ( saved_nsects - 1 ) ; i + + ) {
VERIFY ( sect_info [ i ] . addr , saved_sect_info [ i ] . addr , " H5Fget_free_sections " ) ;
VERIFY ( sect_info [ i ] . size , saved_sect_info [ i ] . size , " H5Fget_free_sections " ) ;
total + = sect_info [ i ] . size ;
}
VERIFY ( ( ( hsize_t ) free_space - last_size ) , total , " H5Fget_free_sections " ) ;
HDfree ( sect_info ) ;
/* Allocate storage for +1 free space section information */
sect_info = ( H5F_sect_info_t * ) HDcalloc ( ( size_t ) ( saved_nsects + 1 ) , sizeof ( H5F_sect_info_t ) ) ;
CHECK ( sect_info , NULL , " HDcalloc " ) ;
/* Retrieve free-space info for +1 sections */
nsects = H5Fget_free_sections ( file , H5FD_MEM_DEFAULT , ( size_t ) ( saved_nsects + 1 ) , sect_info ) ;
VERIFY ( nsects , saved_nsects , " H5Fget_free_sections " ) ;
/* Verify free-space info is correct */
total = 0 ;
for ( i = 0 ; i < nsects ; i + + ) {
VERIFY ( sect_info [ i ] . addr , saved_sect_info [ i ] . addr , " H5Fget_free_sections " ) ;
VERIFY ( sect_info [ i ] . size , saved_sect_info [ i ] . size , " H5Fget_free_sections " ) ;
total + = sect_info [ i ] . size ;
}
VERIFY ( sect_info [ nsects ] . addr , 0 , " H5Fget_free_sections " ) ;
VERIFY ( sect_info [ nsects ] . size , 0 , " H5Fget_free_sections " ) ;
VERIFY ( free_space , total , " H5Fget_free_sections " ) ;
HDfree ( sect_info ) ;
/* Verify that there is no free-space section for this type */
nsects = H5Fget_free_sections ( file , H5FD_MEM_BTREE , ( size_t ) 0 , NULL ) ;
VERIFY ( nsects , 0 , " H5Fget_free_sections " ) ;
/* Close file */
ret = H5Fclose ( file ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
ret = H5Pclose ( fcpl ) ;
CHECK ( fcpl , FAIL , " H5Pclose " ) ;
HDfree ( saved_sect_info ) ;
} /* end test_free_sections() */
/****************************************************************
* *
2010-01-30 12:29:13 +08:00
* * test_filespace_sects ( ) :
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
* * This test checks free space section info for
* * files created with sec2 and split drivers .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
test_filespace_sects ( void )
{
hid_t fapl_sec2 ; /* File access property id with sec2 driver */
hid_t fapl_split ; /* File access property id with split driver */
hid_t fapl_core ; /* File access property id with core driver */
hid_t fapl_stdio ; /* File access property id with stdio driver */
hid_t fapl_family ; /* File access property id with family driver */
char filename [ FILENAME_LEN ] ; /* Filename to use */
herr_t ret ; /* Return value */
/* SEC2 */
MESSAGE ( 5 , ( " Testing File free space information for a sec2 file \n " ) ) ;
fapl_sec2 = H5Pcreate ( H5P_FILE_ACCESS ) ;
ret = H5Pset_fapl_sec2 ( fapl_sec2 ) ;
CHECK ( ret , FAIL , " H5Pset_fapl_sec2 " ) ;
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname ( FILENAME [ 0 ] , fapl_sec2 , filename , sizeof ( filename ) ) ;
/* perform free space information test for file with sec2 driver */
test_free_sections ( fapl_sec2 , filename ) ;
/* close fapl_sec2 and remove the file */
h5_cleanup ( FILENAME , fapl_sec2 ) ;
/* SPLIT */
MESSAGE ( 5 , ( " Testing File free space information for a split file \n " ) ) ;
fapl_split = H5Pcreate ( H5P_FILE_ACCESS ) ;
CHECK ( fapl_split , FAIL , " h5_fileaccess " ) ;
ret = H5Pset_fapl_split ( fapl_split , " -m.h5 " , H5P_DEFAULT , " -r.h5 " , H5P_DEFAULT ) ;
CHECK ( ret , FAIL , " H5Pset_fapl_split " ) ;
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname ( FILENAME [ 1 ] , fapl_split , filename , sizeof ( filename ) ) ;
/* perform free space information test for file with split driver */
test_free_sections ( fapl_split , filename ) ;
/* close fapl and remove the file */
h5_cleanup ( FILENAME , fapl_split ) ;
/* STDIO */
MESSAGE ( 5 , ( " Testing File free space information for a stdio file \n " ) ) ;
fapl_stdio = H5Pcreate ( H5P_FILE_ACCESS ) ;
CHECK ( fapl_stdio , FAIL , " h5_fileaccess " ) ;
ret = H5Pset_fapl_stdio ( fapl_stdio ) ;
CHECK ( ret , FAIL , " H5Pset_fapl_split " ) ;
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname ( FILENAME [ 2 ] , fapl_stdio , filename , sizeof ( filename ) ) ;
/* perform free space information test for file with stdio driver */
test_free_sections ( fapl_stdio , filename ) ;
/* close fapl and remove the file */
2013-03-02 04:09:40 +08:00
h5_cleanup ( FILENAME , fapl_stdio ) ;
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
/* CORE */
MESSAGE ( 5 , ( " Testing File free space information for a core file \n " ) ) ;
fapl_core = H5Pcreate ( H5P_FILE_ACCESS ) ;
CHECK ( fapl_core , FAIL , " h5_fileaccess " ) ;
ret = H5Pset_fapl_core ( fapl_core , ( size_t ) CORE_INCREMENT , TRUE ) ;
CHECK ( ret , FAIL , " H5Pset_fapl_core " ) ;
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname ( FILENAME [ 3 ] , fapl_core , filename , sizeof ( filename ) ) ;
/* perform free space information test for file with core driver */
test_free_sections ( fapl_core , filename ) ;
/* close fapl_ and remove the file */
h5_cleanup ( FILENAME , fapl_core ) ;
/* FAMILY */
MESSAGE ( 5 , ( " Testing File free space information for a family file \n " ) ) ;
fapl_family = H5Pcreate ( H5P_FILE_ACCESS ) ;
CHECK ( fapl_family , FAIL , " h5_fileaccess " ) ;
ret = H5Pset_fapl_family ( fapl_family , ( hsize_t ) FAMILY_SIZE , H5P_DEFAULT ) ;
CHECK ( ret , FAIL , " H5Pset_fapl_family " ) ;
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname ( FILENAME [ 4 ] , fapl_family , filename , sizeof ( filename ) ) ;
/* perform free space information test for file with family driver */
test_free_sections ( fapl_family , filename ) ;
/* close fapl and remove the file */
h5_cleanup ( FILENAME , fapl_family ) ;
} /* end test_filespace_sects() */
/****************************************************************
* *
2010-01-30 12:29:13 +08:00
* * test_filespace_info ( ) :
* * Verify that the public routines H5Pget / set_file_space ( )
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
* * retrieve and set the file space strategy and free space
* * section threshold as specified .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
test_filespace_info ( void )
{
hid_t fid1 , fid2 ; /* HDF5 File IDs */
hid_t fapl , new_fapl ; /* File access property */
hid_t fcpl , fcpl1 , fcpl2 ; /* File creation property */
char filename [ FILENAME_LEN ] ; /* Filename to use */
H5F_file_space_type_t strategy , fs_type , def_type ; /* File space handling strategy */
hsize_t threshold , fs_size , def_size ; /* Free space section threshold */
hbool_t new_format ; /* new format or old format */
herr_t ret ; /* return value */
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing File Space Management public routines: H5Pget/set_file_space() \n " ) ) ;
fapl = h5_fileaccess ( ) ;
h5_fixname ( FILESPACE_NAME [ 0 ] , fapl , filename , sizeof filename ) ;
new_fapl = H5Pcopy ( fapl ) ;
CHECK ( new_fapl , FAIL , " H5Pcopy " ) ;
/* Set the "use the latest version of the format" bounds */
ret = H5Pset_libver_bounds ( new_fapl , H5F_LIBVER_LATEST , H5F_LIBVER_LATEST ) ;
CHECK ( ret , FAIL , " H5Pset_libver_bounds " ) ;
/* Create file-creation template */
fcpl = H5Pcreate ( H5P_FILE_CREATE ) ;
CHECK ( fcpl , FAIL , " H5Pcreate " ) ;
/* Get default file space information */
ret = H5Pget_file_space ( fcpl , & def_type , & def_size ) ;
CHECK ( ret , FAIL , " H5Pget_file_space " ) ;
/* Test with old & new format groups */
for ( new_format = FALSE ; new_format < = TRUE ; new_format + + ) {
hid_t my_fapl ;
/* Set the FAPL for the type of format */
if ( new_format ) {
MESSAGE ( 5 , ( " Testing with new group format \n " ) ) ;
my_fapl = new_fapl ;
} /* end if */
else {
MESSAGE ( 5 , ( " Testing with old group format \n " ) ) ;
my_fapl = fapl ;
} /* end else */
/* Test with different sized free space section threshold */
for ( fs_size = 0 ; fs_size < = TEST_THRESHOLD10 ; fs_size + + ) {
/* Test with different file space handling strategies */
for ( fs_type = 0 ; fs_type < H5F_FILE_SPACE_NTYPES ; H5_INC_ENUM ( H5F_file_space_type_t , fs_type ) ) {
/* Get a copy of the default file creation property */
fcpl1 = H5Pcopy ( fcpl ) ;
CHECK ( fcpl1 , FAIL , " H5Pcopy " ) ;
/* Set file space strategy and free space section threshold */
ret = H5Pset_file_space ( fcpl1 , fs_type , fs_size ) ;
CHECK ( ret , FAIL , " H5Pget_file_space " ) ;
/* Get the file space info from the creation property */
ret = H5Pget_file_space ( fcpl1 , & strategy , & threshold ) ;
CHECK ( ret , FAIL , " H5Pget_file_space " ) ;
/* A 0 value for strategy retains existing strategy in use */
VERIFY ( strategy , ( H5F_file_space_type_t ) ( fs_type ? fs_type : def_type ) , " H5Pget_file_space " ) ;
/* A 0 value for threshold retains existing threshold in use */
VERIFY ( threshold , ( hsize_t ) ( fs_size ? fs_size : def_size ) , " H5Pget_file_space " ) ;
/* Create the file with the specified file space info */
fid1 = H5Fcreate ( filename , H5F_ACC_TRUNC , fcpl1 , my_fapl ) ;
CHECK ( ret , FAIL , " H5Fcreate " ) ;
/* Close the file */
ret = H5Fclose ( fid1 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Re-open the file */
fid2 = H5Fopen ( filename , H5F_ACC_RDWR , my_fapl ) ;
CHECK ( ret , FAIL , " H5Fopen " ) ;
/* Get the file's creation property */
fcpl2 = H5Fget_create_plist ( fid2 ) ;
CHECK ( fcpl2 , FAIL , " H5Fget_create_plist " ) ;
strategy = threshold = 0 ;
/* Get the file space info from the creation property list */
ret = H5Pget_file_space ( fcpl2 , & strategy , & threshold ) ;
CHECK ( ret , FAIL , " H5Pget_file_space " ) ;
VERIFY ( strategy , ( H5F_file_space_type_t ) ( fs_type ? fs_type : def_type ) , " H5Pget_file_space " ) ;
VERIFY ( threshold , ( hsize_t ) ( fs_size ? fs_size : def_size ) , " H5Pget_file_space " ) ;
/* Close the file */
ret = H5Fclose ( fid2 ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Release file-creation template */
ret = H5Pclose ( fcpl1 ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
ret = H5Pclose ( fcpl2 ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
} /* end for file space strategy type */
} /* end for free space threshold */
h5_cleanup ( FILESPACE_NAME , my_fapl ) ;
} /* end for new/old format */
/* Close the file creation property list */
ret = H5Pclose ( fcpl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
} /* test_filespace_info() */
/****************************************************************
* *
2010-01-30 12:29:13 +08:00
* * test_filespace_compatible ( ) :
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
* * Verify that the branch with file space management enhancement
* * can open , read and modify 1.6 HDF5 file and 1.8 HDF5 file .
* * Also verify the correct file space strategy / threshold in use
* * and the amount of free space .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
test_filespace_compatible ( void )
{
int fd_old = ( - 1 ) , fd_new = ( - 1 ) ; /* File descriptors for copying data */
hid_t fid ; /* File id */
hid_t fcpl ; /* File creation property list template */
hid_t did ; /* Dataset id */
int check [ 100 ] ; /* Temporary buffer for verifying dataset data */
int rdbuf [ 100 ] ; /* Temporary buffer for reading in dataset data */
uint8_t buf [ READ_OLD_BUFSIZE ] ; /* temporary buffer for reading */
ssize_t nread ; /* Number of bytes read in */
unsigned i , j ; /* Local index variable */
hssize_t free_space ; /* Amount of free space in the file */
hsize_t threshold ; /* Free space section threshold */
H5F_file_space_type_t strategy ; /* File space handling strategy */
herr_t ret ; /* Return value */
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing File space compatibility for 1.6 and 1.8 files \n " ) ) ;
for ( j = 0 ; j < NELMTS ( OLD_FILENAME ) ; j + + ) {
2010-03-18 05:38:20 +08:00
const char * filename = H5_get_srcdir_filename ( OLD_FILENAME [ j ] ) ; /* Corrected test file name */
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
/* Copy old file into test file */
fd_old = HDopen ( filename , O_RDONLY , 0666 ) ;
CHECK ( fd_old , FAIL , " HDopen " ) ;
fd_new = HDopen ( FILE5 , O_RDWR | O_CREAT | O_TRUNC , 0666 ) ;
CHECK ( fd_new , FAIL , " HDopen " ) ;
/* Copy data */
while ( ( nread = HDread ( fd_old , buf , ( size_t ) READ_OLD_BUFSIZE ) ) > 0 )
HDwrite ( fd_new , buf , ( size_t ) nread ) ;
/* Close the files */
ret = HDclose ( fd_old ) ;
CHECK ( ret , FAIL , " HDclose " ) ;
ret = HDclose ( fd_new ) ;
CHECK ( ret , FAIL , " HDclose " ) ;
/* Open the test file */
fid = H5Fopen ( FILE5 , H5F_ACC_RDWR , H5P_DEFAULT ) ;
CHECK ( fid , FAIL , " H5Fopen " ) ;
/* There should not be any free space in the file */
free_space = H5Fget_freespace ( fid ) ;
CHECK ( free_space , FAIL , " H5Fget_freespace " ) ;
VERIFY ( free_space , ( hssize_t ) 0 , " H5Fget_freespace " ) ;
/* Get the file's file creation property list */
2013-03-15 23:26:55 +08:00
/* Retrieve the file space handling strategy and threshold */
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
fcpl = H5Fget_create_plist ( fid ) ;
CHECK ( fcpl , FAIL , " H5Fget_create_plist " ) ;
ret = H5Pget_file_space ( fcpl , & strategy , & threshold ) ;
CHECK ( ret , FAIL , " H5Pget_file_space " ) ;
/* File space handling strategy should be H5F_FILE_SPACE_ALL = 2 */
/* Free space section threshold should be 1 */
VERIFY ( strategy , 2 , " H5Pget_file_space " ) ;
VERIFY ( threshold , 1 , " H5Pget_file_space " ) ;
/* Generate raw data */
for ( i = 0 ; i < 100 ; i + + )
check [ i ] = ( int ) i ;
/* Open and read the dataset */
did = H5Dopen2 ( fid , DSETNAME , H5P_DEFAULT ) ;
CHECK ( did , FAIL , " H5Dopen " ) ;
ret = H5Dread ( did , H5T_NATIVE_INT , H5S_ALL , H5S_ALL , H5P_DEFAULT , & rdbuf ) ;
CHECK ( ret , FAIL , " H5Dread " ) ;
/* Verify the data read is correct */
for ( i = 0 ; i < 100 ; i + + )
VERIFY ( rdbuf [ i ] , check [ i ] , " test_compatible " ) ;
/* Close the dataset */
ret = H5Dclose ( did ) ;
CHECK ( ret , FAIL , " H5Dclose " ) ;
/* Remove the dataset */
ret = H5Ldelete ( fid , DSETNAME , H5P_DEFAULT ) ;
CHECK ( ret , FAIL , " H5Ldelete " ) ;
2013-03-15 23:26:55 +08:00
/* Close the plist */
ret = H5Pclose ( fcpl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
/* Close the file */
ret = H5Fclose ( fid ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
/* Re-Open the file */
fid = H5Fopen ( FILE5 , H5F_ACC_RDONLY , H5P_DEFAULT ) ;
CHECK ( fid , FAIL , " H5Fopen " ) ;
/* The dataset should not be there */
did = H5Dopen2 ( fid , DSETNAME , H5P_DEFAULT ) ;
VERIFY ( did , FAIL , " H5Dopen " ) ;
/* There should not be any free space in the file */
free_space = H5Fget_freespace ( fid ) ;
CHECK ( free_space , FAIL , " H5Fget_freespace " ) ;
VERIFY ( free_space , ( hssize_t ) 0 , " H5Fget_freespace " ) ;
/* Close the file */
ret = H5Fclose ( fid ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
} /* end for */
} /* test_filespace_compatible */
[svn-r19402] Description:
Correct Bz#1968 (Problem when opening new format file with
H5F_LIBVER_EARLIEST) by initializing symbol table leaf information in a
more universal way. Also cleaned up other superblock initialization a
little bit while I'm here.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-09-17 04:01:08 +08:00
/****************************************************************
* *
2011-10-14 23:34:45 +08:00
* * test_libver_bounds_real ( ) :
* * Verify that a file created and modified with the
* * specified libver bounds has the specified object header
* * versions for the right objects .
[svn-r19402] Description:
Correct Bz#1968 (Problem when opening new format file with
H5F_LIBVER_EARLIEST) by initializing symbol table leaf information in a
more universal way. Also cleaned up other superblock initialization a
little bit while I'm here.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-09-17 04:01:08 +08:00
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
2011-10-14 23:34:45 +08:00
test_libver_bounds_real ( H5F_libver_t libver_create , unsigned oh_vers_create ,
H5F_libver_t libver_mod , unsigned oh_vers_mod )
[svn-r19402] Description:
Correct Bz#1968 (Problem when opening new format file with
H5F_LIBVER_EARLIEST) by initializing symbol table leaf information in a
more universal way. Also cleaned up other superblock initialization a
little bit while I'm here.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-09-17 04:01:08 +08:00
{
hid_t file , group ; /* Handles */
hid_t fapl ; /* File access property list */
2011-10-14 22:36:03 +08:00
H5O_info_t oinfo ; /* Object info */
2011-10-14 23:34:45 +08:00
herr_t ret ; /* Return value */
[svn-r19402] Description:
Correct Bz#1968 (Problem when opening new format file with
H5F_LIBVER_EARLIEST) by initializing symbol table leaf information in a
more universal way. Also cleaned up other superblock initialization a
little bit while I'm here.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-09-17 04:01:08 +08:00
/*
2011-10-14 23:34:45 +08:00
* Create a new file using the creation properties .
[svn-r19402] Description:
Correct Bz#1968 (Problem when opening new format file with
H5F_LIBVER_EARLIEST) by initializing symbol table leaf information in a
more universal way. Also cleaned up other superblock initialization a
little bit while I'm here.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-09-17 04:01:08 +08:00
*/
fapl = H5Pcreate ( H5P_FILE_ACCESS ) ;
CHECK ( fapl , FAIL , " H5Pcreate " ) ;
2011-10-14 23:34:45 +08:00
ret = H5Pset_libver_bounds ( fapl , libver_create , H5F_LIBVER_LATEST ) ;
[svn-r19402] Description:
Correct Bz#1968 (Problem when opening new format file with
H5F_LIBVER_EARLIEST) by initializing symbol table leaf information in a
more universal way. Also cleaned up other superblock initialization a
little bit while I'm here.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-09-17 04:01:08 +08:00
CHECK ( ret , FAIL , " H5Pset_libver_bounds " ) ;
file = H5Fcreate ( " tfile5.h5 " , H5F_ACC_TRUNC , H5P_DEFAULT , fapl ) ;
CHECK ( file , FAIL , " H5Fcreate " ) ;
2011-10-14 22:36:03 +08:00
/*
2011-10-14 23:34:45 +08:00
* Make sure the root group has the correct object header version
2011-10-14 22:36:03 +08:00
*/
ret = H5Oget_info_by_name ( file , " / " , & oinfo , H5P_DEFAULT ) ;
CHECK ( ret , FAIL , " H5Oget_info_by_name " ) ;
2011-10-14 23:34:45 +08:00
VERIFY ( oinfo . hdr . version , oh_vers_create , " H5Oget_info_by_name " ) ;
2011-10-14 22:36:03 +08:00
/*
2011-10-14 23:34:45 +08:00
* Reopen the file and make sure the root group still has the correct version
2011-10-14 22:36:03 +08:00
*/
[svn-r19402] Description:
Correct Bz#1968 (Problem when opening new format file with
H5F_LIBVER_EARLIEST) by initializing symbol table leaf information in a
more universal way. Also cleaned up other superblock initialization a
little bit while I'm here.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-09-17 04:01:08 +08:00
ret = H5Fclose ( file ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
2011-10-14 23:34:45 +08:00
ret = H5Pset_libver_bounds ( fapl , libver_mod , H5F_LIBVER_LATEST ) ;
[svn-r19402] Description:
Correct Bz#1968 (Problem when opening new format file with
H5F_LIBVER_EARLIEST) by initializing symbol table leaf information in a
more universal way. Also cleaned up other superblock initialization a
little bit while I'm here.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-09-17 04:01:08 +08:00
CHECK ( ret , FAIL , " H5Pset_libver_bounds " ) ;
file = H5Fopen ( " tfile5.h5 " , H5F_ACC_RDWR , fapl ) ;
CHECK ( file , FAIL , " H5Fopen " ) ;
2011-10-14 22:36:03 +08:00
ret = H5Oget_info_by_name ( file , " / " , & oinfo , H5P_DEFAULT ) ;
CHECK ( ret , FAIL , " H5Oget_info_by_name " ) ;
2011-10-14 23:34:45 +08:00
VERIFY ( oinfo . hdr . version , oh_vers_create , " H5Oget_info_by_name " ) ;
2011-10-14 22:36:03 +08:00
[svn-r19402] Description:
Correct Bz#1968 (Problem when opening new format file with
H5F_LIBVER_EARLIEST) by initializing symbol table leaf information in a
more universal way. Also cleaned up other superblock initialization a
little bit while I'm here.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-09-17 04:01:08 +08:00
/*
2011-10-14 23:34:45 +08:00
* Create a group named " G1 " in the file , and make sure it has the correct
* object header version
[svn-r19402] Description:
Correct Bz#1968 (Problem when opening new format file with
H5F_LIBVER_EARLIEST) by initializing symbol table leaf information in a
more universal way. Also cleaned up other superblock initialization a
little bit while I'm here.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-09-17 04:01:08 +08:00
*/
group = H5Gcreate2 ( file , " /G1 " , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( group , FAIL , " H5Gcreate " ) ;
2011-10-14 22:36:03 +08:00
ret = H5Oget_info ( group , & oinfo ) ;
CHECK ( ret , FAIL , " H5Oget_info_by_name " ) ;
2011-10-14 23:34:45 +08:00
VERIFY ( oinfo . hdr . version , oh_vers_mod , " H5Oget_info_by_name " ) ;
2011-10-14 22:36:03 +08:00
[svn-r19402] Description:
Correct Bz#1968 (Problem when opening new format file with
H5F_LIBVER_EARLIEST) by initializing symbol table leaf information in a
more universal way. Also cleaned up other superblock initialization a
little bit while I'm here.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-09-17 04:01:08 +08:00
ret = H5Gclose ( group ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
/*
2011-10-14 22:36:03 +08:00
* Create a group named " /G1/G3 " in the file , and make sure it has the
2011-10-14 23:34:45 +08:00
* correct object header version
[svn-r19402] Description:
Correct Bz#1968 (Problem when opening new format file with
H5F_LIBVER_EARLIEST) by initializing symbol table leaf information in a
more universal way. Also cleaned up other superblock initialization a
little bit while I'm here.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-09-17 04:01:08 +08:00
*/
group = H5Gcreate2 ( file , " /G1/G3 " , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( group , FAIL , " H5Gcreate " ) ;
2011-10-14 22:36:03 +08:00
ret = H5Oget_info ( group , & oinfo ) ;
CHECK ( ret , FAIL , " H5Oget_info_by_name " ) ;
2011-10-14 23:34:45 +08:00
VERIFY ( oinfo . hdr . version , oh_vers_mod , " H5Oget_info_by_name " ) ;
2011-10-14 22:36:03 +08:00
[svn-r19402] Description:
Correct Bz#1968 (Problem when opening new format file with
H5F_LIBVER_EARLIEST) by initializing symbol table leaf information in a
more universal way. Also cleaned up other superblock initialization a
little bit while I'm here.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-09-17 04:01:08 +08:00
ret = H5Gclose ( group ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
2011-10-14 22:36:03 +08:00
/*
2011-10-14 23:34:45 +08:00
* Make sure the root group still has the correct object header version
2011-10-14 22:36:03 +08:00
*/
ret = H5Oget_info_by_name ( file , " / " , & oinfo , H5P_DEFAULT ) ;
CHECK ( ret , FAIL , " H5Oget_info_by_name " ) ;
2011-10-14 23:34:45 +08:00
VERIFY ( oinfo . hdr . version , oh_vers_create , " H5Oget_info_by_name " ) ;
2011-10-14 22:36:03 +08:00
[svn-r19402] Description:
Correct Bz#1968 (Problem when opening new format file with
H5F_LIBVER_EARLIEST) by initializing symbol table leaf information in a
more universal way. Also cleaned up other superblock initialization a
little bit while I'm here.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-09-17 04:01:08 +08:00
ret = H5Fclose ( file ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
2013-03-02 04:09:40 +08:00
ret = H5Pclose ( fapl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
2011-10-14 23:34:45 +08:00
} /* end test_libver_bounds_real() */
/****************************************************************
* *
* * test_libver_bounds ( ) :
* * Verify that a file created and modified with various
* * libver bounds is handled correctly . ( Further testing
* * welcome )
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
test_libver_bounds ( void )
{
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing setting library version bounds \n " ) ) ;
/* Run the tests */
test_libver_bounds_real ( H5F_LIBVER_EARLIEST , 1 , H5F_LIBVER_LATEST , 2 ) ;
test_libver_bounds_real ( H5F_LIBVER_LATEST , 2 , H5F_LIBVER_EARLIEST , 1 ) ;
} /* end test_libver_bounds() */
[svn-r19402] Description:
Correct Bz#1968 (Problem when opening new format file with
H5F_LIBVER_EARLIEST) by initializing symbol table leaf information in a
more universal way. Also cleaned up other superblock initialization a
little bit while I'm here.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-09-17 04:01:08 +08:00
2011-03-03 04:44:44 +08:00
/****************************************************************
* *
* * test_libver_macros ( ) :
* * Verify that H5_VERSION_GE and H5_VERSION_LE work correactly .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
test_libver_macros ( void )
{
unsigned major = H5_VERS_MAJOR ;
unsigned minor = H5_VERS_MINOR ;
unsigned release = H5_VERS_RELEASE ;
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing macros for library version comparison \n " ) ) ;
VERIFY ( H5_VERSION_GE ( major , minor , release ) , TRUE , " H5_VERSION_GE " ) ;
VERIFY ( H5_VERSION_GE ( major - 1 , minor , release ) , TRUE , " H5_VERSION_GE " ) ;
VERIFY ( H5_VERSION_GE ( major - 1 , minor + 1 , release ) , TRUE , " H5_VERSION_GE " ) ;
VERIFY ( H5_VERSION_GE ( major - 1 , minor , release + 1 ) , TRUE , " H5_VERSION_GE " ) ;
VERIFY ( H5_VERSION_GE ( major , minor - 1 , release ) , TRUE , " H5_VERSION_GE " ) ;
VERIFY ( H5_VERSION_GE ( major , minor - 1 , release + 1 ) , TRUE , " H5_VERSION_GE " ) ;
VERIFY ( H5_VERSION_GE ( major , minor , release - 1 ) , TRUE , " H5_VERSION_GE " ) ;
VERIFY ( H5_VERSION_GE ( major + 1 , minor , release ) , FALSE , " H5_VERSION_GE " ) ;
VERIFY ( H5_VERSION_GE ( major + 1 , minor - 1 , release ) , FALSE , " H5_VERSION_GE " ) ;
VERIFY ( H5_VERSION_GE ( major + 1 , minor - 1 , release - 1 ) , FALSE , " H5_VERSION_GE " ) ;
VERIFY ( H5_VERSION_GE ( major , minor + 1 , release ) , FALSE , " H5_VERSION_GE " ) ;
VERIFY ( H5_VERSION_GE ( major , minor + 1 , release - 1 ) , FALSE , " H5_VERSION_GE " ) ;
VERIFY ( H5_VERSION_GE ( major , minor , release + 1 ) , FALSE , " H5_VERSION_GE " ) ;
VERIFY ( H5_VERSION_LE ( major , minor , release ) , TRUE , " H5_VERSION_LE " ) ;
VERIFY ( H5_VERSION_LE ( major + 1 , minor , release ) , TRUE , " H5_VERSION_LE " ) ;
VERIFY ( H5_VERSION_LE ( major + 1 , minor - 1 , release ) , TRUE , " H5_VERSION_LE " ) ;
VERIFY ( H5_VERSION_LE ( major + 1 , minor - 1 , release - 1 ) , TRUE , " H5_VERSION_LE " ) ;
VERIFY ( H5_VERSION_LE ( major , minor + 1 , release ) , TRUE , " H5_VERSION_LE " ) ;
VERIFY ( H5_VERSION_LE ( major , minor + 1 , release - 1 ) , TRUE , " H5_VERSION_LE " ) ;
VERIFY ( H5_VERSION_LE ( major , minor , release + 1 ) , TRUE , " H5_VERSION_LE " ) ;
VERIFY ( H5_VERSION_LE ( major - 1 , minor , release ) , FALSE , " H5_VERSION_LE " ) ;
VERIFY ( H5_VERSION_LE ( major - 1 , minor + 1 , release ) , FALSE , " H5_VERSION_LE " ) ;
VERIFY ( H5_VERSION_LE ( major - 1 , minor + 1 , release + 1 ) , FALSE , " H5_VERSION_LE " ) ;
VERIFY ( H5_VERSION_LE ( major , minor - 1 , release ) , FALSE , " H5_VERSION_LE " ) ;
VERIFY ( H5_VERSION_LE ( major , minor - 1 , release + 1 ) , FALSE , " H5_VERSION_LE " ) ;
VERIFY ( H5_VERSION_LE ( major , minor , release - 1 ) , FALSE , " H5_VERSION_LE " ) ;
} /* test_libver_macros() */
2011-03-16 04:55:05 +08:00
/****************************************************************
* *
* * test_libver_macros2 ( ) :
* * Verify that H5_VERSION_GE works correactly and show how
* * to use it .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static void
test_libver_macros2 ( void )
{
hid_t file ;
hid_t grp ;
htri_t status ;
herr_t ret ; /* Return value */
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing macros for library version comparison with a file \n " ) ) ;
/*
* Create a file .
*/
file = H5Fcreate ( FILE6 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( file , FAIL , " H5Fcreate " ) ;
/*
* Create a group in the file .
*/
2011-03-17 04:08:34 +08:00
grp = H5Gcreate2 ( file , " Group " , H5P_DEFAULT , H5P_DEFAULT , H5P_DEFAULT ) ;
2011-03-16 04:55:05 +08:00
CHECK ( file , FAIL , " H5Gcreate " ) ;
/*
* Close the group
*/
ret = H5Gclose ( grp ) ;
CHECK ( ret , FAIL , " H5Gclose " ) ;
/*
* Delete the group using different function based on the library version .
* And verify the action .
*/
# if H5_VERSION_GE(1,8,0)
ret = H5Ldelete ( file , " Group " , H5P_DEFAULT ) ;
CHECK ( ret , FAIL , " H5Lunlink " ) ;
status = H5Lexists ( file , " Group " , H5P_DEFAULT ) ;
VERIFY ( status , FALSE , " H5Lexists " ) ;
# else
ret = H5Gunlink ( file , " Group " ) ;
CHECK ( ret , FAIL , " H5Gunlink " ) ;
H5E_BEGIN_TRY {
grp = H5Gopen ( file , " Group " ) ;
} H5E_END_TRY ;
VERIFY ( grp , FAIL , " H5Gopen " ) ;
# endif
/*
* Close the file .
*/
ret = H5Fclose ( file ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
} /* test_libver_macros2() */
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
/****************************************************************
* *
2010-01-30 12:29:13 +08:00
* * test_deprec ( ) :
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
* * Test deprecated functionality .
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
# ifndef H5_NO_DEPRECATED_SYMBOLS
static void
test_deprec ( void )
{
hid_t file ; /* File IDs for old & new files */
hid_t fcpl ; /* File creation property list */
unsigned super ; /* Superblock version # */
unsigned freelist ; /* Free list version # */
unsigned stab ; /* Symbol table entry version # */
unsigned shhdr ; /* Shared object header version # */
H5F_info1_t finfo ; /* global information about file */
herr_t ret ; /* Generic return value */
/* Output message about test being performed */
MESSAGE ( 5 , ( " Testing deprecated routines \n " ) ) ;
/* Creating a file with the default file creation property list should
* create a version 0 superblock
*/
/* Create file with default file creation property list */
file = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , H5P_DEFAULT , H5P_DEFAULT ) ;
CHECK ( file , FAIL , " H5Fcreate " ) ;
/* Get the file's version information */
ret = H5Fget_info1 ( file , & finfo ) ;
CHECK ( ret , FAIL , " H5Fget_info1 " ) ;
VERIFY ( finfo . super_ext_size , 0 , " H5Fget_info1 " ) ;
VERIFY ( finfo . sohm . hdr_size , 0 , " H5Fget_info1 " ) ;
VERIFY ( finfo . sohm . msgs_info . index_size , 0 , " H5Fget_info1 " ) ;
VERIFY ( finfo . sohm . msgs_info . heap_size , 0 , " H5Fget_info1 " ) ;
/* Get the file's dataset creation property list */
fcpl = H5Fget_create_plist ( file ) ;
CHECK ( fcpl , FAIL , " H5Fget_create_plist " ) ;
/* Get the file's version information */
ret = H5Pget_version ( fcpl , & super , & freelist , & stab , & shhdr ) ;
CHECK ( ret , FAIL , " H5Pget_version " ) ;
VERIFY ( super , 0 , " H5Pget_version " ) ;
VERIFY ( freelist , 0 , " H5Pget_version " ) ;
VERIFY ( stab , 0 , " H5Pget_version " ) ;
VERIFY ( shhdr , 0 , " H5Pget_version " ) ;
/* Close FCPL */
ret = H5Pclose ( fcpl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
/* Close file */
ret = H5Fclose ( file ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Create a file creation property list */
fcpl = H5Pcreate ( H5P_FILE_CREATE ) ;
CHECK ( fcpl , FAIL , " H5Pcreate " ) ;
/* Set a property in the FCPL that will push the superblock version up */
2009-10-10 02:31:24 +08:00
ret = H5Pset_file_space ( fcpl , H5F_FILE_SPACE_VFD , ( hsize_t ) 0 ) ;
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
CHECK ( ret , FAIL , " H5Pset_file_space " ) ;
/* Creating a file with the non-default file creation property list should
* create a version 2 superblock
*/
/* Create file with custom file creation property list */
file = H5Fcreate ( FILE1 , H5F_ACC_TRUNC , fcpl , H5P_DEFAULT ) ;
CHECK ( file , FAIL , " H5Fcreate " ) ;
/* Close FCPL */
ret = H5Pclose ( fcpl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
/* Get the file's version information */
ret = H5Fget_info1 ( file , & finfo ) ;
CHECK ( ret , FAIL , " H5Fget_info1 " ) ;
VERIFY ( finfo . super_ext_size , 40 , " H5Fget_info1 " ) ;
VERIFY ( finfo . sohm . hdr_size , 0 , " H5Fget_info1 " ) ;
VERIFY ( finfo . sohm . msgs_info . index_size , 0 , " H5Fget_info1 " ) ;
VERIFY ( finfo . sohm . msgs_info . heap_size , 0 , " H5Fget_info1 " ) ;
/* Get the file's dataset creation property list */
fcpl = H5Fget_create_plist ( file ) ;
CHECK ( fcpl , FAIL , " H5Fget_create_plist " ) ;
/* Get the file's version information */
ret = H5Pget_version ( fcpl , & super , & freelist , & stab , & shhdr ) ;
CHECK ( ret , FAIL , " H5Pget_version " ) ;
VERIFY ( super , 2 , " H5Pget_version " ) ;
VERIFY ( freelist , 0 , " H5Pget_version " ) ;
VERIFY ( stab , 0 , " H5Pget_version " ) ;
VERIFY ( shhdr , 0 , " H5Pget_version " ) ;
/* Close FCPL */
ret = H5Pclose ( fcpl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
/* Close file */
ret = H5Fclose ( file ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
/* Re-open the file */
file = H5Fopen ( FILE1 , H5F_ACC_RDONLY , H5P_DEFAULT ) ;
CHECK ( file , FAIL , " H5Fcreate " ) ;
/* Get the file's version information */
ret = H5Fget_info1 ( file , & finfo ) ;
CHECK ( ret , FAIL , " H5Fget_info1 " ) ;
VERIFY ( finfo . super_ext_size , 40 , " H5Fget_info1 " ) ;
VERIFY ( finfo . sohm . hdr_size , 0 , " H5Fget_info1 " ) ;
VERIFY ( finfo . sohm . msgs_info . index_size , 0 , " H5Fget_info1 " ) ;
VERIFY ( finfo . sohm . msgs_info . heap_size , 0 , " H5Fget_info1 " ) ;
/* Get the file's creation property list */
fcpl = H5Fget_create_plist ( file ) ;
CHECK ( fcpl , FAIL , " H5Fget_create_plist " ) ;
/* Get the file's version information */
ret = H5Pget_version ( fcpl , & super , & freelist , & stab , & shhdr ) ;
CHECK ( ret , FAIL , " H5Pget_version " ) ;
VERIFY ( super , 2 , " H5Pget_version " ) ;
VERIFY ( freelist , 0 , " H5Pget_version " ) ;
VERIFY ( stab , 0 , " H5Pget_version " ) ;
VERIFY ( shhdr , 0 , " H5Pget_version " ) ;
/* Close FCPL */
ret = H5Pclose ( fcpl ) ;
CHECK ( ret , FAIL , " H5Pclose " ) ;
/* Close file */
ret = H5Fclose ( file ) ;
CHECK ( ret , FAIL , " H5Fclose " ) ;
} /* test_deprec */
# endif /* H5_NO_DEPRECATED_SYMBOLS */
1997-07-31 05:17:56 +08:00
/****************************************************************
* *
* * test_file ( ) : Main low - level file I / O test routine .
2005-08-14 04:53:35 +08:00
* *
1997-07-31 05:17:56 +08:00
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2005-08-14 04:53:35 +08:00
void
1998-01-17 06:23:43 +08:00
test_file ( void )
1997-07-31 05:17:56 +08:00
{
/* Output message about test being performed */
1997-08-30 00:59:28 +08:00
MESSAGE ( 5 , ( " Testing Low-Level File I/O \n " ) ) ;
1997-07-31 05:17:56 +08:00
2001-12-12 03:53:44 +08:00
test_file_create ( ) ; /* Test file creation(also creation templates)*/
1998-04-09 05:43:02 +08:00
test_file_open ( ) ; /* Test file opening */
2005-08-14 04:53:35 +08:00
# ifndef H5_NO_SHARED_WRITING
2001-12-12 03:53:44 +08:00
test_file_close ( ) ; /* Test file close behavior */
2005-08-14 04:53:35 +08:00
# endif /* H5_NO_SHARED_WRITING */
2003-10-30 01:04:58 +08:00
test_get_file_id ( ) ; /* Test H5Iget_file_id */
2003-09-11 02:32:28 +08:00
test_file_perm ( ) ; /* Test file access permissions */
2012-01-26 04:06:09 +08:00
test_file_perm2 ( ) ; /* Test file access permission again */
2003-10-07 21:32:32 +08:00
test_file_freespace ( ) ; /* Test file free space information */
2005-01-29 01:32:44 +08:00
test_file_ishdf5 ( ) ; /* Test detecting HDF5 files correctly */
2005-04-17 00:22:16 +08:00
test_file_open_dot ( ) ; /* Test opening objects with "." for a name */
2006-03-10 05:34:34 +08:00
# ifndef H5_CANNOT_OPEN_TWICE
2005-06-02 05:20:10 +08:00
test_file_open_overlap ( ) ; /* Test opening files in an overlapping manner */
2006-03-10 05:34:34 +08:00
# endif /*H5_CANNOT_OPEN_TWICE*/
2005-07-21 22:48:26 +08:00
test_file_getname ( ) ; /* Test basic H5Fget_name() functionality */
2006-03-10 05:34:34 +08:00
# ifndef H5_CANNOT_OPEN_TWICE
2005-10-03 13:50:05 +08:00
test_file_double_root_open ( ) ; /* Test opening root group from two files works properly */
test_file_double_group_open ( ) ; /* Test opening same group from two files works properly */
test_file_double_dataset_open ( ) ; /* Test opening same dataset from two files works properly */
test_file_double_datatype_open ( ) ; /* Test opening same named datatype from two files works properly */
2006-03-10 05:34:34 +08:00
# endif /*H5_CANNOT_OPEN_TWICE*/
2009-04-09 05:53:31 +08:00
test_userblock_file_size ( ) ; /* Tests that files created with a userblock have the correct size */
test_cached_stab_info ( ) ; /* Tests that files are created with cached stab info in the superblock */
[svn-r17365] Description:
Final merge of changes from sblock_mdc branch back to trunk. The superblock is now managed by the metadata cache.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-08-15 14:26:08 +08:00
test_rw_noupdate ( ) ; /* Test to ensure that RW permissions don't write the file unless dirtied */
[svn-r17459] Description:
Correct bad interaction between non-zero userblocks with non-zero
alignments.
Also add some additional range checking and tests for invalid userblock
sizes.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-09-09 04:15:37 +08:00
test_userblock_alignment ( ) ; /* Tests that files created with a userblock and alignment interact properly */
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
test_filespace_sects ( ) ; /* Test file free space section information */
test_filespace_info ( ) ; /* Test file creation public routines:H5Pget/set_file_space */
test_filespace_compatible ( ) ; /* Test compatibility for file space management */
[svn-r19402] Description:
Correct Bz#1968 (Problem when opening new format file with
H5F_LIBVER_EARLIEST) by initializing symbol table leaf information in a
more universal way. Also cleaned up other superblock initialization a
little bit while I'm here.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
2010-09-17 04:01:08 +08:00
test_libver_bounds ( ) ; /* Test compatibility for file space management */
2011-03-03 04:44:44 +08:00
test_libver_macros ( ) ; /* Test the macros for library version comparison */
2011-03-16 04:55:05 +08:00
test_libver_macros2 ( ) ; /* Test the macros for library version comparison */
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
# ifndef H5_NO_DEPRECATED_SYMBOLS
test_deprec ( ) ; /* Test deprecated routines */
# endif /* H5_NO_DEPRECATED_SYMBOLS */
[svn-r17146] Description:
Bring a bunch of misc. improvements & tweaks from the revise_chunks
branch back to the trunk, so that future merges won't be so painful.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.7 (amazon) in debug mode
Mac OS X/32 10.5.7 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-07-03 05:10:35 +08:00
} /* test_file() */
1998-07-03 08:57:00 +08:00
/*-------------------------------------------------------------------------
* Function : cleanup_file
*
* Purpose : Cleanup temporary test files
*
* Return : none
*
* Programmer : Albert Cheng
* July 2 , 1998
*
* Modifications :
*
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
void
cleanup_file ( void )
{
2009-09-25 02:26:42 +08:00
HDremove ( SFILE1 ) ;
2006-03-10 05:34:34 +08:00
HDremove ( FILE1 ) ;
HDremove ( FILE2 ) ;
HDremove ( FILE3 ) ;
HDremove ( FILE4 ) ;
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!*
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x,
w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.8 (amazon) in debug mode
Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
2009-10-02 10:08:59 +08:00
HDremove ( FILE5 ) ;
1998-07-03 08:57:00 +08:00
}
2009-03-26 23:12:48 +08:00