mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/hdffv/hdf5 into develop
This commit is contained in:
commit
833a4f73fd
@ -144,7 +144,7 @@ if (TEST_MASK_ERROR)
|
|||||||
# the error stack remains in the .err file
|
# the error stack remains in the .err file
|
||||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
|
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
|
||||||
endif ()
|
endif ()
|
||||||
string (REGEX REPLACE "[.]*_pmi_alps[.]*\n" "" TEST_STREAM "${TEST_STREAM}")
|
string (REGEX REPLACE "^.*_pmi_alps[^\n]+\n" "" TEST_STREAM "${TEST_STREAM}")
|
||||||
string (REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}")
|
string (REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}")
|
||||||
string (REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}")
|
string (REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}")
|
||||||
string (REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}")
|
string (REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}")
|
||||||
|
@ -1175,7 +1175,6 @@ public class H5 implements java.io.Serializable {
|
|||||||
|
|
||||||
public synchronized static native int H5Aread_reg_ref(long attr_id, long mem_type_id, String[] buf)
|
public synchronized static native int H5Aread_reg_ref(long attr_id, long mem_type_id, String[] buf)
|
||||||
throws HDF5LibraryException, NullPointerException;
|
throws HDF5LibraryException, NullPointerException;
|
||||||
throws HDF5LibraryException, NullPointerException;
|
|
||||||
|
|
||||||
public synchronized static native int H5Aread_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning)
|
public synchronized static native int H5Aread_short(long attr_id, long mem_type_id, short[] buf, boolean isCriticalPinning)
|
||||||
throws HDF5LibraryException, NullPointerException;
|
throws HDF5LibraryException, NullPointerException;
|
||||||
|
@ -48,7 +48,9 @@ set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
|
|||||||
|
|
||||||
########### JNI libraries always must be built shared ###############
|
########### JNI libraries always must be built shared ###############
|
||||||
add_library (${HDF5_JAVA_JNI_LIB_TARGET} SHARED ${HDF5_JAVA_JNI_CSRCS} ${HDF5_JAVA_JNI_CHDRS})
|
add_library (${HDF5_JAVA_JNI_LIB_TARGET} SHARED ${HDF5_JAVA_JNI_CSRCS} ${HDF5_JAVA_JNI_CHDRS})
|
||||||
target_include_directories(${HDF5_JAVA_JNI_LIB_TARGET} PRIVATE ${HDF5_BINARY_DIR} ${HDF5_JAVA_JNI_SOURCE_DIR})
|
target_include_directories(${HDF5_JAVA_JNI_LIB_TARGET}
|
||||||
|
PRIVATE "${HDF5_BINARY_DIR};${HDF5_JAVA_JNI_SOURCE_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
|
||||||
|
)
|
||||||
TARGET_C_PROPERTIES (${HDF5_JAVA_JNI_LIB_TARGET} SHARED)
|
TARGET_C_PROPERTIES (${HDF5_JAVA_JNI_LIB_TARGET} SHARED)
|
||||||
target_link_libraries (${HDF5_JAVA_JNI_LIB_TARGET} PUBLIC ${HDF5_LIBSH_TARGET})
|
target_link_libraries (${HDF5_JAVA_JNI_LIB_TARGET} PUBLIC ${HDF5_LIBSH_TARGET})
|
||||||
set_target_properties (${HDF5_JAVA_JNI_LIB_TARGET} PROPERTIES FOLDER libraries/jni)
|
set_target_properties (${HDF5_JAVA_JNI_LIB_TARGET} PROPERTIES FOLDER libraries/jni)
|
||||||
|
@ -950,6 +950,7 @@ if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c)
|
|||||||
)
|
)
|
||||||
add_custom_command (
|
add_custom_command (
|
||||||
OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
|
OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
|
||||||
|
${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1
|
||||||
COMMAND ${HDF5_BATCH_CMD}
|
COMMAND ${HDF5_BATCH_CMD}
|
||||||
ARGS ${HDF5_BINARY_DIR}/${HDF5_BATCH_H5DETECT_SCRIPT}
|
ARGS ${HDF5_BINARY_DIR}/${HDF5_BATCH_H5DETECT_SCRIPT}
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
@ -965,6 +966,7 @@ if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c)
|
|||||||
if (BUILD_SHARED_LIBS)
|
if (BUILD_SHARED_LIBS)
|
||||||
add_custom_command (
|
add_custom_command (
|
||||||
OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c
|
OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c
|
||||||
|
${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c"
|
ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c"
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
@ -977,6 +979,7 @@ if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c)
|
|||||||
else ()
|
else ()
|
||||||
add_custom_command (
|
add_custom_command (
|
||||||
OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
|
OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
|
||||||
|
${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1
|
||||||
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5detect>
|
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5detect>
|
||||||
ARGS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
|
ARGS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
@ -987,6 +990,7 @@ if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c)
|
|||||||
if (BUILD_SHARED_LIBS)
|
if (BUILD_SHARED_LIBS)
|
||||||
add_custom_command (
|
add_custom_command (
|
||||||
OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c
|
OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c
|
||||||
|
${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c"
|
ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c"
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
@ -998,6 +1002,26 @@ if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c)
|
|||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c PROPERTIES GENERATED TRUE)
|
set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c PROPERTIES GENERATED TRUE)
|
||||||
|
else ()
|
||||||
|
add_custom_command (
|
||||||
|
OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/gen_SRCS.stamp1
|
||||||
|
DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
|
||||||
|
WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}
|
||||||
|
)
|
||||||
|
if (BUILD_SHARED_LIBS)
|
||||||
|
add_custom_command (
|
||||||
|
OUTPUT ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
ARGS -E copy_if_different "${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c" "${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c"
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
ARGS -E touch ${HDF5_GENERATED_SOURCE_DIR}/shared/shared_gen_SRCS.stamp1
|
||||||
|
DEPENDS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c
|
||||||
|
WORKING_DIRECTORY ${HDF5_GENERATED_SOURCE_DIR}
|
||||||
|
)
|
||||||
|
set_source_files_properties (${HDF5_GENERATED_SOURCE_DIR}/shared/H5Tinit.c PROPERTIES GENERATED TRUE)
|
||||||
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c)
|
add_executable (H5make_libsettings ${HDF5_SRC_DIR}/H5make_libsettings.c)
|
||||||
@ -1011,6 +1035,7 @@ target_link_libraries (H5make_libsettings
|
|||||||
|
|
||||||
add_custom_command (
|
add_custom_command (
|
||||||
OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c
|
OUTPUT ${HDF5_BINARY_DIR}/H5lib_settings.c
|
||||||
|
${HDF5_BINARY_DIR}/gen_SRCS.stamp2
|
||||||
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5make_libsettings>
|
COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}$<TARGET_FILE:H5make_libsettings>
|
||||||
ARGS ${HDF5_BINARY_DIR}/H5lib_settings.c
|
ARGS ${HDF5_BINARY_DIR}/H5lib_settings.c
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
@ -1022,6 +1047,7 @@ set_source_files_properties (${HDF5_BINARY_DIR}/H5lib_settings.c PROPERTIES GENE
|
|||||||
if (BUILD_SHARED_LIBS)
|
if (BUILD_SHARED_LIBS)
|
||||||
add_custom_command (
|
add_custom_command (
|
||||||
OUTPUT ${HDF5_BINARY_DIR}/shared/H5lib_settings.c
|
OUTPUT ${HDF5_BINARY_DIR}/shared/H5lib_settings.c
|
||||||
|
${HDF5_BINARY_DIR}/shared/shared_gen_SRCS.stamp2
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
ARGS -E copy_if_different "${HDF5_BINARY_DIR}/H5lib_settings.c" "${HDF5_BINARY_DIR}/shared/H5lib_settings.c"
|
ARGS -E copy_if_different "${HDF5_BINARY_DIR}/H5lib_settings.c" "${HDF5_BINARY_DIR}/shared/H5lib_settings.c"
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
@ -1046,6 +1046,8 @@ H5Aget_info(hid_t attr_id, H5A_info_t *ainfo)
|
|||||||
/* Check arguments */
|
/* Check arguments */
|
||||||
if(NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR)))
|
if(NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR)))
|
||||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute")
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute")
|
||||||
|
if(!ainfo)
|
||||||
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "attribute_info parameter cannot be NULL")
|
||||||
|
|
||||||
loc_params.type = H5VL_OBJECT_BY_SELF;
|
loc_params.type = H5VL_OBJECT_BY_SELF;
|
||||||
loc_params.obj_type = H5I_get_type(attr_id);
|
loc_params.obj_type = H5I_get_type(attr_id);
|
||||||
|
65
test/tattr.c
65
test/tattr.c
@ -143,6 +143,10 @@ float attr_data5=-5.123F; /* Test data for 5th attribute */
|
|||||||
#define DIM1 100
|
#define DIM1 100
|
||||||
#define RANK 2
|
#define RANK 2
|
||||||
|
|
||||||
|
/* Used by test_attr_info_null_info_pointer() */
|
||||||
|
#define GET_INFO_NULL_POINTER_ATTR_NAME "NullInfoPointerAttr"
|
||||||
|
|
||||||
|
|
||||||
/* Attribute iteration struct */
|
/* Attribute iteration struct */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
H5_iter_order_t order; /* Direction of iteration */
|
H5_iter_order_t order; /* Direction of iteration */
|
||||||
@ -5874,6 +5878,65 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
|
|||||||
CHECK(ret, FAIL, "H5Sclose");
|
CHECK(ret, FAIL, "H5Sclose");
|
||||||
} /* test_attr_info_by_idx() */
|
} /* test_attr_info_by_idx() */
|
||||||
|
|
||||||
|
|
||||||
|
/***************************************************************
|
||||||
|
**
|
||||||
|
** test_attr_info_null_info_pointer(): A test to ensure that
|
||||||
|
** passing a NULL attribute info pointer to H5Aget_info
|
||||||
|
** (_by_name/_by_idx) doesn't cause bad behavior.
|
||||||
|
**
|
||||||
|
****************************************************************/
|
||||||
|
static void
|
||||||
|
test_attr_info_null_info_pointer(hid_t fcpl, hid_t fapl)
|
||||||
|
{
|
||||||
|
herr_t err_ret = -1;
|
||||||
|
hid_t fid;
|
||||||
|
hid_t attr;
|
||||||
|
hid_t sid;
|
||||||
|
|
||||||
|
/* Create dataspace for dataset & attributes */
|
||||||
|
sid = H5Screate(H5S_SCALAR);
|
||||||
|
CHECK(sid, FAIL, "H5Screate");
|
||||||
|
|
||||||
|
/* Create file */
|
||||||
|
fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl);
|
||||||
|
CHECK(fid, FAIL, "H5Fcreate");
|
||||||
|
|
||||||
|
/* Create attribute */
|
||||||
|
attr = H5Acreate2(fid, GET_INFO_NULL_POINTER_ATTR_NAME, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT);
|
||||||
|
CHECK(attr, FAIL, "H5Acreate2");
|
||||||
|
|
||||||
|
H5E_BEGIN_TRY {
|
||||||
|
err_ret = H5Aget_info(attr, NULL);
|
||||||
|
} H5E_END_TRY;
|
||||||
|
|
||||||
|
CHECK(err_ret, SUCCEED, "H5Aget_info");
|
||||||
|
|
||||||
|
H5E_BEGIN_TRY {
|
||||||
|
err_ret = H5Aget_info_by_name(fid, ".", GET_INFO_NULL_POINTER_ATTR_NAME, NULL, H5P_DEFAULT);
|
||||||
|
} H5E_END_TRY;
|
||||||
|
|
||||||
|
CHECK(err_ret, SUCCEED, "H5Aget_info_by_name");
|
||||||
|
|
||||||
|
H5E_BEGIN_TRY {
|
||||||
|
err_ret = H5Aget_info_by_idx(fid, ".", H5_INDEX_NAME, H5_ITER_INC, 0, NULL, H5P_DEFAULT);
|
||||||
|
} H5E_END_TRY;
|
||||||
|
|
||||||
|
CHECK(err_ret, SUCCEED, "H5Aget_info_by_idx");
|
||||||
|
|
||||||
|
/* Close dataspace */
|
||||||
|
err_ret = H5Sclose(sid);
|
||||||
|
CHECK(err_ret, FAIL, "H5Sclose");
|
||||||
|
|
||||||
|
/* Close attribute */
|
||||||
|
err_ret = H5Aclose(attr);
|
||||||
|
CHECK(err_ret, FAIL, "H5Aclose");
|
||||||
|
|
||||||
|
/* Close file */
|
||||||
|
err_ret = H5Fclose(fid);
|
||||||
|
CHECK(err_ret, FAIL, "H5Fclose");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************
|
/****************************************************************
|
||||||
**
|
**
|
||||||
@ -10875,6 +10938,7 @@ test_attr(void)
|
|||||||
test_attr_null_space(my_fcpl, my_fapl); /* Test storing attribute with NULL dataspace */
|
test_attr_null_space(my_fcpl, my_fapl); /* Test storing attribute with NULL dataspace */
|
||||||
test_attr_deprec(fcpl, my_fapl); /* Test deprecated API routines */
|
test_attr_deprec(fcpl, my_fapl); /* Test deprecated API routines */
|
||||||
test_attr_many(new_format, my_fcpl, my_fapl); /* Test storing lots of attributes */
|
test_attr_many(new_format, my_fcpl, my_fapl); /* Test storing lots of attributes */
|
||||||
|
test_attr_info_null_info_pointer(my_fcpl, my_fapl); /* Test passing a NULL attribute info pointer to H5Aget_info(_by_name/_by_idx) */
|
||||||
|
|
||||||
/* Attribute creation order tests */
|
/* Attribute creation order tests */
|
||||||
test_attr_corder_create_basic(my_fcpl, my_fapl);/* Test creating an object w/attribute creation order info */
|
test_attr_corder_create_basic(my_fcpl, my_fapl);/* Test creating an object w/attribute creation order info */
|
||||||
@ -10919,6 +10983,7 @@ test_attr(void)
|
|||||||
test_attr_null_space(fcpl, my_fapl); /* Test storing attribute with NULL dataspace */
|
test_attr_null_space(fcpl, my_fapl); /* Test storing attribute with NULL dataspace */
|
||||||
test_attr_deprec(fcpl, my_fapl); /* Test deprecated API routines */
|
test_attr_deprec(fcpl, my_fapl); /* Test deprecated API routines */
|
||||||
test_attr_many(new_format, fcpl, my_fapl); /* Test storing lots of attributes */
|
test_attr_many(new_format, fcpl, my_fapl); /* Test storing lots of attributes */
|
||||||
|
test_attr_info_null_info_pointer(fcpl, my_fapl); /* Test passing a NULL attribute info pointer to H5Aget_info(_by_name/_by_idx) */
|
||||||
|
|
||||||
/* New attribute API routine tests, on old-format storage */
|
/* New attribute API routine tests, on old-format storage */
|
||||||
test_attr_info_by_idx(new_format, fcpl, my_fapl); /* Test querying attribute info by index */
|
test_attr_info_by_idx(new_format, fcpl, my_fapl); /* Test querying attribute info by index */
|
||||||
|
Loading…
Reference in New Issue
Block a user