mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-12 17:31:09 +08:00
Merge pull request #595 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:hdf5_1_10 to hdf5_1_10
* commit '5bf108432ba9b49ee545af3947b7fb2e2b6e8514': Updated RELEASE.txt Marked H5I_REFERENCE as deprecated in H5Ipublic.h. Merge of recent develop work to 1.10 branch.
This commit is contained in:
commit
0c34b0bdf7
@ -142,7 +142,7 @@ case "$cc_vendor-$cc_version" in
|
||||
|
||||
# Symbols
|
||||
NO_SYMBOLS_CFLAGS="-s"
|
||||
SYMBOLS_CFLAGS="-g"
|
||||
SYMBOLS_CFLAGS="-g -fno-omit-frame-pointer"
|
||||
|
||||
# Profile
|
||||
PROFILE_CFLAGS="-pg"
|
||||
|
38
configure.ac
38
configure.ac
@ -585,11 +585,11 @@ if test "X$HDF_FORTRAN" = "Xyes"; then
|
||||
AC_DEFINE([FORTRAN_HAVE_STORAGE_SIZE], [1], [Define if we have Fortran intrinsic STORAGE_SIZE])
|
||||
fi
|
||||
|
||||
if test "X$HAVE_C_SIZEOF_FORTRAN" = "Xyes"; then
|
||||
if test "X$HAVE_C_SIZEOF_FORTRAN" = "Xyes"; then
|
||||
AC_DEFINE([FORTRAN_HAVE_C_SIZEOF], [1], [Define if we have Fortran intrinsic C_SIZEOF])
|
||||
fi
|
||||
|
||||
if test "X$HAVE_SIZEOF_FORTRAN" = "Xyes"; then
|
||||
if test "X$HAVE_SIZEOF_FORTRAN" = "Xyes"; then
|
||||
AC_DEFINE([FORTRAN_HAVE_SIZEOF], [1], [Define if we have Fortran intrinsic SIZEOF])
|
||||
fi
|
||||
|
||||
@ -604,7 +604,7 @@ if test "X$HDF_FORTRAN" = "Xyes"; then
|
||||
|
||||
## Is C_LONG_DOUBLE different from C_DOUBLE
|
||||
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="0"
|
||||
if test "X$FORTRAN_HAVE_C_LONG_DOUBLE"; then
|
||||
if test "$FORTRAN_HAVE_C_LONG_DOUBLE" = "1"; then
|
||||
PAC_PROG_FC_C_LONG_DOUBLE_EQ_C_DOUBLE
|
||||
if test "X$C_LONG_DOUBLE_IS_UNIQUE_FORTRAN" = "Xyes"; then
|
||||
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE="1"
|
||||
@ -1252,10 +1252,11 @@ AC_ARG_WITH([fnord],
|
||||
])
|
||||
|
||||
## ----------------------------------------------------------------------
|
||||
## Is the dmalloc present? It has a header file `dmalloc.h' and a library
|
||||
## `-ldmalloc' and their locations might be specified with the `--with-dmalloc'
|
||||
## command-line switch. The value is an include path and/or a library path.
|
||||
## If the library path is specified then it must be preceded by a comma.
|
||||
## Is dmalloc (debug malloc library) requested? It has a header file
|
||||
## `dmalloc.h' and a library `-ldmalloc' and their locations might be
|
||||
## specified with the `--with-dmalloc' command-line switch. The value
|
||||
## is an include path and/or a library path. If the library path is
|
||||
## specified then it must be preceded by a comma.
|
||||
##
|
||||
AC_SUBST([HAVE_DMALLOC])
|
||||
|
||||
@ -1941,26 +1942,17 @@ AC_DEFINE_UNQUOTED([PRINTF_LL_WIDTH], ["$hdf5_cv_printf_ll"],
|
||||
[Width for printf() for type `long long' or `__int64', use `ll'])
|
||||
|
||||
## ----------------------------------------------------------------------
|
||||
## Deprecate old ways of determining debug/production build
|
||||
## These can probably be removed in the future (1.10.1?)
|
||||
## Remove old ways of determining debug/production build.
|
||||
## These were used in 1.8.x and earlier. We should probably keep these checks
|
||||
## around to help people migrate to 1.10.x and newer versions.
|
||||
##
|
||||
AC_ARG_ENABLE([debug],
|
||||
[AS_HELP_STRING([--enable-debug],
|
||||
[DEPRECATED: use --enable-build-mode=debug])],
|
||||
[DEPRECATED_DEBUG=$enableval])
|
||||
|
||||
if test "X-$DEPRECATED_DEBUG" != "X-" ; then
|
||||
AC_MSG_ERROR([--enable-debug is deprecated, use --enable-build-mode=debug instead.])
|
||||
fi
|
||||
[AS_HELP_STRING([--enable-debug], [DEPRECATED: use --enable-build-mode=debug])],
|
||||
[AC_MSG_ERROR([--enable-debug is deprecated, use --enable-build-mode=debug instead.])])
|
||||
|
||||
AC_ARG_ENABLE([production],
|
||||
[AS_HELP_STRING([--enable-production],
|
||||
[DEPRECATED: use --enable-build-mode=production])],
|
||||
[DEPRECATED_PRODUCTION=$enableval])
|
||||
|
||||
if test "X-$DEPRECATED_PRODUCTION" != "X-" ; then
|
||||
AC_MSG_ERROR([--enable-production is deprecated, use --enable-build-mode=production instead.])
|
||||
fi
|
||||
[AS_HELP_STRING([--enable-production], [DEPRECATED: use --enable-build-mode=production])],
|
||||
[AC_MSG_ERROR([--enable-production is deprecated, use --enable-build-mode=production instead.])])
|
||||
|
||||
|
||||
## ----------------------------------------------------------------------
|
||||
|
@ -26,6 +26,7 @@ extern "C" {
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_hdf_hdf5lib_HDF5Constants_H5_1QUARTER_1HADDR_1MAX(JNIEnv *env, jclass cls) { return (hsize_t)HADDR_MAX/4; }
|
||||
|
@ -58,7 +58,7 @@ END PROGRAM PROG_FC_HAVE_F2003_REQUIREMENTS
|
||||
!---- START ----- Check to see C_LONG_DOUBLE is different from C_DOUBLE
|
||||
MODULE type_mod
|
||||
USE ISO_C_BINDING
|
||||
INTERFACE h5t
|
||||
INTERFACE h5t
|
||||
MODULE PROCEDURE h5t_c_double
|
||||
MODULE PROCEDURE h5t_c_long_double
|
||||
END INTERFACE
|
||||
|
@ -476,4 +476,3 @@ rm -f pac_Cconftest.out
|
||||
],[])
|
||||
])
|
||||
|
||||
|
||||
|
@ -55,7 +55,7 @@ New Features
|
||||
Configuration:
|
||||
-------------
|
||||
- Removed version-specific gcc/gfortran flags for version 4.0 (inclusive)
|
||||
and earlier
|
||||
and earlier.
|
||||
|
||||
The config/gnu-flags file, which is sourced as a part of the configure
|
||||
process, adds version-specific flags for use when building HDF5. Most of
|
||||
@ -70,12 +70,18 @@ New Features
|
||||
to remove the flags not understood by that version of the compiler.
|
||||
Nothing should change when building with gcc >= 4.1.
|
||||
|
||||
Also, as a part of this work, the string 'gfortran40' was changed to
|
||||
'gfortran' in the config/gnu-fflags file.
|
||||
|
||||
(HDFFV-9937, DER, 2017/05/31)
|
||||
|
||||
-
|
||||
- -fno-omit-frame-pointer was added when building with debugging symbols
|
||||
enabled.
|
||||
|
||||
Debugging symbols can be enabled independently of the overall build
|
||||
mode in both the autotools and CMake. This allows (limited) debugging
|
||||
of optimized code. Since many debuggers rely on the frame pointer,
|
||||
we've disabled this optimization when debugging symbols are requested
|
||||
(e.g.: via building with --enable-symbols).
|
||||
|
||||
(HDFFV-10226, DER, 2017/05/31)
|
||||
|
||||
Library:
|
||||
--------
|
||||
@ -102,6 +108,17 @@ New Features
|
||||
|
||||
(HDFFV-10214, DER, 2017/05/31)
|
||||
|
||||
- The H5I_REFERENCE value in the H5I_type_t enum (defined in H5Ipublic.h)
|
||||
has been marked as deprectated.
|
||||
|
||||
This ID type value is not used in the C library. i.e.: There are no
|
||||
hid_t values that are of ID type H5I_REFERENCE.
|
||||
|
||||
This enum value will be removed in a future major version of the library.
|
||||
The code will remain unchanged in the HDF5 1.10.x branches.
|
||||
|
||||
(HDFFV-10252, DER, 2017/04/05)
|
||||
|
||||
Parallel Library:
|
||||
-----------------
|
||||
-
|
||||
@ -114,6 +131,21 @@ New Features
|
||||
------------
|
||||
-
|
||||
|
||||
Java Library:
|
||||
-------------
|
||||
|
||||
- The H5I_REFERENCE value in the H5I_type_t enum (defined in H5Ipublic.h)
|
||||
has been marked as deprectated.
|
||||
|
||||
JNI code which refers to this value will be removed in a future
|
||||
major version of the library. The code will remain unchanged in the
|
||||
1.10.x branches.
|
||||
|
||||
See the C library section, above, for further information.
|
||||
|
||||
(HDFFV-10252, DER, 2017/04/05)
|
||||
|
||||
|
||||
Tools:
|
||||
------
|
||||
-
|
||||
@ -147,7 +179,32 @@ Bug Fixes since HDF5-1.10.0-patch1 release
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
-
|
||||
- Corrected FORTRAN_HAVE_C_LONG_DOUBLE processing in the autotools.
|
||||
|
||||
A bug in the autotools Fortran processing code always set the
|
||||
FORTRAN_HAVE_C_LONG_DOUBLE variable to be true regardless of
|
||||
whether or not a C long double type was present.
|
||||
|
||||
This would cause compilation failures on platforms where a C
|
||||
long double type was not available and the Fortran wrappers
|
||||
were being built.
|
||||
|
||||
(HDFFV-10247, DER, 2017/07/05)
|
||||
|
||||
- The deprecated --enable-production and --enable-debug configure options
|
||||
failed to emit errors when passed an empty string
|
||||
(e.g.: --enable-debug="").
|
||||
|
||||
Due to the way we checked for these options being set, it was possible
|
||||
to avoid the error message and continue configuration if an empty string
|
||||
was passed to the option.
|
||||
|
||||
Any use of --enable-production or --enable-debug will now halt the
|
||||
configuration step and emit a helpful error message
|
||||
(use --enable-build-mode=debug|production instead).
|
||||
|
||||
(HDFFV-10248, DER, 2017/07/05)
|
||||
|
||||
|
||||
Performance
|
||||
-------------
|
||||
|
279
src/H5FD.c
279
src/H5FD.c
@ -12,14 +12,11 @@
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* Programmer: Robb Matzke <matzke@llnl.gov>
|
||||
* Monday, July 26, 1999
|
||||
*
|
||||
* Purpose: The Virtual File Layer as described in documentation.
|
||||
* This is the greatest common denominator for all types of
|
||||
* storage access whether a file, memory, network, etc. This
|
||||
* layer usually just dispatches the request to an actual
|
||||
* file driver layer.
|
||||
* Purpose: The Virtual File Layer as described in documentation.
|
||||
* This is the greatest common denominator for all types of
|
||||
* storage access whether a file, memory, network, etc. This
|
||||
* layer usually just dispatches the request to an actual
|
||||
* file driver layer.
|
||||
*/
|
||||
|
||||
/****************/
|
||||
@ -112,9 +109,6 @@ static const H5I_class_t H5I_VFL_CLS[1] = {{
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Monday, July 26, 1999
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -147,9 +141,6 @@ done:
|
||||
* otherwise.
|
||||
* Failure: Never fails.
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Friday, February 19, 1999
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
int
|
||||
@ -189,11 +180,6 @@ H5FD_term_package(void)
|
||||
*
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Monday, July 26, 1999
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
@ -221,26 +207,18 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FDregister
|
||||
* Function: H5FDregister
|
||||
*
|
||||
* Purpose: Registers a new file driver as a member of the virtual file
|
||||
* driver class. Certain fields of the class struct are
|
||||
* required and that is checked here so it doesn't have to be
|
||||
* checked every time the field is accessed.
|
||||
* Purpose: Registers a new file driver as a member of the virtual file
|
||||
* driver class. Certain fields of the class struct are
|
||||
* required and that is checked here so it doesn't have to be
|
||||
* checked every time the field is accessed.
|
||||
*
|
||||
* Return: Success: A file driver ID which is good until the
|
||||
* library is closed or the driver is
|
||||
* unregistered.
|
||||
* Return: Success: A file driver ID which is good until the
|
||||
* library is closed or the driver is
|
||||
* unregistered.
|
||||
*
|
||||
* Failure: A negative value.
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Monday, July 26, 1999
|
||||
*
|
||||
* Modifications:
|
||||
* Copied guts of function into H5FD_register
|
||||
* Quincey Koziol
|
||||
* Friday, January 30, 2004
|
||||
* Failure: A negative value.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -255,18 +233,18 @@ H5FDregister(const H5FD_class_t *cls)
|
||||
|
||||
/* Check arguments */
|
||||
if(!cls)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "null class pointer is disallowed")
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "null class pointer is disallowed")
|
||||
if(!cls->open || !cls->close)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`open' and/or `close' methods are not defined")
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`open' and/or `close' methods are not defined")
|
||||
if(!cls->get_eoa || !cls->set_eoa)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eoa' and/or `set_eoa' methods are not defined")
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eoa' and/or `set_eoa' methods are not defined")
|
||||
if(!cls->get_eof)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eof' method is not defined")
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eof' method is not defined")
|
||||
if(!cls->read || !cls->write)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`read' and/or `write' method is not defined")
|
||||
for (type=H5FD_MEM_DEFAULT; type<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,type))
|
||||
if(cls->fl_map[type]<H5FD_MEM_NOLIST || cls->fl_map[type]>=H5FD_MEM_NTYPES)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid free-list mapping")
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`read' and/or `write' method is not defined")
|
||||
for (type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,type))
|
||||
if(cls->fl_map[type] < H5FD_MEM_NOLIST || cls->fl_map[type] >= H5FD_MEM_NTYPES)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid free-list mapping")
|
||||
|
||||
/* Create the new class ID */
|
||||
if((ret_value=H5FD_register(cls, sizeof(H5FD_class_t), TRUE)) < 0)
|
||||
@ -278,29 +256,18 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FD_register
|
||||
* Function: H5FD_register
|
||||
*
|
||||
* Purpose: Registers a new file driver as a member of the virtual file
|
||||
* driver class. Certain fields of the class struct are
|
||||
* required and that is checked here so it doesn't have to be
|
||||
* checked every time the field is accessed.
|
||||
* Purpose: Registers a new file driver as a member of the virtual file
|
||||
* driver class. Certain fields of the class struct are
|
||||
* required and that is checked here so it doesn't have to be
|
||||
* checked every time the field is accessed.
|
||||
*
|
||||
* Return: Success: A file driver ID which is good until the
|
||||
* library is closed or the driver is
|
||||
* unregistered.
|
||||
* Return: Success: A file driver ID which is good until the
|
||||
* library is closed or the driver is
|
||||
* unregistered.
|
||||
*
|
||||
* Failure: A negative value.
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Monday, July 26, 1999
|
||||
*
|
||||
* Modifications:
|
||||
* Broke into public and internal routines & added 'size'
|
||||
* parameter to internal routine, which allows us to create
|
||||
* sub-classes of H5FD_class_t for internal support (see the
|
||||
* MPI drivers, etc.)
|
||||
* Quincey Koziol
|
||||
* January 30, 2004
|
||||
* Failure: A negative value.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -325,7 +292,7 @@ H5FD_register(const void *_cls, size_t size, hbool_t app_ref)
|
||||
|
||||
/* Copy the class structure so the caller can reuse or free it */
|
||||
if(NULL == (saved = (H5FD_class_t *)H5MM_malloc(size)))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for file driver class struct")
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for file driver class struct")
|
||||
HDmemcpy(saved, cls, size);
|
||||
|
||||
/* Create the new class ID */
|
||||
@ -342,19 +309,16 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FDunregister
|
||||
* Function: H5FDunregister
|
||||
*
|
||||
* Purpose: Removes a driver ID from the library. This in no way affects
|
||||
* file access property lists which have been defined to use
|
||||
* this driver or files which are already opened under this
|
||||
* driver.
|
||||
* Purpose: Removes a driver ID from the library. This in no way affects
|
||||
* file access property lists which have been defined to use
|
||||
* this driver or files which are already opened under this
|
||||
* driver.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Return: Success: Non-negative
|
||||
*
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Monday, July 26, 1999
|
||||
* Failure: Negative
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -394,9 +358,6 @@ done:
|
||||
*
|
||||
* Failure: NULL
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Friday, August 20, 1999
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
H5FD_class_t *
|
||||
@ -442,11 +403,6 @@ done:
|
||||
* Failure: 0 if an error occurs or if the driver has no
|
||||
* data to store in the superblock.
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Monday, August 16, 1999
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
hsize_t
|
||||
@ -480,11 +436,6 @@ done:
|
||||
*
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Monday, August 16, 1999
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -511,9 +462,6 @@ done:
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Monday, August 16, 1999
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
@ -542,9 +490,6 @@ done:
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Friday, July 19, 2013
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -592,9 +537,6 @@ done:
|
||||
* Failure: NULL, including when the file has no
|
||||
* properties.
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Friday, August 13, 1999
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
void *
|
||||
@ -622,9 +564,6 @@ done:
|
||||
* Return: Success: non-negative
|
||||
* Failure: negative
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Tuesday, August 3, 1999
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -706,11 +645,6 @@ done:
|
||||
*
|
||||
* Failure: NULL
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Tuesday, July 27, 1999
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
H5FD_t *
|
||||
@ -745,16 +679,6 @@ done:
|
||||
*
|
||||
* Failure: NULL
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Wednesday, August 4, 1999
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
* Raymond Lu
|
||||
* Tuesday, Oct 23, 2001
|
||||
* Changed the file access list to the new generic property
|
||||
* list.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
H5FD_t *
|
||||
@ -861,9 +785,6 @@ done:
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Tuesday, July 27, 1999
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -893,9 +814,6 @@ done:
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Wednesday, August 4, 1999
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -944,11 +862,6 @@ done:
|
||||
* comparison callback then the file pointers
|
||||
* themselves are compared.
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Tuesday, July 27, 1999
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
int
|
||||
@ -975,11 +888,6 @@ done:
|
||||
*
|
||||
* Failure: Must never fail.
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Wednesday, August 4, 1999
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
int
|
||||
@ -1025,11 +933,6 @@ done:
|
||||
*
|
||||
* Failure: negative
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Friday, August 25, 2000
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
int
|
||||
@ -1059,9 +962,6 @@ done:
|
||||
*
|
||||
* Failure: negative
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Friday, August 25, 2000
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static int
|
||||
@ -1118,9 +1018,6 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/)
|
||||
*
|
||||
* Failure: The undefined address HADDR_UNDEF
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Tuesday, July 27, 1999
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
haddr_t
|
||||
@ -1170,11 +1067,6 @@ done:
|
||||
*
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Wednesday, July 28, 1999
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -1207,16 +1099,13 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5FDget_eoa
|
||||
* Function: H5FDget_eoa
|
||||
*
|
||||
* Purpose: Returns the address of the first byte after the last
|
||||
* allocated memory in the file.
|
||||
* Purpose: Returns the address of the first byte after the last
|
||||
* allocated memory in the file.
|
||||
*
|
||||
* Return: Success: First byte after allocated memory.
|
||||
* Failure: HADDR_UNDEF
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Friday, July 30, 1999
|
||||
* Return: Success: First byte after allocated memory.
|
||||
* Failure: HADDR_UNDEF
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -1230,13 +1119,13 @@ H5FDget_eoa(H5FD_t *file, H5FD_mem_t type)
|
||||
|
||||
/* Check args */
|
||||
if(!file || !file->cls)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer")
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer")
|
||||
if(type < H5FD_MEM_DEFAULT || type >= H5FD_MEM_NTYPES)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file type")
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file type")
|
||||
|
||||
/* The real work */
|
||||
if(HADDR_UNDEF == (ret_value = H5FD_get_eoa(file, type)))
|
||||
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eoa request failed")
|
||||
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eoa request failed")
|
||||
|
||||
/* (Note compensating for base address subtraction in internal routine) */
|
||||
ret_value += file->base_addr;
|
||||
@ -1265,9 +1154,6 @@ done:
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative, no side effect
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Friday, July 30, 1999
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -1280,16 +1166,16 @@ H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr)
|
||||
|
||||
/* Check args */
|
||||
if(!file || !file->cls)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer")
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer")
|
||||
if(type < H5FD_MEM_DEFAULT || type >= H5FD_MEM_NTYPES)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file type")
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file type")
|
||||
if(!H5F_addr_defined(addr) || addr > file->maxaddr)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid end-of-address value")
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid end-of-address value")
|
||||
|
||||
/* The real work */
|
||||
/* (Note compensating for base address addition in internal routine) */
|
||||
if(H5FD_set_eoa(file, type, addr - file->base_addr) < 0)
|
||||
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file set eoa request failed")
|
||||
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file set eoa request failed")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
@ -1315,11 +1201,6 @@ done:
|
||||
*
|
||||
* Failure: HADDR_UNDEF
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Thursday, July 29, 1999
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
haddr_t
|
||||
@ -1332,11 +1213,11 @@ H5FDget_eof(H5FD_t *file, H5FD_mem_t type)
|
||||
|
||||
/* Check arguments */
|
||||
if(!file || !file->cls)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer")
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer")
|
||||
|
||||
/* The real work */
|
||||
if(HADDR_UNDEF == (ret_value = H5FD_get_eof(file, type)))
|
||||
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eof request failed")
|
||||
HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eof request failed")
|
||||
|
||||
/* (Note compensating for base address subtraction in internal routine) */
|
||||
ret_value += file->base_addr;
|
||||
@ -1354,9 +1235,6 @@ done:
|
||||
* Return: Success: The maximum address allowed in the file.
|
||||
* Failure: HADDR_UNDEF
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Thursday, January 3, 2008
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
haddr_t
|
||||
@ -1384,9 +1262,6 @@ done:
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Tuesday, January 8, 2008
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -1412,8 +1287,6 @@ H5FD_get_feature_flags(const H5FD_t *file, unsigned long *feature_flags)
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Vailin Choi; Oct 2013
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -1438,9 +1311,6 @@ H5FD_set_feature_flags(H5FD_t *file, unsigned long feature_flags)
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Thursday, January 17, 2008
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -1483,9 +1353,6 @@ done:
|
||||
*
|
||||
* Failure: Negative. The contents of BUF is undefined.
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Thursday, July 29, 1999
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -1548,9 +1415,6 @@ done:
|
||||
*
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Thursday, July 29, 1999
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -1613,10 +1477,6 @@ done:
|
||||
* Programmer: Robb Matzke
|
||||
* Thursday, July 29, 1999
|
||||
*
|
||||
* Modifications:
|
||||
* Quincey Koziol, May 20, 2002
|
||||
* Added 'closing' parameter
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -1653,9 +1513,6 @@ done:
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Wednesday, August 4, 1999
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -1683,9 +1540,6 @@ done:
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Thursday, January 31, 2008
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -1722,9 +1576,6 @@ done:
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Thursday, January 31, 2008
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -1752,8 +1603,6 @@ done:
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Vailin Choi; March 2015
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -1786,8 +1635,6 @@ done:
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Vailin Choi; May 2013
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -1815,8 +1662,6 @@ done:
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Vailin Choi; March 2015
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -1848,8 +1693,6 @@ done:
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Vailin Choi; May 2013
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -1878,9 +1721,6 @@ done:
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*
|
||||
* Programmer: Quincey Koziol <koziol@ncsa.uiuc.edu>
|
||||
* March 27, 2002
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -1909,8 +1749,6 @@ H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum)
|
||||
* Programmer: Raymond Lu
|
||||
* Sep. 16, 2002
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*--------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -1972,9 +1810,6 @@ done:
|
||||
*
|
||||
* Return: Non-negative if succeed; negative if fails.
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Jan. 17, 2008
|
||||
*
|
||||
*--------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -2000,9 +1835,6 @@ H5FD_set_base_addr(H5FD_t *file, haddr_t base_addr)
|
||||
* Return: Success: The absolute base address of the file
|
||||
* Failure: The undefined address (HADDR_UNDEF)
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Sept. 10, 2009
|
||||
*
|
||||
*--------------------------------------------------------------------------
|
||||
*/
|
||||
haddr_t
|
||||
@ -2024,8 +1856,6 @@ H5FD_get_base_addr(const H5FD_t *file)
|
||||
*
|
||||
* Return: Non-negative if succeed; negative if fails.
|
||||
*
|
||||
* Programmer: Vailin Choi; April 2013
|
||||
*
|
||||
*--------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
@ -2052,9 +1882,6 @@ H5FD_set_paged_aggr(H5FD_t *file, hbool_t paged)
|
||||
*
|
||||
* Return: SUCCEED/FAIL
|
||||
*
|
||||
* Programmer: Jacob Gruber
|
||||
* Wednesday, August 17, 2011
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
|
@ -28,26 +28,31 @@
|
||||
* fail otherwise).
|
||||
*
|
||||
* When adding types here, add a section to the 'misc19' test in test/tmisc.c
|
||||
* to verify that the H5I{inc|dec|get}_ref() routines work correctly with in.
|
||||
* to verify that the H5I{inc|dec|get}_ref() routines work correctly with it.
|
||||
*
|
||||
*/
|
||||
typedef enum H5I_type_t {
|
||||
H5I_UNINIT = (-2), /*uninitialized type */
|
||||
H5I_BADID = (-1), /*invalid Type */
|
||||
H5I_FILE = 1, /*type ID for File objects */
|
||||
H5I_GROUP, /*type ID for Group objects */
|
||||
H5I_DATATYPE, /*type ID for Datatype objects */
|
||||
H5I_DATASPACE, /*type ID for Dataspace objects */
|
||||
H5I_DATASET, /*type ID for Dataset objects */
|
||||
H5I_ATTR, /*type ID for Attribute objects */
|
||||
H5I_REFERENCE, /*type ID for Reference objects */
|
||||
H5I_VFL, /*type ID for virtual file layer */
|
||||
H5I_GENPROP_CLS, /*type ID for generic property list classes */
|
||||
H5I_GENPROP_LST, /*type ID for generic property lists */
|
||||
H5I_ERROR_CLASS, /*type ID for error classes */
|
||||
H5I_ERROR_MSG, /*type ID for error messages */
|
||||
H5I_ERROR_STACK, /*type ID for error stacks */
|
||||
H5I_NTYPES /*number of library types, MUST BE LAST! */
|
||||
H5I_UNINIT = (-2), /* uninitialized type */
|
||||
H5I_BADID = (-1), /* invalid Type */
|
||||
H5I_FILE = 1, /* type ID for File objects */
|
||||
H5I_GROUP, /* type ID for Group objects */
|
||||
H5I_DATATYPE, /* type ID for Datatype objects */
|
||||
H5I_DATASPACE, /* type ID for Dataspace objects */
|
||||
H5I_DATASET, /* type ID for Dataset objects */
|
||||
H5I_ATTR, /* type ID for Attribute objects */
|
||||
H5I_REFERENCE, /* type ID for Reference objects
|
||||
** DEPRECATED**
|
||||
H5I_REFERENCE is not used in the library and
|
||||
will be removed from this enumeration in a
|
||||
future major release of the library.
|
||||
*/
|
||||
H5I_VFL, /* type ID for virtual file layer */
|
||||
H5I_GENPROP_CLS, /* type ID for generic property list classes */
|
||||
H5I_GENPROP_LST, /* type ID for generic property lists */
|
||||
H5I_ERROR_CLASS, /* type ID for error classes */
|
||||
H5I_ERROR_MSG, /* type ID for error messages */
|
||||
H5I_ERROR_STACK, /* type ID for error stacks */
|
||||
H5I_NTYPES /* number of library types, MUST BE LAST! */
|
||||
} H5I_type_t;
|
||||
|
||||
/* Type of atoms to return to users */
|
||||
|
100
test/h5test.c
100
test/h5test.c
@ -104,6 +104,68 @@ static herr_t h5_errors(hid_t estack, void *client_data);
|
||||
static char * h5_fixname_real(const char *base_name, hid_t fapl, const char *suffix,
|
||||
char *fullname, size_t size, hbool_t nest_printf);
|
||||
|
||||
|
||||
|
||||
/* A non-usable VFD class and its functions.
|
||||
*
|
||||
* Usable for testing things like ID handling where we shouldn't mess with the real VFDs.
|
||||
*/
|
||||
static H5FD_t *dummy_vfd_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
|
||||
static H5FD_t *dummy_vfd_open(const char H5_ATTR_UNUSED *name, unsigned H5_ATTR_UNUSED flags, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED maxaddr) { return NULL; }
|
||||
|
||||
static herr_t dummy_vfd_close(H5FD_t *_file);
|
||||
static herr_t dummy_vfd_close(H5FD_t H5_ATTR_UNUSED *_file) { return FAIL; }
|
||||
|
||||
static haddr_t dummy_vfd_get_eoa(const H5FD_t *file, H5FD_mem_t type);
|
||||
static haddr_t dummy_vfd_get_eoa(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; }
|
||||
|
||||
static herr_t dummy_vfd_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
|
||||
static herr_t dummy_vfd_set_eoa(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t H5_ATTR_UNUSED addr) { return FAIL; }
|
||||
|
||||
static haddr_t dummy_vfd_get_eof(const H5FD_t *file, H5FD_mem_t type);
|
||||
static haddr_t dummy_vfd_get_eof(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; }
|
||||
|
||||
static herr_t dummy_vfd_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf);
|
||||
static herr_t dummy_vfd_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, void H5_ATTR_UNUSED *buf) { return FAIL; }
|
||||
|
||||
static herr_t dummy_vfd_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf);
|
||||
static herr_t dummy_vfd_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf) { return FAIL; }
|
||||
|
||||
static H5FD_class_t dummy_vfd_class_g = {
|
||||
"fake", /* name */
|
||||
1, /* maxaddr */
|
||||
H5F_CLOSE_WEAK, /* fc_degree */
|
||||
NULL, /* terminate */
|
||||
NULL, /* sb_size */
|
||||
NULL, /* sb_encode */
|
||||
NULL, /* sb_decode */
|
||||
0, /* fapl_size */
|
||||
NULL, /* fapl_get */
|
||||
NULL, /* fapl_copy */
|
||||
NULL, /* fapl_free */
|
||||
0, /* dxpl_size */
|
||||
NULL, /* dxpl_copy */
|
||||
NULL, /* dxpl_free */
|
||||
dummy_vfd_open, /* open */
|
||||
dummy_vfd_close, /* close */
|
||||
NULL, /* cmp */
|
||||
NULL, /* query */
|
||||
NULL, /* get_type_map */
|
||||
NULL, /* alloc */
|
||||
NULL, /* free */
|
||||
dummy_vfd_get_eoa, /* get_eoa */
|
||||
dummy_vfd_set_eoa, /* set_eoa */
|
||||
dummy_vfd_get_eof, /* get_eof */
|
||||
NULL, /* get_handle */
|
||||
dummy_vfd_read, /* read */
|
||||
dummy_vfd_write, /* write */
|
||||
NULL, /* flush */
|
||||
NULL, /* truncate */
|
||||
NULL, /* lock */
|
||||
NULL, /* unlock */
|
||||
H5FD_FLMAP_DEFAULT /* fl_map */
|
||||
};
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: h5_errors
|
||||
@ -1828,3 +1890,41 @@ error:
|
||||
return FAIL;
|
||||
} /* h5_wait_message() */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: h5_get_dummy_vfd_class()
|
||||
*
|
||||
* Purpose: Returns a disposable, generally non-functional,
|
||||
* VFD class struct.
|
||||
*
|
||||
* In some of the test code, we need a disposable VFD but
|
||||
* we don't want to mess with the real VFDs and we also
|
||||
* don't have access to the internals of the real VFDs (which
|
||||
* use static globals and functions) to easily duplicate
|
||||
* them (e.g.: for testing VFD ID handling).
|
||||
*
|
||||
* This API call will return a pointer to a VFD class that
|
||||
* can be used to construct a test VFD using H5FDregister().
|
||||
*
|
||||
* Return: Success: A pointer to a VFD class struct
|
||||
* Failure: NULL
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
H5FD_class_t *
|
||||
h5_get_dummy_vfd_class(void)
|
||||
{
|
||||
H5FD_class_t *vfd_class = NULL;
|
||||
|
||||
if(NULL == (vfd_class = (H5FD_class_t *)HDmalloc(sizeof(H5FD_class_t))))
|
||||
TEST_ERROR;
|
||||
|
||||
HDmemcpy(vfd_class, &dummy_vfd_class_g, sizeof(H5FD_class_t));
|
||||
|
||||
return vfd_class;
|
||||
|
||||
error:
|
||||
if(vfd_class)
|
||||
HDfree(vfd_class);
|
||||
return NULL;
|
||||
} /* h5_get_dummy_vfd_class */
|
||||
|
||||
|
@ -136,6 +136,7 @@ H5TEST_DLL h5_stat_size_t h5_get_file_size(const char *filename, hid_t fapl);
|
||||
H5TEST_DLL int print_func(const char *format, ...);
|
||||
H5TEST_DLL int h5_make_local_copy(const char *origfilename, const char *local_copy_name);
|
||||
H5TEST_DLL herr_t h5_verify_cached_stabs(const char *base_name[], hid_t fapl);
|
||||
H5TEST_DLL H5FD_class_t *h5_get_dummy_vfd_class(void);
|
||||
|
||||
/* Functions that will replace VFD-dependent functions that violate
|
||||
* the single responsibility principle. Unlike their predecessors,
|
||||
|
69
test/tmisc.c
69
test/tmisc.c
@ -29,7 +29,7 @@
|
||||
#include "hdf5.h"
|
||||
#include "testhdf5.h"
|
||||
#include "H5srcdir.h"
|
||||
#include "H5Dpkg.h" /* Datasets */
|
||||
#include "H5Dpkg.h" /* Datasets */
|
||||
|
||||
/* Definitions for misc. test #1 */
|
||||
#define MISC1_FILE "tmisc1.h5"
|
||||
@ -2984,19 +2984,21 @@ test_misc18(void)
|
||||
static void
|
||||
test_misc19(void)
|
||||
{
|
||||
hid_t fid; /* File ID */
|
||||
hid_t sid; /* 'Space ID */
|
||||
hid_t did; /* Dataset ID */
|
||||
hid_t tid; /* 'Type ID */
|
||||
hid_t aid; /* Attribute ID */
|
||||
hid_t plid; /* Property List ID */
|
||||
hid_t pcid; /* Property Class ID */
|
||||
hid_t gid; /* Group ID */
|
||||
hid_t ecid; /* Error Class ID */
|
||||
hid_t emid; /* Error Message ID */
|
||||
hid_t esid; /* Error Stack ID */
|
||||
int rc; /* Reference count */
|
||||
herr_t ret; /* Generic return value */
|
||||
hid_t fid = -1; /* File ID */
|
||||
hid_t sid = -1; /* Dataspace ID */
|
||||
hid_t did = -1; /* Dataset ID */
|
||||
hid_t tid = -1; /* Datatype ID */
|
||||
hid_t aid = -1; /* Attribute ID */
|
||||
hid_t plid = -1; /* Property List ID */
|
||||
hid_t pcid = -1; /* Property Class ID */
|
||||
hid_t gid = -1; /* Group ID */
|
||||
hid_t ecid = -1; /* Error Class ID */
|
||||
hid_t emid = -1; /* Error Message ID */
|
||||
hid_t esid = -1; /* Error Stack ID */
|
||||
hid_t vfdid = -1; /* Virtual File Driver ID */
|
||||
H5FD_class_t *vfd_cls = NULL; /* VFD class */
|
||||
int rc; /* Reference count */
|
||||
herr_t ret; /* Generic return value */
|
||||
|
||||
/* Check H5I operations on files */
|
||||
|
||||
@ -3406,6 +3408,45 @@ test_misc19(void)
|
||||
} H5E_END_TRY;
|
||||
VERIFY(ret, FAIL, "H5Eclose_stack");
|
||||
|
||||
|
||||
/* Check H5I operations on virtual file drivers */
|
||||
|
||||
/* Get a VFD class to register */
|
||||
vfd_cls = h5_get_dummy_vfd_class();
|
||||
CHECK(vfd_cls, NULL, "h5_get_dummy_vfd_class");
|
||||
|
||||
/* Register a virtual file driver */
|
||||
vfdid = H5FDregister(vfd_cls);
|
||||
CHECK(vfdid, FAIL, "H5FDregister");
|
||||
|
||||
/* Check the reference count */
|
||||
rc = H5Iget_ref(vfdid);
|
||||
VERIFY(rc, 1, "H5Iget_ref");
|
||||
|
||||
/* Increment the reference count */
|
||||
rc = H5Iinc_ref(vfdid);
|
||||
VERIFY(rc, 2, "H5Iinc_ref");
|
||||
|
||||
/* Unregister the VFD normally */
|
||||
ret = H5FDunregister(vfdid);
|
||||
CHECK(ret, FAIL, "H5FDunregister");
|
||||
|
||||
/* Check the reference count */
|
||||
rc = H5Iget_ref(vfdid);
|
||||
VERIFY(rc, 1, "H5Iget_ref");
|
||||
|
||||
/* Unregister the VFD by decrementing the reference count */
|
||||
rc = H5Idec_ref(vfdid);
|
||||
VERIFY(rc, 0, "H5Idec_ref");
|
||||
|
||||
/* Try unregistering the VFD again (should fail) */
|
||||
H5E_BEGIN_TRY {
|
||||
ret = H5FDunregister(vfdid);
|
||||
} H5E_END_TRY;
|
||||
VERIFY(ret, FAIL, "H5FDunregister");
|
||||
|
||||
HDfree(vfd_cls);
|
||||
|
||||
} /* end test_misc19() */
|
||||
|
||||
/****************************************************************
|
||||
|
Loading…
x
Reference in New Issue
Block a user