summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.in158
-rw-r--r--test/freespace.c109
-rw-r--r--test/mf.c244
3 files changed, 312 insertions, 199 deletions
diff --git a/test/Makefile.in b/test/Makefile.in
index 3d1468d..406f02c 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1,8 +1,9 @@
-# Makefile.in generated by automake 1.10.2 from Makefile.am.
+# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -34,8 +35,9 @@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
@@ -67,13 +69,13 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/H5config.h
CONFIG_CLEAN_FILES = testerror.sh
+CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libh5test_la_LIBADD =
am_libh5test_la_OBJECTS = h5test.lo testframe.lo cache_common.lo \
swmr_common.lo
libh5test_la_OBJECTS = $(am_libh5test_la_OBJECTS)
am__installdirs = "$(DESTDIR)$(bindir)"
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
am__EXEEXT_1 = testhdf5$(EXEEXT) lheap$(EXEEXT) ohdr$(EXEEXT) \
stab$(EXEEXT) gheap$(EXEEXT) cache$(EXEEXT) cache_api$(EXEEXT) \
pool$(EXEEXT) hyperslab$(EXEEXT) istore$(EXEEXT) \
@@ -356,6 +358,7 @@ vfd_DEPENDENCIES = libh5test.la $(LIBHDF5)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
depcomp = $(SHELL) $(top_srcdir)/bin/depcomp
am__depfiles_maybe = depfiles
+am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -393,6 +396,8 @@ DIST_SOURCES = $(libh5test_la_SOURCES) app_ref.c big.c bittests.c \
$(ttsafe_SOURCES) unlink.c vfd.c
ETAGS = etags
CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = /home1/packages/automake/automake-1.9.6/bin/aclocal-1.9 -I /afs/ncsa/projects/hdf/packages/libtool_1.5.14/Linux_2.4/share/aclocal
ADD_PARALLEL_FILES = @ADD_PARALLEL_FILES@
@@ -507,6 +512,7 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PARALLEL = @PARALLEL@
PATH_SEPARATOR = @PATH_SEPARATOR@
@@ -598,6 +604,7 @@ sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
@@ -756,9 +763,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign test/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign test/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -776,6 +783,7 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
testerror.sh: $(top_builddir)/config.status $(srcdir)/testerror.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
@@ -792,45 +800,64 @@ libh5test.la: $(libh5test_la_OBJECTS) $(libh5test_la_DEPENDENCIES)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- || test -f $$p1 \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
- else :; fi; \
- done
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
- rm -f "$(DESTDIR)$(bindir)/$$f"; \
- done
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
clean-checkPROGRAMS:
- @list='$(check_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
+ @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
app_ref$(EXEEXT): $(app_ref_OBJECTS) $(app_ref_DEPENDENCIES)
@rm -f app_ref$(EXEEXT)
$(LINK) $(app_ref_OBJECTS) $(app_ref_LDADD) $(LIBS)
@@ -1121,21 +1148,21 @@ distclean-compile:
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
@@ -1158,7 +1185,7 @@ tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
+ set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
@@ -1166,29 +1193,34 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
+ $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -1209,13 +1241,17 @@ distdir: $(DISTFILES)
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@@ -1248,6 +1284,7 @@ clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@@ -1271,6 +1308,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -1279,18 +1318,28 @@ install-data-am:
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am: install-binPROGRAMS
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
+install-ps-am:
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -1313,7 +1362,7 @@ ps-am:
uninstall-am: uninstall-binPROGRAMS
-.MAKE: install-am install-strip
+.MAKE: check-am install-am install-strip
.PHONY: CTAGS GTAGS all all-am all-local check check-TESTS check-am \
clean clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
@@ -1549,6 +1598,7 @@ check-vfd: $(LIB) $(PROGS) $(TESTS)
HDF5_DRIVER=$$vfd $(MAKE) $(AM_MAKEFLAGS) check || exit 1; \
fi; \
done
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/test/freespace.c b/test/freespace.c
index 79a0864..82395d0 100644
--- a/test/freespace.c
+++ b/test/freespace.c
@@ -90,6 +90,16 @@ static herr_t TEST_sect_merging(H5FS_section_info_t *, H5FS_section_info_t *, vo
static herr_t TEST_sect_can_shrink(const H5FS_section_info_t *, void *);
static herr_t TEST_sect_shrinking(H5FS_section_info_t **, void *);
+static unsigned test_fs_create(hid_t fapl);
+static unsigned test_fs_sect_add(hid_t fapl);
+static unsigned test_fs_sect_merge(hid_t fapl);
+static unsigned test_fs_sect_shrink(hid_t fapl);
+static unsigned test_fs_sect_find(hid_t fapl);
+static unsigned test_fs_sect_change_class(hid_t fapl);
+static unsigned test_fs_sect_extend(hid_t fapl);
+static unsigned test_fs_sect_iterate(hid_t fapl);
+
+
H5FS_section_class_t TEST_FSPACE_SECT_CLS[1] = {{
TEST_FSPACE_SECT_TYPE, /* Section type */
0, /* Extra serialized size */
@@ -171,7 +181,7 @@ const H5FS_section_class_t *test_classes[] = {
static void init_cparam(H5FS_create_t *);
static void init_sect_node(TEST_free_section_t *, haddr_t, hsize_t, unsigned, H5FS_section_state_t);
-static int check_stats(const H5FS_t *, const frspace_state_t *);
+static int check_stats(const H5F_t *, const H5FS_t *, frspace_state_t *);
#define NUM_SECTIONS 1000
@@ -391,12 +401,12 @@ init_sect_node(TEST_free_section_t *sect_node, haddr_t addr, hsize_t size, unsig
* Verify statistics for the free-space manager
*/
static int
-check_stats(const H5FS_t *frsp, const frspace_state_t *state)
+check_stats(const H5F_t *f, const H5FS_t *frsp, frspace_state_t *state)
{
H5FS_stat_t frspace_stats; /* Statistics about the heap */
/* Get statistics for heap and verify they are correct */
- if(H5FS_stat_info(frsp, &frspace_stats) < 0)
+ if(H5FS_stat_info(f, frsp, &frspace_stats) < 0)
FAIL_STACK_ERROR
if(frspace_stats.tot_space != state->tot_space) {
@@ -487,7 +497,7 @@ test_fs_create(hid_t fapl)
TEST_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
HDmemset(&test_cparam, 0, sizeof(H5FS_create_t));
@@ -636,7 +646,7 @@ test_fs_sect_add(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
fr_meta_size = H5FS_HEADER_SIZE(f) + H5FS_SINFO_PREFIX_SIZE(f);
@@ -699,7 +709,7 @@ test_fs_sect_add(hid_t fapl)
state.tot_sect_count += 1;
state.ghost_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
fr_meta_size = H5FS_HEADER_SIZE(f);
@@ -771,7 +781,7 @@ test_fs_sect_add(hid_t fapl)
/* nothing in free-space */
HDmemset(&state, 0, sizeof(frspace_state_t));
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/* Close the free space manager */
@@ -842,7 +852,7 @@ test_fs_sect_add(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
if(H5FS_sect_remove(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node) < 0)
@@ -938,7 +948,7 @@ test_fs_sect_find(hid_t fapl)
HDmemset(&state, 0, sizeof(frspace_state_t));
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
@@ -947,7 +957,7 @@ test_fs_sect_find(hid_t fapl)
if (node_found) TEST_ERROR
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/* Close the free space manager */
@@ -986,7 +996,7 @@ test_fs_sect_find(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
@@ -1006,7 +1016,7 @@ test_fs_sect_find(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/*
@@ -1025,7 +1035,7 @@ test_fs_sect_find(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/*
@@ -1044,7 +1054,7 @@ test_fs_sect_find(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
@@ -1103,7 +1113,7 @@ test_fs_sect_find(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/*
@@ -1122,7 +1132,7 @@ test_fs_sect_find(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
@@ -1176,7 +1186,7 @@ test_fs_sect_find(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
if((node_found = H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
@@ -1309,7 +1319,7 @@ test_fs_sect_merge(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/*
@@ -1327,7 +1337,7 @@ test_fs_sect_merge(hid_t fapl)
/* section B & C are merged */
state.tot_space += TEST_SECT_SIZE30;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/*
@@ -1345,7 +1355,7 @@ test_fs_sect_merge(hid_t fapl)
/* section A is merged with the merged section of B & C */
state.tot_space += TEST_SECT_SIZE10;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/*
@@ -1363,7 +1373,7 @@ test_fs_sect_merge(hid_t fapl)
/* section D is merged with the merged section of A & B & C */
state.tot_space += TEST_SECT_SIZE80;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
@@ -1437,7 +1447,7 @@ test_fs_sect_merge(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/*
@@ -1457,7 +1467,7 @@ test_fs_sect_merge(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/* should not be able to find the merged section of A & B */
@@ -1531,7 +1541,7 @@ test_fs_sect_merge(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/*
@@ -1551,7 +1561,7 @@ test_fs_sect_merge(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/*
@@ -1569,7 +1579,7 @@ test_fs_sect_merge(hid_t fapl)
/* sections B & C are merged because H5FS_CLS_MERGE_SYM is set & section class type is the same */
state.tot_space += TEST_SECT_SIZE50;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/*
@@ -1592,7 +1602,7 @@ test_fs_sect_merge(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/* should not be able to find a merged section of A, B, C & D */
@@ -1764,7 +1774,7 @@ test_fs_sect_shrink(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/* section A should still be there in free-space */
@@ -1796,7 +1806,7 @@ test_fs_sect_shrink(hid_t fapl)
/* should have nothing in free-space */
HDmemset(&state, 0, sizeof(frspace_state_t));
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/* section A should not be there in free-space */
@@ -1864,7 +1874,7 @@ test_fs_sect_shrink(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/*
@@ -1880,7 +1890,7 @@ test_fs_sect_shrink(hid_t fapl)
FAIL_STACK_ERROR
/* free-space should be the same since section B is shrunk */
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/* section B should not be there in free-space */
@@ -1890,7 +1900,7 @@ test_fs_sect_shrink(hid_t fapl)
if (node_found) TEST_ERROR
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
@@ -1963,7 +1973,7 @@ test_fs_sect_shrink(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/*
@@ -1980,7 +1990,7 @@ test_fs_sect_shrink(hid_t fapl)
/* section A & B are merged and then strunk, so there is nothing in free-space */
HDmemset(&state, 0, sizeof(frspace_state_t));
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/* section B should not be there in free-space */
@@ -2098,7 +2108,7 @@ test_fs_sect_change_class(hid_t fapl)
state.tot_sect_count += 1;
state.ghost_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/*
@@ -2117,7 +2127,7 @@ test_fs_sect_change_class(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
if (H5FS_sect_change_class(f, H5P_DATASET_XFER_DEFAULT, frsp, (H5FS_section_info_t *)sect_node1,
@@ -2126,7 +2136,7 @@ test_fs_sect_change_class(hid_t fapl)
state.serial_sect_count += 1;
state.ghost_sect_count -=1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
if(H5FS_sect_find(f, H5P_DATASET_XFER_DEFAULT, frsp,
@@ -2374,7 +2384,7 @@ test_fs_sect_extend(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/*
@@ -2393,7 +2403,7 @@ test_fs_sect_extend(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/* Extend a block by requested-size */
@@ -2404,7 +2414,7 @@ test_fs_sect_extend(hid_t fapl)
state.tot_space -= sect_node2->sect_info.size;
state.tot_sect_count -= 1;
state.serial_sect_count -= 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/* Close the free space manager */
@@ -2448,7 +2458,7 @@ test_fs_sect_extend(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/*
@@ -2467,7 +2477,7 @@ test_fs_sect_extend(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/* Extend the block by requested-size */
@@ -2475,7 +2485,7 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Not able to extend the block: free space info remains the same */
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/* Close the free space manager */
@@ -2519,7 +2529,7 @@ test_fs_sect_extend(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/*
@@ -2538,7 +2548,7 @@ test_fs_sect_extend(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/* Extend the block by requested-size */
@@ -2547,7 +2557,7 @@ test_fs_sect_extend(hid_t fapl)
/* Succeed in extending the block: total free space is decreased but other info remains the same */
state.tot_space -= 30;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/* Close the free space manager */
@@ -2591,7 +2601,7 @@ test_fs_sect_extend(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/*
@@ -2610,7 +2620,7 @@ test_fs_sect_extend(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/* Extend the block by requested-size */
@@ -2618,7 +2628,7 @@ test_fs_sect_extend(hid_t fapl)
TEST_ERROR
/* Not able to extend the block: free space manager info remains the same */
- if(check_stats(frsp, &state))
+ if(check_stats(f, frsp, &state))
TEST_ERROR
/* Close the free space manager */
@@ -2791,3 +2801,4 @@ error:
} H5E_END_TRY;
return (1);
} /* main() */
+
diff --git a/test/mf.c b/test/mf.c
index 5c05848..c405694 100644
--- a/test/mf.c
+++ b/test/mf.c
@@ -79,18 +79,43 @@ typedef struct frspace_state_t {
} frspace_state_t;
-static int check_stats(const H5FS_t *, const frspace_state_t *);
+static int check_stats(const H5F_t *, const H5FS_t *, frspace_state_t *);
+static unsigned test_mf_eoa(const char *env_h5_drvr, hid_t fapl);
+static unsigned test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl);
+static unsigned test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl);
+static unsigned test_mf_tmp(const char *env_h5_drvr, hid_t fapl);
+static unsigned test_mf_fs_start(hid_t fapl);
+static unsigned test_mf_fs_alloc_free(hid_t fapl);
+static unsigned test_mf_fs_extend(hid_t fapl);
+static unsigned test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl);
+static unsigned test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl);
+static unsigned test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl);
+static unsigned test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl);
+static unsigned test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl);
+static unsigned test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl);
+static unsigned test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl);
+static unsigned test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl);
+static unsigned test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl);
+static unsigned test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl);
+static unsigned test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl);
+static unsigned test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl);
+static unsigned test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl);
+static unsigned test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl);
+static unsigned test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl);
+static unsigned test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl);
+static unsigned test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl);
+static unsigned test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl);
/*
* Verify statistics for the free-space manager
*/
static int
-check_stats(const H5FS_t *frsp, const frspace_state_t *state)
+check_stats(const H5F_t *f, const H5FS_t *frsp, frspace_state_t *state)
{
H5FS_stat_t frspace_stats; /* Statistics about the heap */
/* Get statistics for free-space and verify they are correct */
- if(H5FS_stat_info(frsp, &frspace_stats) < 0)
+ if(H5FS_stat_info(f, frsp, &frspace_stats) < 0)
FAIL_STACK_ERROR
if(frspace_stats.tot_space != state->tot_space) {
@@ -895,7 +920,7 @@ error:
} /* test_mf_tmp() */
/*
- * To verify that the free-space manager is started up via H5MF_alloc_start()
+ * To verify that the free-space manager is created or opened
*
* Set up:
* Turn off using meta/small data aggregator
@@ -912,7 +937,7 @@ test_mf_fs_start(hid_t fapl)
frspace_state_t state;
- TESTING("H5MF_alloc_start() of free-space manager");
+ TESTING("H5MF_alloc_create()/H5MF_alloc_open() of free-space manager");
/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename, sizeof(filename));
@@ -945,8 +970,10 @@ test_mf_fs_start(hid_t fapl)
/* Start up free-space manager */
type = H5FD_MEM_SUPER;
- if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type, TRUE) < 0)
- TEST_ERROR
+
+ if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type) < 0)
+ TEST_ERROR
+
if (f->shared->fs_state[type] != H5F_FS_STATE_OPEN)
TEST_ERROR
if (f->shared->fs_man[type]->client != H5FS_CLIENT_FILE_ID)
@@ -954,7 +981,7 @@ test_mf_fs_start(hid_t fapl)
HDmemset(&state, 0, sizeof(frspace_state_t));
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
if(H5Fclose(file) < 0)
@@ -1052,8 +1079,10 @@ test_mf_fs_alloc_free(hid_t fapl)
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
- if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type, TRUE) < 0)
- TEST_ERROR
+
+ if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type) < 0)
+ TEST_ERROR
+
if (f->shared->fs_state[type] != H5F_FS_STATE_OPEN)
TEST_ERROR
if (f->shared->fs_man[type]->client != H5FS_CLIENT_FILE_ID)
@@ -1077,7 +1106,7 @@ test_mf_fs_alloc_free(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Allocate a block of 30 */
@@ -1091,7 +1120,7 @@ test_mf_fs_alloc_free(hid_t fapl)
state.tot_sect_count -= 1;
state.serial_sect_count -= 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Free the block to free-space */
@@ -1100,7 +1129,7 @@ test_mf_fs_alloc_free(hid_t fapl)
state.tot_space += TEST_BLOCK_SIZE30;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Remove section A from free-space */
@@ -1135,8 +1164,10 @@ test_mf_fs_alloc_free(hid_t fapl)
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
- if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type, TRUE) < 0)
- TEST_ERROR
+
+ if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type) < 0)
+ TEST_ERROR
+
if (f->shared->fs_state[type] != H5F_FS_STATE_OPEN)
TEST_ERROR
if (f->shared->fs_man[type]->client != H5FS_CLIENT_FILE_ID)
@@ -1160,7 +1191,7 @@ test_mf_fs_alloc_free(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Allocate a block of 20 */
@@ -1173,7 +1204,7 @@ test_mf_fs_alloc_free(hid_t fapl)
/* should still have 1 section of size 10 left in free-space manager */
state.tot_space -= (TEST_BLOCK_SIZE20);
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Free the block to free-space manager */
@@ -1181,7 +1212,7 @@ test_mf_fs_alloc_free(hid_t fapl)
/* Still 1 section in free-space because of merging */
state.tot_space += TEST_BLOCK_SIZE20;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Remove section A from free-space manager */
@@ -1217,8 +1248,10 @@ test_mf_fs_alloc_free(hid_t fapl)
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
- if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type, TRUE) < 0)
- TEST_ERROR
+
+ if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type) < 0)
+ TEST_ERROR
+
if (f->shared->fs_state[type] != H5F_FS_STATE_OPEN)
TEST_ERROR
if (f->shared->fs_man[type]->client != H5FS_CLIENT_FILE_ID)
@@ -1242,7 +1275,7 @@ test_mf_fs_alloc_free(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/*
@@ -1257,7 +1290,7 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
/* free-space info should be the same */
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Remove section A from free-space */
@@ -1270,7 +1303,7 @@ test_mf_fs_alloc_free(hid_t fapl)
TEST_ERROR
HDmemset(&state, 0, sizeof(frspace_state_t));
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Free the block of size 40 to free-space */
@@ -1281,7 +1314,7 @@ test_mf_fs_alloc_free(hid_t fapl)
* The block is returned to free-space.
* It is shrunk and freed because it is at end of file.
*/
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
if(H5Fclose(file) < 0)
@@ -1392,8 +1425,10 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
- if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type, TRUE) < 0)
- TEST_ERROR
+
+ if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type) < 0)
+ TEST_ERROR
+
if (f->shared->fs_state[type] != H5F_FS_STATE_OPEN)
TEST_ERROR
if (f->shared->fs_man[type]->client != H5FS_CLIENT_FILE_ID)
@@ -1417,7 +1452,7 @@ test_mf_fs_extend(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Allocate a block of 30 */
@@ -1431,7 +1466,7 @@ test_mf_fs_extend(hid_t fapl)
state.tot_sect_count -= 1;
state.serial_sect_count -= 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Create section B */
@@ -1445,7 +1480,7 @@ test_mf_fs_extend(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Try to extend the allocated block */
@@ -1460,7 +1495,7 @@ test_mf_fs_extend(hid_t fapl)
state.tot_sect_count -= 1;
state.serial_sect_count -= 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Free the extended block to free-space manager */
@@ -1471,7 +1506,7 @@ test_mf_fs_extend(hid_t fapl)
state.tot_sect_count = 1;
state.serial_sect_count = 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Remove the extended block */
@@ -1507,8 +1542,10 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
- if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type, TRUE) < 0)
- TEST_ERROR
+
+ if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type) < 0)
+ TEST_ERROR
+
if (f->shared->fs_state[type] != H5F_FS_STATE_OPEN)
TEST_ERROR
if (f->shared->fs_man[type]->client != H5FS_CLIENT_FILE_ID)
@@ -1532,7 +1569,7 @@ test_mf_fs_extend(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Allocate a block of 30 */
@@ -1546,7 +1583,7 @@ test_mf_fs_extend(hid_t fapl)
state.tot_sect_count -= 1;
state.serial_sect_count -= 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Create section B */
@@ -1560,7 +1597,7 @@ test_mf_fs_extend(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Try to extend the allocated block */
@@ -1571,7 +1608,7 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* free-space info should remain the same */
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Free the allocated block A to free-space */
@@ -1581,7 +1618,7 @@ test_mf_fs_extend(hid_t fapl)
/* rest of the info remains the same */
state.tot_space += TEST_BLOCK_SIZE30;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Remove the merged sections A & B from free-space */
@@ -1617,8 +1654,10 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
- if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type, TRUE) < 0)
- TEST_ERROR
+
+ if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type) < 0)
+ TEST_ERROR
+
if (f->shared->fs_state[type] != H5F_FS_STATE_OPEN)
TEST_ERROR
if (f->shared->fs_man[type]->client != H5FS_CLIENT_FILE_ID)
@@ -1642,7 +1681,7 @@ test_mf_fs_extend(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Allocate a block of 30 */
@@ -1656,7 +1695,7 @@ test_mf_fs_extend(hid_t fapl)
state.tot_sect_count -= 1;
state.serial_sect_count -= 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Create section B */
@@ -1670,7 +1709,7 @@ test_mf_fs_extend(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Try to extend the allocated block */
@@ -1682,7 +1721,7 @@ test_mf_fs_extend(hid_t fapl)
/* Should have 1 section of size=10 left in free-space manager */
state.tot_space -= (TEST_BLOCK_SIZE40);
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Free the extended block */
@@ -1691,7 +1730,7 @@ test_mf_fs_extend(hid_t fapl)
/* rest info is same, the extended section returned is merged with the section in free-space */
state.tot_space += (TEST_BLOCK_SIZE30+TEST_BLOCK_SIZE40);
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Remove the merged sections A & B from free-space */
@@ -1727,8 +1766,10 @@ test_mf_fs_extend(hid_t fapl)
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
- if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type, TRUE) < 0)
- TEST_ERROR
+
+ if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type) < 0)
+ TEST_ERROR
+
if (f->shared->fs_state[type] != H5F_FS_STATE_OPEN)
TEST_ERROR
if (f->shared->fs_man[type]->client != H5FS_CLIENT_FILE_ID)
@@ -1752,7 +1793,7 @@ test_mf_fs_extend(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Allocate a block of size=20 */
@@ -1766,7 +1807,7 @@ test_mf_fs_extend(hid_t fapl)
state.tot_sect_count -= 1;
state.serial_sect_count -= 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Create section B */
@@ -1780,7 +1821,7 @@ test_mf_fs_extend(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Try to extend the allocated block */
@@ -1791,7 +1832,7 @@ test_mf_fs_extend(hid_t fapl)
TEST_ERROR
/* Free-space info should be the same */
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Free the allocated block */
@@ -1801,7 +1842,7 @@ test_mf_fs_extend(hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Remove section A from free-space manger */
@@ -1908,8 +1949,10 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
- if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type, TRUE) < 0)
+
+ if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type) < 0)
TEST_ERROR
+
if (f->shared->fs_state[type] != H5F_FS_STATE_OPEN)
TEST_ERROR
if (f->shared->fs_man[type]->client != H5FS_CLIENT_FILE_ID)
@@ -1975,8 +2018,10 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl)
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
- if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type, TRUE) < 0)
+
+ if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type) < 0)
TEST_ERROR
+
if (f->shared->fs_state[type] != H5F_FS_STATE_OPEN)
TEST_ERROR
if (f->shared->fs_man[type]->client != H5FS_CLIENT_FILE_ID)
@@ -2824,8 +2869,9 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl)
if(NULL == (f = (H5F_t *)H5I_object(file)))
FAIL_STACK_ERROR
- /* Allocate first block from meta_aggr */
type = H5FD_MEM_SUPER;
+
+ /* Allocate first block from meta_aggr */
addr1 = H5MF_alloc(f, type, H5P_DATASET_XFER_DEFAULT, (hsize_t)TEST_BLOCK_SIZE30);
H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size);
@@ -2867,7 +2913,7 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Free all the allocated blocks */
@@ -3047,7 +3093,7 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Free all the allocated blocks */
@@ -3682,7 +3728,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state.tot_space += mis_align;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
}
@@ -3705,7 +3751,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state.tot_space += mis_align;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
}
@@ -3920,8 +3966,10 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
- if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type, TRUE) < 0)
- TEST_ERROR
+
+ if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type) < 0)
+ TEST_ERROR
+
if (f->shared->fs_state[type] != H5F_FS_STATE_OPEN)
TEST_ERROR
if (f->shared->fs_man[type]->client != H5FS_CLIENT_FILE_ID)
@@ -3944,7 +3992,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Allocate a block of 50 */
@@ -3958,7 +4006,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state.tot_sect_count -= 1;
state.serial_sect_count -= 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Free the block to free-space */
@@ -3967,7 +4015,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state.tot_space += TEST_BLOCK_SIZE50;
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
if(H5Fclose(file) < 0)
@@ -3987,8 +4035,10 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
- if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type, TRUE) < 0)
- TEST_ERROR
+
+ if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type) < 0)
+ TEST_ERROR
+
if (f->shared->fs_state[type] != H5F_FS_STATE_OPEN)
TEST_ERROR
if (f->shared->fs_man[type]->client != H5FS_CLIENT_FILE_ID)
@@ -4011,7 +4061,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Allocate a block of 600 */
@@ -4025,7 +4075,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* try to extend the block */
@@ -4036,7 +4086,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
/* space should be decreased by 200, # of sections remain the same */
state.tot_space -= TEST_BLOCK_SIZE200;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* Free the block to free-space manager */
@@ -4046,7 +4096,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state.tot_space += (TEST_BLOCK_SIZE600+TEST_BLOCK_SIZE200);
state.tot_sect_count = 1;
state.serial_sect_count = 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
if(H5Fclose(file) < 0)
@@ -4074,8 +4124,10 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
FAIL_STACK_ERROR
type = H5FD_MEM_SUPER;
- if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type, TRUE) < 0)
+
+ if(H5MF_alloc_start(f, H5P_DATASET_XFER_DEFAULT, type) < 0)
TEST_ERROR
+
if (f->shared->fs_state[type] != H5F_FS_STATE_OPEN)
TEST_ERROR
if (f->shared->fs_man[type]->client != H5FS_CLIENT_FILE_ID)
@@ -4098,7 +4150,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
state.tot_sect_count += 1;
state.serial_sect_count += 1;
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/*
* Allocate a block of 40
@@ -4125,7 +4177,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
}
/* free-space info should be the same */
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
if(H5Fclose(file) < 0)
@@ -4388,7 +4440,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* Verify total size of free space after all the allocations */
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30);
@@ -4667,7 +4719,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* Verify total size of free space after all the allocations */
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr1, (hsize_t)TEST_BLOCK_SIZE30);
@@ -5039,7 +5091,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
TEST_ERROR
/* Verify total size of free space after all allocations */
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
if(H5Fclose(file) < 0)
@@ -5244,7 +5296,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if (addr3 % alignment) TEST_ERROR
/* Verify total size of free space after all allocations */
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
if(H5Fclose(file) < 0)
@@ -5452,7 +5504,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
}
/* Verify total size of free space after all allocations */
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
/* nothing is changed in meta_aggr */
@@ -5772,7 +5824,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl)
if (sdata_addr != 0 || sdata_size != 0)
TEST_ERROR
- if(check_stats(f->shared->fs_man[type], &state))
+ if(check_stats(f, f->shared->fs_man[type], &state))
TEST_ERROR
if(H5Fclose(file) < 0)
@@ -5798,11 +5850,11 @@ error:
int
main(void)
{
- hid_t fapl = -1; /* File access property list for data files */
- hid_t new_fapl = -1; /* File access property list for alignment & aggr setting */
- unsigned nerrors = 0; /* Cumulative error count */
- test_type_t curr_test;
- const char *env_h5_drvr; /* File Driver value from environment */
+ hid_t fapl = -1; /* File access property list for data files */
+ hid_t new_fapl = -1; /* File access property list for alignment & aggr setting */
+ unsigned nerrors = 0; /* Cumulative error count */
+ test_type_t curr_test; /* Current test being worked on */
+ const char *env_h5_drvr; /* File Driver value from environment */
/* Get the VFD to use */
env_h5_drvr = HDgetenv("HDF5_DRIVER");
@@ -5811,12 +5863,6 @@ main(void)
fapl = h5_fileaccess();
- /* meta/small data is set to 2048 for the following tests */
- if(H5Pset_meta_block_size(fapl, (hsize_t)TEST_BLOCK_SIZE2048) < 0)
- TEST_ERROR
- if(H5Pset_small_data_block_size(fapl, (hsize_t)TEST_BLOCK_SIZE2048) < 0)
- TEST_ERROR
-
/* Make a copy of the FAPL before adjusting the alignment */
if((new_fapl = H5Pcopy(fapl)) < 0) TEST_ERROR
@@ -5824,6 +5870,12 @@ main(void)
if(H5Pset_alignment(fapl, (hsize_t)1, (hsize_t)1) < 0)
TEST_ERROR
+ /* meta/small data is set to 2048 for the following tests */
+ if(H5Pset_meta_block_size(fapl, (hsize_t)TEST_BLOCK_SIZE2048) < 0)
+ TEST_ERROR
+ if(H5Pset_small_data_block_size(fapl, (hsize_t)TEST_BLOCK_SIZE2048) < 0)
+ TEST_ERROR
+
/* interaction with file allocation */
nerrors += test_mf_eoa(env_h5_drvr, fapl);
nerrors += test_mf_eoa_shrink(env_h5_drvr, fapl);
@@ -5849,10 +5901,7 @@ main(void)
nerrors += test_mf_aggr_extend(env_h5_drvr, fapl);
nerrors += test_mf_aggr_absorb(env_h5_drvr, fapl);
- /*
- * tests for alignment
- */
-
+ /* Tests for alignment */
for(curr_test = TEST_NORMAL; curr_test < TEST_NTESTS; curr_test++) {
switch(curr_test) {
@@ -5869,6 +5918,7 @@ main(void)
default:
TEST_ERROR;
+ break;
} /* end switch */
nerrors += test_mf_align_eoa(env_h5_drvr, fapl, new_fapl);
@@ -5881,12 +5931,14 @@ main(void)
nerrors += test_mf_align_alloc6(env_h5_drvr, fapl, new_fapl);
} /* end if */
+ if (H5Pclose(new_fapl) < 0)
+ FAIL_STACK_ERROR
+ h5_cleanup(FILENAME, fapl);
+
if(nerrors)
goto error;
puts("All free-space manager tests for file memory passed.");
- h5_cleanup(FILENAME, fapl);
-
return (0);
error: