summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--c++/test/tattr.cpp6
-rwxr-xr-xconfigure9
-rw-r--r--configure.in4
-rw-r--r--src/H5FDcore.c144
-rw-r--r--src/H5FDsec2.c33
-rw-r--r--src/H5config.h.in3
-rw-r--r--src/H5private.h6
-rw-r--r--test/btree2.c194
-rw-r--r--test/dangle.c30
-rw-r--r--test/earray.c19
-rw-r--r--test/fheap.c151
-rw-r--r--test/freespace.c198
-rw-r--r--test/h5test.c100
-rw-r--r--test/h5test.h2
-rw-r--r--test/links.c51
-rw-r--r--test/mf.c307
-rw-r--r--test/stab.c35
-rw-r--r--test/tattr.c52
-rw-r--r--test/tfile.c4
-rw-r--r--test/tsohm.c44
-rw-r--r--test/unlink.c58
-rw-r--r--testpar/t_mdset.c6
22 files changed, 806 insertions, 650 deletions
diff --git a/c++/test/tattr.cpp b/c++/test/tattr.cpp
index 11f7303..73b5a91 100644
--- a/c++/test/tattr.cpp
+++ b/c++/test/tattr.cpp
@@ -1043,9 +1043,9 @@ static void test_attr_dtype_shared()
// Get size of file
h5_stat_size_t empty_filesize; // Size of empty file
- empty_filesize = h5_get_file_size(FILENAME.c_str());
+ empty_filesize = h5_get_file_size(FILENAME.c_str(), H5P_DEFAULT);
if (empty_filesize < 0)
- TestErrPrintf("Line %d: file size wrong!\n",__LINE__);
+ TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
// Open the file again
fid1.openFile(FILENAME, H5F_ACC_RDWR);
@@ -1162,7 +1162,7 @@ static void test_attr_dtype_shared()
fid1.close();
// Check size of file
- filesize=h5_get_file_size(FILENAME.c_str());
+ filesize = h5_get_file_size(FILENAME.c_str(), H5P_DEFAULT);
verify_val((long)filesize, (long)empty_filesize, "Checking file size", __LINE__, __FILE__);
PASSED();
diff --git a/configure b/configure
index 6c3c2df..d7b0023 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.in Id: configure.in 15779 2008-10-04 17:48:10Z koziol .
+# From configure.in Id: configure.in 15713 2008-09-28 09:57:24Z hdftest .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for HDF5 1.9.20.
#
@@ -23285,7 +23285,8 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-for ac_func in lseek64 fseek64 fseeko ftello
+
+for ac_func in lseek64 fseek64 ftruncate64 fseeko ftello
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
{ echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -23390,8 +23391,8 @@ else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- { echo "$as_me:$LINENO: result: skipping test for lseek64(), fseek64(), fseeko(), and ftello" >&5
-echo "${ECHO_T}skipping test for lseek64(), fseek64(), fseeko(), and ftello" >&6; }
+ { echo "$as_me:$LINENO: result: skipping test for lseek64(), fseek64(), ftruncate64(), fseeko(), and ftello()" >&5
+echo "${ECHO_T}skipping test for lseek64(), fseek64(), ftruncate64(), fseeko(), and ftello()" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
diff --git a/configure.in b/configure.in
index 05e1189..f7925d0 100644
--- a/configure.in
+++ b/configure.in
@@ -1320,8 +1320,8 @@ esac
AC_TRY_COMPILE([#include <sys/types.h>],
[off64_t n = 0;],
- [AC_CHECK_FUNCS([lseek64 fseek64 fseeko ftello])],
- [AC_MSG_RESULT([skipping test for lseek64(), fseek64(), fseeko(), and ftello])])
+ [AC_CHECK_FUNCS([lseek64 fseek64 ftruncate64 fseeko ftello])],
+ [AC_MSG_RESULT([skipping test for lseek64(), fseek64(), ftruncate64(), fseeko(), and ftello()])])
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/stat.h>],
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index de49e9e..8840720 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -91,6 +91,7 @@ static H5FD_t *H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id,
haddr_t maxaddr);
static herr_t H5FD_core_close(H5FD_t *_file);
static int H5FD_core_cmp(const H5FD_t *_f1, const H5FD_t *_f2);
+static herr_t H5FD_core_query(const H5FD_t *_f1, unsigned long *flags);
static haddr_t H5FD_core_get_eoa(const H5FD_t *_file, H5FD_mem_t type);
static herr_t H5FD_core_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
static haddr_t H5FD_core_get_eof(const H5FD_t *_file);
@@ -100,6 +101,7 @@ static herr_t H5FD_core_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, hadd
static herr_t H5FD_core_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr,
size_t size, const void *buf);
static herr_t H5FD_core_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing);
+static herr_t H5FD_core_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static const H5FD_class_t H5FD_core_g = {
"core", /*name */
@@ -118,7 +120,7 @@ static const H5FD_class_t H5FD_core_g = {
H5FD_core_open, /*open */
H5FD_core_close, /*close */
H5FD_core_cmp, /*cmp */
- NULL, /*query */
+ H5FD_core_query, /*query */
NULL, /*alloc */
NULL, /*free */
H5FD_core_get_eoa, /*get_eoa */
@@ -128,7 +130,7 @@ static const H5FD_class_t H5FD_core_g = {
H5FD_core_read, /*read */
H5FD_core_write, /*write */
H5FD_core_flush, /*flush */
- NULL, /*truncate */
+ H5FD_core_truncate, /*truncate */
NULL, /*lock */
NULL, /*unlock */
H5FD_FLMAP_SINGLE /*fl_map */
@@ -344,7 +346,7 @@ H5FD_core_fapl_get(H5FD_t *_file)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
fa->increment = file->increment;
- fa->backing_store = (file->fd>=0);
+ fa->backing_store = (hbool_t)(file->fd >= 0);
/* Set return value */
ret_value=fa;
@@ -558,6 +560,42 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5FD_core_query
+ *
+ * Purpose: Set the flags that this VFL driver is capable of supporting.
+ * (listed in H5FDpublic.h)
+ *
+ * Return: Success: non-negative
+ * Failure: negative
+ *
+ * Programmer: Quincey Koziol
+ * Tuesday, October 7, 2008
+ *
+ *-------------------------------------------------------------------------
+ */
+/* ARGSUSED */
+static herr_t
+H5FD_core_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5FD_core_query, FAIL)
+
+ /* Set the VFL feature flags that this driver supports */
+ if(flags) {
+ *flags = 0;
+ *flags |= H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */
+ *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */
+ *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */
+ *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */
+ } /* end if */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD_core_query() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5FD_core_get_eoa
*
* Purpose: Gets the end-of-address marker for the file. The EOA marker
@@ -620,18 +658,18 @@ static herr_t
H5FD_core_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr)
{
H5FD_core_t *file = (H5FD_core_t*)_file;
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5FD_core_set_eoa, FAIL)
- if (ADDR_OVERFLOW(addr))
+ if(ADDR_OVERFLOW(addr))
HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "address overflow")
file->eoa = addr;
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5FD_core_set_eoa() */
/*-------------------------------------------------------------------------
@@ -795,18 +833,18 @@ static herr_t
H5FD_core_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr,
size_t size, const void *buf)
{
- H5FD_core_t *file = (H5FD_core_t*)_file;
- herr_t ret_value=SUCCEED; /* Return value */
+ H5FD_core_t *file = (H5FD_core_t*)_file;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5FD_core_write, FAIL)
- assert(file && file->pub.cls);
- assert(buf);
+ HDassert(file && file->pub.cls);
+ HDassert(buf);
/* Check for overflow conditions */
- if (REGION_OVERFLOW(addr, size))
+ if(REGION_OVERFLOW(addr, size))
HGOTO_ERROR(H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed")
- if (addr+size>file->eoa)
+ if(addr + size > file->eoa)
HGOTO_ERROR(H5E_IO, H5E_OVERFLOW, FAIL, "file address overflowed")
/*
@@ -815,34 +853,33 @@ H5FD_core_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had
* careful of non-Posix realloc() that doesn't understand what to do when
* the first argument is null.
*/
- if (addr+size>file->eof) {
+ if(addr + size > file->eof) {
unsigned char *x;
size_t new_eof;
- H5_ASSIGN_OVERFLOW(new_eof,file->increment*((addr+size)/file->increment),hsize_t,size_t);
-
+ /* Determine new size of memory buffer */
+ H5_ASSIGN_OVERFLOW(new_eof, file->increment * ((addr + size) / file->increment), hsize_t, size_t);
if((addr + size) % file->increment)
new_eof += file->increment;
- if(NULL == file->mem)
- x = (unsigned char *)H5MM_malloc(new_eof);
- else
- x = (unsigned char *)H5MM_realloc(file->mem, new_eof);
+
+ /* (Re)allocate memory for the file buffer */
+ if(NULL == (x = (unsigned char *)H5MM_realloc(file->mem, new_eof)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block")
#ifdef H5_CLEAR_MEMORY
HDmemset(x + file->eof, 0, (size_t)(new_eof - file->eof));
#endif /* H5_CLEAR_MEMORY */
- if (!x)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block")
file->mem = x;
+
file->eof = new_eof;
- }
+ } /* end if */
/* Write from BUF to memory */
- HDmemcpy(file->mem+addr, buf, size);
+ HDmemcpy(file->mem + addr, buf, size);
file->dirty = TRUE;
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5FD_core_write() */
/*-------------------------------------------------------------------------
@@ -900,3 +937,62 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
}
+
+/*-------------------------------------------------------------------------
+ * Function: H5FD_core_truncate
+ *
+ * Purpose: Makes sure that the true file size is the same (or larger)
+ * than the end-of-address.
+ *
+ * Return: Success: Non-negative
+ * Failure: Negative
+ *
+ * Programmer: Quincey Koziol
+ * Tuesday, October 7, 2008
+ *
+ *-------------------------------------------------------------------------
+ */
+/* ARGSUSED */
+static herr_t
+H5FD_core_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing)
+{
+ H5FD_core_t *file = (H5FD_core_t*)_file;
+ size_t new_eof; /* New size of memory buffer */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5FD_core_truncate, FAIL)
+
+ HDassert(file);
+
+ /* Determine new size of memory buffer */
+ H5_ASSIGN_OVERFLOW(new_eof, file->increment * (file->eoa / file->increment), hsize_t, size_t);
+ if(file->eoa % file->increment)
+ new_eof += file->increment;
+
+ /* Extend the file to make sure it's large enough */
+ if(!H5F_addr_eq((haddr_t)new_eof, file->eof)) {
+ unsigned char *x; /* Pointer to new buffer for file data */
+
+ /* (Re)allocate memory for the file buffer */
+ if(NULL == (x = (unsigned char *)H5MM_realloc(file->mem, new_eof)))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block")
+#ifdef H5_CLEAR_MEMORY
+if(file->eof < new_eof)
+ HDmemset(x + file->eof, 0, (size_t)(new_eof - file->eof));
+#endif /* H5_CLEAR_MEMORY */
+ file->mem = x;
+
+ /* Update backing store, if using it */
+ if(file->fd >= 0 && file->backing_store) {
+ if(-1 == HDftruncate(file->fd, (off_t)new_eof))
+ HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")
+ } /* end if */
+
+ /* Update the eof value */
+ file->eof = new_eof;
+ } /* end if */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD_core_truncate() */
+
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index cace117..cd3419b 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -101,24 +101,16 @@ typedef struct H5FD_sec2_t {
* file_offset_t: The datatype for file offsets, the second argument of
* the lseek() or lseek64() call.
*
- * file_seek: The function which adjusts the current file position,
- * either lseek() or lseek64().
*/
/* adding for windows NT file system support. */
#ifdef H5_HAVE_LSEEK64
# define file_offset_t off64_t
-# define file_seek lseek64
-# define file_truncate ftruncate64
#elif defined (_WIN32) && !defined(__MWERKS__)
# /*MSVC*/
-# define file_offset_t __int64
-# define file_seek _lseeki64
-# define file_truncate _chsize
+# define file_offset_t __int64
#else
# define file_offset_t off_t
-# define file_seek lseek
-# define file_truncate HDftruncate
#endif
/*
@@ -517,36 +509,33 @@ done:
* (listed in H5FDpublic.h)
*
* Return: Success: non-negative
- *
* Failure: negative
*
* Programmer: Quincey Koziol
* Friday, August 25, 2000
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
/* ARGSUSED */
static herr_t
H5FD_sec2_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */)
{
- herr_t ret_value=SUCCEED;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5FD_sec2_query, FAIL)
/* Set the VFL feature flags that this driver supports */
if(flags) {
*flags = 0;
- *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */
- *flags|=H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */
- *flags|=H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */
- *flags|=H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */
- }
+ *flags |= H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */
+ *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */
+ *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */
+ *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */
+ } /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5FD_sec2_query() */
/*-------------------------------------------------------------------------
@@ -733,7 +722,7 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hadd
/* Seek to the correct location */
if ((addr!=file->pos || OP_READ!=file->op) &&
- file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0)
+ HDlseek(file->fd, (file_offset_t)addr, SEEK_SET)<0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
/*
@@ -817,7 +806,7 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had
/* Seek to the correct location */
if ((addr!=file->pos || OP_WRITE!=file->op) &&
- file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0)
+ HDlseek(file->fd, (file_offset_t)addr, SEEK_SET)<0)
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
/*
@@ -901,7 +890,7 @@ HDfprintf(stderr, "%s: file->eof = %a, file->eoa = %a\n", FUNC, file->eof, file-
if(SetEndOfFile((HANDLE)filehandle) == 0)
HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")
#else /* _WIN32 */
- if(-1 == file_truncate(file->fd, (file_offset_t)file->eoa))
+ if(-1 == HDftruncate(file->fd, (file_offset_t)file->eoa))
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")
#endif /* _WIN32 */
diff --git a/src/H5config.h.in b/src/H5config.h.in
index efa3469..c4606c9 100644
--- a/src/H5config.h.in
+++ b/src/H5config.h.in
@@ -122,6 +122,9 @@
/* Define to 1 if you have the `ftello' function. */
#undef HAVE_FTELLO
+/* Define to 1 if you have the `ftruncate64' function. */
+#undef HAVE_FTRUNCATE64
+
/* Define if the compiler understand the __FUNCTION__ keyword */
#undef HAVE_FUNCTION
diff --git a/src/H5private.h b/src/H5private.h
index cc9274f..63bbcf4 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -779,7 +779,11 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDftell(F) ftell(F)
#endif /* HDftell */
#ifndef HDftruncate
+ #ifdef H5_HAVE_FTRUNCATE64
+ #define HDftruncate(F,L) ftruncate64(F,L)
+ #else
#define HDftruncate(F,L) ftruncate(F,L)
+ #endif
#endif /* HDftruncate */
#ifndef HDfwrite
#define HDfwrite(M,Z,N,F) fwrite(M,Z,N,F)
@@ -920,7 +924,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDlongjmp(J,N) longjmp(J,N)
#endif /* HDlongjmp */
#ifndef HDlseek
- #ifdef H5_HAVE_FSEEK64
+ #ifdef H5_HAVE_LSEEK64
#define HDlseek(F,O,W) lseek64(F,O,W)
#else
#define HDlseek(F,O,W) lseek(F,O,W)
diff --git a/test/btree2.c b/test/btree2.c
index a25a373..84d90f6 100644
--- a/test/btree2.c
+++ b/test/btree2.c
@@ -219,7 +219,7 @@ remove_cb(const void *_record, void *_op_data)
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_insert_basic(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -238,7 +238,7 @@ test_insert_basic(hid_t fapl)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -404,7 +404,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_insert_split_root(hid_t fapl)
{
hid_t file=-1;
@@ -425,7 +425,7 @@ test_insert_split_root(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -580,7 +580,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_insert_level1_2leaf_redistrib(hid_t fapl)
{
hid_t file=-1;
@@ -599,7 +599,7 @@ test_insert_level1_2leaf_redistrib(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -740,7 +740,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_insert_level1_side_split(hid_t fapl)
{
hid_t file=-1;
@@ -759,7 +759,7 @@ test_insert_level1_side_split(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -911,7 +911,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_insert_level1_3leaf_redistrib(hid_t fapl)
{
hid_t file=-1;
@@ -931,7 +931,7 @@ test_insert_level1_3leaf_redistrib(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -1059,7 +1059,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_insert_level1_middle_split(hid_t fapl)
{
hid_t file=-1;
@@ -1079,7 +1079,7 @@ test_insert_level1_middle_split(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -1183,7 +1183,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_insert_make_level2(hid_t fapl)
{
hid_t file=-1;
@@ -1204,7 +1204,7 @@ test_insert_make_level2(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -1367,7 +1367,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_insert_level2_leaf_redistrib(hid_t fapl)
{
hid_t file=-1;
@@ -1387,7 +1387,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -1632,7 +1632,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_insert_level2_leaf_split(hid_t fapl)
{
hid_t file=-1;
@@ -1652,7 +1652,7 @@ test_insert_level2_leaf_split(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -1908,7 +1908,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_insert_level2_2internal_redistrib(hid_t fapl)
{
hid_t file=-1;
@@ -1928,7 +1928,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -2101,7 +2101,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_insert_level2_2internal_split(hid_t fapl)
{
hid_t file=-1;
@@ -2121,7 +2121,7 @@ test_insert_level2_2internal_split(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -2304,7 +2304,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_insert_level2_3internal_redistrib(hid_t fapl)
{
hid_t file=-1;
@@ -2324,7 +2324,7 @@ test_insert_level2_3internal_redistrib(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -2506,7 +2506,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_insert_level2_3internal_split(hid_t fapl)
{
hid_t file=-1;
@@ -2526,7 +2526,7 @@ test_insert_level2_3internal_split(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -2711,7 +2711,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_insert_lots(hid_t fapl)
{
hid_t file=-1;
@@ -2743,7 +2743,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
TESTING("B-tree insert: create random level 4 B-tree");
/* Allocate space for the records */
- if((records = HDmalloc(sizeof(hsize_t) * INSERT_MANY)) == NULL)
+ if((records = (hsize_t *)HDmalloc(sizeof(hsize_t) * INSERT_MANY)) == NULL)
TEST_ERROR
/* Initialize record #'s */
@@ -2752,7 +2752,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
/* Shuffle record #'s */
for(u=0; u<INSERT_MANY; u++) {
- swap_idx = (unsigned)(HDrandom()%(INSERT_MANY-u))+u;
+ swap_idx = ((unsigned)HDrandom() % (INSERT_MANY - u)) + u;
temp_rec = records[u];
records[u] = records[swap_idx];
records[swap_idx] = temp_rec;
@@ -2765,7 +2765,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/*
@@ -2798,7 +2798,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Check up on B-tree after re-open */
@@ -2917,7 +2917,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_basic(hid_t fapl)
{
hid_t file=-1;
@@ -2937,7 +2937,7 @@ test_remove_basic(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/* Record removal tests */
@@ -3202,7 +3202,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level1_noredistrib(hid_t fapl)
{
hid_t file=-1;
@@ -3224,7 +3224,7 @@ test_remove_level1_noredistrib(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/* B-tree record removal tests */
@@ -3425,7 +3425,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level1_redistrib(hid_t fapl)
{
hid_t file=-1;
@@ -3446,7 +3446,7 @@ test_remove_level1_redistrib(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/* More complex record removals */
@@ -3625,7 +3625,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level1_2leaf_merge(hid_t fapl)
{
hid_t file=-1;
@@ -3647,7 +3647,7 @@ test_remove_level1_2leaf_merge(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
TESTING("B-tree remove: merge 2 leaves to 1 in level-1 B-tree (r->l)");
@@ -3809,7 +3809,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level1_3leaf_merge(hid_t fapl)
{
hid_t file=-1;
@@ -3831,7 +3831,7 @@ test_remove_level1_3leaf_merge(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
TESTING("B-tree remove: merge 3 leaves to 2 in level-1 B-tree");
@@ -3937,7 +3937,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level1_promote(hid_t fapl)
{
hid_t file=-1;
@@ -3959,7 +3959,7 @@ test_remove_level1_promote(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
TESTING("B-tree remove: promote from right leaf of level-1 B-tree");
@@ -4181,7 +4181,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level1_promote_2leaf_redistrib(hid_t fapl)
{
hid_t file=-1;
@@ -4203,7 +4203,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
TESTING("B-tree remove: promote from leaf of level-1 B-tree w/2 node redistrib");
@@ -4334,7 +4334,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level1_promote_3leaf_redistrib(hid_t fapl)
{
hid_t file=-1;
@@ -4356,7 +4356,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
TESTING("B-tree remove: promote from leaf of level-1 B-tree w/3 node redistrib");
@@ -4487,7 +4487,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level1_promote_2leaf_merge(hid_t fapl)
{
hid_t file=-1;
@@ -4509,7 +4509,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
TESTING("B-tree remove: promote from leaf of level-1 B-tree w/2->1 merge");
@@ -4635,7 +4635,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level1_promote_3leaf_merge(hid_t fapl)
{
hid_t file=-1;
@@ -4657,7 +4657,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
TESTING("B-tree remove: promote from leaf of level-1 B-tree w/3->2 merge");
@@ -4783,7 +4783,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level1_collapse(hid_t fapl)
{
hid_t file=-1;
@@ -4804,7 +4804,7 @@ test_remove_level1_collapse(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
TESTING("B-tree remove: collapse level-1 B-tree back to level-0");
@@ -4922,7 +4922,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level2_promote(hid_t fapl)
{
hid_t file=-1;
@@ -4944,7 +4944,7 @@ test_remove_level2_promote(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
TESTING("B-tree remove: promote from right internal of level-2 B-tree");
@@ -5213,7 +5213,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level2_promote_2internal_redistrib(hid_t fapl)
{
hid_t file=-1;
@@ -5235,7 +5235,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
TESTING("B-tree remove: promote from right internal of level-2 B-tree w/redistrib");
@@ -5366,7 +5366,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level2_promote_3internal_redistrib(hid_t fapl)
{
hid_t file=-1;
@@ -5388,7 +5388,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
TESTING("B-tree remove: promote from left internal of level-2 B-tree w/redistrib");
@@ -5519,7 +5519,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level2_promote_2internal_merge(hid_t fapl)
{
hid_t file=-1;
@@ -5541,7 +5541,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
TESTING("B-tree remove: promote from right internal of level-2 B-tree w/merge");
@@ -5675,7 +5675,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level2_promote_3internal_merge(hid_t fapl)
{
hid_t file=-1;
@@ -5697,7 +5697,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
TESTING("B-tree remove: promote from middle internal of level-2 B-tree w/merge");
@@ -5831,7 +5831,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level2_2internal_merge_left(hid_t fapl)
{
hid_t file=-1;
@@ -5853,7 +5853,7 @@ test_remove_level2_2internal_merge_left(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
TESTING("B-tree remove: merge 2 internal nodes to 1 in level-2 B-tree (l->r)");
@@ -5959,7 +5959,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level2_2internal_merge_right(hid_t fapl)
{
hid_t file=-1;
@@ -5981,7 +5981,7 @@ test_remove_level2_2internal_merge_right(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
TESTING("B-tree remove: merge 2 internal nodes to 1 in level-2 B-tree (r->l)");
@@ -6087,7 +6087,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level2_3internal_merge(hid_t fapl)
{
hid_t file=-1;
@@ -6109,7 +6109,7 @@ test_remove_level2_3internal_merge(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
TESTING("B-tree remove: merge 3 internal nodes to 2 in level-2 B-tree");
@@ -6215,7 +6215,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_level2_collapse_right(hid_t fapl)
{
hid_t file=-1;
@@ -6238,7 +6238,7 @@ test_remove_level2_collapse_right(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
TESTING("B-tree remove: collapse level-2 B-tree back to level-1 (r->l)");
@@ -6343,7 +6343,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_remove_lots(hid_t fapl)
{
hid_t file = -1;
@@ -6376,7 +6376,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
*/
/* Allocate space for the records */
- if(NULL == (records = HDmalloc(sizeof(hsize_t) * INSERT_MANY)))
+ if(NULL == (records = (hsize_t *)HDmalloc(sizeof(hsize_t) * INSERT_MANY)))
TEST_ERROR
/* Initialize record #'s */
@@ -6388,7 +6388,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
hsize_t temp_rec; /* Temporary record */
unsigned swap_idx; /* Location to swap with when shuffling */
- swap_idx = (unsigned)(HDrandom() % (INSERT_MANY - u)) + u;
+ swap_idx = ((unsigned)HDrandom() % (INSERT_MANY - u)) + u;
temp_rec = records[u];
records[u] = records[swap_idx];
records[swap_idx] = temp_rec;
@@ -6401,7 +6401,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -6461,7 +6461,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Re-shuffle record #'s */
@@ -6469,7 +6469,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
hsize_t temp_rec; /* Temporary record */
unsigned swap_idx; /* Location to swap with when shuffling */
- swap_idx = (unsigned)(HDrandom() % (INSERT_MANY - u)) + u;
+ swap_idx = ((unsigned)HDrandom() % (INSERT_MANY - u)) + u;
temp_rec = records[u];
records[u] = records[swap_idx];
records[swap_idx] = temp_rec;
@@ -6536,13 +6536,13 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Remove all records */
for(u = 0; u < INSERT_MANY; u++) {
/* Pick a record index to remove from randomly */
- rem_idx = (unsigned)(HDrandom() % (INSERT_MANY - u));
+ rem_idx = ((unsigned)HDrandom() % (INSERT_MANY - u));
rrecord = HSIZET_MAX;
/* Remove random record */
@@ -6603,7 +6603,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Remove all records */
@@ -6667,7 +6667,7 @@ HDfprintf(stderr, "curr_time = %lu\n", (unsigned long)curr_time);
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Remove all records */
@@ -6738,7 +6738,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_find_neighbor(hid_t fapl)
{
hid_t file=-1;
@@ -6753,7 +6753,7 @@ test_find_neighbor(hid_t fapl)
herr_t ret; /* Generic error return value */
/* Allocate space for the records */
- if((records = HDmalloc(sizeof(hsize_t)*FIND_NEIGHBOR))==NULL)
+ if((records = (hsize_t *)HDmalloc(sizeof(hsize_t)*FIND_NEIGHBOR))==NULL)
TEST_ERROR
/* Initialize record #'s */
@@ -6772,7 +6772,7 @@ test_find_neighbor(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -6959,7 +6959,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_delete(hid_t fapl)
{
hid_t file=-1;
@@ -6988,7 +6988,7 @@ test_delete(hid_t fapl)
STACK_ERROR
/* Get the size of an empty file */
- if((empty_size = h5_get_file_size(filename)) < 0)
+ if((empty_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Create the file to work on */
@@ -6996,7 +6996,7 @@ test_delete(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -7016,7 +7016,7 @@ test_delete(hid_t fapl)
STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is correct size */
@@ -7033,7 +7033,7 @@ test_delete(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -7066,7 +7066,7 @@ test_delete(hid_t fapl)
STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is correct size */
@@ -7083,7 +7083,7 @@ test_delete(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -7116,7 +7116,7 @@ test_delete(hid_t fapl)
STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is correct size */
@@ -7133,7 +7133,7 @@ test_delete(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -7166,7 +7166,7 @@ test_delete(hid_t fapl)
STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is correct size */
@@ -7200,7 +7200,7 @@ error:
*
*-------------------------------------------------------------------------
*/
-static int
+static unsigned
test_modify(hid_t fapl)
{
hid_t file=-1;
@@ -7227,7 +7227,7 @@ test_modify(hid_t fapl)
STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
STACK_ERROR
/*
@@ -7432,7 +7432,7 @@ main(void)
envval = HDgetenv("HDF5_DRIVER");
if(envval == NULL)
envval = "nomatch";
- if(HDstrcmp(envval, "core") && HDstrcmp(envval, "split") && HDstrcmp(envval, "multi") && HDstrcmp(envval, "family")) {
+ if(HDstrcmp(envval, "split") && HDstrcmp(envval, "multi") && HDstrcmp(envval, "family")) {
/* Reset library */
h5_reset();
fapl = h5_fileaccess();
diff --git a/test/dangle.c b/test/dangle.c
index b08a5e6..2f8a67e 100644
--- a/test/dangle.c
+++ b/test/dangle.c
@@ -111,13 +111,13 @@ test_dangle_dataset(H5F_close_degree_t degree)
if(H5Fclose(fid) < 0)
TEST_ERROR;
- if(H5Pclose(fapl) < 0)
+ if(h5_get_file_size(filename, fapl) < 0)
TEST_ERROR;
- if(H5close() < 0)
+ if(H5Pclose(fapl) < 0)
TEST_ERROR;
- if(h5_get_file_size(filename) < 0)
+ if(H5close() < 0)
TEST_ERROR;
/* Clean up temporary file */
@@ -202,13 +202,13 @@ test_dangle_group(H5F_close_degree_t degree)
if(H5Fclose(fid) < 0)
TEST_ERROR;
- if(H5Pclose(fapl) < 0)
+ if(h5_get_file_size(filename, fapl) < 0)
TEST_ERROR;
- if(H5close() < 0)
+ if(H5Pclose(fapl) < 0)
TEST_ERROR;
- if(h5_get_file_size(filename) < 0)
+ if(H5close() < 0)
TEST_ERROR;
/* Clean up temporary file */
@@ -298,13 +298,13 @@ test_dangle_datatype1(H5F_close_degree_t degree)
if(H5Fclose(fid) < 0)
TEST_ERROR;
- if(H5Pclose(fapl) < 0)
+ if(h5_get_file_size(filename, fapl) < 0)
TEST_ERROR;
- if(H5close() < 0)
+ if(H5Pclose(fapl) < 0)
TEST_ERROR;
- if(h5_get_file_size(filename) < 0)
+ if(H5close() < 0)
TEST_ERROR;
/* Clean up temporary file */
@@ -385,13 +385,13 @@ test_dangle_datatype2(H5F_close_degree_t degree)
if(H5Fclose(fid) < 0)
TEST_ERROR;
- if(H5Pclose(fapl) < 0)
+ if(h5_get_file_size(filename, fapl) < 0)
TEST_ERROR;
- if(H5close() < 0)
+ if(H5Pclose(fapl) < 0)
TEST_ERROR;
- if(h5_get_file_size(filename) < 0)
+ if(H5close() < 0)
TEST_ERROR;
/* Clean up temporary file */
@@ -492,13 +492,13 @@ test_dangle_attribute(H5F_close_degree_t degree)
if(H5Fclose(fid) < 0)
TEST_ERROR;
- if(H5Pclose(fapl) < 0)
+ if(h5_get_file_size(filename, fapl) < 0)
TEST_ERROR;
- if(H5close() < 0)
+ if(H5Pclose(fapl) < 0)
TEST_ERROR;
- if(h5_get_file_size(filename) < 0)
+ if(H5close() < 0)
TEST_ERROR;
/* Clean up temporary file */
diff --git a/test/earray.c b/test/earray.c
index 7f04aa3..0f241e6 100644
--- a/test/earray.c
+++ b/test/earray.c
@@ -442,7 +442,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-finish(hid_t file, H5F_t *f, H5EA_t *ea, haddr_t ea_addr)
+finish(hid_t file, hid_t fapl, H5F_t *f, H5EA_t *ea, haddr_t ea_addr)
{
h5_stat_size_t file_size; /* File size, after deleting array */
@@ -466,7 +466,7 @@ HDsystem("cp earray.h5 earray.h5.save");
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename_g)) < 0)
+ if((file_size = h5_get_file_size(filename_g, fapl)) < 0)
TEST_ERROR
/* Verify the file is correct size */
@@ -634,7 +634,7 @@ test_create(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t UNUSED *tpara
TEST_ERROR
/* Close array, delete array, close file & verify file is empty */
- if(finish(file, f, ea, ea_addr) < 0)
+ if(finish(file, fapl, f, ea, ea_addr) < 0)
TEST_ERROR
/* All tests passed */
@@ -704,7 +704,7 @@ test_reopen(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
TEST_ERROR
/* Close array, delete array, close file & verify file is empty */
- if(finish(file, f, ea, ea_addr) < 0)
+ if(finish(file, fapl, f, ea, ea_addr) < 0)
TEST_ERROR
/* All tests passed */
@@ -808,7 +808,7 @@ test_open_twice(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
FAIL_STACK_ERROR
/* Close array, delete array, close file & verify file is empty */
- if(finish(file2, f2, ea2, ea_addr) < 0)
+ if(finish(file2, fapl, f2, ea2, ea_addr) < 0)
TEST_ERROR
/* All tests passed */
@@ -923,7 +923,7 @@ test_delete_open(hid_t fapl, H5EA_create_t *cparam, earray_test_param_t *tparam)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename_g)) < 0)
+ if((file_size = h5_get_file_size(filename_g, fapl)) < 0)
TEST_ERROR
/* Verify the file is correct size */
@@ -1099,7 +1099,7 @@ HDfprintf(stderr, "state.nsuper_blks = %Hu\n", state.nsuper_blks);
} /* end for */
/* Close array, delete array, close file & verify file is empty */
- if(finish(file, f, ea, ea_addr) < 0)
+ if(finish(file, fapl, f, ea, ea_addr) < 0)
TEST_ERROR
/* All tests passed */
@@ -1152,8 +1152,7 @@ main(void)
if(NULL == (envval = HDgetenv("HDF5_DRIVER")))
envval = "nomatch";
- if(HDstrcmp(envval, "core") && HDstrcmp(envval, "split") && HDstrcmp(envval, "multi") &&
- HDstrcmp(envval, "family")) {
+ if(HDstrcmp(envval, "split") && HDstrcmp(envval, "multi") && HDstrcmp(envval, "family")) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename_g, sizeof(filename_g));
@@ -1170,7 +1169,7 @@ main(void)
FAIL_STACK_ERROR
/* Get the size of a file w/no array */
- if((empty_size_g = h5_get_file_size(filename_g)) < 0)
+ if((empty_size_g = h5_get_file_size(filename_g, fapl)) < 0)
TEST_ERROR
}
diff --git a/test/fheap.c b/test/fheap.c
index 34c44ff..8c6e6d0 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -666,7 +666,7 @@ open_heap(char *filename, hid_t fapl, hid_t dxpl, const H5HF_create_t *cparam,
FAIL_STACK_ERROR
/* Get the size of a file w/empty heap*/
- if((*empty_size = h5_get_file_size(filename)) < 0)
+ if((*empty_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -751,7 +751,6 @@ error:
* Purpose: Perform common "close" operations on file & heap for testing
*
* Return: Success: 0
- *
* Failure: 1
*
* Programmer: Quincey Koziol
@@ -760,7 +759,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-close_heap(char *filename, hid_t dxpl, fheap_test_param_t *tparam,
+close_heap(char *filename, hid_t fapl, hid_t dxpl, fheap_test_param_t *tparam,
hid_t file, H5F_t *f, H5HF_t **fh, haddr_t fh_addr,
fheap_heap_state_t *state, fheap_heap_ids_t *keep_ids,
h5_stat_size_t empty_size)
@@ -799,7 +798,7 @@ close_heap(char *filename, hid_t dxpl, fheap_test_param_t *tparam,
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is correct size */
@@ -1833,7 +1832,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam
FAIL_STACK_ERROR
/* Get the size of a file w/empty heap*/
- if((empty_size = h5_get_file_size(filename)) < 0)
+ if((empty_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -1885,7 +1884,7 @@ test_create(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is correct size */
@@ -1946,7 +1945,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam
FAIL_STACK_ERROR
/* Get the size of a file w/empty heap*/
- if((empty_size = h5_get_file_size(filename)) < 0)
+ if((empty_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -2022,7 +2021,7 @@ test_reopen(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tparam
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is correct size */
@@ -2086,7 +2085,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tp
FAIL_STACK_ERROR
/* Get the size of a file w/empty heap*/
- if((empty_size = h5_get_file_size(filename)) < 0)
+ if((empty_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -2182,7 +2181,7 @@ test_open_twice(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *tp
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is correct size */
@@ -2248,7 +2247,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *t
FAIL_STACK_ERROR
/* Get the size of a file w/no heap*/
- if((empty_size = h5_get_file_size(filename)) < 0)
+ if((empty_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -2346,7 +2345,7 @@ test_delete_open(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t UNUSED *t
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is correct size */
@@ -6272,7 +6271,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
FAIL_STACK_ERROR
/* Get the size of a file w/empty heap*/
- if((empty_size = h5_get_file_size(filename)) < 0)
+ if((empty_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -6337,7 +6336,7 @@ test_man_remove_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
TEST_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is correct size */
@@ -6428,7 +6427,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
FAIL_STACK_ERROR
/* Get the size of a file w/empty heap*/
- if((empty_size = h5_get_file_size(filename)) < 0)
+ if((empty_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -6521,7 +6520,7 @@ test_man_remove_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpara
TEST_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is correct size */
@@ -6613,7 +6612,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
FAIL_STACK_ERROR
/* Get the size of a file w/empty heap*/
- if((empty_size = h5_get_file_size(filename)) < 0)
+ if((empty_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -6681,7 +6680,7 @@ test_man_remove_one_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is correct size */
@@ -6774,7 +6773,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
FAIL_STACK_ERROR
/* Get the size of a file w/empty heap*/
- if((empty_size = h5_get_file_size(filename)) < 0)
+ if((empty_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -6912,7 +6911,7 @@ test_man_remove_two_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
TEST_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is correct size */
@@ -7010,7 +7009,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
FAIL_STACK_ERROR
/* Get the size of a file w/empty heap*/
- if((empty_size = h5_get_file_size(filename)) < 0)
+ if((empty_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -7207,7 +7206,7 @@ test_man_remove_three_larger(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
TEST_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is correct size */
@@ -7283,7 +7282,7 @@ test_man_remove_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -7372,7 +7371,7 @@ test_man_remove_two_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -7443,7 +7442,7 @@ test_man_remove_first_row(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -7516,7 +7515,7 @@ test_man_remove_first_two_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_par
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -7593,7 +7592,7 @@ test_man_remove_first_four_rows(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -7664,7 +7663,7 @@ test_man_remove_all_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -7739,7 +7738,7 @@ test_man_remove_2nd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -7818,7 +7817,7 @@ test_man_remove_3rd_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_param
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -7900,7 +7899,7 @@ test_man_skip_start_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -7998,7 +7997,7 @@ test_man_skip_start_block_add_back(hid_t fapl, H5HF_create_t *cparam, fheap_test
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -8108,7 +8107,7 @@ test_man_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_t
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -8202,7 +8201,7 @@ test_man_skip_2nd_block(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *t
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -8345,7 +8344,7 @@ test_man_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_tes
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -8512,7 +8511,7 @@ test_man_fill_one_partial_skip_2nd_block_add_skipped(hid_t fapl, H5HF_create_t *
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -8642,7 +8641,7 @@ test_man_fill_row_skip_add_skipped(hid_t fapl, H5HF_create_t *cparam, fheap_test
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -8770,7 +8769,7 @@ test_man_skip_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -8893,7 +8892,7 @@ test_man_fill_direct_skip_indirect_start_block_add_skipped(hid_t fapl, H5HF_crea
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -9021,7 +9020,7 @@ test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H5HF_
TEST_ERROR
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -9164,7 +9163,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -9339,7 +9338,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -9491,7 +9490,7 @@ test_man_fill_direct_skip_indirect_two_rows_add_skipped(hid_t fapl, H5HF_create_
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -9672,7 +9671,7 @@ test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(hid_t
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -9799,7 +9798,7 @@ test_man_fill_2nd_direct_skip_start_block_add_skipped(hid_t fapl, H5HF_create_t
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -9938,7 +9937,7 @@ test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(hid_t fapl, H
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -10089,7 +10088,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -10251,7 +10250,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -10413,7 +10412,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -10582,7 +10581,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -10742,7 +10741,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -10920,7 +10919,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -11133,7 +11132,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -11330,7 +11329,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -11563,7 +11562,7 @@ HDfprintf(stderr, "obj_size = %Zu\n", obj_size);
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -11698,7 +11697,7 @@ test_man_frag_simple(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -11868,7 +11867,7 @@ test_man_frag_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -11981,7 +11980,7 @@ HDfprintf(stderr, "num_first_indirect_rows = %u\n", num_first_indirect_rows);
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -12100,7 +12099,7 @@ test_man_frag_3rd_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *
/* Perform common file & heap close operations */
- if(close_heap(filename, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
+ if(close_heap(filename, fapl, dxpl, tparam, file, f, &fh, fh_addr, &state, &keep_ids, empty_size) < 0)
TEST_ERROR
/* Free resources */
@@ -12246,7 +12245,7 @@ test_huge_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
#ifdef QAK
HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
@@ -12477,7 +12476,7 @@ test_huge_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
#ifdef QAK
HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
@@ -12783,7 +12782,7 @@ test_huge_insert_three(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tp
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
#ifdef QAK
HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
@@ -13207,7 +13206,7 @@ test_huge_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
#ifdef QAK
HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
@@ -13424,7 +13423,7 @@ test_filtered_huge(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
#ifdef QAK
HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size, (unsigned long)file_size);
@@ -13578,7 +13577,7 @@ test_tiny_insert_one(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
#ifdef QAK
HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
@@ -13809,7 +13808,7 @@ test_tiny_insert_two(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
#ifdef QAK
HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
@@ -14410,7 +14409,7 @@ test_tiny_insert_mix(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpar
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
#ifdef QAK
HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
@@ -14600,9 +14599,10 @@ test_filtered_man_root_direct(hid_t fapl, H5HF_create_t *cparam, fheap_test_para
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
+/* Needs file free space to be persistent */
#ifdef NOT_YET
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
#ifdef QAK
HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size, (unsigned long)file_size);
@@ -14908,9 +14908,10 @@ test_filtered_man_root_indirect(hid_t fapl, H5HF_create_t *cparam, fheap_test_pa
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
+/* Needs file free space to be persistent */
#ifdef NOT_YET
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
#ifdef QAK
HDfprintf(stderr, "empty_size = %lu, file_size = %lu\n", (unsigned long)empty_size, (unsigned long)file_size);
@@ -15033,7 +15034,7 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed);
total_obj_added = 0;
while(total_obj_added < size_limit) {
/* Choose a random size of object (from 1 up to above standalone block size limit) */
- obj_size = (size_t)((HDrandom() % (tmp_cparam.max_man_size + 255)) + 1);
+ obj_size = (((uint32_t)HDrandom() % (tmp_cparam.max_man_size + 255)) + 1);
obj_loc = (tmp_cparam.max_man_size + 255) - obj_size;
/* Insert object */
@@ -15057,7 +15058,7 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %
/* Choose a position to swap with */
/* (0 is current position) */
- pos = (size_t)(HDrandom() % (keep_ids.num_ids - u));
+ pos = ((size_t)HDrandom() % (keep_ids.num_ids - u));
/* If we chose a different position, swap with it */
if(pos > 0) {
@@ -15106,7 +15107,7 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
#ifdef QAK
HDfprintf(stderr, "file_size = %lu\n", (unsigned long)file_size);
@@ -15249,7 +15250,7 @@ HDfprintf(stderr, "Random # seed was: %lu\n", seed);
size_range = tmp_cparam.max_man_size + 255;
/* Choose a random size of object (from 1 up to stand alone block size) */
- obj_size = (size_t)((HDrandom() % (size_range - 1)) + 1);
+ obj_size = (((unsigned)HDrandom() % (size_range - 1)) + 1);
obj_loc = (tmp_cparam.max_man_size + 255) - obj_size;
/* Insert object */
@@ -15273,7 +15274,7 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %
/* Choose a position to swap with */
/* (0 is current position) */
- pos = (size_t)(HDrandom() % (keep_ids.num_ids - u));
+ pos = ((size_t)HDrandom() % (keep_ids.num_ids - u));
/* If we chose a different position, swap with it */
if(pos > 0) {
@@ -15322,7 +15323,7 @@ HDfprintf(stderr, "keep_ids.num_ids = %Zu, total_obj_added = %Hu, size_limit = %
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
#ifdef QAK
HDfprintf(stderr, "empty_size = %lu\n", (unsigned long)empty_size);
diff --git a/test/freespace.c b/test/freespace.c
index c786ebb..5b24fee 100644
--- a/test/freespace.c
+++ b/test/freespace.c
@@ -25,7 +25,6 @@
/* Other private headers that this test requires */
#define H5F_PACKAGE
#include "H5Fpkg.h"
-#include "H5FLprivate.h"
#include "H5Iprivate.h"
#include "H5Vprivate.h"
@@ -84,8 +83,6 @@ typedef struct TEST_free_section_t {
H5FS_section_info_t sect_info; /* Free space section information (must be first in struct) */
} TEST_free_section_t;
-H5FL_DEFINE(TEST_free_section_t);
-
static herr_t TEST_sect_init_cls(H5FS_section_class_t *, void *);
static herr_t TEST_sect_free(H5FS_section_info_t *_sect);
@@ -191,14 +188,6 @@ static herr_t TEST_sects_cb(const H5FS_section_info_t *_sect, void *_udata);
/*
* Tests
*/
-static int test_fs_create(hid_t);
-static int test_fs_sect_add(hid_t);
-static int test_fs_sect_merge(hid_t);
-static int test_fs_sect_shrink(hid_t);
-static int test_fs_sect_find(hid_t);
-static int test_fs_sect_change_class(hid_t);
-static int test_fs_sect_extend(hid_t);
-static int test_fs_sect_iterate(hid_t);
/*
* free-space section routines for client TEST
@@ -279,12 +268,10 @@ error:
* Free the section
*/
static herr_t
-TEST_sect_free(H5FS_section_info_t *_sect)
+TEST_sect_free(H5FS_section_info_t *sect)
{
- TEST_free_section_t *sect = (TEST_free_section_t *)_sect;
-
/* Release the section */
- H5FL_FREE(TEST_free_section_t, sect);
+ HDfree(sect);
return(0);
} /* TEST_sect_free() */
@@ -313,8 +300,8 @@ TEST_sect_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
*can_shrink = TRUE;
else
*can_shrink = FALSE;
- return(*can_shrink);
+ return((htri_t)*can_shrink);
} /* TEST_sect_can_shrink() */
/*
@@ -448,7 +435,7 @@ error:
/*
* To verify the creation, close, reopen and deletion of the free-space manager
*/
-static int
+static unsigned
test_fs_create(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -476,7 +463,7 @@ test_fs_create(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of a file w/empty heap*/
- if((empty_size = h5_get_file_size(filename)) < 0)
+ if((empty_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -484,7 +471,7 @@ test_fs_create(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* initialize creation parameters for free-space manager */
@@ -540,7 +527,7 @@ test_fs_create(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -585,7 +572,7 @@ error:
* Result: H5FS_sect_add() will not shrink section A
*
*/
-static int
+static unsigned
test_fs_sect_add(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -615,7 +602,7 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of a file w/empty heap*/
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -623,27 +610,27 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
nclasses = NELMTS(test_classes);
if(NULL == (frsp = H5FS_create(f, H5P_DATASET_XFER_DEFAULT, &fs_addr,
- &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
- FAIL_STACK_ERROR
+ &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
+ FAIL_STACK_ERROR
if(!H5F_addr_defined(fs_addr))
TEST_ERROR
- if(NULL == (sect_node = H5FL_MALLOC(TEST_free_section_t)))
- FAIL_STACK_ERROR
+ if(NULL == (sect_node = HDmalloc(sizeof(TEST_free_section_t))))
+ FAIL_STACK_ERROR
init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node,
- H5FS_ADD_RETURNED_SPACE, NULL))
- FAIL_STACK_ERROR
+ H5FS_ADD_RETURNED_SPACE, NULL))
+ FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
state.tot_space += sect_node->sect_info.size;
@@ -657,7 +644,7 @@ test_fs_sect_add(hid_t fapl)
/* Close the free space manager */
if(H5FS_close(f, H5P_DATASET_XFER_DEFAULT, frsp) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
frsp = NULL;
/* Close the file */
@@ -665,7 +652,7 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of a file w/empty heap*/
- if((tmp_file_size = h5_get_file_size(filename)) < 0)
+ if((tmp_file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
if (tmp_file_size <= (file_size+fr_meta_size))
@@ -676,7 +663,7 @@ test_fs_sect_add(hid_t fapl)
TESTING("adding a section via H5FS_sect_add() to free-space with H5FS_CLS_GHOST_OBJ: test 2");
/* Get the size of a file w/empty heap*/
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -684,7 +671,7 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -692,21 +679,21 @@ test_fs_sect_add(hid_t fapl)
init_flags = H5FS_CLS_GHOST_OBJ;
if(NULL == (frsp = H5FS_create(f, H5P_DATASET_XFER_DEFAULT, &fs_addr,
- &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
- FAIL_STACK_ERROR
+ &cparam, nclasses, test_classes, &init_flags, (hsize_t)FSPACE_THRHD_DEF, (hsize_t)FSPACE_ALIGN_DEF)))
+ FAIL_STACK_ERROR
if(!H5F_addr_defined(fs_addr))
TEST_ERROR
/* Create free list section node */
- if(NULL == (sect_node = H5FL_MALLOC(TEST_free_section_t)))
- FAIL_STACK_ERROR
+ if(NULL == (sect_node = HDmalloc(sizeof(TEST_free_section_t))))
+ FAIL_STACK_ERROR
init_sect_node(sect_node, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node,
- 0, NULL))
- FAIL_STACK_ERROR
+ 0, NULL))
+ FAIL_STACK_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
state.tot_space += sect_node->sect_info.size;
@@ -720,14 +707,14 @@ test_fs_sect_add(hid_t fapl)
/* Close the free space manager */
if(H5FS_close(f, H5P_DATASET_XFER_DEFAULT, frsp) < 0)
- FAIL_STACK_ERROR
+ FAIL_STACK_ERROR
/* Close the file */
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
/* Get the size of a file w/empty heap*/
- if((tmp_file_size = h5_get_file_size(filename)) < 0)
+ if((tmp_file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
if (tmp_file_size != (file_size+fr_meta_size))
@@ -746,7 +733,7 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of a file w/empty heap*/
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -754,7 +741,7 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */
@@ -770,7 +757,7 @@ test_fs_sect_add(hid_t fapl)
if(!H5F_addr_defined(fs_addr))
TEST_ERROR
- if(NULL == (sect_node = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
/*
@@ -815,7 +802,7 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of a file w/empty heap*/
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -823,7 +810,7 @@ test_fs_sect_add(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
TEST_set_eoa((haddr_t)TEST_SECT_ADDR150); /* set end of file address for shrinking */
@@ -839,7 +826,7 @@ test_fs_sect_add(hid_t fapl)
if(!H5F_addr_defined(fs_addr))
TEST_ERROR
- if(NULL == (sect_node = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
/*
@@ -910,7 +897,7 @@ error:
* Set up: Add section A whose size is less than requested-size
*
*/
-static int
+static unsigned
test_fs_sect_find(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -937,7 +924,7 @@ test_fs_sect_find(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -986,7 +973,7 @@ test_fs_sect_find(hid_t fapl)
/*
* Add section A
*/
- if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1007,7 +994,7 @@ test_fs_sect_find(hid_t fapl)
/*
* Add section C
*/
- if(NULL == (sect_node3 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node3 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node3, (haddr_t)(TEST_SECT_ADDR200), (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1026,7 +1013,7 @@ test_fs_sect_find(hid_t fapl)
/*
* Add section B
*/
- if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1045,7 +1032,7 @@ test_fs_sect_find(hid_t fapl)
/*
* Add section D
*/
- if(NULL == (sect_node4 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node4 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR300, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1103,7 +1090,7 @@ test_fs_sect_find(hid_t fapl)
/*
* Add section A
*/
- if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1123,7 +1110,7 @@ test_fs_sect_find(hid_t fapl)
/*
* Add section B
*/
- if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1176,7 +1163,7 @@ test_fs_sect_find(hid_t fapl)
/*
* Add section A
*/
- if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1263,7 +1250,7 @@ error:
* section A cannot be merged with the merged section of B & C because of different section class type
* section D cannot be merged with the merged section of B & C because of different section class type
*/
-static int
+static unsigned
test_fs_sect_merge(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -1293,7 +1280,7 @@ test_fs_sect_merge(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -1309,7 +1296,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section C
*/
- if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1329,7 +1316,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section B
*/
- if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1347,7 +1334,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section A
*/
- if(NULL == (sect_node3 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node3 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1365,7 +1352,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section D
*/
- if(NULL == (sect_node4 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node4 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1420,7 +1407,7 @@ test_fs_sect_merge(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -1437,7 +1424,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section A
*/
- if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1457,7 +1444,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section B
*/
- if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1514,7 +1501,7 @@ test_fs_sect_merge(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -1531,7 +1518,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section A
*/
- if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE10, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1551,7 +1538,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section B
*/
- if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE);
@@ -1571,7 +1558,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section C
*/
- if(NULL == (sect_node3 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node3 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE);
@@ -1589,7 +1576,7 @@ test_fs_sect_merge(hid_t fapl)
/*
* Add section D
*/
- if(NULL == (sect_node4 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node4 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node4, (haddr_t)TEST_SECT_ADDR150, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1717,7 +1704,7 @@ error:
* Section B is merged with section A and then shrunk.
* Result: free-space should be empty
*/
-static int
+static unsigned
test_fs_sect_shrink(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -1745,7 +1732,7 @@ test_fs_sect_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -1763,7 +1750,7 @@ test_fs_sect_shrink(hid_t fapl)
/*
* Add section A that allow shrinking but its section class type does not define "can_shrink"
*/
- if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NEW, H5FS_SECT_LIVE);
@@ -1797,7 +1784,7 @@ test_fs_sect_shrink(hid_t fapl)
/*
* Re-add section A that allow shrinking and its section class type defines "can_shrink"
*/
- if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1844,7 +1831,7 @@ test_fs_sect_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -1864,7 +1851,7 @@ test_fs_sect_shrink(hid_t fapl)
/*
* Add section A
*/
- if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR80, (hsize_t)TEST_SECT_SIZE20, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1884,7 +1871,7 @@ test_fs_sect_shrink(hid_t fapl)
/*
* Add section B
*/
- if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1944,7 +1931,7 @@ test_fs_sect_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -1963,7 +1950,7 @@ test_fs_sect_shrink(hid_t fapl)
/*
* Add section A
*/
- if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -1983,7 +1970,7 @@ test_fs_sect_shrink(hid_t fapl)
/*
* Add section B
*/
- if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -2055,7 +2042,7 @@ error:
* Change section class of B and C to A's section class
* Result: the merge list should be null and the class of sections B & C should be changed
*/
-static int
+static unsigned
test_fs_sect_change_class(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -2082,7 +2069,7 @@ test_fs_sect_change_class(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -2099,7 +2086,7 @@ test_fs_sect_change_class(hid_t fapl)
/*
* Add section A
*/
- if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR60, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -2119,7 +2106,7 @@ test_fs_sect_change_class(hid_t fapl)
/*
* Add section B
*/
- if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE);
@@ -2183,7 +2170,7 @@ test_fs_sect_change_class(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -2200,7 +2187,7 @@ test_fs_sect_change_class(hid_t fapl)
/*
* Add section A
*/
- if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE30, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -2212,7 +2199,7 @@ test_fs_sect_change_class(hid_t fapl)
/*
* Add section B
*/
- if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE50, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE);
@@ -2224,7 +2211,7 @@ test_fs_sect_change_class(hid_t fapl)
/*
* Add section C
*/
- if(NULL == (sect_node3 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node3 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node3, (haddr_t)TEST_SECT_ADDR200, (hsize_t)TEST_SECT_SIZE80, TEST_FSPACE_SECT_TYPE_NONE, H5FS_SECT_LIVE);
@@ -2332,7 +2319,7 @@ error:
* even though the requested-size is equal to section B's size
*
*/
-static int
+static unsigned
test_fs_sect_extend(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -2356,7 +2343,7 @@ test_fs_sect_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/*
@@ -2375,7 +2362,7 @@ test_fs_sect_extend(hid_t fapl)
/*
* Add section A
*/
- if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -2395,7 +2382,7 @@ test_fs_sect_extend(hid_t fapl)
/*
* Add section B
*/
- if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -2449,7 +2436,7 @@ test_fs_sect_extend(hid_t fapl)
/*
* Add section A
*/
- if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -2469,7 +2456,7 @@ test_fs_sect_extend(hid_t fapl)
/*
* Add section B
*/
- if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -2520,7 +2507,7 @@ test_fs_sect_extend(hid_t fapl)
/*
* Add section A
*/
- if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -2540,7 +2527,7 @@ test_fs_sect_extend(hid_t fapl)
/*
* Add section B
*/
- if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -2592,7 +2579,7 @@ test_fs_sect_extend(hid_t fapl)
/*
* Add section A
*/
- if(NULL == (sect_node1 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node1 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node1, (haddr_t)TEST_SECT_ADDR70, (hsize_t)TEST_SECT_SIZE5, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -2612,7 +2599,7 @@ test_fs_sect_extend(hid_t fapl)
/*
* Add section B
*/
- if(NULL == (sect_node2 = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node2 = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
init_sect_node(sect_node2, (haddr_t)TEST_SECT_ADDR100, (hsize_t)TEST_SECT_SIZE40, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
@@ -2672,7 +2659,7 @@ error:
* Iterate through all sections and collect size and count for all sections
* Check info with H5FS_sect_stat()
*/
-static int
+static unsigned
test_fs_sect_iterate(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -2699,7 +2686,7 @@ test_fs_sect_iterate(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
init_cparam(&cparam);
@@ -2716,10 +2703,10 @@ test_fs_sect_iterate(hid_t fapl)
TEST_ERROR
for (i = 1; i <= NUM_SECTIONS; i++) {
- if(NULL == (sect_node = H5FL_MALLOC(TEST_free_section_t)))
+ if(NULL == (sect_node = HDmalloc(sizeof(TEST_free_section_t))))
FAIL_STACK_ERROR
- sect_size = ((i-1) % 9) + 1;
+ sect_size = (unsigned)((i-1) % 9) + 1;
init_sect_node(sect_node, (haddr_t)i*10, (hsize_t)sect_size, TEST_FSPACE_SECT_TYPE, H5FS_SECT_LIVE);
if(H5FS_sect_add(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node,
@@ -2768,9 +2755,14 @@ error:
int
main(void)
{
-
hid_t fapl = -1; /* File access property list for data files */
unsigned nerrors = 0; /* Cumulative error count */
+ const char *env_h5_drvr = NULL; /* File Driver value from environment */
+
+ /* Get the VFD to use */
+ env_h5_drvr = HDgetenv("HDF5_DRIVER");
+ if(env_h5_drvr == NULL)
+ env_h5_drvr = "nomatch";
fapl = h5_fileaccess();
diff --git a/test/h5test.c b/test/h5test.c
index 98508ff..03fa3b7 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -541,7 +541,7 @@ h5_fileaccess(void)
if (H5Pset_fapl_stdio(fapl)<0) return -1;
} else if (!HDstrcmp(name, "core")) {
/* In-core temporary file with 1MB increment */
- if (H5Pset_fapl_core(fapl, (size_t)1024*1024, TRUE)<0) return -1;
+ if (H5Pset_fapl_core(fapl, (size_t)1, TRUE)<0) return -1;
} else if (!HDstrcmp(name, "split")) {
/* Split meta data and raw data each using default driver */
if (H5Pset_fapl_split(fapl,
@@ -562,13 +562,13 @@ h5_fileaccess(void)
HDmemset(memb_name, 0, sizeof memb_name);
HDmemset(memb_addr, 0, sizeof memb_addr);
- assert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES);
- for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
+ HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES);
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) {
memb_fapl[mt] = H5P_DEFAULT;
sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
memb_name[mt] = sv[mt];
- memb_addr[mt] = MAX(mt-1,0)*(HADDR_MAX/10);
- }
+ memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10);
+ } /* end for */
if (H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name,
memb_addr, FALSE)<0) {
@@ -847,20 +847,92 @@ h5_dump_info_object(MPI_Info info)
* Programmer: Quincey Koziol
* Saturday, March 22, 2003
*
- * Modifications:
- * Albert Cheng, Oct 11, 2006
- * Changed Failure return value to -1.
- *
*-------------------------------------------------------------------------
*/
h5_stat_size_t
-h5_get_file_size(const char *filename)
+h5_get_file_size(const char *filename, hid_t fapl)
{
- h5_stat_t sb;
+ char temp[2048]; /* Temporary buffer for file names */
+ h5_stat_t sb; /* Structure for querying file info */
+
+ if(fapl == H5P_DEFAULT) {
+ /* Get the file's statistics */
+ if(0 == HDstat(filename, &sb))
+ return((h5_stat_size_t)sb.st_size);
+ } /* end if */
+ else {
+ hid_t driver; /* VFD used for file */
- /* Get the file's statistics */
- if (HDstat(filename, &sb)==0)
- return((h5_stat_size_t)sb.st_size);
+ /* Get the driver used when creating the file */
+ if((driver = H5Pget_driver(fapl)) < 0)
+ return(-1);
+
+ /* Check for simple cases */
+ if(driver == H5FD_SEC2 || driver == H5FD_STDIO || driver == H5FD_CORE ||
+#ifdef H5_HAVE_PARALLEL
+ driver == H5FD_MPIO || driver == H5FD_MPIPOSIX ||
+#endif /* H5_HAVE_PARALLEL */
+#ifdef H5_HAVE_WINDOWS
+ driver == H5FD_WINDOWS ||
+#endif /* H5_HAVE_WINDOWS */
+#ifdef H5_HAVE_DIRECT
+ driver == H5FD_DIRECT ||
+#endif /* H5_HAVE_DIRECT */
+ driver == H5FD_LOG) {
+ /* Get the file's statistics */
+ if(0 == HDstat(filename, &sb))
+ return((h5_stat_size_t)sb.st_size);
+ } /* end if */
+ else if(driver == H5FD_MULTI) {
+ H5FD_mem_t mt;
+ h5_stat_size_t tot_size = 0;
+
+ HDassert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES);
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) {
+ /* Create the filename to query */
+ HDsnprintf(temp, sizeof temp, "%s-%c.h5", filename, multi_letters[mt]);
+
+ /* Check for existence of file */
+ if(0 == HDaccess(temp, F_OK)) {
+ /* Get the file's statistics */
+ if(0 != HDstat(temp, &sb))
+ return(-1);
+
+ /* Add to total size */
+ tot_size += (h5_stat_size_t)sb.st_size;
+ } /* end if */
+ } /* end for */
+
+ /* Return total size */
+ return(tot_size);
+ } /* end if */
+ else if(driver == H5FD_FAMILY) {
+ h5_stat_size_t tot_size = 0;
+
+ /* Try all filenames possible, until we find one that's missing */
+ for(int j = 0; /*void*/; j++) {
+ /* Create the filename to query */
+ HDsnprintf(temp, sizeof temp, filename, j);
+
+ /* Check for existence of file */
+ if(HDaccess(temp, F_OK) < 0)
+ break;
+
+ /* Get the file's statistics */
+ if(0 != HDstat(temp, &sb))
+ return(-1);
+
+ /* Add to total size */
+ tot_size += (h5_stat_size_t)sb.st_size;
+ } /* end for */
+
+ /* Return total size */
+ return(tot_size);
+ } /* end if */
+ else {
+ HDassert(0 && "Unknown VFD!");
+ } /* end else */
+ } /* end else */
return(-1);
} /* end get_file_size() */
diff --git a/test/h5test.h b/test/h5test.h
index 04c664e..dd3bb32 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -149,7 +149,7 @@ H5TEST_DLL void h5_no_hwconv(void);
H5TEST_DLL const char *h5_rmprefix(const char *filename);
H5TEST_DLL void h5_reset(void);
H5TEST_DLL void h5_show_hostname(void);
-H5TEST_DLL h5_stat_size_t h5_get_file_size(const char *filename);
+H5TEST_DLL h5_stat_size_t h5_get_file_size(const char *filename, hid_t fapl);
H5TEST_DLL int print_func(const char *format, ...);
/* Routines for operating on the list of tests (for the "all in one" tests) */
diff --git a/test/links.c b/test/links.c
index 03e77f2..268dc2a 100644
--- a/test/links.c
+++ b/test/links.c
@@ -696,7 +696,7 @@ long_links(hid_t fapl, hbool_t new_format)
if((gid = H5Gcreate2(fid, "grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Construct very long file name */
- if((objname = HDmalloc((size_t)(MAX_NAME_LEN + 1))) == NULL) TEST_ERROR
+ if((objname = (char *)HDmalloc((size_t)(MAX_NAME_LEN + 1))) == NULL) TEST_ERROR
for(u = 0; u < MAX_NAME_LEN; u++)
objname[u] = 'a';
objname[MAX_NAME_LEN] = '\0';
@@ -3699,7 +3699,8 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
hid_t core_fapl, space, dset, did, dapl_id, dcpl;
hsize_t dims[2];
int points[NUM1000][NUM1000];
- int filesize, new_filesize, i, j, n;
+ h5_stat_size_t filesize, new_filesize;
+ int i, j, n;
if(new_format)
TESTING("H5Pset/get_elink_fapl() with same physical layout (w/new group format)")
@@ -3753,7 +3754,7 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
if(H5Fclose(fid) < 0) TEST_ERROR
/* get size of target file */
- filesize = h5_get_file_size(filename2);
+ filesize = h5_get_file_size(filename2, core_fapl);
/* Create the main file */
if((fid=H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -3788,16 +3789,17 @@ external_set_elink_fapl2(hid_t fapl, hbool_t new_format)
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
TEST_ERROR
- if(H5Pclose(core_fapl) < 0) TEST_ERROR
if(H5Pclose(dapl_id) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
if(H5Fclose(fid) < 0) TEST_ERROR
- new_filesize = h5_get_file_size(filename2);
+ new_filesize = h5_get_file_size(filename2, core_fapl);
/* the file size should remain the same since there is no backing store */
if (new_filesize != filesize) TEST_ERROR
+ if(H5Pclose(core_fapl) < 0) TEST_ERROR
+
PASSED();
return 0;
@@ -3923,7 +3925,6 @@ external_set_elink_fapl3(hbool_t new_format)
H5Pclose(stdio_fapl);
} H5E_END_TRY;
return -1;
- return -1;
} /* end external_set_elink_fapl3() */
@@ -5874,7 +5875,7 @@ ud_hard_links(hid_t fapl)
/* Get the size of the empty file for reference */
if(H5Fclose(fid) < 0) TEST_ERROR
- if((empty_size = h5_get_file_size(filename))<0) TEST_ERROR
+ if((empty_size = h5_get_file_size(filename, fapl))<0) TEST_ERROR
if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -5904,7 +5905,7 @@ ud_hard_links(hid_t fapl)
/* Close and re-open file to ensure that data is written to disk */
if(H5Fclose(fid) < 0) TEST_ERROR
- if((fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR
/* Open group through UD link */
if((gid = H5Gopen2(fid, "ud_link", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
@@ -5959,7 +5960,7 @@ ud_hard_links(hid_t fapl)
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
/* The file should be empty again. */
- if(empty_size != h5_get_file_size(filename)) TEST_ERROR
+ if(empty_size != h5_get_file_size(filename, fapl)) TEST_ERROR
if(H5Lunregister(UD_HARD_TYPE) < 0) FAIL_STACK_ERROR
@@ -6041,7 +6042,7 @@ ud_link_reregister(hid_t fapl)
/* Get the size of the empty file for reference */
if(H5Fclose(fid) < 0) TEST_ERROR
- if((empty_size=h5_get_file_size(filename))<0) TEST_ERROR
+ if((empty_size=h5_get_file_size(filename, fapl))<0) TEST_ERROR
if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR
@@ -6144,7 +6145,7 @@ ud_link_reregister(hid_t fapl)
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
/* The file should be empty again. */
- if(empty_size != h5_get_file_size(filename)) TEST_ERROR
+ if(empty_size != h5_get_file_size(filename, fapl)) TEST_ERROR
if(H5Lunregister(UD_HARD_TYPE) < 0) FAIL_STACK_ERROR
if(H5Lis_registered(UD_HARD_TYPE) != FALSE) FAIL_STACK_ERROR
@@ -6187,8 +6188,8 @@ UD_cb_create(const char * link_name, hid_t loc_group, const void *udata,
if(udata_size > 0 && !udata) TEST_ERROR
if(lcpl_id < 0) TEST_ERROR
- if(strcmp(link_name, UD_CB_LINK_NAME) && strcmp(link_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR
- if(strcmp(udata, UD_CB_TARGET)) TEST_ERROR
+ if(HDstrcmp(link_name, UD_CB_LINK_NAME) && strcmp(link_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR
+ if(HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR
if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR
return 0;
@@ -6208,8 +6209,8 @@ UD_cb_traverse(const char * link_name, hid_t cur_group, const void *udata,
if(cur_group < 0) TEST_ERROR
if(udata_size > 0 && !udata) TEST_ERROR
- if(strcmp(link_name, UD_CB_LINK_NAME) && strcmp(link_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR
- if(strcmp(udata, UD_CB_TARGET)) TEST_ERROR
+ if(HDstrcmp(link_name, UD_CB_LINK_NAME) && strcmp(link_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR
+ if(HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR
if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR
if((ret_value = H5Oopen(cur_group, target, lapl_id)) < 0)
@@ -6231,7 +6232,7 @@ UD_cb_move(const char *new_name, hid_t new_loc, const void *udata,
if(udata_size > 0 && !udata) TEST_ERROR
if(HDstrcmp(new_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR
- if(HDstrcmp(udata, UD_CB_TARGET)) TEST_ERROR
+ if(HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR
if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR
return 0;
@@ -6250,7 +6251,7 @@ UD_cb_delete(const char *link_name, hid_t file, const void *udata,
if(udata_size > 0 && !udata) TEST_ERROR
if(HDstrcmp(link_name, UD_CB_LINK_NAME) && HDstrcmp(link_name, NEW_UD_CB_LINK_NAME)) TEST_ERROR
- if(HDstrcmp(udata, UD_CB_TARGET)) TEST_ERROR
+ if(HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR
if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR
return 0;
@@ -6267,13 +6268,13 @@ UD_cb_query(const char * link_name, const void *udata, size_t udata_size,
if(!link_name) TEST_ERROR
if(udata_size > 0 && !udata) TEST_ERROR
- if(strcmp(link_name, UD_CB_LINK_NAME)) TEST_ERROR
- if(strcmp(udata, UD_CB_TARGET)) TEST_ERROR
+ if(HDstrcmp(link_name, UD_CB_LINK_NAME)) TEST_ERROR
+ if(HDstrcmp((const char *)udata, UD_CB_TARGET)) TEST_ERROR
if(udata_size != UD_CB_TARGET_LEN) TEST_ERROR
if(buf) {
if(buf_size < 16) TEST_ERROR
- strcpy(buf, "query succeeded");
+ HDstrcpy((char *)buf, "query succeeded");
} /* end if */
/* There are 15 characters and a NULL in "query succeeded" */
@@ -6673,7 +6674,7 @@ UD_cbsucc_query(const char UNUSED *link_name, const void UNUSED *udata,
*/
if(buf != NULL && buf_size >= 8)
- strcpy(buf, "succeed");
+ HDstrcpy((char *)buf, "succeed");
return 8;
} /* end UD_cbsucc_query() */
@@ -8144,7 +8145,7 @@ corder_transition(hid_t fapl)
if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR
/* Get the size of the file with an empty group */
- if((empty_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Re-open the file */
@@ -8293,7 +8294,7 @@ corder_transition(hid_t fapl)
if(H5Fclose(file_id) < 0) TEST_ERROR
/* Get the size of the file now */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
if(file_size != empty_size) TEST_ERROR
PASSED();
@@ -8354,7 +8355,7 @@ corder_delete(hid_t fapl)
if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR
/* Get the size of an empty file */
- if((empty_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Re-open the file */
if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
@@ -8419,7 +8420,7 @@ corder_delete(hid_t fapl)
} /* end if */
/* Get the size of the file now */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
if(file_size != empty_size) TEST_ERROR
} /* end for */
diff --git a/test/mf.c b/test/mf.c
index 5106ec8..baa7c1d 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -37,10 +37,8 @@
#include "H5Vprivate.h"
#define FILENAME_LEN 1024
-#define TEST_FSPACE_CLIENT_ID 2
#define TEST_BLOCK_SIZE5 5
-#define TEST_BLOCK_SIZE10 10
#define TEST_BLOCK_SIZE20 20
#define TEST_BLOCK_SIZE30 30
#define TEST_BLOCK_SIZE40 40
@@ -54,7 +52,6 @@
#define TEST_BLOCK_SIZE2058 2058
#define TEST_BLOCK_SIZE8000 8000
#define TEST_BLOCK_SIZE2048 2048
-#define TEST_BLOCK_SIZE1024 1024
#define TEST_BLOCK_ADDR70 70
#define TEST_BLOCK_ADDR100 100
@@ -133,7 +130,7 @@ error:
*
* Allocate two blocks which should be from file allocation
*/
-static int
+static unsigned
test_mf_eoa(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -162,7 +159,7 @@ test_mf_eoa(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Turn off using meta/small data aggregator */
@@ -174,7 +171,7 @@ test_mf_eoa(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -204,7 +201,7 @@ test_mf_eoa(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -216,7 +213,7 @@ test_mf_eoa(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30);
@@ -226,7 +223,7 @@ test_mf_eoa(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -261,7 +258,7 @@ error:
* H5MF_try_shrink() the block by 20 from the end: succeed
*
*/
-static int
+static unsigned
test_mf_eoa_shrink(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -291,7 +288,7 @@ test_mf_eoa_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Turn off using meta/small data aggregator */
@@ -303,7 +300,7 @@ test_mf_eoa_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -323,7 +320,7 @@ test_mf_eoa_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -335,7 +332,7 @@ test_mf_eoa_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -354,7 +351,7 @@ test_mf_eoa_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -370,7 +367,7 @@ test_mf_eoa_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -394,7 +391,7 @@ test_mf_eoa_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -411,7 +408,7 @@ test_mf_eoa_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -430,7 +427,7 @@ test_mf_eoa_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -446,7 +443,7 @@ test_mf_eoa_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -465,7 +462,7 @@ test_mf_eoa_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -496,7 +493,7 @@ error:
* Test 2: Allocate a block of 30
* H5MF_try_extend() the block of size 20 by 50: fail
*/
-static int
+static unsigned
test_mf_eoa_extend(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -526,7 +523,7 @@ test_mf_eoa_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of a file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Turn off using meta/small data aggregator */
@@ -538,7 +535,7 @@ test_mf_eoa_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -557,7 +554,7 @@ test_mf_eoa_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -569,7 +566,7 @@ test_mf_eoa_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* should succeed */
@@ -587,7 +584,7 @@ test_mf_eoa_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -603,11 +600,11 @@ test_mf_eoa_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -638,7 +635,7 @@ test_mf_eoa_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -662,7 +659,7 @@ error:
* Set up:
* Turn off using meta/small data aggregator
*/
-static int
+static unsigned
test_mf_fs_start(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -690,7 +687,7 @@ test_mf_fs_start(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Turn off using meta/small data aggregator */
@@ -702,7 +699,7 @@ test_mf_fs_start(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Start up free-space manager */
@@ -723,7 +720,7 @@ test_mf_fs_start(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -767,7 +764,7 @@ error:
* Deallocate the block which will be returned to free-space manager
* (the space is shrunk and freed since it is at end of file)
*/
-static int
+static unsigned
test_mf_fs_alloc_free(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -799,7 +796,7 @@ test_mf_fs_alloc_free(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of a file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Turn off using meta/small data aggregator */
@@ -811,7 +808,7 @@ test_mf_fs_alloc_free(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
@@ -878,7 +875,7 @@ test_mf_fs_alloc_free(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -894,7 +891,7 @@ test_mf_fs_alloc_free(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
@@ -960,7 +957,7 @@ test_mf_fs_alloc_free(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -976,7 +973,7 @@ test_mf_fs_alloc_free(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
@@ -1051,11 +1048,11 @@ test_mf_fs_alloc_free(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
- if (file_size != file_size)
+ if (new_file_size != file_size)
TEST_ERROR
PASSED()
@@ -1107,7 +1104,7 @@ error:
* Fail: section A does not adjoin section B (70+20 != address of section B) even though
* the requested-size (50) equal to size of section B (50)
*/
-static int
+static unsigned
test_mf_fs_extend(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -1140,7 +1137,7 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of a file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Turn off using meta/small data aggregator */
@@ -1152,7 +1149,7 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
@@ -1251,7 +1248,7 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -1267,7 +1264,7 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
@@ -1361,7 +1358,7 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -1377,7 +1374,7 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
@@ -1471,7 +1468,7 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -1487,7 +1484,7 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
@@ -1590,7 +1587,7 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl_new)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -1632,7 +1629,7 @@ error:
* section size + remaining size of aggregator is > aggr->alloc_size,
* section is allowed to absorb an aggregator (allow_sect_absorb is true)
*/
-static int
+static unsigned
test_mf_fs_absorb(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -1665,7 +1662,7 @@ test_mf_fs_absorb(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
@@ -1725,7 +1722,7 @@ test_mf_fs_absorb(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
@@ -1808,7 +1805,7 @@ error:
* The second block of 50 is allocated from meta_aggr
* There is space of 1968 left in meta_aggr
*/
-static int
+static unsigned
test_mf_aggr_alloc1(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -1834,7 +1831,7 @@ test_mf_aggr_alloc1(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of a file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -1842,7 +1839,7 @@ test_mf_aggr_alloc1(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Allocate first block from meta_aggr */
@@ -1866,7 +1863,7 @@ test_mf_aggr_alloc1(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -1878,7 +1875,7 @@ test_mf_aggr_alloc1(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Free the two blocks */
@@ -1889,7 +1886,7 @@ test_mf_aggr_alloc1(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -1930,7 +1927,7 @@ error:
* The block of 2058 is allocated out of meta_aggr
* There is space of 1968 left in meta_aggr
*/
-static int
+static unsigned
test_mf_aggr_alloc2(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -1956,7 +1953,7 @@ test_mf_aggr_alloc2(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of a file */
- if((file_size= h5_get_file_size(filename)) < 0)
+ if((file_size= h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -1964,7 +1961,7 @@ test_mf_aggr_alloc2(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
@@ -1997,7 +1994,7 @@ test_mf_aggr_alloc2(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -2010,7 +2007,7 @@ test_mf_aggr_alloc2(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE50+TEST_BLOCK_SIZE2058);
@@ -2019,7 +2016,7 @@ test_mf_aggr_alloc2(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -2073,7 +2070,7 @@ error:
* The fourth block of 50 is allocated from what is left in meta_aggr
* There is space of 1968 left in meta_aggr
*/
-static int
+static unsigned
test_mf_aggr_alloc3(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -2101,7 +2098,7 @@ test_mf_aggr_alloc3(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -2109,7 +2106,7 @@ test_mf_aggr_alloc3(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Allocate first block from meta_aggr */
@@ -2168,7 +2165,7 @@ test_mf_aggr_alloc3(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -2227,7 +2224,7 @@ error:
* The block does not adjoin meta_aggr
* meta_aggr's info is unchanged
*/
-static int
+static unsigned
test_mf_aggr_alloc4(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -2253,7 +2250,7 @@ test_mf_aggr_alloc4(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -2261,7 +2258,7 @@ test_mf_aggr_alloc4(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Allocate first block from meta_aggr */
@@ -2324,7 +2321,7 @@ test_mf_aggr_alloc4(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -2364,7 +2361,7 @@ error:
* There is space of 2046 left in meta_aggr
*
*/
-static int
+static unsigned
test_mf_aggr_alloc5(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -2390,7 +2387,7 @@ test_mf_aggr_alloc5(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -2398,7 +2395,7 @@ test_mf_aggr_alloc5(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Allocate first block from meta_aggr */
@@ -2436,7 +2433,7 @@ test_mf_aggr_alloc5(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -2486,7 +2483,7 @@ error:
* meta_aggr's unused space of [880, 1968] is freed to free-space
* meta_aggr is updated to point to the new block
*/
-static int
+static unsigned
test_mf_aggr_alloc6(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -2513,7 +2510,7 @@ test_mf_aggr_alloc6(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -2521,7 +2518,7 @@ test_mf_aggr_alloc6(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Allocate first block from meta_aggr */
@@ -2580,7 +2577,7 @@ test_mf_aggr_alloc6(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -2641,7 +2638,7 @@ error:
* meta_aggr's unused space of [880, 1968] is freed to free-space
* meta_aggr is updated to point to the new block
*/
-static int
+static unsigned
test_mf_aggr_alloc7(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -2668,7 +2665,7 @@ test_mf_aggr_alloc7(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((empty_size = h5_get_file_size(filename)) < 0)
+ if((empty_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -2676,7 +2673,7 @@ test_mf_aggr_alloc7(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Allocate the first block from meta_aggr */
@@ -2753,7 +2750,7 @@ test_mf_aggr_alloc7(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Verify the file is the correct size */
@@ -2788,7 +2785,7 @@ error:
* Try to extend a block which adjoins meta_aggr but meta_aggr cannot fulfill the extended-request
* H5MF_try_extend() fails
*/
-static int
+static unsigned
test_mf_aggr_extend(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -2815,7 +2812,7 @@ test_mf_aggr_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((empty_size = h5_get_file_size(filename)) < 0)
+ if((empty_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -2823,7 +2820,7 @@ test_mf_aggr_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Allocate the first block from meta_aggr */
@@ -2872,7 +2869,7 @@ test_mf_aggr_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Allocate the first block from meta_aggr */
@@ -2927,7 +2924,7 @@ test_mf_aggr_extend(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Allocate first block from meta_aggr */
@@ -3003,7 +3000,7 @@ error:
* H5MF_try_shrink() block B should fail since it does not adjoin the
* beginning nor the end of meta_aggr
*/
-static int
+static unsigned
test_mf_aggr_absorb(hid_t fapl)
{
hid_t file = -1; /* File ID */
@@ -3032,7 +3029,7 @@ test_mf_aggr_absorb(hid_t fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((empty_size = h5_get_file_size(filename)) < 0)
+ if((empty_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -3040,7 +3037,7 @@ test_mf_aggr_absorb(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Allocate block A from meta_aggr */
@@ -3072,7 +3069,7 @@ test_mf_aggr_absorb(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Allocate block A from meta_aggr */
@@ -3116,7 +3113,7 @@ test_mf_aggr_absorb(hid_t fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* Allocate block A from meta_aggr */
@@ -3195,7 +3192,7 @@ error:
* The return address should be aligned
* H5MF_try_extend() the block with aligned address should succeed
*/
-static int
+static unsigned
test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
hid_t file = -1; /* File ID */
@@ -3216,7 +3213,8 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- if(HDstrcmp(env_h5_drvr, "stdio")) {
+ if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
+ HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -3235,7 +3233,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* get alignment setting */
@@ -3247,11 +3245,11 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* calculate fragment for alignment of block 30 */
- if ((tmp = file_size % alignment))
+ if ((tmp = (hsize_t)file_size % alignment))
mis_align = alignment - tmp;
accum = mis_align + TEST_BLOCK_SIZE30;
@@ -3278,7 +3276,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* calculate fragment for alignment of block 50 */
mis_align = 0;
- if ((tmp = (file_size + accum) % alignment))
+ if ((tmp = ((hsize_t)file_size + accum) % alignment))
mis_align = alignment - tmp;
accum += (mis_align + TEST_BLOCK_SIZE50);
@@ -3305,7 +3303,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl1)) < 0)
TEST_ERROR
if (new_file_size != file_size)
@@ -3323,13 +3321,14 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- if(HDstrcmp(env_h5_drvr, "stdio")) {
+ if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
+ HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) {
/* Re-open the file with alignment and meta/sdata setting */
if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl1)) < 0)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* allocate a block of 50 from meta_aggr */
@@ -3343,7 +3342,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl1)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -3358,7 +3357,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl1)) < 0)
TEST_ERROR
if (new_file_size != (file_size-TEST_BLOCK_SIZE50)) TEST_ERROR
@@ -3375,13 +3374,14 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- if(HDstrcmp(env_h5_drvr, "stdio")) {
+ if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
+ HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) {
/* Re-open the file with alignment and meta/sdata setting */
if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl1)) < 0)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* allocate a block of 50 */
@@ -3395,7 +3395,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl1)) < 0)
TEST_ERROR
/* Re-open the file */
@@ -3410,7 +3410,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if(H5Fclose(file) < 0)
FAIL_STACK_ERROR
- if((new_file_size = h5_get_file_size(filename)) < 0)
+ if((new_file_size = h5_get_file_size(filename, fapl1)) < 0)
TEST_ERROR
if (new_file_size != (file_size+TEST_BLOCK_SIZE30)) TEST_ERROR
@@ -3461,7 +3461,7 @@ error:
* The free-space manager is unable to fulfill the request
* The block is allocated from file allocation and should be aligned
*/
-static int
+static unsigned
test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
hid_t file = -1; /* File ID */
@@ -3498,7 +3498,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
@@ -3565,7 +3565,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
@@ -3641,8 +3641,9 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- if(HDstrcmp(env_h5_drvr, "stdio")) {
- if((file_size = h5_get_file_size(filename)) < 0)
+ if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
+ HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) {
+ if((file_size = h5_get_file_size(filename, new_fapl)) < 0)
TEST_ERROR
/* Re-open the file with alignment setting */
@@ -3650,7 +3651,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
@@ -3695,7 +3696,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if (!(addr >= (haddr_t)file_size)) TEST_ERROR
/* calculate fragment for alignment of block 40 from file allocation */
- if ((tmp = file_size % alignment))
+ if ((tmp = (hsize_t)file_size % alignment))
mis_align = alignment - tmp;
if (mis_align) {
@@ -3823,7 +3824,7 @@ error:
* There is space of 2018 left in meta_aggr
* EOA is at 20372
*/
-static int
+static unsigned
test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
hid_t file = -1; /* File ID */
@@ -3844,7 +3845,8 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- if(HDstrcmp(env_h5_drvr, "stdio")) {
+ if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
+ HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -3857,7 +3859,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* get alignment setting */
@@ -3869,11 +3871,11 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* calculate fragment for alignment of block 30 */
- if ((tmp = file_size % alignment))
+ if ((tmp = (hsize_t)file_size % alignment))
mis_align = alignment - tmp;
/* Allocate a block of 30 from meta_aggr */
@@ -4079,7 +4081,7 @@ error:
* There is space of 1968 left in meta_aggr
* EOA is at 18432
*/
-static int
+static unsigned
test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
hid_t file = -1; /* File ID */
@@ -4098,7 +4100,8 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- if(HDstrcmp(env_h5_drvr, "stdio")) {
+ if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
+ HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -4111,7 +4114,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* get alignment setting */
@@ -4123,11 +4126,11 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* calculate fragment for alignment of block 30 */
- if ((tmp = file_size % alignment))
+ if ((tmp = (hsize_t)file_size % alignment))
mis_align = alignment - tmp;
/* Allocate a block of 30 from meta_aggr */
@@ -4403,7 +4406,7 @@ error:
* The block of 1034 is allocated from the new block and should be aligned
* There is space of 1014 left in meta_aggr
*/
-static int
+static unsigned
test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
hid_t file = -1; /* File ID */
@@ -4424,7 +4427,8 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- if(HDstrcmp(env_h5_drvr, "stdio")) {
+ if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
+ HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -4437,7 +4441,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* get alignment setting */
@@ -4449,11 +4453,11 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* calculate fragment for alignment of block 30 */
- if ((tmp = file_size % alignment))
+ if ((tmp = (hsize_t)file_size % alignment))
mis_align = alignment - tmp;
/* Allocate a block of 30 from meta_aggr */
@@ -4697,7 +4701,7 @@ error:
* There is space of 2023 left in meta_aggr
*
*/
-static int
+static unsigned
test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
hid_t file = -1; /* File ID */
@@ -4717,7 +4721,8 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- if(HDstrcmp(env_h5_drvr, "stdio")) {
+ if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
+ HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -4730,7 +4735,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file with alignment setting and meta/sdata setting */
@@ -4738,7 +4743,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* get alignment setting */
@@ -4746,7 +4751,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* calculate fragment for alignment of block 30 */
- if ((tmp = file_size % alignment))
+ if ((tmp = (hsize_t)file_size % alignment))
mis_align = alignment - tmp;
/* Allocate a block of 30 from meta_aggr */
@@ -4900,7 +4905,7 @@ error:
* EOA is 14346
* meta_aggr and sdata_aggr are all 0
*/
-static int
+static unsigned
test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
hid_t file = -1; /* File ID */
@@ -4921,7 +4926,8 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- if(HDstrcmp(env_h5_drvr, "stdio")) {
+ if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
+ HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -4934,7 +4940,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file with alignment setting and meta/sdata setting */
@@ -4942,7 +4948,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* get alignment setting */
@@ -4950,7 +4956,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* calculate fragment for alignment of block 30 */
- if ((tmp = file_size % alignment))
+ if ((tmp = (hsize_t)file_size % alignment))
mis_align = alignment - tmp;
/* Allocate a block of 30 from meta_aggr */
@@ -5167,7 +5173,7 @@ error:
* EOA is at 22538
* meta_aggr is unchanged
*/
-static int
+static unsigned
test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
{
hid_t file = -1; /* File ID */
@@ -5187,7 +5193,8 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* Skip test when using VFDs that have their own 'alloc' callback, which
* don't push mis-aligned space fragments on the file free space list
*/
- if(HDstrcmp(env_h5_drvr, "stdio")) {
+ if(HDstrcmp(env_h5_drvr, "stdio") && HDstrcmp(env_h5_drvr, "split") &&
+ HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) {
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -5200,7 +5207,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0)
+ if((file_size = h5_get_file_size(filename, fapl)) < 0)
TEST_ERROR
/* Re-open the file with alignment setting and meta/sdata setting */
@@ -5208,7 +5215,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
/* Get a pointer to the internal file object */
- if(NULL == (f = H5I_object(file)))
+ if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
/* get alignment setting */
@@ -5216,7 +5223,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* calculate fragment for alignment of block 30 */
- if ((tmp = file_size % alignment))
+ if ((tmp = (hsize_t)file_size % alignment))
mis_align = alignment - tmp;
/* Allocate a block of 30 from meta_aggr */
diff --git a/test/stab.c b/test/stab.c
index 2b9a84d..56a5571 100644
--- a/test/stab.c
+++ b/test/stab.c
@@ -342,7 +342,7 @@ lifecycle(hid_t fapl2)
if(H5Fclose(fid) < 0) TEST_ERROR
/* Get size of file as empty */
- if((empty_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((empty_size = h5_get_file_size(filename, fapl2)) < 0) TEST_ERROR
/* Re-open file */
if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl2)) < 0) TEST_ERROR
@@ -491,7 +491,7 @@ lifecycle(hid_t fapl2)
if(H5Fclose(fid) < 0) TEST_ERROR
/* Get size of file as empty */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl2)) < 0) TEST_ERROR
/* Verify that file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -547,7 +547,7 @@ long_compact(hid_t fapl2)
if(H5Fclose(fid) < 0) TEST_ERROR
/* Get size of file as empty */
- if((empty_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((empty_size = h5_get_file_size(filename, fapl2)) < 0) TEST_ERROR
/* Construct very long object name template */
if((objname = (char *)HDmalloc((size_t)(LONG_COMPACT_LENGTH + 1))) == NULL) TEST_ERROR
@@ -624,7 +624,7 @@ long_compact(hid_t fapl2)
if(H5Fclose(fid) < 0) TEST_ERROR
/* Get size of file as empty */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl2)) < 0) TEST_ERROR
/* Verify that file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -794,7 +794,7 @@ no_compact(hid_t fapl2)
if(H5Fclose(fid) < 0) TEST_ERROR
/* Get size of file as empty */
- if((empty_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((empty_size = h5_get_file_size(filename, fapl2)) < 0) TEST_ERROR
/* Re-open file */
if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl2)) < 0) TEST_ERROR
@@ -851,7 +851,7 @@ no_compact(hid_t fapl2)
if(H5Fclose(fid) < 0) TEST_ERROR
/* Get size of file as empty */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl2)) < 0) TEST_ERROR
/* Verify that file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -1006,7 +1006,7 @@ error:
*-------------------------------------------------------------------------
*/
static int
-old_api(hid_t fapl, const char *driver)
+old_api(hid_t fapl)
{
#ifndef H5_NO_DEPRECATED_SYMBOLS
hid_t fid = (-1); /* File ID */
@@ -1034,11 +1034,8 @@ old_api(hid_t fapl, const char *driver)
/* Close file */
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
- /* Avoid size comparisons if we are using the core VFD */
- if(HDstrcmp(driver, "core")) {
- /* Get the size of the file with a "small" heap for group */
- if((small_file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
- } /* end if */
+ /* Get the size of the file with a "small" heap for group */
+ if((small_file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Create file */
@@ -1059,20 +1056,16 @@ old_api(hid_t fapl, const char *driver)
/* Close file */
if(H5Fclose(fid) < 0) FAIL_STACK_ERROR
- /* Avoid size comparisons if we are using the core VFD */
- if(HDstrcmp(driver, "core")) {
- /* Get the size of the file with a "large" heap for group */
- if((large_file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ /* Get the size of the file with a "large" heap for group */
+ if((large_file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
- /* Check that the file with a "large" group heap is actually bigger */
- if(large_file_size <= small_file_size) TEST_ERROR
- } /* end if */
+ /* Check that the file with a "large" group heap is actually bigger */
+ if(large_file_size <= small_file_size) TEST_ERROR
PASSED();
#else /* H5_NO_DEPRECATED_SYMBOLS */
/* Shut compiler up */
fapl = fapl;
- driver = driver;
SKIPPED();
puts(" Deprecated API symbols not enabled");
@@ -1147,7 +1140,7 @@ main(void)
nerrors += gcpl_on_root(fapl2);
/* Old group API specific tests */
- nerrors += old_api(fapl, envval);
+ nerrors += old_api(fapl);
/* Close 2nd FAPL */
H5Pclose(fapl2);
diff --git a/test/tattr.c b/test/tattr.c
index 162c188..953a50f 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -1631,7 +1631,7 @@ test_attr_dtype_shared(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Get size of file */
- empty_filesize = h5_get_file_size(FILENAME);
+ empty_filesize = h5_get_file_size(FILENAME, fapl);
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
@@ -1770,7 +1770,7 @@ test_attr_dtype_shared(hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Check size of file */
- filesize = h5_get_file_size(FILENAME);
+ filesize = h5_get_file_size(FILENAME, fapl);
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dtype_shared() */
@@ -2125,7 +2125,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Get size of file */
- empty_filesize = h5_get_file_size(FILENAME);
+ empty_filesize = h5_get_file_size(FILENAME, fapl);
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
@@ -2216,7 +2216,7 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Check size of file */
- filesize = h5_get_file_size(FILENAME);
+ filesize = h5_get_file_size(FILENAME, fapl);
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_create() */
@@ -2256,7 +2256,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Get size of file */
- empty_filesize = h5_get_file_size(FILENAME);
+ empty_filesize = h5_get_file_size(FILENAME, fapl);
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
@@ -2355,7 +2355,7 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Check size of file */
- filesize = h5_get_file_size(FILENAME);
+ filesize = h5_get_file_size(FILENAME, fapl);
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_open() */
@@ -2396,7 +2396,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Get size of file */
- empty_filesize = h5_get_file_size(FILENAME);
+ empty_filesize = h5_get_file_size(FILENAME, fapl);
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
@@ -2533,7 +2533,7 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Check size of file */
- filesize = h5_get_file_size(FILENAME);
+ filesize = h5_get_file_size(FILENAME, fapl);
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_delete() */
@@ -2575,7 +2575,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Get size of file */
- empty_filesize = h5_get_file_size(FILENAME);
+ empty_filesize = h5_get_file_size(FILENAME, fapl);
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
@@ -2692,7 +2692,7 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Check size of file */
- filesize = h5_get_file_size(FILENAME);
+ filesize = h5_get_file_size(FILENAME, fapl);
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_rename() */
@@ -2734,7 +2734,7 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Get size of file */
- empty_filesize = h5_get_file_size(FILENAME);
+ empty_filesize = h5_get_file_size(FILENAME, fapl);
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
@@ -2822,7 +2822,7 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Check size of file */
- filesize = h5_get_file_size(FILENAME);
+ filesize = h5_get_file_size(FILENAME, fapl);
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_unlink() */
@@ -2862,7 +2862,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Get size of file */
- empty_filesize = h5_get_file_size(FILENAME);
+ empty_filesize = h5_get_file_size(FILENAME, fapl);
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
@@ -2987,7 +2987,7 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Check size of file */
- filesize = h5_get_file_size(FILENAME);
+ filesize = h5_get_file_size(FILENAME, fapl);
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_dense_limits() */
@@ -3555,7 +3555,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Get size of file */
- empty_filesize = h5_get_file_size(FILENAME);
+ empty_filesize = h5_get_file_size(FILENAME, fapl);
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
@@ -3780,7 +3780,7 @@ test_attr_big(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Check size of file */
- filesize = h5_get_file_size(FILENAME);
+ filesize = h5_get_file_size(FILENAME, fapl);
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_big() */
@@ -3821,7 +3821,7 @@ test_attr_null_space(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Get size of file */
- empty_filesize = h5_get_file_size(FILENAME);
+ empty_filesize = h5_get_file_size(FILENAME, fapl);
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
@@ -3998,7 +3998,7 @@ test_attr_null_space(hid_t fcpl, hid_t fapl)
/* Check size of file */
- filesize = h5_get_file_size(FILENAME);
+ filesize = h5_get_file_size(FILENAME, fapl);
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* test_attr_null_space() */
@@ -8077,7 +8077,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Get size of file */
- empty_filesize = h5_get_file_size(FILENAME);
+ empty_filesize = h5_get_file_size(FILENAME, fapl);
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
@@ -8297,7 +8297,7 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Check size of file */
- filesize = h5_get_file_size(FILENAME);
+ filesize = h5_get_file_size(FILENAME, fapl);
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* end for */
@@ -8403,7 +8403,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Get size of file */
- empty_filesize = h5_get_file_size(FILENAME);
+ empty_filesize = h5_get_file_size(FILENAME, fapl);
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
@@ -8739,7 +8739,7 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Check size of file */
- filesize = h5_get_file_size(FILENAME);
+ filesize = h5_get_file_size(FILENAME, fapl);
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* end for */
@@ -8844,7 +8844,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Get size of file */
- empty_filesize = h5_get_file_size(FILENAME);
+ empty_filesize = h5_get_file_size(FILENAME, fapl);
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
@@ -9103,7 +9103,7 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Check size of file */
- filesize = h5_get_file_size(FILENAME);
+ filesize = h5_get_file_size(FILENAME, fapl);
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* end for */
@@ -9208,7 +9208,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Get size of file */
- empty_filesize = h5_get_file_size(FILENAME);
+ empty_filesize = h5_get_file_size(FILENAME, fapl);
if(empty_filesize < 0)
TestErrPrintf("Line %d: file size wrong!\n", __LINE__);
@@ -9453,7 +9453,7 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Fclose");
/* Check size of file */
- filesize = h5_get_file_size(FILENAME);
+ filesize = h5_get_file_size(FILENAME, fapl);
VERIFY(filesize, empty_filesize, "h5_get_file_size");
} /* end for */
diff --git a/test/tfile.c b/test/tfile.c
index b5f024c..2afade3 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -1212,7 +1212,7 @@ test_file_freespace(void)
CHECK_I(ret, "H5Fclose");
/* Get the "empty" file size */
- empty_filesize = h5_get_file_size(FILE1);
+ empty_filesize = h5_get_file_size(FILE1, H5P_DEFAULT);
/* Re-open the file (with read-write permission) */
file = H5Fopen(FILE1, H5F_ACC_RDWR, H5P_DEFAULT);
@@ -1275,7 +1275,7 @@ test_file_freespace(void)
CHECK(ret, FAIL, "H5Fclose");
/* Get the file size after modifications*/
- mod_filesize = h5_get_file_size(FILE1);
+ mod_filesize = h5_get_file_size(FILE1, H5P_DEFAULT);
/* Check that the file reverted to empty size */
VERIFY(mod_filesize, empty_filesize, "H5Fget_freespace");
diff --git a/test/tsohm.c b/test/tsohm.c
index a586717..94fd128 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -763,7 +763,7 @@ static void test_sohm_size1(void)
CHECK_I(ret, "H5Fclose");
/* Get the file size */
- norm_empty_filesize = h5_get_file_size(FILENAME);
+ norm_empty_filesize = h5_get_file_size(FILENAME, fapl_id);
/* Add a bunch of large datatypes to the file */
file = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl_id);
@@ -779,7 +779,7 @@ static void test_sohm_size1(void)
norm_oh_size = oinfo.hdr.space.total;
/* Get the new file size */
- norm_final_filesize = h5_get_file_size(FILENAME);
+ norm_final_filesize = h5_get_file_size(FILENAME, fapl_id);
/* Use the same property list to create a new file. */
file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id);
@@ -795,7 +795,7 @@ static void test_sohm_size1(void)
CHECK_I(ret, "H5Fclose");
/* Get the file size */
- norm_final_filesize2 = h5_get_file_size(FILENAME);
+ norm_final_filesize2 = h5_get_file_size(FILENAME, fapl_id);
@@ -819,7 +819,7 @@ static void test_sohm_size1(void)
ret = H5Fclose(file);
CHECK_I(ret, "H5Fclose");
- sohm_empty_filesize = h5_get_file_size(FILENAME);
+ sohm_empty_filesize = h5_get_file_size(FILENAME, fapl_id);
/* Add a bunch of datatypes to this file */
file = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl_id);
@@ -835,7 +835,7 @@ static void test_sohm_size1(void)
sohm_oh_size = oinfo.hdr.space.total;
/* Get the new file size */
- sohm_final_filesize = h5_get_file_size(FILENAME);
+ sohm_final_filesize = h5_get_file_size(FILENAME, fapl_id);
/* Use the same property list to create a new file. */
file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id);
@@ -851,7 +851,7 @@ static void test_sohm_size1(void)
CHECK_I(ret, "H5Fclose");
/* Get the file size */
- sohm_final_filesize2 = h5_get_file_size(FILENAME);
+ sohm_final_filesize2 = h5_get_file_size(FILENAME, fapl_id);
@@ -874,7 +874,7 @@ static void test_sohm_size1(void)
ret = H5Fclose(file);
CHECK_I(ret, "H5Fclose");
- sohm_btree_empty_filesize = h5_get_file_size(FILENAME);
+ sohm_btree_empty_filesize = h5_get_file_size(FILENAME, fapl_id);
/* Add a bunch of datatypes to this file */
file = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl_id);
@@ -890,7 +890,7 @@ static void test_sohm_size1(void)
sohm_btree_oh_size = oinfo.hdr.space.total;
/* Get the new file size */
- sohm_btree_final_filesize = h5_get_file_size(FILENAME);
+ sohm_btree_final_filesize = h5_get_file_size(FILENAME, fapl_id);
/* Use the same property list to create a new file. */
file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, fapl_id);
@@ -906,7 +906,7 @@ static void test_sohm_size1(void)
CHECK_I(ret, "H5Fclose");
/* Get the file size */
- sohm_btree_final_filesize2 = h5_get_file_size(FILENAME);
+ sohm_btree_final_filesize2 = h5_get_file_size(FILENAME, fapl_id);
@@ -1441,7 +1441,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
CHECK_I(ret, "H5Fclose");
/* Get the file size */
- ret_sizes->empty_size = h5_get_file_size(FILENAME);
+ ret_sizes->empty_size = h5_get_file_size(FILENAME, H5P_DEFAULT);
/* Re-open the file and set up messages to write */
file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
@@ -1544,9 +1544,9 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
/* Get the file's size now */
if(x == 0)
- ret_sizes->first_dset = h5_get_file_size(FILENAME);
+ ret_sizes->first_dset = h5_get_file_size(FILENAME, H5P_DEFAULT);
else
- ret_sizes->second_dset = h5_get_file_size(FILENAME);
+ ret_sizes->second_dset = h5_get_file_size(FILENAME, H5P_DEFAULT);
file_id = H5Fopen(FILENAME, H5F_ACC_RDWR, H5P_DEFAULT);
CHECK_I(file_id, "H5Fopen");
@@ -1561,7 +1561,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
/* Close file and get its size now */
ret = H5Fclose(file_id);
CHECK_I(ret, "H5Fclose");
- ret_sizes->dsets1 = h5_get_file_size(FILENAME);
+ ret_sizes->dsets1 = h5_get_file_size(FILENAME, H5P_DEFAULT);
/* Now create a new group filled with datasets that use all different messages */
@@ -1602,7 +1602,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
CHECK_I(ret, "H5Gclose");
ret = H5Fclose(file_id);
CHECK_I(ret, "H5Fclose");
- ret_sizes->dsets2 = h5_get_file_size(FILENAME);
+ ret_sizes->dsets2 = h5_get_file_size(FILENAME, H5P_DEFAULT);
/* Create a new group and interleave writes of datasets types 1 and 2. */
@@ -1656,7 +1656,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
CHECK_I(ret, "H5Gclose");
ret = H5Fclose(file_id);
CHECK_I(ret, "H5Fclose");
- ret_sizes->interleaved = h5_get_file_size(FILENAME);
+ ret_sizes->interleaved = h5_get_file_size(FILENAME, H5P_DEFAULT);
/* Create lots of new attribute messages on the group
* (using different strings for the attribute)
@@ -1699,7 +1699,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
CHECK_I(ret, "H5Gclose");
ret = H5Fclose(file_id);
CHECK_I(ret, "H5Fclose");
- ret_sizes->attrs1 = h5_get_file_size(FILENAME);
+ ret_sizes->attrs1 = h5_get_file_size(FILENAME, H5P_DEFAULT);
/* Create all of the attributes again on the other group */
@@ -1738,7 +1738,7 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
CHECK_I(ret, "H5Gclose");
ret = H5Fclose(file_id);
CHECK_I(ret, "H5Fclose");
- ret_sizes->attrs2 = h5_get_file_size(FILENAME);
+ ret_sizes->attrs2 = h5_get_file_size(FILENAME, H5P_DEFAULT);
/* Close everything */
@@ -2723,7 +2723,7 @@ static void delete_helper(hid_t fcpl_id, hid_t *dspace_id, hid_t *dcpl_id)
/* Close file and get filesize */
ret = H5Fclose(file_id);
CHECK_I(ret, "H5Fclose");
- norm_filesize = h5_get_file_size(FILENAME);
+ norm_filesize = h5_get_file_size(FILENAME, H5P_DEFAULT);
/* Create a new file with messages 0 to (HALF_DELETE_NUM_MESGS - 1) */
file_id = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
@@ -2755,7 +2755,7 @@ static void delete_helper(hid_t fcpl_id, hid_t *dspace_id, hid_t *dcpl_id)
/* Close file and get filesize */
ret = H5Fclose(file_id);
CHECK_I(ret, "H5Fclose");
- deleted_filesize = h5_get_file_size(FILENAME);
+ deleted_filesize = h5_get_file_size(FILENAME, H5P_DEFAULT);
/* The two filesizes should be almost the same */
if(norm_filesize > deleted_filesize * OVERHEAD_ALLOWED)
@@ -2950,7 +2950,7 @@ test_sohm_delete_revert_helper(hid_t fcpl_id)
/* Close the file and get its size */
ret = H5Fclose(file_id);
CHECK_I(ret, "H5Fclose");
- initial_filesize = h5_get_file_size(FILENAME);
+ initial_filesize = h5_get_file_size(FILENAME, H5P_DEFAULT);
/* Re-create the file and create a dataset in it */
@@ -2969,7 +2969,7 @@ test_sohm_delete_revert_helper(hid_t fcpl_id)
/* Close the file and get its size */
ret = H5Fclose(file_id);
CHECK_I(ret, "H5Fclose");
- deleted_filesize = h5_get_file_size(FILENAME);
+ deleted_filesize = h5_get_file_size(FILENAME, H5P_DEFAULT);
VERIFY(deleted_filesize, initial_filesize, "h5_get_file_size");
@@ -2999,7 +2999,7 @@ test_sohm_delete_revert_helper(hid_t fcpl_id)
/* Close the file and get its size */
ret = H5Fclose(file_id);
CHECK_I(ret, "H5Fclose");
- deleted_filesize = h5_get_file_size(FILENAME);
+ deleted_filesize = h5_get_file_size(FILENAME, H5P_DEFAULT);
VERIFY(deleted_filesize, initial_filesize, "h5_get_file_size");
diff --git a/test/unlink.c b/test/unlink.c
index 868f765..e03323f 100644
--- a/test/unlink.c
+++ b/test/unlink.c
@@ -44,8 +44,6 @@ const char *FILENAME[] = {
NULL
};
-#define THE_OBJECT "/foo"
-
/* Macros for test_create_unlink() & test_filespace */
#define GROUPNAME "group"
#define GROUP2NAME "group2"
@@ -564,7 +562,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) TEST_ERROR
/* Get the size of an empty file */
- if((empty_size=h5_get_file_size(filename))<0) TEST_ERROR
+ if((empty_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Create common objects for datasets */
@@ -602,7 +600,7 @@ test_filespace(hid_t fapl)
if((space = H5Screate_simple(FILESPACE_NDIMS, dims, NULL)) < 0) TEST_ERROR
/* Create buffer for writing dataset */
- if((data = HDmalloc(sizeof(int)*FILESPACE_DIM0*FILESPACE_DIM1*FILESPACE_DIM2))==NULL) TEST_ERROR
+ if(NULL == (data = (int *)HDmalloc(sizeof(int) * FILESPACE_DIM0 * FILESPACE_DIM1 * FILESPACE_DIM2))) TEST_ERROR
/* Create single dataset (with contiguous storage & late allocation), remove it & verify file size */
@@ -622,7 +620,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -647,7 +645,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename))<0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -672,7 +670,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename))<0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -697,7 +695,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -722,7 +720,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -746,7 +744,7 @@ test_filespace(hid_t fapl)
for(u = 0; u < FILESPACE_REWRITE; u++) {
/* Set buffer to some compressible values */
for(v = 0, tmp_data = data; v < (FILESPACE_DIM0 * FILESPACE_DIM1 * FILESPACE_DIM2); v++)
- *tmp_data++ = v * u;
+ *tmp_data++ = (int)(v * u);
/* Write the buffer to the dataset */
if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) FAIL_STACK_ERROR
@@ -769,7 +767,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl_nocache)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -794,7 +792,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -858,7 +856,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -886,7 +884,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -911,7 +909,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -943,7 +941,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -973,7 +971,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -1063,7 +1061,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -1098,7 +1096,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename))<0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -1132,7 +1130,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -1170,7 +1168,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -1220,7 +1218,7 @@ test_filespace(hid_t fapl)
if(H5Fclose(file) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != empty_size) TEST_ERROR
@@ -1517,7 +1515,7 @@ test_unlink_rightleaf(hid_t fid)
TESTING("deleting right-most child in non-leaf B-tree node");
/* Allocate space for the group IDs */
- if(NULL == (gids = (hid_t *)HDmalloc(ngroups * sizeof(hid_t)))) TEST_ERROR
+ if(NULL == (gids = (hid_t *)HDmalloc((size_t)ngroups * sizeof(hid_t)))) TEST_ERROR
if((rootid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
@@ -1580,7 +1578,7 @@ test_unlink_rightnode(hid_t fid)
TESTING("deleting right-most child in non-leaf B-tree node");
/* Allocate space for the group IDs */
- if(NULL == (gids = (hid_t *)HDmalloc(ngroups * sizeof(hid_t)))) TEST_ERROR
+ if(NULL == (gids = (hid_t *)HDmalloc((size_t)ngroups * sizeof(hid_t)))) TEST_ERROR
if((rootid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
@@ -1643,7 +1641,7 @@ test_unlink_middlenode(hid_t fid)
TESTING("deleting right-most child in non-leaf B-tree node");
/* Allocate space for the group IDs */
- if(NULL == (gids = (hid_t *)HDmalloc(ngroups * sizeof(hid_t)))) TEST_ERROR
+ if(NULL == (gids = (hid_t *)HDmalloc((size_t)ngroups * sizeof(hid_t)))) TEST_ERROR
if((rootid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
@@ -2165,7 +2163,7 @@ test_full_group_compact(hid_t fapl)
if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR
/* Get the size of the file with only the objects to keep */
- if((keep_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((keep_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Re-open the file */
if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
@@ -2229,7 +2227,7 @@ test_full_group_compact(hid_t fapl)
if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != keep_size) TEST_ERROR
@@ -2299,7 +2297,7 @@ test_full_group_dense(hid_t fapl)
if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR
/* Get the size of the file with only the objects to keep */
- if((keep_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((keep_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Re-open the file */
if((file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR
@@ -2375,7 +2373,7 @@ test_full_group_dense(hid_t fapl)
if(H5Fclose(file_id) < 0) FAIL_STACK_ERROR
/* Get the size of the file */
- if((file_size = h5_get_file_size(filename)) < 0) TEST_ERROR
+ if((file_size = h5_get_file_size(filename, fapl)) < 0) TEST_ERROR
/* Verify the file is correct size */
if(file_size != keep_size) TEST_ERROR
@@ -2419,7 +2417,7 @@ main(void)
envval = HDgetenv("HDF5_DRIVER");
if(envval == NULL)
envval = "nomatch";
- if(HDstrcmp(envval, "core") && HDstrcmp(envval, "split") && HDstrcmp(envval, "multi") && HDstrcmp(envval, "family")) {
+ if(HDstrcmp(envval, "split") && HDstrcmp(envval, "multi") && HDstrcmp(envval, "family")) {
hid_t fapl, fapl2, file;
int nerrors = 0;
char filename[1024];
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index da48378..c4b319a 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -456,7 +456,7 @@ void big_dataset(void)
VRFY((ret >= 0), "H5Fclose succeeded");
/* Check that file of the correct size was created */
- file_size=h5_get_file_size(filename);
+ file_size = h5_get_file_size(filename, fapl);
VRFY((file_size == 2147485696ULL), "File is correct size(~2GB)");
/*
@@ -485,7 +485,7 @@ void big_dataset(void)
VRFY((ret >= 0), "H5Fclose succeeded");
/* Check that file of the correct size was created */
- file_size=h5_get_file_size(filename);
+ file_size = h5_get_file_size(filename, fapl);
VRFY((file_size == 4294969344ULL), "File is correct size(~4GB)");
/*
@@ -514,7 +514,7 @@ void big_dataset(void)
VRFY((ret >= 0), "H5Fclose succeeded");
/* Check that file of the correct size was created */
- file_size=h5_get_file_size(filename);
+ file_size = h5_get_file_size(filename, fapl);
VRFY((file_size == 8589936640ULL), "File is correct size(~8GB)");
/* Close fapl */