From 348c380e3f17e3a7e221780b5daba18427cc7bea Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 2 Feb 2009 20:41:51 -0500 Subject: [svn-r16401] Description: Correct error introduced in r16353 with layout version, and add test so it gets caught earlier. Tested on: FreeBSD/32 6.3 (duty) Too minor to require h5committest --- MANIFEST | 1 + src/H5Olayout.c | 2 +- tools/h5repack/h5repack.sh.in | 5 +++++ tools/h5repack/testfiles/h5repack_layouto.h5 | Bin 0 -> 1576 bytes 4 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 tools/h5repack/testfiles/h5repack_layouto.h5 diff --git a/MANIFEST b/MANIFEST index 5913ba4..6114000 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1500,6 +1500,7 @@ ./tools/h5repack/testfiles/h5repack_attr.h5 ./tools/h5repack/testfiles/h5repack_hlink.h5 ./tools/h5repack/testfiles/h5repack_layout.h5 +./tools/h5repack/testfiles/h5repack_layouto.h5 ./tools/h5repack/testfiles/h5repack_early.h5 ./tools/h5repack/testfiles/h5repack_szip.h5 ./tools/h5repack/testfiles/h5repack_deflate.h5 diff --git a/src/H5Olayout.c b/src/H5Olayout.c index a23e3ef..f914006 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -300,7 +300,7 @@ H5O_layout_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const voi HDassert(p); /* Message version */ - *p++ = (uint8_t)mesg->version; + *p++ = (uint8_t)H5O_LAYOUT_VERSION_3; /* Layout class */ *p++ = mesg->type; diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index 422c8dd..ba3bdfe 100755 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -51,6 +51,8 @@ FILE10=h5repack_fletcher.h5 FILE11=h5repack_filters.h5 FILE12=h5repack_nbit.h5 FILE13=h5repack_soffset.h5 +FILE14=h5repack_layouto.h5 # A file with an older version of the layout message + # (copy of test/tlayouto.h5) nerrors=0 @@ -498,6 +500,9 @@ TOOLTEST $arg arg="$FILE1 -t 1 -a 1 " TOOLTEST $arg +# Check repacking file with old version of layout message (should get upgraded +# to new version and be readable, etc.) +TOOLTEST $FILE14 if test $nerrors -eq 0 ; then echo "All $H5REPACK tests passed." diff --git a/tools/h5repack/testfiles/h5repack_layouto.h5 b/tools/h5repack/testfiles/h5repack_layouto.h5 new file mode 100644 index 0000000..a038e68 Binary files /dev/null and b/tools/h5repack/testfiles/h5repack_layouto.h5 differ -- cgit v0.12