summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2018-07-21 05:46:34 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2018-07-21 05:46:34 (GMT)
commitc983fc3c5bc3cab152ce80990536c2faf4642392 (patch)
tree307d2d51a10cbc86812c65768e121c69dd9051d2
parent4f37cdcd36adb1bafcdf9af49b611180a64d157b (diff)
parent243a36911fb80931225e0044cc654ccbfec3ed10 (diff)
downloadhdf5-c983fc3c5bc3cab152ce80990536c2faf4642392.zip
hdf5-c983fc3c5bc3cab152ce80990536c2faf4642392.tar.gz
hdf5-c983fc3c5bc3cab152ce80990536c2faf4642392.tar.bz2
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/~bmribler/hdf5_bmr_cpp4 into develop
-rwxr-xr-xbin/cmakehdf510
-rw-r--r--config/cmake/HDFCompilerFlags.cmake9
-rw-r--r--config/gnu-flags14
-rw-r--r--configure.ac13
-rw-r--r--java/test/TestH5Lcreate.java10
-rw-r--r--release_docs/RELEASE.txt10
-rw-r--r--src/H5MF.c18
-rw-r--r--src/H5Oattribute.c9
-rw-r--r--test/CMakeTests.cmake19
-rw-r--r--test/Makefile.am2
-rw-r--r--test/ShellTests.cmake28
-rw-r--r--test/tattr.c94
-rw-r--r--tools/test/h5repack/Makefile.am2
13 files changed, 175 insertions, 63 deletions
diff --git a/bin/cmakehdf5 b/bin/cmakehdf5
index 7f6453a..da1aef8 100755
--- a/bin/cmakehdf5
+++ b/bin/cmakehdf5
@@ -46,8 +46,9 @@ cacheinit=$srcdir/config/cmake/cacheinit.cmake
build_cpp_lib=-DHDF5_BUILD_CPP_LIB:BOOL=OFF # C++ interface default off
build_fortran=-DHDF5_BUILD_FORTRAN:BOOL=OFF # Fortran interface default off
build_hl_lib=-DHDF5_BUILD_HL_LIB:BOOL=ON # High Level interface default on
-build_threadsafe=-DHDF5_ENABLE_THREADSAFE:BOOL=OFF # Threadsafe feature default off
+build_threadsafe=-DHDF5_ENABLE_THREADSAFE:BOOL=OFF # Threadsafe feature default off
build_testing=-DBUILD_TESTING:BOOL=ON # Build tests default on
+build_test_shell=-DTEST_SHELL_SCRIPTS:BOOL=ON # Run shell script tests default on
build_tools=-DHDF5_BUILD_TOOLS:BOOL=ON # Build tools default on
with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT=ON # enable zlib filter default on
with_szlib=-DHDF5_ENABLE_SZIP_SUPPORT=OFF # enables szip filter default off
@@ -256,6 +257,12 @@ while [ $# -gt 0 ]; do
--disable-testing)
build_testing=-DBUILD_TESTING:BOOL=OFF
;;
+ --enable-shell-testing)
+ build_test_shell=-DTEST_SHELL_SCRIPTS:BOOL=ON
+ ;;
+ --disable-shell-testing)
+ build_test_shell=-DTEST_SHELL_SCRIPTS:BOOL=OFF
+ ;;
--with-zlib)
with_zlib=-DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON
;;
@@ -342,6 +349,7 @@ STEP "Configure..." \
$build_threadsafe \
$shared_lib \
$build_testing \
+ $build_test_shell \
$build_tools \
$with_zlib \
$with_szlib \
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index 1ba090c..214afa0 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -13,26 +13,27 @@
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
+ set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}")
+ if (NOT CYGWIN)
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
+ endif ()
if (${HDF_CFG_NAME} MATCHES "Debug")
- set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99")
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Og -ftrapv -fno-common")
endif ()
else ()
- set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99")
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstdarg-opt")
endif ()
endif ()
endif ()
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_LOADED)
+ set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}")
if (${HDF_CFG_NAME} MATCHES "Debug")
- set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}")
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common")
endif ()
else ()
- set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}")
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt")
endif ()
diff --git a/config/gnu-flags b/config/gnu-flags
index 2f2e428..ac054bf 100644
--- a/config/gnu-flags
+++ b/config/gnu-flags
@@ -84,6 +84,18 @@ case "$cc_vendor-$cc_version" in
;;
esac
+ case "$host_os-$host_cpu" in
+ # cygwin needs the "-std-c99" flag removed, so make
+ # a specific case for Cygwin without the flag and a default
+ # case to add the flag everywhere else
+ cygwin-*)
+ ;;
+
+ *)
+ H5_CFLAGS="$H5_CFLAGS -std=c99"
+ ;;
+ esac
+
# Host-specific flags
case "`hostname`" in
sleipnir.ncsa.uiuc.edu)
@@ -101,7 +113,7 @@ case "$cc_vendor-$cc_version" in
# NOTE: Don't add -Wpadded here since we can't/won't fix the (many)
# warnings that are emitted. If you need it, add it from the
# environment variable at configure time.
- H5_CFLAGS="$H5_CFLAGS $arch -std=c99 -pedantic -Wall -Wextra -Wbad-function-cast -Wc++-compat -Wcast-align"
+ H5_CFLAGS="$H5_CFLAGS $arch -pedantic -Wall -Wextra -Wbad-function-cast -Wc++-compat -Wcast-align"
H5_CFLAGS="$H5_CFLAGS -Wcast-qual -Wconversion -Wdeclaration-after-statement -Wdisabled-optimization -Wfloat-equal"
H5_CFLAGS="$H5_CFLAGS -Wformat=2 -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-include-dirs"
H5_CFLAGS="$H5_CFLAGS -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith"
diff --git a/configure.ac b/configure.ac
index dfb0a4d..18ede67 100644
--- a/configure.ac
+++ b/configure.ac
@@ -848,19 +848,6 @@ AC_SUBST([RUNPARALLEL])
AC_SUBST([TESTPARALLEL])
## ----------------------------------------------------------------------
-## Disable shared libraries on CYGWIN. (LK - 04/16/15)
-## A number of tests run by "make check" fail on CYGWIN, so for HDF5 v1.8.15
-## we will change the default for shared libraries to disabled.
-
-
-case "`uname`" in
- CYGWIN*)
- enable_shared="no"
- CHECK_WARN="Shared libraries are not currently supported on CYGWIN."
- ;;
-esac
-
-## ----------------------------------------------------------------------
## Check if they would like the Java native interface (JNI) compiled
##
diff --git a/java/test/TestH5Lcreate.java b/java/test/TestH5Lcreate.java
index 646babc..06c4ac1 100644
--- a/java/test/TestH5Lcreate.java
+++ b/java/test/TestH5Lcreate.java
@@ -147,6 +147,13 @@ public class TestH5Lcreate {
H5.H5Pset_link_creation_order(H5fcpl, HDF5Constants.H5P_CRT_ORDER_TRACKED+HDF5Constants.H5P_CRT_ORDER_INDEXED);
H5fid = H5.H5Fcreate(H5_FILE, HDF5Constants.H5F_ACC_TRUNC,
H5fcpl, HDF5Constants.H5P_DEFAULT);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5L.createH5file: " + err);
+ }
+ assertTrue("TestH5L.createH5file: H5.H5Fcreate: ",H5fid > 0);
+ try {
H5dsid = H5.H5Screate_simple(2, H5dims, null);
H5did1 = _createDataset(H5fid, H5dsid, "DS1", HDF5Constants.H5P_DEFAULT);
H5gid = _createGroup(H5fid, "/G1");
@@ -154,9 +161,8 @@ public class TestH5Lcreate {
}
catch (Throwable err) {
err.printStackTrace();
- fail("TestH5L.createH5file: " + err);
+ fail("TestH5L.createH5objs: " + err);
}
- assertTrue("TestH5L.createH5file: H5.H5Fcreate: ",H5fid > 0);
assertTrue("TestH5L.createH5file: H5.H5Screate_simple: ",H5dsid > 0);
assertTrue("TestH5L.createH5file: H5.H5Gcreate: ",H5gid > 0);
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 34d90ff..1976ed6 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -110,6 +110,16 @@ Bug Fixes since HDF5-1.10.2 release
Library
-------
+ - H5Adelete
+
+ H5Adelete failed when deleting the last "large" attribute that
+ is stored densely via fractal heap/v2 b-tree.
+
+ After removing the attribute, update the ainfo message. If the
+ number of attributes goes to zero, remove the message.
+
+ (VC - 2018/07/20, HDFFV-9277)
+
- Error checks in h5stat and when decoding messages
h5stat exited with seg fault/core dumped when
diff --git a/src/H5MF.c b/src/H5MF.c
index 2f60080..65b27db 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -37,7 +37,7 @@
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fpkg.h" /* File access */
-#include "H5FSpkg.h" /* File access */
+#include "H5FSpkg.h" /* File free space */
#include "H5Iprivate.h" /* IDs */
#include "H5MFpkg.h" /* File memory management */
#include "H5VMprivate.h" /* Vectors and arrays */
@@ -322,7 +322,7 @@ H5MF__open_fstype(H5F_t *f, H5F_mem_page_t type)
HDassert(H5F_addr_defined(f->shared->fs_addr[type]));
HDassert(f->shared->fs_state[type] == H5F_FS_STATE_CLOSED);
- /* Set up the aligment and threshold to use depending on the manager type */
+ /* Set up the alignment and threshold to use depending on the manager type */
if(H5F_PAGED_AGGR(f)) {
alignment = (type == H5F_MEM_PAGE_GENERIC) ? f->shared->fs_page_size : (hsize_t)H5F_ALIGN_DEF;
threshold = H5F_ALIGN_THRHD_DEF;
@@ -896,7 +896,7 @@ H5MF__sects_dump(f, stderr);
static haddr_t
H5MF__alloc_pagefs(H5F_t *f, H5FD_mem_t alloc_type, hsize_t size)
{
- H5F_mem_page_t ptype; /* Free-space mananger type */
+ H5F_mem_page_t ptype; /* Free-space manager type */
H5MF_free_section_t *node = NULL; /* Free space section pointer */
haddr_t ret_value = HADDR_UNDEF; /* Return value */
@@ -3049,7 +3049,7 @@ done:
* further space allocations involving them should take
* place during file close.
*
- * On entry to this routine. the free space manager(s) involved
+ * On entry to this routine, the free space manager(s) involved
* in allocation of file space for free space managers should
* still be floating. (i.e. should not have any file space
* allocated to them.)
@@ -3265,7 +3265,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled)
* everything other than the self referential FSMs (and possibly the
* cache image) has been allocated at this point, this allows us to
* to float the self referential FSMs on the first file space allocation /
- * deallocaiton and then set the EOA to this value before we handle
+ * deallocation and then set the EOA to this value before we handle
* the allocation / deallocation. (If a cache image exists, the
* first allocation / deallocation will be the deallocation of space
* for the cache image).
@@ -3297,7 +3297,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled)
/* ******************* PROBLEM: ********************
*
* If the file has an alignment other than 1, and if
- * the EOA is not a multiple of this alignment, allocating sapce
+ * the EOA is not a multiple of this alignment, allocating space
* for the section via the VFD info has the potential of generating
* a fragment that will be added to the free space manager. This
* of course undoes everything we have been doing here.
@@ -3324,7 +3324,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled)
* end of file via H5FD_alloc().
*
* In the past, this issue of allocating space without touching the
- * free space managers has been deal with by calling
+ * free space managers has been dealt with by calling
* H5MF_aggr_vfd_alloc(), which in turn calls H5MF_aggr_alloc().
* This is problematic since (if I read the code correctly) it will
* re-constitute the metadata aggregator, which will add any leftover
@@ -3369,7 +3369,7 @@ H5MF_settle_meta_data_fsm(H5F_t *f, hbool_t *fsm_settled)
/* All free space managers should have file space allocated for them
* now, and should see no further allocations / deallocations. Store
- * the pre and post file space allocaton for self referential FSMs EOA
+ * the pre and post file space allocation for self referential FSMs EOA
* for use when we actually write the free space manager superblock
* extension message.
*/
@@ -3532,7 +3532,7 @@ H5MF__fsm_is_self_referential(H5F_t *f, H5FS_t *fspace)
*
* 3) Load the self referential FSMs. In passing verify that
* the lowest address of a FSM header is equal to
- * f->shared->eoa_pre_fsm_fsalloc.'
+ * f->shared->eoa_pre_fsm_fsalloc.
*
* Note that we don't have to use any special I/O for
* this -- we can use the regular I/O methods even if
diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c
index e8a8433..640d1c7 100644
--- a/src/H5Oattribute.c
+++ b/src/H5Oattribute.c
@@ -1448,6 +1448,12 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo)
} /* end if */
} /* end if */
+ /* Update the message after removing the attribute */
+ /* This is particularly needed when removing the last attribute that is
+ accessed via fractal heap/v2 B-tree (HDFFV-9277) */
+ if(H5O__msg_write_real(loc->file, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, ainfo) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info message")
+
/* Check if we have deleted all the attributes and the attribute info
* message should be deleted itself.
*/
@@ -1455,9 +1461,6 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, H5O_ainfo_t *ainfo)
if(H5O__msg_remove_real(loc->file, oh, H5O_MSG_AINFO, H5O_ALL, NULL, NULL, TRUE) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute info")
} /* end if */
- else
- if(H5O__msg_write_real(loc->file, oh, H5O_MSG_AINFO, H5O_MSG_FLAG_DONTSHARE, 0, ainfo) < 0)
- HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info message")
done:
/* Release resources */
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index 34e21f7..cc6ebb8 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -720,6 +720,23 @@ if (BUILD_SHARED_LIBS)
endif ()
endif ()
+#-- Adding test for tcheck_version
+add_test (NAME H5TEST-tcheck_version-major COMMAND $<TARGET_FILE:tcheck_version> "-tM")
+set_tests_properties (H5TEST-tcheck_version-major PROPERTIES
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ WILL_FAIL "true"
+)
+add_test (NAME H5TEST-tcheck_version-minor COMMAND $<TARGET_FILE:tcheck_version> "-tm")
+set_tests_properties (H5TEST-tcheck_version-minor PROPERTIES
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ WILL_FAIL "true"
+)
+add_test (NAME H5TEST-tcheck_version-release COMMAND $<TARGET_FILE:tcheck_version> "-tr")
+set_tests_properties (H5TEST-tcheck_version-release PROPERTIES
+ WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
+ WILL_FAIL "true"
+)
+
##############################################################################
##############################################################################
@@ -730,7 +747,6 @@ endif ()
#---------------
# error_test
# err_compat
-# tcheck_version
# testmeta
# atomic_writer
# atomic_reader
@@ -740,7 +756,6 @@ endif ()
##############################################################################
# autotools script tests
# error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh.
-# NOT CONVERTED tcheck_version is used by testcheck_version.sh.
# NOT CONVERTED accum_swmr_reader is used by accum.c.
# NOT CONVERTED atomic_writer and atomic_reader are standalone programs.
# links_env is used by testlinks_env.sh
diff --git a/test/Makefile.am b/test/Makefile.am
index dcc002c..b9aa3fb 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -115,6 +115,8 @@ if HAVE_SHARED_CONDITIONAL
libfilter_plugin2_dsets_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
libfilter_plugin3_dsets_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
libfilter_plugin4_groups_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
+ libfilter_plugin3_dsets_la_LIBADD=$(LIBHDF5)
+ libfilter_plugin4_groups_la_LIBADD=$(LIBHDF5)
else
# The libh5test library provides common support code for the tests.
noinst_LTLIBRARIES=libh5test.la
diff --git a/test/ShellTests.cmake b/test/ShellTests.cmake
index fe997b2..58dc85d 100644
--- a/test/ShellTests.cmake
+++ b/test/ShellTests.cmake
@@ -28,7 +28,6 @@ if (UNIX)
configure_file(${HDF5_TEST_SOURCE_DIR}/testflushrefresh.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testflushrefresh.sh @ONLY)
endif ()
configure_file(${HDF5_TEST_SOURCE_DIR}/test_usecases.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/test_usecases.sh @ONLY)
- configure_file(${HDF5_TEST_SOURCE_DIR}/testcheck_version.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testcheck_version.sh @ONLY)
configure_file(${HDF5_TEST_SOURCE_DIR}/testswmr.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testswmr.sh @ONLY)
configure_file(${HDF5_TEST_SOURCE_DIR}/testvdsswmr.sh.in ${HDF5_TEST_BINARY_DIR}/H5TEST/testvdsswmr.sh @ONLY)
@@ -49,27 +48,6 @@ if (UNIX)
ARGS -E copy_if_different "${HDF5_SOURCE_DIR}/bin/output_filter.sh" "${HDF5_TEST_BINARY_DIR}/H5TEST/bin/output_filter.sh"
)
- add_custom_command (
- TARGET tcheck_version
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "${HDF5_BINARY_DIR}/H5pubconf.h" "${HDF5_TEST_BINARY_DIR}/src/H5pubconf.h"
- )
-
- add_custom_command (
- TARGET tcheck_version
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "${HDF5_BINARY_DIR}/libhdf5.settings" "${HDF5_TEST_BINARY_DIR}/src/libhdf5.settings"
- )
-
- add_custom_command (
- TARGET tcheck_version
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different "${HDF5_SOURCE_DIR}/src/H5public.h" "${HDF5_TEST_BINARY_DIR}/src/H5public.h"
- )
-
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/flushrefresh_test")
add_custom_command (
TARGET flushrefresh
@@ -190,7 +168,6 @@ if (UNIX)
##############################################################################
# H5_CHECK_TESTS
#---------------
- # tcheck_version
# atomic_writer
# atomic_reader
# filenotclosed
@@ -198,7 +175,6 @@ if (UNIX)
##############################################################################
# autotools script tests
# error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh.
- # NOT CONVERTED tcheck_version is used by testcheck_version.sh.
# NOT CONVERTED accum_swmr_reader is used by accum.c.
# NOT CONVERTED atomic_writer and atomic_reader are standalone programs.
# links_env is used by testlinks_env.sh
@@ -235,10 +211,6 @@ if (UNIX)
set_tests_properties (H5SHELL-testvdsswmr PROPERTIES
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
- add_test (H5SHELL-testcheck_version ${SH_PROGRAM} ${HDF5_TEST_BINARY_DIR}/H5TEST/testcheck_version.sh)
- set_tests_properties (H5SHELL-testcheck_version PROPERTIES
- WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
- )
endif ()
endif ()
diff --git a/test/tattr.c b/test/tattr.c
index bf9ce96..4358d4c 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -136,6 +136,13 @@ float attr_data5=-5.123F; /* Test data for 5th attribute */
#define BUG3_DT_NAME "dt"
#define BUG3_ATTR_NAME "attr"
+/* Used by test_attr_delete_last_dense() */
+#define GRPNAME "grp"
+#define ATTRNAME "attr"
+#define DIM0 100
+#define DIM1 100
+#define RANK 2
+
/* Attribute iteration struct */
typedef struct {
H5_iter_order_t order; /* Direction of iteration */
@@ -10672,6 +10679,92 @@ test_attr_bug9(hid_t fcpl, hid_t fapl)
/****************************************************************
**
+** test_attr_delete_dense():
+** This is to verify the error as described in HDFFV-9277
+** is fixed when deleting the last "large" attribute that
+** is stored densely.
+**
+****************************************************************/
+static void
+test_attr_delete_last_dense(hid_t fcpl, hid_t fapl)
+{
+ hid_t fid; /* File ID */
+ hid_t gid; /* Group ID */
+ hid_t aid; /* Attribute ID */
+ hid_t sid; /* Dataspace ID */
+ hsize_t dim2[2] = {DIM0, DIM1}; /* Dimension sizes */
+ int i, j; /* Local index variables */
+ double *data = NULL; /* Pointer to the data buffer */
+ herr_t ret; /* Generic return status */
+
+ /* Output message about test being performed */
+ MESSAGE(5, ("Testing Deleting the last large attribute stored densely\n"));
+
+ /* Create the file */
+ fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Create the group */
+ gid = H5Gcreate2(fid, GRPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gcreate");
+
+ /* Create the dataspace */
+ sid = H5Screate_simple(RANK, dim2, NULL);
+ CHECK(sid, FAIL, "H5Screate_simple");
+
+ /* Attach the attribute to the group */
+ aid = H5Acreate2(gid, ATTRNAME, H5T_IEEE_F64LE, sid, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(aid, FAIL, "H5Acreate2");
+
+ /* Allocate the data buffer */
+ data = (double *)HDmalloc((size_t)(DIM0 * DIM1) * sizeof(double));
+ CHECK_PTR(data, "HDmalloc");
+
+ /* Initialize the data */
+ for(i = 0; i < DIM0; i++)
+ for(j = 0; j < DIM1; j++)
+ *(data + i * DIM1 + j) = i + j;
+
+ /* Write to the attribute */
+ ret = H5Awrite(aid, H5T_NATIVE_DOUBLE, data);
+ CHECK(ret, FAIL, "H5Awrite");
+
+ /* Closing */
+ ret = H5Aclose(aid);
+ CHECK(ret, FAIL, "H5Aclose");
+ ret = H5Sclose(sid);
+ CHECK(ret, FAIL, "H5Sclose");
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Re-open the file */
+ fid = H5Fopen(FILENAME, H5F_ACC_RDWR, fapl);
+ CHECK(fid, FAIL, "H5Fopen");
+
+ /* Open the group */
+ gid = H5Gopen2(fid, GRPNAME, H5P_DEFAULT);
+ CHECK(gid, FAIL, "H5Gopen");
+
+ /* Delete the attribute */
+ ret = H5Adelete(gid, ATTRNAME);
+ CHECK(ret, FAIL, "H5Adelete");
+
+ /* Closing */
+ ret = H5Gclose(gid);
+ CHECK(ret, FAIL, "H5Gclose");
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Free the data buffer */
+ if(data)
+ HDfree(data);
+
+} /* test_attr_delete_last_dense() */
+
+/****************************************************************
+**
** test_attr(): Main H5A (attribute) testing routine.
**
****************************************************************/
@@ -10819,6 +10912,7 @@ test_attr(void)
test_attr_bug7(my_fcpl, my_fapl); /* Test creating and deleting large attributes in ohdr chunk 0 */
test_attr_bug8(my_fcpl, my_fapl); /* Test attribute expanding object header with undecoded messages */
test_attr_bug9(my_fcpl, my_fapl); /* Test large attributes converting to dense storage */
+ test_attr_delete_last_dense(my_fcpl, my_fapl); /* Test */
} /* end for */
} /* end if */
else {
diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am
index ce7cad4..59d7a6a 100644
--- a/tools/test/h5repack/Makefile.am
+++ b/tools/test/h5repack/Makefile.am
@@ -50,6 +50,8 @@ if HAVE_SHARED_CONDITIONAL
libdynlibvers_la_SOURCES=dynlib_vrpk.c
libdynlibadd_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
libdynlibvers_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
+ libdynlibadd_la_LIBADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
+ libdynlibvers_la_LIBADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5)
endif