summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2015-06-26 18:44:27 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2015-06-26 18:44:27 (GMT)
commit130e77f4fa8044b2e2e06cf18b74ed8f8c64665a (patch)
tree0aaac762383218a930bc513108de585225eb6cf9 /tools
parent39b99473ea6e83aa394779a591eeef55fe141487 (diff)
downloadhdf5-130e77f4fa8044b2e2e06cf18b74ed8f8c64665a.zip
hdf5-130e77f4fa8044b2e2e06cf18b74ed8f8c64665a.tar.gz
hdf5-130e77f4fa8044b2e2e06cf18b74ed8f8c64665a.tar.bz2
[svn-r27288] Bring revision #24622 from revise_chksum_retry branch to revise_chunks. h5committested.
#test-p fails but will be fixed with merges later: #26569 (revise_chksum_retry) + v3 metadata cache #27237 (trunk).
Diffstat (limited to 'tools')
-rw-r--r--tools/h5diff/testfiles/h5diff_hyper1.h5bin1052720 -> 1052720 bytes
-rw-r--r--tools/h5diff/testfiles/h5diff_hyper2.h5bin1052720 -> 1052720 bytes
-rw-r--r--tools/h5diff/testfiles/tmptest.he5bin4740424 -> 4740424 bytes
-rw-r--r--tools/h5diff/testfiles/tmptest2.he5bin4734280 -> 4734280 bytes
-rw-r--r--tools/h5import/testfiles/binfp64.h5bin10760 -> 10760 bytes
-rw-r--r--tools/h5import/testfiles/binin16.h5bin10760 -> 10760 bytes
-rw-r--r--tools/h5import/testfiles/binin32.h5bin9472 -> 9472 bytes
-rw-r--r--tools/h5import/testfiles/binin8.h5bin10760 -> 10760 bytes
-rw-r--r--tools/h5import/testfiles/binuin16.h5bin10760 -> 10760 bytes
-rw-r--r--tools/h5import/testfiles/binuin32.h5bin6384 -> 6384 bytes
-rw-r--r--tools/h5import/testfiles/txtfp32.h5bin4192 -> 4192 bytes
-rw-r--r--tools/h5import/testfiles/txtfp64.h5bin9784 -> 9784 bytes
-rw-r--r--tools/h5import/testfiles/txtin16.h5bin9784 -> 9784 bytes
-rw-r--r--tools/h5import/testfiles/txtin32.h5bin4192 -> 4192 bytes
-rw-r--r--tools/h5import/testfiles/txtin8.h5bin9784 -> 9784 bytes
-rw-r--r--tools/h5import/testfiles/txtuin16.h5bin10240 -> 10240 bytes
-rw-r--r--tools/h5import/testfiles/txtuin32.h5bin6240 -> 6240 bytes
-rw-r--r--tools/h5repack/testfiles/h5repack_attr.h5bin20056 -> 20056 bytes
-rw-r--r--tools/h5repack/testfiles/h5repack_deflate.h5bin5962 -> 5962 bytes
-rw-r--r--tools/h5repack/testfiles/h5repack_early.h5bin2067224 -> 2067224 bytes
-rw-r--r--tools/h5repack/testfiles/h5repack_fill.h5bin2072 -> 2072 bytes
-rw-r--r--tools/h5repack/testfiles/h5repack_filters.h5bin29744 -> 29744 bytes
-rw-r--r--tools/h5repack/testfiles/h5repack_fletcher.h5bin7880 -> 7880 bytes
-rw-r--r--tools/h5repack/testfiles/h5repack_hlink.h5bin6576 -> 6576 bytes
-rw-r--r--tools/h5repack/testfiles/h5repack_layouto.h5bin1576 -> 1576 bytes
-rw-r--r--tools/h5repack/testfiles/h5repack_nbit.h5bin13776 -> 13776 bytes
-rw-r--r--tools/h5repack/testfiles/h5repack_shuffle.h5bin7864 -> 7864 bytes
-rw-r--r--tools/h5repack/testfiles/h5repack_soffset.h5bin11052 -> 11052 bytes
-rw-r--r--tools/h5stat/testfiles/h5stat_filters.h5bin46272 -> 46272 bytes
-rw-r--r--tools/misc/Makefile.am15
-rw-r--r--tools/misc/Makefile.in82
-rw-r--r--tools/misc/clear_open_chk.c72
-rw-r--r--tools/misc/h5clear.c137
-rw-r--r--tools/misc/h5clear_gentest.c238
-rw-r--r--tools/misc/testh5clear.sh.in135
-rw-r--r--tools/testfiles/family_file00000.h5bin1024 -> 1024 bytes
-rw-r--r--tools/testfiles/taindices.h5bin17160 -> 17160 bytes
-rw-r--r--tools/testfiles/tarray1.h5bin2112 -> 2112 bytes
-rw-r--r--tools/testfiles/tarray2.h5bin3008 -> 3008 bytes
-rw-r--r--tools/testfiles/tarray3.h5bin3200 -> 3200 bytes
-rw-r--r--tools/testfiles/tarray4.h5bin2176 -> 2176 bytes
-rw-r--r--tools/testfiles/tarray5.h5bin2368 -> 2368 bytes
-rw-r--r--tools/testfiles/tarray6.h5bin6400 -> 6400 bytes
-rw-r--r--tools/testfiles/tarray7.h5bin6400 -> 6400 bytes
-rw-r--r--tools/testfiles/tattr.h5bin3024 -> 3024 bytes
-rw-r--r--tools/testfiles/tattr2.h5bin33840 -> 33840 bytes
-rw-r--r--tools/testfiles/tbigdims.h5bin6192 -> 6192 bytes
-rw-r--r--tools/testfiles/tbitfields.h5bin2704 -> 2704 bytes
-rw-r--r--tools/testfiles/tchar.h5bin2356 -> 2356 bytes
-rw-r--r--tools/testfiles/tcompound.h5bin8192 -> 8192 bytes
-rw-r--r--tools/testfiles/tcompound2.h5bin13640 -> 13640 bytes
-rw-r--r--tools/testfiles/tcompound_complex.h5bin8192 -> 8192 bytes
-rw-r--r--tools/testfiles/tdatareg.h5bin5652 -> 5652 bytes
-rw-r--r--tools/testfiles/tdset.h5bin7648 -> 7648 bytes
-rw-r--r--tools/testfiles/tdset2.h5bin9936 -> 9936 bytes
-rw-r--r--tools/testfiles/tempty.h5bin4304 -> 4304 bytes
-rw-r--r--tools/testfiles/tenum.h5bin2128 -> 2128 bytes
-rw-r--r--tools/testfiles/tfamily00000.h5bin256 -> 256 bytes
-rw-r--r--tools/testfiles/tfcontents2.h5bin792 -> 792 bytes
-rw-r--r--tools/testfiles/tfvalues.h5bin9552 -> 9552 bytes
-rw-r--r--tools/testfiles/tgroup.h5bin11096 -> 11096 bytes
-rw-r--r--tools/testfiles/thlink.h5bin5536 -> 5536 bytes
-rw-r--r--tools/testfiles/thyperslab.h5bin1050880 -> 1050880 bytes
-rw-r--r--tools/testfiles/tlarge_objname.h5bin40008 -> 40008 bytes
-rw-r--r--tools/testfiles/tlonglinks.h5bin203168 -> 203168 bytes
-rw-r--r--tools/testfiles/tloop.h5bin3168 -> 3168 bytes
-rw-r--r--tools/testfiles/tloop2.h5bin3168 -> 3168 bytes
-rw-r--r--tools/testfiles/tmulti-s.h5bin2048 -> 2048 bytes
-rw-r--r--tools/testfiles/tname-amp.h5bin2880 -> 2880 bytes
-rw-r--r--tools/testfiles/tname-apos.h5bin2880 -> 2880 bytes
-rw-r--r--tools/testfiles/tname-gt.h5bin2880 -> 2880 bytes
-rw-r--r--tools/testfiles/tname-lt.h5bin2880 -> 2880 bytes
-rw-r--r--tools/testfiles/tname-quot.h5bin2880 -> 2880 bytes
-rw-r--r--tools/testfiles/tname-sp.h5bin2880 -> 2880 bytes
-rw-r--r--tools/testfiles/tnestedcomp.h5bin2072 -> 2072 bytes
-rw-r--r--tools/testfiles/tnodata.h5bin1412 -> 1412 bytes
-rw-r--r--tools/testfiles/tnullspace.h5bin3624 -> 3624 bytes
-rw-r--r--tools/testfiles/tobjref.h5bin2900 -> 2900 bytes
-rw-r--r--tools/testfiles/topaque.h5bin1744 -> 1744 bytes
-rw-r--r--tools/testfiles/tref-escapes-at.h5bin5849 -> 5849 bytes
-rw-r--r--tools/testfiles/tref-escapes.h5bin5536 -> 5536 bytes
-rw-r--r--tools/testfiles/tref.h5bin3004 -> 3004 bytes
-rw-r--r--tools/testfiles/tsaf.h5bin769444 -> 769444 bytes
-rw-r--r--tools/testfiles/tslink.h5bin1168 -> 1168 bytes
-rw-r--r--tools/testfiles/tsplit_file-m.h5bin2048 -> 2048 bytes
-rw-r--r--tools/testfiles/tstr.h5bin15608 -> 15608 bytes
-rw-r--r--tools/testfiles/tstr2.h5bin11096 -> 11096 bytes
-rw-r--r--tools/testfiles/tstr3.h5bin8736 -> 8736 bytes
-rw-r--r--tools/testfiles/tstring-at.h5bin1672 -> 1672 bytes
-rw-r--r--tools/testfiles/tstring.h5bin2160 -> 2160 bytes
-rw-r--r--tools/testfiles/tvldtypes1.h5bin8336 -> 8336 bytes
-rw-r--r--tools/testfiles/tvldtypes2.h5bin6208 -> 6208 bytes
-rw-r--r--tools/testfiles/tvldtypes3.h5bin6240 -> 6240 bytes
-rw-r--r--tools/testfiles/tvldtypes4.h5bin8192 -> 8192 bytes
-rw-r--r--tools/testfiles/tvldtypes5.h5bin8192 -> 8192 bytes
-rw-r--r--tools/testfiles/tvms.h5bin2288 -> 2288 bytes
96 files changed, 654 insertions, 25 deletions
diff --git a/tools/h5diff/testfiles/h5diff_hyper1.h5 b/tools/h5diff/testfiles/h5diff_hyper1.h5
index ceeff80..1fd47e1 100644
--- a/tools/h5diff/testfiles/h5diff_hyper1.h5
+++ b/tools/h5diff/testfiles/h5diff_hyper1.h5
Binary files differ
diff --git a/tools/h5diff/testfiles/h5diff_hyper2.h5 b/tools/h5diff/testfiles/h5diff_hyper2.h5
index 05a2eb1..ad2f468 100644
--- a/tools/h5diff/testfiles/h5diff_hyper2.h5
+++ b/tools/h5diff/testfiles/h5diff_hyper2.h5
Binary files differ
diff --git a/tools/h5diff/testfiles/tmptest.he5 b/tools/h5diff/testfiles/tmptest.he5
index edcfcd2..7dedfc1 100644
--- a/tools/h5diff/testfiles/tmptest.he5
+++ b/tools/h5diff/testfiles/tmptest.he5
Binary files differ
diff --git a/tools/h5diff/testfiles/tmptest2.he5 b/tools/h5diff/testfiles/tmptest2.he5
index a6ab02b..0ce63dc 100644
--- a/tools/h5diff/testfiles/tmptest2.he5
+++ b/tools/h5diff/testfiles/tmptest2.he5
Binary files differ
diff --git a/tools/h5import/testfiles/binfp64.h5 b/tools/h5import/testfiles/binfp64.h5
index 80e3a8a..5426edb 100644
--- a/tools/h5import/testfiles/binfp64.h5
+++ b/tools/h5import/testfiles/binfp64.h5
Binary files differ
diff --git a/tools/h5import/testfiles/binin16.h5 b/tools/h5import/testfiles/binin16.h5
index 0825bbc..6d89c63 100644
--- a/tools/h5import/testfiles/binin16.h5
+++ b/tools/h5import/testfiles/binin16.h5
Binary files differ
diff --git a/tools/h5import/testfiles/binin32.h5 b/tools/h5import/testfiles/binin32.h5
index fd8faa9..61cc507 100644
--- a/tools/h5import/testfiles/binin32.h5
+++ b/tools/h5import/testfiles/binin32.h5
Binary files differ
diff --git a/tools/h5import/testfiles/binin8.h5 b/tools/h5import/testfiles/binin8.h5
index a1d1a37..efd3ae0 100644
--- a/tools/h5import/testfiles/binin8.h5
+++ b/tools/h5import/testfiles/binin8.h5
Binary files differ
diff --git a/tools/h5import/testfiles/binuin16.h5 b/tools/h5import/testfiles/binuin16.h5
index c486c89..1af804c 100644
--- a/tools/h5import/testfiles/binuin16.h5
+++ b/tools/h5import/testfiles/binuin16.h5
Binary files differ
diff --git a/tools/h5import/testfiles/binuin32.h5 b/tools/h5import/testfiles/binuin32.h5
index 41699d7..e7d12d9 100644
--- a/tools/h5import/testfiles/binuin32.h5
+++ b/tools/h5import/testfiles/binuin32.h5
Binary files differ
diff --git a/tools/h5import/testfiles/txtfp32.h5 b/tools/h5import/testfiles/txtfp32.h5
index f74e003..bd41f06 100644
--- a/tools/h5import/testfiles/txtfp32.h5
+++ b/tools/h5import/testfiles/txtfp32.h5
Binary files differ
diff --git a/tools/h5import/testfiles/txtfp64.h5 b/tools/h5import/testfiles/txtfp64.h5
index b6ba4f5..41c4e9e 100644
--- a/tools/h5import/testfiles/txtfp64.h5
+++ b/tools/h5import/testfiles/txtfp64.h5
Binary files differ
diff --git a/tools/h5import/testfiles/txtin16.h5 b/tools/h5import/testfiles/txtin16.h5
index dc6c1ea..5089c97 100644
--- a/tools/h5import/testfiles/txtin16.h5
+++ b/tools/h5import/testfiles/txtin16.h5
Binary files differ
diff --git a/tools/h5import/testfiles/txtin32.h5 b/tools/h5import/testfiles/txtin32.h5
index 350333c..8d547cf 100644
--- a/tools/h5import/testfiles/txtin32.h5
+++ b/tools/h5import/testfiles/txtin32.h5
Binary files differ
diff --git a/tools/h5import/testfiles/txtin8.h5 b/tools/h5import/testfiles/txtin8.h5
index 42e7727..61b7165 100644
--- a/tools/h5import/testfiles/txtin8.h5
+++ b/tools/h5import/testfiles/txtin8.h5
Binary files differ
diff --git a/tools/h5import/testfiles/txtuin16.h5 b/tools/h5import/testfiles/txtuin16.h5
index 9ee166a..c43b875 100644
--- a/tools/h5import/testfiles/txtuin16.h5
+++ b/tools/h5import/testfiles/txtuin16.h5
Binary files differ
diff --git a/tools/h5import/testfiles/txtuin32.h5 b/tools/h5import/testfiles/txtuin32.h5
index 1a4dda5..aec3b0f 100644
--- a/tools/h5import/testfiles/txtuin32.h5
+++ b/tools/h5import/testfiles/txtuin32.h5
Binary files differ
diff --git a/tools/h5repack/testfiles/h5repack_attr.h5 b/tools/h5repack/testfiles/h5repack_attr.h5
index fe066db..3bc4906 100644
--- a/tools/h5repack/testfiles/h5repack_attr.h5
+++ b/tools/h5repack/testfiles/h5repack_attr.h5
Binary files differ
diff --git a/tools/h5repack/testfiles/h5repack_deflate.h5 b/tools/h5repack/testfiles/h5repack_deflate.h5
index 3a4b86d..86d66c0 100644
--- a/tools/h5repack/testfiles/h5repack_deflate.h5
+++ b/tools/h5repack/testfiles/h5repack_deflate.h5
Binary files differ
diff --git a/tools/h5repack/testfiles/h5repack_early.h5 b/tools/h5repack/testfiles/h5repack_early.h5
index 9b92890..0394bef 100644
--- a/tools/h5repack/testfiles/h5repack_early.h5
+++ b/tools/h5repack/testfiles/h5repack_early.h5
Binary files differ
diff --git a/tools/h5repack/testfiles/h5repack_fill.h5 b/tools/h5repack/testfiles/h5repack_fill.h5
index 21516cb..81c32d5 100644
--- a/tools/h5repack/testfiles/h5repack_fill.h5
+++ b/tools/h5repack/testfiles/h5repack_fill.h5
Binary files differ
diff --git a/tools/h5repack/testfiles/h5repack_filters.h5 b/tools/h5repack/testfiles/h5repack_filters.h5
index 042b8db..0600adb 100644
--- a/tools/h5repack/testfiles/h5repack_filters.h5
+++ b/tools/h5repack/testfiles/h5repack_filters.h5
Binary files differ
diff --git a/tools/h5repack/testfiles/h5repack_fletcher.h5 b/tools/h5repack/testfiles/h5repack_fletcher.h5
index 2f137b0..e4e2c05 100644
--- a/tools/h5repack/testfiles/h5repack_fletcher.h5
+++ b/tools/h5repack/testfiles/h5repack_fletcher.h5
Binary files differ
diff --git a/tools/h5repack/testfiles/h5repack_hlink.h5 b/tools/h5repack/testfiles/h5repack_hlink.h5
index 3d22728..b00f9a2 100644
--- a/tools/h5repack/testfiles/h5repack_hlink.h5
+++ b/tools/h5repack/testfiles/h5repack_hlink.h5
Binary files differ
diff --git a/tools/h5repack/testfiles/h5repack_layouto.h5 b/tools/h5repack/testfiles/h5repack_layouto.h5
index a038e68..3322020 100644
--- a/tools/h5repack/testfiles/h5repack_layouto.h5
+++ b/tools/h5repack/testfiles/h5repack_layouto.h5
Binary files differ
diff --git a/tools/h5repack/testfiles/h5repack_nbit.h5 b/tools/h5repack/testfiles/h5repack_nbit.h5
index 3ada112..c678f1c 100644
--- a/tools/h5repack/testfiles/h5repack_nbit.h5
+++ b/tools/h5repack/testfiles/h5repack_nbit.h5
Binary files differ
diff --git a/tools/h5repack/testfiles/h5repack_shuffle.h5 b/tools/h5repack/testfiles/h5repack_shuffle.h5
index d13cca7..6520193 100644
--- a/tools/h5repack/testfiles/h5repack_shuffle.h5
+++ b/tools/h5repack/testfiles/h5repack_shuffle.h5
Binary files differ
diff --git a/tools/h5repack/testfiles/h5repack_soffset.h5 b/tools/h5repack/testfiles/h5repack_soffset.h5
index 89ee99a..a9457d3 100644
--- a/tools/h5repack/testfiles/h5repack_soffset.h5
+++ b/tools/h5repack/testfiles/h5repack_soffset.h5
Binary files differ
diff --git a/tools/h5stat/testfiles/h5stat_filters.h5 b/tools/h5stat/testfiles/h5stat_filters.h5
index 5b5f4bb..cbd4467 100644
--- a/tools/h5stat/testfiles/h5stat_filters.h5
+++ b/tools/h5stat/testfiles/h5stat_filters.h5
Binary files differ
diff --git a/tools/misc/Makefile.am b/tools/misc/Makefile.am
index 882f8f2..dee1050 100644
--- a/tools/misc/Makefile.am
+++ b/tools/misc/Makefile.am
@@ -24,21 +24,24 @@ include $(top_srcdir)/config/commence.am
AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib
#test script and program
-TEST_PROG=h5repart_gentest talign
-TEST_SCRIPT=testh5repart.sh testh5mkgrp.sh
+TEST_PROG=h5repart_gentest talign h5clear_gentest
+TEST_SCRIPT=testh5repart.sh testh5mkgrp.sh testh5clear.sh
-check_PROGRAMS=$(TEST_PROG) repart_test
+
+check_PROGRAMS=$(TEST_PROG) repart_test clear_open_chk
check_SCRIPTS=$(TEST_SCRIPT)
-SCRIPT_DEPEND=h5repart$(EXEEXT) h5mkgrp$(EXEEXT)
+SCRIPT_DEPEND=h5repart$(EXEEXT) h5mkgrp$(EXEEXT) h5clear$(EXEEXT)
+
# These are our main targets, the tools
-bin_PROGRAMS=h5debug h5repart h5mkgrp
+bin_PROGRAMS=h5debug h5repart h5mkgrp h5clear
bin_SCRIPTS=h5redeploy
# Add h5debug, h5repart, and h5mkgrp specific linker flags here
h5debug_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
h5repart_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
h5mkgrp_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
+h5clear_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
# Tell automake to clean h5redeploy script
CLEANFILES=h5redeploy
@@ -49,7 +52,7 @@ CLEANFILES=h5redeploy
CHECK_CLEANFILES+=*.h5 ../testfiles/fst_family*.h5 ../testfiles/scd_family*.h5
# These were generated by configure. Remove them only when distclean.
-DISTCLEANFILES=h5cc testh5repart.sh
+DISTCLEANFILES=h5cc testh5repart.sh testh5clear.sh
# All programs rely on hdf5 library and h5tools library
LDADD=$(LIBH5TOOLS) $(LIBHDF5)
diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in
index 1b8e0eb..d9b2ade 100644
--- a/tools/misc/Makefile.in
+++ b/tools/misc/Makefile.in
@@ -99,11 +99,13 @@ host_triplet = @host@
DIST_COMMON = $(top_srcdir)/config/commence.am \
$(top_srcdir)/config/conclude.am $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am $(top_srcdir)/bin/mkinstalldirs \
- $(srcdir)/h5cc.in $(srcdir)/testh5mkgrp.sh.in \
- $(srcdir)/testh5repart.sh.in $(top_srcdir)/bin/depcomp \
- $(top_srcdir)/bin/test-driver
-check_PROGRAMS = $(am__EXEEXT_1) repart_test$(EXEEXT)
-bin_PROGRAMS = h5debug$(EXEEXT) h5repart$(EXEEXT) h5mkgrp$(EXEEXT)
+ $(srcdir)/h5cc.in $(srcdir)/testh5clear.sh.in \
+ $(srcdir)/testh5mkgrp.sh.in $(srcdir)/testh5repart.sh.in \
+ $(top_srcdir)/bin/depcomp $(top_srcdir)/bin/test-driver
+check_PROGRAMS = $(am__EXEEXT_1) repart_test$(EXEEXT) \
+ clear_open_chk$(EXEEXT)
+bin_PROGRAMS = h5debug$(EXEEXT) h5repart$(EXEEXT) h5mkgrp$(EXEEXT) \
+ h5clear$(EXEEXT)
TESTS = $(am__EXEEXT_1) $(TEST_SCRIPT)
subdir = tools/misc
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -113,19 +115,36 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/H5config.h
-CONFIG_CLEAN_FILES = h5cc testh5mkgrp.sh testh5repart.sh
+CONFIG_CLEAN_FILES = h5cc testh5clear.sh testh5mkgrp.sh \
+ testh5repart.sh
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
-am__EXEEXT_1 = h5repart_gentest$(EXEEXT) talign$(EXEEXT)
+am__EXEEXT_1 = h5repart_gentest$(EXEEXT) talign$(EXEEXT) \
+ h5clear_gentest$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS)
-h5debug_SOURCES = h5debug.c
-h5debug_OBJECTS = h5debug.$(OBJEXT)
-h5debug_LDADD = $(LDADD)
-h5debug_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5)
+clear_open_chk_SOURCES = clear_open_chk.c
+clear_open_chk_OBJECTS = clear_open_chk.$(OBJEXT)
+clear_open_chk_LDADD = $(LDADD)
+clear_open_chk_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
+h5clear_SOURCES = h5clear.c
+h5clear_OBJECTS = h5clear.$(OBJEXT)
+h5clear_LDADD = $(LDADD)
+h5clear_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5)
+h5clear_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(h5clear_LDFLAGS) $(LDFLAGS) -o $@
+h5clear_gentest_SOURCES = h5clear_gentest.c
+h5clear_gentest_OBJECTS = h5clear_gentest.$(OBJEXT)
+h5clear_gentest_LDADD = $(LDADD)
+h5clear_gentest_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5)
+h5debug_SOURCES = h5debug.c
+h5debug_OBJECTS = h5debug.$(OBJEXT)
+h5debug_LDADD = $(LDADD)
+h5debug_DEPENDENCIES = $(LIBH5TOOLS) $(LIBHDF5)
h5debug_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(h5debug_LDFLAGS) $(LDFLAGS) -o $@
@@ -217,10 +236,10 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
-SOURCES = h5debug.c h5mkgrp.c h5repart.c h5repart_gentest.c \
- repart_test.c talign.c
-DIST_SOURCES = h5debug.c h5mkgrp.c h5repart.c h5repart_gentest.c \
- repart_test.c talign.c
+SOURCES = clear_open_chk.c h5clear.c h5clear_gentest.c h5debug.c \
+ h5mkgrp.c h5repart.c h5repart_gentest.c repart_test.c talign.c
+DIST_SOURCES = clear_open_chk.c h5clear.c h5clear_gentest.c h5debug.c \
+ h5mkgrp.c h5repart.c h5repart_gentest.c repart_test.c talign.c
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
@@ -696,22 +715,23 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 \
../testfiles/fst_family*.h5 ../testfiles/scd_family*.h5
#test script and program
-TEST_PROG = h5repart_gentest talign
-TEST_SCRIPT = testh5repart.sh testh5mkgrp.sh
+TEST_PROG = h5repart_gentest talign h5clear_gentest
+TEST_SCRIPT = testh5repart.sh testh5mkgrp.sh testh5clear.sh
check_SCRIPTS = $(TEST_SCRIPT)
-SCRIPT_DEPEND = h5repart$(EXEEXT) h5mkgrp$(EXEEXT)
+SCRIPT_DEPEND = h5repart$(EXEEXT) h5mkgrp$(EXEEXT) h5clear$(EXEEXT)
bin_SCRIPTS = h5redeploy
# Add h5debug, h5repart, and h5mkgrp specific linker flags here
h5debug_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
h5repart_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
h5mkgrp_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
+h5clear_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS)
# Tell automake to clean h5redeploy script
CLEANFILES = h5redeploy
# These were generated by configure. Remove them only when distclean.
-DISTCLEANFILES = h5cc testh5repart.sh
+DISTCLEANFILES = h5cc testh5repart.sh testh5clear.sh
# All programs rely on hdf5 library and h5tools library
LDADD = $(LIBH5TOOLS) $(LIBHDF5)
@@ -777,6 +797,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__aclocal_m4_deps):
h5cc: $(top_builddir)/config.status $(srcdir)/h5cc.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+testh5clear.sh: $(top_builddir)/config.status $(srcdir)/testh5clear.sh.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
testh5mkgrp.sh: $(top_builddir)/config.status $(srcdir)/testh5mkgrp.sh.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
testh5repart.sh: $(top_builddir)/config.status $(srcdir)/testh5repart.sh.in
@@ -840,6 +862,18 @@ clean-checkPROGRAMS:
echo " rm -f" $$list; \
rm -f $$list
+clear_open_chk$(EXEEXT): $(clear_open_chk_OBJECTS) $(clear_open_chk_DEPENDENCIES) $(EXTRA_clear_open_chk_DEPENDENCIES)
+ @rm -f clear_open_chk$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(clear_open_chk_OBJECTS) $(clear_open_chk_LDADD) $(LIBS)
+
+h5clear$(EXEEXT): $(h5clear_OBJECTS) $(h5clear_DEPENDENCIES) $(EXTRA_h5clear_DEPENDENCIES)
+ @rm -f h5clear$(EXEEXT)
+ $(AM_V_CCLD)$(h5clear_LINK) $(h5clear_OBJECTS) $(h5clear_LDADD) $(LIBS)
+
+h5clear_gentest$(EXEEXT): $(h5clear_gentest_OBJECTS) $(h5clear_gentest_DEPENDENCIES) $(EXTRA_h5clear_gentest_DEPENDENCIES)
+ @rm -f h5clear_gentest$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(h5clear_gentest_OBJECTS) $(h5clear_gentest_LDADD) $(LIBS)
+
h5debug$(EXEEXT): $(h5debug_OBJECTS) $(h5debug_DEPENDENCIES) $(EXTRA_h5debug_DEPENDENCIES)
@rm -f h5debug$(EXEEXT)
$(AM_V_CCLD)$(h5debug_LINK) $(h5debug_OBJECTS) $(h5debug_LDADD) $(LIBS)
@@ -905,6 +939,9 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clear_open_chk.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5clear.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5clear_gentest.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5debug.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5mkgrp.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5repart.Po@am__quote@
@@ -1135,6 +1172,13 @@ talign.log: talign$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+h5clear_gentest.log: h5clear_gentest$(EXEEXT)
+ @p='h5clear_gentest$(EXEEXT)'; \
+ b='h5clear_gentest'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
.sh.log:
@p='$<'; \
$(am__set_b); \
diff --git a/tools/misc/clear_open_chk.c b/tools/misc/clear_open_chk.c
new file mode 100644
index 0000000..3a299ec
--- /dev/null
+++ b/tools/misc/clear_open_chk.c
@@ -0,0 +1,72 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#include "hdf5.h"
+#include "H5private.h"
+#include "h5tools.h"
+
+static void usage(void);
+
+static void
+usage(void)
+{
+ HDfprintf(stdout, "\n");
+ HDfprintf(stdout, "Usage error!\n");
+ HDfprintf(stdout, "Usage: clear_open_chk filename\n");
+} /* usage() */
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: To open the file which has zero or nonzero status_flags in
+ * the superblock.
+ *
+ * Return: 0 on success
+ * 1 on failure
+ *
+ * Programmer: Vailin Choi; July 2013
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main(int argc, char *argv[])
+{
+ char *fname; /* The HDF5 file name */
+ hid_t fid; /* File ID */
+
+ /* Check the # of arguments */
+ if(argc != 2) {
+ usage();
+ return(EXIT_FAILURE);
+ }
+
+ /* Get the file name */
+ fname = HDstrdup(argv[1]);
+
+ /* Try opening the file */
+ if((fid = h5tools_fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) {
+ HDfprintf(stdout, "\nclear_open_chk: cannot open the file\n");
+ return EXIT_FAILURE;
+ }
+
+ /* Close the file */
+ if(H5Fclose(fid) < 0) {
+ HDfprintf(stdout, "\nclear_open_chk: cannot close the file\n");
+ return EXIT_FAILURE;
+ }
+
+ /* Return success */
+ return EXIT_SUCCESS;
+
+} /* main() */
diff --git a/tools/misc/h5clear.c b/tools/misc/h5clear.c
new file mode 100644
index 0000000..0be4f8f
--- /dev/null
+++ b/tools/misc/h5clear.c
@@ -0,0 +1,137 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Programmer:
+ *
+ * Purpose:
+ */
+
+#include "hdf5.h"
+#include "H5private.h"
+#include "h5tools.h"
+#include "h5tools_utils.h"
+
+/* Name of tool */
+#define PROGRAMNAME "h5clear"
+
+/* Make this private property (defined in H5Fprivate.h) available to h5clear. */
+#define H5F_ACS_CLEAR_STATUS_FLAGS_NAME "clear_status_flags"
+
+/*-------------------------------------------------------------------------
+ * Function: leave
+ *
+ * Purpose: Close the tools library and exit
+ *
+ * Return: Does not return
+ *
+ *-------------------------------------------------------------------------
+ */
+static void
+leave(int ret)
+{
+ h5tools_close();
+ HDexit(ret);
+
+} /* leave() */
+
+/*-------------------------------------------------------------------------
+ * Function: usage
+ *
+ * Purpose: Prints a usage message
+ *
+ * Return: void
+ *
+ *-------------------------------------------------------------------------
+ */
+static void
+usage(void)
+{
+ HDfprintf(stdout, "usage: h5clear filename\n");
+
+} /* usage() */
+
+
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose:
+ *
+ * Return: Success:
+ * Failure:
+ *
+ * Programmer:
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main (int argc, char *argv[])
+{
+ char *fname; /* File name */
+ hbool_t clear = TRUE; /* To clear the status_flags in the file's superblock */
+ hid_t fapl = -1; /* File access property list */
+ hid_t fid = -1; /* File ID */
+
+ h5tools_setprogname(PROGRAMNAME);
+ h5tools_setstatus(EXIT_SUCCESS);
+
+ /* Disable the HDF5 library's error reporting */
+ H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
+
+ /* initialize h5tools lib */
+ h5tools_init();
+
+ /* Check for the # of arguments */
+ if(argc != 2) {
+ usage();
+ leave(EXIT_FAILURE);
+ }
+
+ /* Duplicate the file name */
+ fname = HDstrdup(argv[opt_ind]);
+
+ /* Get a copy of the file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
+ error_msg("H5Pcreate\n");
+ exit(EXIT_FAILURE);
+ }
+
+ /* Set to clear the status_flags in the file's superblock */
+ /* This is a private property used by h5clear only */
+ if(H5Pset(fapl, H5F_ACS_CLEAR_STATUS_FLAGS_NAME, &clear) < 0) {
+ error_msg("H5Pset\n");
+ exit(EXIT_FAILURE);
+ }
+
+ if((fid = h5tools_fopen(fname, H5F_ACC_RDWR, fapl, NULL, NULL, (size_t)0)) < 0) {
+ error_msg("h5tools_fopen\n");
+ exit(EXIT_FAILURE);
+ }
+
+ /* Close the file */
+ if(H5Fclose(fid) < 0) {
+ error_msg("H5Fclose\n");
+ exit(EXIT_FAILURE);
+ }
+
+ /* CLose the property list */
+ if(H5Pclose(fapl) < 0) {
+ error_msg("H5Pclose\n");
+ exit(EXIT_FAILURE);
+ }
+
+ return EXIT_SUCCESS;
+} /* main() */
diff --git a/tools/misc/h5clear_gentest.c b/tools/misc/h5clear_gentest.c
new file mode 100644
index 0000000..ae057e5
--- /dev/null
+++ b/tools/misc/h5clear_gentest.c
@@ -0,0 +1,238 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#include "hdf5.h"
+#include "H5private.h"
+
+/* The HDF5 test files */
+const char *FILENAME[] = {
+ "h5clear_sec2.h5", /* 0 -- sec2 file */
+ "h5clear_core.h5", /* 1 -- core file */
+ "h5clear_fam_%05d.h5", /* 2 -- family files */
+ "h5clear_split", /* 3 -- split files */
+ "h5clear_invalid.h5" /* 4 -- sec2 file with invalid superblock version */
+};
+
+#define FAMILY_SIZE 1024U
+#define CORE_INCREMENT 1024U
+
+#define SUPER_VERS_OFF 8
+#define SUPER_VERS_SIZE 1
+#define SUPER_VERS_LATEST 2
+
+/*-------------------------------------------------------------------------
+ * Function: main
+ *
+ * Purpose: To create HDF5 files with non-zero status_flags in the superblock
+ * via flushing and exiting without closing the library.
+ *
+ * Due to file locking, status_flag in the superblock will be
+ * nonzero after H5Fcreate. The library will clear status_flags
+ * on file closing. This program, after "H5Fcreate" the files,
+ * exits without going through library closing. Thus, status_flags
+ * for these files are not cleared and users cannot open them.
+ *
+ * These files are used by "h5clear" to see if the tool clears
+ * status_flags properly so users can open the files afterwards.
+ *
+ * Return: Success: 0
+ * Failure: 1
+ *
+ * Programmer: Vailin Choi; July 2013
+ *
+ *-------------------------------------------------------------------------
+ */
+int
+main(void)
+{
+ hid_t fid; /* File ID */
+ hid_t fapl, new_fapl; /* File access property lists */
+ char fname[512]; /* File name */
+ hbool_t new_format; /* To use latest library format or not */
+ int fd; /* File descriptor */
+ uint8_t super_vers; /* Superblock version */
+ ssize_t bytes_written; /* The # of bytes written to the file */
+
+ /* Create a copy of the file access property list */
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ goto error;
+
+ /* Copy the file access property list */
+ if((new_fapl = H5Pcopy(fapl)) < 0)
+ goto error;
+ /* Set to latest library format */
+ if(H5Pset_libver_bounds(new_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
+ goto error;
+
+ /* Create file with/without latest library format */
+ for(new_format = FALSE; new_format <= TRUE; new_format++) {
+ hid_t fapl2, my_fapl; /* File access property lists */
+
+ /* Set to use the appropriate file access property list */
+ if(new_format)
+ fapl2 = new_fapl;
+ else
+ fapl2 = fapl;
+ /*
+ * Create a sec2 file
+ */
+ if((my_fapl = H5Pcopy(fapl2)) < 0)
+ goto error;
+ /* Create the file */
+ sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[0]);
+ if((fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
+ goto error;
+
+ /* Flush the file */
+ if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
+ goto error;
+
+ /* Close the property list */
+ if(H5Pclose(my_fapl) < 0)
+ goto error;
+
+ /*
+ * Create a core file
+ */
+ /* Create a copy of file access property list */
+ if((my_fapl = H5Pcopy(fapl2)) < 0)
+ goto error;
+
+ /* Setup the fapl for the family file driver */
+ if(H5Pset_fapl_core(my_fapl, (size_t)CORE_INCREMENT, TRUE) < 0)
+ goto error;
+
+ /* Create the file */
+ sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[1]);
+ if((fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
+ goto error;
+
+ /* Flush the file */
+ if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
+ goto error;
+
+ /* Close the property list */
+ if(H5Pclose(my_fapl) < 0)
+ goto error;
+
+ /*
+ * Create a family file
+ */
+ /* Create a copy of file access property list */
+ if((my_fapl = H5Pcopy(fapl2)) < 0)
+ goto error;
+
+ /* Setup the fapl for the family file driver */
+ if(H5Pset_fapl_family(my_fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0)
+ goto error;
+
+ /* Create the file */
+ sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[2]);
+ if((fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
+ goto error;
+
+ /* Flush the file */
+ if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
+ goto error;
+
+ /* Close the property list */
+ if(H5Pclose(my_fapl) < 0)
+ goto error;
+
+ /*
+ * Create a split file
+ */
+ /* Create a copy of file access property list */
+ my_fapl = H5Pcopy(fapl2);
+
+ /* Setup the fapl for the split file driver */
+ H5Pset_fapl_split(my_fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT);
+
+ /* Create the file */
+ sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[3]);
+ if((fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
+ goto error;
+
+ /* Flush the file */
+ if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
+ goto error;
+
+ /* Close the property list */
+ if(H5Pclose(my_fapl) < 0)
+ goto error;
+
+ /*
+ * Create a sec2 file but change its superblock version #
+ */
+ /* Create a copy of file access property list */
+ if((my_fapl = H5Pcopy(fapl2)) < 0)
+ goto error;
+ /* Create the file */
+ sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[4]);
+ if((fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
+ goto error;
+
+ /* Flush the file */
+ if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
+ goto error;
+
+ /* Close the property list */
+ if(H5Pclose(my_fapl) < 0)
+ goto error;
+
+ /* Open the test file via system call "open" */
+ if((fd = HDopen(fname, O_RDWR, 0666)) < 0) {
+ HDfprintf(stdout, "cannot open the file\n");
+ goto error;
+ }
+
+ /* Position the file to superblock version via system call "lseek" */
+ if(HDlseek(fd, (off_t)SUPER_VERS_OFF, SEEK_SET) < 0) {
+ HDfprintf(stdout, "cannot lseek the file superblock version\n");
+ goto error;
+ }
+
+ /* Change to an incorrect superblock version */
+ super_vers = SUPER_VERS_LATEST + 1;
+ /* Write to the file via system call "write" */
+ if((bytes_written = HDwrite(fd, &super_vers, (size_t)SUPER_VERS_SIZE)) < 0) {
+ HDfprintf(stdout, "cannot write to the file with incorrect superblock version\n");
+ goto error;
+ }
+
+ /* Close the file via system call "close" */
+ if(HDclose(fd) < 0) {
+ HDfprintf(stdout, "cannot close the file\n");
+ goto error;
+ }
+
+ } /* end for */
+
+ /* Close the property lists */
+ if(H5Pclose(fapl) < 0)
+ goto error;
+ if(H5Pclose(new_fapl) < 0)
+ goto error;
+
+ fflush(stdout);
+ fflush(stderr);
+
+ /* Not going through library closing by calling _exit(0) with success */
+ HD_exit(0);
+
+error:
+
+ /* Exit with failure */
+ HD_exit(1);
+}
diff --git a/tools/misc/testh5clear.sh.in b/tools/misc/testh5clear.sh.in
new file mode 100644
index 0000000..8c98fed
--- /dev/null
+++ b/tools/misc/testh5clear.sh.in
@@ -0,0 +1,135 @@
+#! /bin/sh
+#
+# Copyright by The HDF Group.
+# Copyright by the Board of Trustees of the University of Illinois.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the files COPYING and Copyright.html. COPYING can be found at the root
+# of the source code distribution tree; Copyright.html can be found at the
+# root level of an installed copy of the electronic HDF5 document set and
+# is linked from the top-level documents page. It can also be found at
+# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
+# access to either file, you may request a copy from help@hdfgroup.org.
+#
+# Tests for the h5clear tool
+#
+srcdir=@srcdir@
+TESTNAME=h5clear
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
+H5CLEAR=h5clear
+H5CLEAR_BIN=`pwd`/$H5CLEAR # The path of the tool binary
+
+GENTEST=h5clear_gentest # Generate test files
+GENTEST_BIN=`pwd`/$GENTEST # The path to the binary
+
+OPENCHK=clear_open_chk # Try opening the test file
+OPENCHK_BIN=`pwd`/$OPENCHK # The path to the binary
+
+SUCCEED=0
+FAIL=1
+
+nerrors=0
+verbose=yes
+
+test -d ../testfiles || mkdir ../testfiles
+
+# Print a line-line message left justified in a field of 70 characters
+# beginning with the word "Testing".
+#
+TESTING() {
+ SPACES=" "
+ echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012'
+}
+
+# Algorithm:
+# Try to open the test file--should fail
+# Use "h5clear" to clear the status_flags in the test file
+# Try to open the test file again--should succeed
+# $1 is the filename to H5Fopen() via h5clear
+TOOLTEST() {
+ TESTING $H5CLEAR $1
+ fname=$1
+ #
+ # Try to open the test file
+ $OPENCHK_BIN $fname
+ if test $? -eq $SUCCEED; then
+ echo ".....$OPENCHK: should fail"
+ nerrors=`expr $nerrors + 1`
+ else
+ # Run h5clear to clear the status_flags in the test file
+ $RUNSERIAL $H5CLEAR_BIN $fname
+ if test $? -ne $SUCCEED; then
+ echo ".....$H5CLEAR: should succeed"
+ nerrors=`expr $nerrors + 1`
+ else
+ # Try to open the test file again
+ $OPENCHK_BIN $fname
+ if test $? -ne $SUCCEED; then
+ echo "......$OPENCHK: should succeed"
+ nerrors=`expr $nerrors + 1`
+ else
+ echo "PASSED"
+ fi
+ fi
+ fi
+}
+
+# The input file has an incorrect superblock version #
+# Algorithm:
+# Use "h5clear" to clear status_flags in the test file--should fail not able to open the file
+# $1 is the filename to H5Fopen() via h5clear
+TOOLFAIL() {
+ TESTING $H5CLEAR $1
+ fname=$1
+ # Run h5clear to clear the status_flags in the test file
+ $RUNSERIAL $H5CLEAR_BIN $fname
+ if test $? -eq $SUCCEED; then
+ echo ".....$H5CLEAR: should fail"
+ nerrors=`expr $nerrors + 1`
+ else
+ echo "PASSED"
+ fi
+}
+##############################################################################
+##############################################################################
+### T H E T E S T S ###
+##############################################################################
+##############################################################################
+#
+$GENTEST_BIN # Create HDF5 test files
+if test $? -ne 0; then # Error returned from generating test files
+ echo "$GENTEST: .....fail in generating test files"
+ nerrors=`expr $nerrors + 1`
+else
+ TOOLTEST h5clear_sec2.h5
+ TOOLTEST h5clear_core.h5
+ TOOLTEST h5clear_fam_%05d.h5
+ TOOLTEST h5clear_split
+#
+# files created with latest library format
+ TOOLTEST latest_h5clear_sec2.h5
+ TOOLTEST latest_h5clear_core.h5
+ TOOLTEST latest_h5clear_fam_%05d.h5
+ TOOLTEST latest_h5clear_split
+#
+# files created with incorrect superblock version #
+TOOLFAIL h5clear_invalid.h5
+TOOLFAIL latest_h5clear_invalid.h5
+fi
+#
+# Clean up test files
+if test -z "$HDF5_NOCLEANUP"; then
+ rm -f h5clear_*.h5 latest_h5clear*.h5
+fi
+
+if test $nerrors -eq 0 ; then
+ echo "All $TESTNAME tests passed."
+ exit $EXIT_SUCCESS
+else
+ echo "$TESTNAME tests failed with $nerrors error(s)."
+ exit $EXIT_FAILURE
+fi
diff --git a/tools/testfiles/family_file00000.h5 b/tools/testfiles/family_file00000.h5
index 88f75ca..d86fb96 100644
--- a/tools/testfiles/family_file00000.h5
+++ b/tools/testfiles/family_file00000.h5
Binary files differ
diff --git a/tools/testfiles/taindices.h5 b/tools/testfiles/taindices.h5
index b482a21..c0e5a68 100644
--- a/tools/testfiles/taindices.h5
+++ b/tools/testfiles/taindices.h5
Binary files differ
diff --git a/tools/testfiles/tarray1.h5 b/tools/testfiles/tarray1.h5
index 90371f2..b39d966 100644
--- a/tools/testfiles/tarray1.h5
+++ b/tools/testfiles/tarray1.h5
Binary files differ
diff --git a/tools/testfiles/tarray2.h5 b/tools/testfiles/tarray2.h5
index e2e53e8..4c0b105 100644
--- a/tools/testfiles/tarray2.h5
+++ b/tools/testfiles/tarray2.h5
Binary files differ
diff --git a/tools/testfiles/tarray3.h5 b/tools/testfiles/tarray3.h5
index 580d846..dbc6031 100644
--- a/tools/testfiles/tarray3.h5
+++ b/tools/testfiles/tarray3.h5
Binary files differ
diff --git a/tools/testfiles/tarray4.h5 b/tools/testfiles/tarray4.h5
index b34efb8..142822b 100644
--- a/tools/testfiles/tarray4.h5
+++ b/tools/testfiles/tarray4.h5
Binary files differ
diff --git a/tools/testfiles/tarray5.h5 b/tools/testfiles/tarray5.h5
index 55ebf46..e597e3b 100644
--- a/tools/testfiles/tarray5.h5
+++ b/tools/testfiles/tarray5.h5
Binary files differ
diff --git a/tools/testfiles/tarray6.h5 b/tools/testfiles/tarray6.h5
index 7eb078c..d5ad021 100644
--- a/tools/testfiles/tarray6.h5
+++ b/tools/testfiles/tarray6.h5
Binary files differ
diff --git a/tools/testfiles/tarray7.h5 b/tools/testfiles/tarray7.h5
index 74089ea..a744ed5 100644
--- a/tools/testfiles/tarray7.h5
+++ b/tools/testfiles/tarray7.h5
Binary files differ
diff --git a/tools/testfiles/tattr.h5 b/tools/testfiles/tattr.h5
index d61def5..bceb228 100644
--- a/tools/testfiles/tattr.h5
+++ b/tools/testfiles/tattr.h5
Binary files differ
diff --git a/tools/testfiles/tattr2.h5 b/tools/testfiles/tattr2.h5
index c40f3f7..f062399 100644
--- a/tools/testfiles/tattr2.h5
+++ b/tools/testfiles/tattr2.h5
Binary files differ
diff --git a/tools/testfiles/tbigdims.h5 b/tools/testfiles/tbigdims.h5
index c54c2c3..50bf2fd 100644
--- a/tools/testfiles/tbigdims.h5
+++ b/tools/testfiles/tbigdims.h5
Binary files differ
diff --git a/tools/testfiles/tbitfields.h5 b/tools/testfiles/tbitfields.h5
index 11087f0..b1b7751 100644
--- a/tools/testfiles/tbitfields.h5
+++ b/tools/testfiles/tbitfields.h5
Binary files differ
diff --git a/tools/testfiles/tchar.h5 b/tools/testfiles/tchar.h5
index 4d23ea9..0391772 100644
--- a/tools/testfiles/tchar.h5
+++ b/tools/testfiles/tchar.h5
Binary files differ
diff --git a/tools/testfiles/tcompound.h5 b/tools/testfiles/tcompound.h5
index d1ec650..edef9d3 100644
--- a/tools/testfiles/tcompound.h5
+++ b/tools/testfiles/tcompound.h5
Binary files differ
diff --git a/tools/testfiles/tcompound2.h5 b/tools/testfiles/tcompound2.h5
index 98e80bd..482f9fd 100644
--- a/tools/testfiles/tcompound2.h5
+++ b/tools/testfiles/tcompound2.h5
Binary files differ
diff --git a/tools/testfiles/tcompound_complex.h5 b/tools/testfiles/tcompound_complex.h5
index 5c6274f..a0c90eb 100644
--- a/tools/testfiles/tcompound_complex.h5
+++ b/tools/testfiles/tcompound_complex.h5
Binary files differ
diff --git a/tools/testfiles/tdatareg.h5 b/tools/testfiles/tdatareg.h5
index 62a889f..631d6b0 100644
--- a/tools/testfiles/tdatareg.h5
+++ b/tools/testfiles/tdatareg.h5
Binary files differ
diff --git a/tools/testfiles/tdset.h5 b/tools/testfiles/tdset.h5
index 71dcb91..ae19cf4 100644
--- a/tools/testfiles/tdset.h5
+++ b/tools/testfiles/tdset.h5
Binary files differ
diff --git a/tools/testfiles/tdset2.h5 b/tools/testfiles/tdset2.h5
index 5e17cfd..f3e555b 100644
--- a/tools/testfiles/tdset2.h5
+++ b/tools/testfiles/tdset2.h5
Binary files differ
diff --git a/tools/testfiles/tempty.h5 b/tools/testfiles/tempty.h5
index d7d903f..f6d6b7a 100644
--- a/tools/testfiles/tempty.h5
+++ b/tools/testfiles/tempty.h5
Binary files differ
diff --git a/tools/testfiles/tenum.h5 b/tools/testfiles/tenum.h5
index b1300d8..5521fc4 100644
--- a/tools/testfiles/tenum.h5
+++ b/tools/testfiles/tenum.h5
Binary files differ
diff --git a/tools/testfiles/tfamily00000.h5 b/tools/testfiles/tfamily00000.h5
index a130bfd..70f6dcf 100644
--- a/tools/testfiles/tfamily00000.h5
+++ b/tools/testfiles/tfamily00000.h5
Binary files differ
diff --git a/tools/testfiles/tfcontents2.h5 b/tools/testfiles/tfcontents2.h5
index 1df0779..1514e28 100644
--- a/tools/testfiles/tfcontents2.h5
+++ b/tools/testfiles/tfcontents2.h5
Binary files differ
diff --git a/tools/testfiles/tfvalues.h5 b/tools/testfiles/tfvalues.h5
index a6af958..c238f44 100644
--- a/tools/testfiles/tfvalues.h5
+++ b/tools/testfiles/tfvalues.h5
Binary files differ
diff --git a/tools/testfiles/tgroup.h5 b/tools/testfiles/tgroup.h5
index 565fb67..7c5cd63 100644
--- a/tools/testfiles/tgroup.h5
+++ b/tools/testfiles/tgroup.h5
Binary files differ
diff --git a/tools/testfiles/thlink.h5 b/tools/testfiles/thlink.h5
index 6e0e7e1..0ad92d1 100644
--- a/tools/testfiles/thlink.h5
+++ b/tools/testfiles/thlink.h5
Binary files differ
diff --git a/tools/testfiles/thyperslab.h5 b/tools/testfiles/thyperslab.h5
index a730aa3..dc2c0db 100644
--- a/tools/testfiles/thyperslab.h5
+++ b/tools/testfiles/thyperslab.h5
Binary files differ
diff --git a/tools/testfiles/tlarge_objname.h5 b/tools/testfiles/tlarge_objname.h5
index 707d7b6..9e26283 100644
--- a/tools/testfiles/tlarge_objname.h5
+++ b/tools/testfiles/tlarge_objname.h5
Binary files differ
diff --git a/tools/testfiles/tlonglinks.h5 b/tools/testfiles/tlonglinks.h5
index f54e5f5..6c2cab4 100644
--- a/tools/testfiles/tlonglinks.h5
+++ b/tools/testfiles/tlonglinks.h5
Binary files differ
diff --git a/tools/testfiles/tloop.h5 b/tools/testfiles/tloop.h5
index d7a2f47..e54f91c 100644
--- a/tools/testfiles/tloop.h5
+++ b/tools/testfiles/tloop.h5
Binary files differ
diff --git a/tools/testfiles/tloop2.h5 b/tools/testfiles/tloop2.h5
index 995bfab..60d7ed2 100644
--- a/tools/testfiles/tloop2.h5
+++ b/tools/testfiles/tloop2.h5
Binary files differ
diff --git a/tools/testfiles/tmulti-s.h5 b/tools/testfiles/tmulti-s.h5
index 3feae49..bc2fafb 100644
--- a/tools/testfiles/tmulti-s.h5
+++ b/tools/testfiles/tmulti-s.h5
Binary files differ
diff --git a/tools/testfiles/tname-amp.h5 b/tools/testfiles/tname-amp.h5
index 27ab521..82f6316 100644
--- a/tools/testfiles/tname-amp.h5
+++ b/tools/testfiles/tname-amp.h5
Binary files differ
diff --git a/tools/testfiles/tname-apos.h5 b/tools/testfiles/tname-apos.h5
index 42d0fc3..9b49159 100644
--- a/tools/testfiles/tname-apos.h5
+++ b/tools/testfiles/tname-apos.h5
Binary files differ
diff --git a/tools/testfiles/tname-gt.h5 b/tools/testfiles/tname-gt.h5
index fabd154..1d2795e 100644
--- a/tools/testfiles/tname-gt.h5
+++ b/tools/testfiles/tname-gt.h5
Binary files differ
diff --git a/tools/testfiles/tname-lt.h5 b/tools/testfiles/tname-lt.h5
index 6b13375..e3dafe0 100644
--- a/tools/testfiles/tname-lt.h5
+++ b/tools/testfiles/tname-lt.h5
Binary files differ
diff --git a/tools/testfiles/tname-quot.h5 b/tools/testfiles/tname-quot.h5
index eb8d6cc..fd9e862 100644
--- a/tools/testfiles/tname-quot.h5
+++ b/tools/testfiles/tname-quot.h5
Binary files differ
diff --git a/tools/testfiles/tname-sp.h5 b/tools/testfiles/tname-sp.h5
index 0201efd..514eb8d 100644
--- a/tools/testfiles/tname-sp.h5
+++ b/tools/testfiles/tname-sp.h5
Binary files differ
diff --git a/tools/testfiles/tnestedcomp.h5 b/tools/testfiles/tnestedcomp.h5
index b777ee3..2912310 100644
--- a/tools/testfiles/tnestedcomp.h5
+++ b/tools/testfiles/tnestedcomp.h5
Binary files differ
diff --git a/tools/testfiles/tnodata.h5 b/tools/testfiles/tnodata.h5
index 8e0a89d..1e537f1 100644
--- a/tools/testfiles/tnodata.h5
+++ b/tools/testfiles/tnodata.h5
Binary files differ
diff --git a/tools/testfiles/tnullspace.h5 b/tools/testfiles/tnullspace.h5
index b5dac5d..d405061 100644
--- a/tools/testfiles/tnullspace.h5
+++ b/tools/testfiles/tnullspace.h5
Binary files differ
diff --git a/tools/testfiles/tobjref.h5 b/tools/testfiles/tobjref.h5
index ef42ff3..ecf3827 100644
--- a/tools/testfiles/tobjref.h5
+++ b/tools/testfiles/tobjref.h5
Binary files differ
diff --git a/tools/testfiles/topaque.h5 b/tools/testfiles/topaque.h5
index d56b594..669f4b7 100644
--- a/tools/testfiles/topaque.h5
+++ b/tools/testfiles/topaque.h5
Binary files differ
diff --git a/tools/testfiles/tref-escapes-at.h5 b/tools/testfiles/tref-escapes-at.h5
index 641513c..e3f0d6b 100644
--- a/tools/testfiles/tref-escapes-at.h5
+++ b/tools/testfiles/tref-escapes-at.h5
Binary files differ
diff --git a/tools/testfiles/tref-escapes.h5 b/tools/testfiles/tref-escapes.h5
index 6c7638b..766a840 100644
--- a/tools/testfiles/tref-escapes.h5
+++ b/tools/testfiles/tref-escapes.h5
Binary files differ
diff --git a/tools/testfiles/tref.h5 b/tools/testfiles/tref.h5
index 73b4be5..3a9899a 100644
--- a/tools/testfiles/tref.h5
+++ b/tools/testfiles/tref.h5
Binary files differ
diff --git a/tools/testfiles/tsaf.h5 b/tools/testfiles/tsaf.h5
index c84c5b6..75237ba 100644
--- a/tools/testfiles/tsaf.h5
+++ b/tools/testfiles/tsaf.h5
Binary files differ
diff --git a/tools/testfiles/tslink.h5 b/tools/testfiles/tslink.h5
index 753b62d..ab80d8f 100644
--- a/tools/testfiles/tslink.h5
+++ b/tools/testfiles/tslink.h5
Binary files differ
diff --git a/tools/testfiles/tsplit_file-m.h5 b/tools/testfiles/tsplit_file-m.h5
index a6eef73..d431c70 100644
--- a/tools/testfiles/tsplit_file-m.h5
+++ b/tools/testfiles/tsplit_file-m.h5
Binary files differ
diff --git a/tools/testfiles/tstr.h5 b/tools/testfiles/tstr.h5
index af5384f..ae6a012 100644
--- a/tools/testfiles/tstr.h5
+++ b/tools/testfiles/tstr.h5
Binary files differ
diff --git a/tools/testfiles/tstr2.h5 b/tools/testfiles/tstr2.h5
index d3b1588..b7d4802 100644
--- a/tools/testfiles/tstr2.h5
+++ b/tools/testfiles/tstr2.h5
Binary files differ
diff --git a/tools/testfiles/tstr3.h5 b/tools/testfiles/tstr3.h5
index 9f9112f..727dec5 100644
--- a/tools/testfiles/tstr3.h5
+++ b/tools/testfiles/tstr3.h5
Binary files differ
diff --git a/tools/testfiles/tstring-at.h5 b/tools/testfiles/tstring-at.h5
index aa17960..a477ee5 100644
--- a/tools/testfiles/tstring-at.h5
+++ b/tools/testfiles/tstring-at.h5
Binary files differ
diff --git a/tools/testfiles/tstring.h5 b/tools/testfiles/tstring.h5
index 667fe78..914a464 100644
--- a/tools/testfiles/tstring.h5
+++ b/tools/testfiles/tstring.h5
Binary files differ
diff --git a/tools/testfiles/tvldtypes1.h5 b/tools/testfiles/tvldtypes1.h5
index b5b2bd7..423dae8 100644
--- a/tools/testfiles/tvldtypes1.h5
+++ b/tools/testfiles/tvldtypes1.h5
Binary files differ
diff --git a/tools/testfiles/tvldtypes2.h5 b/tools/testfiles/tvldtypes2.h5
index 65bf63f..86ba20d 100644
--- a/tools/testfiles/tvldtypes2.h5
+++ b/tools/testfiles/tvldtypes2.h5
Binary files differ
diff --git a/tools/testfiles/tvldtypes3.h5 b/tools/testfiles/tvldtypes3.h5
index dd4aca7..66fd1d2 100644
--- a/tools/testfiles/tvldtypes3.h5
+++ b/tools/testfiles/tvldtypes3.h5
Binary files differ
diff --git a/tools/testfiles/tvldtypes4.h5 b/tools/testfiles/tvldtypes4.h5
index 70dc73e..016ad55 100644
--- a/tools/testfiles/tvldtypes4.h5
+++ b/tools/testfiles/tvldtypes4.h5
Binary files differ
diff --git a/tools/testfiles/tvldtypes5.h5 b/tools/testfiles/tvldtypes5.h5
index 776c020..71b924f 100644
--- a/tools/testfiles/tvldtypes5.h5
+++ b/tools/testfiles/tvldtypes5.h5
Binary files differ
diff --git a/tools/testfiles/tvms.h5 b/tools/testfiles/tvms.h5
index 9c243ff..d3b0b7c 100644
--- a/tools/testfiles/tvms.h5
+++ b/tools/testfiles/tvms.h5
Binary files differ