summaryrefslogtreecommitdiffstats
path: root/fortran
diff options
context:
space:
mode:
authorM. Scot Breitenfeld <brtnfld@hdfgroup.org>2019-03-11 16:32:49 (GMT)
committerM. Scot Breitenfeld <brtnfld@hdfgroup.org>2019-03-11 16:32:49 (GMT)
commit7c927a35902d50a03088c56efb9e0ad773500d02 (patch)
tree1f82b1d04061bfebcfb639aab80e11cc7c72acf1 /fortran
parent07fde1e25c51e1c4294248311104ef02dbb7da21 (diff)
downloadhdf5-7c927a35902d50a03088c56efb9e0ad773500d02.zip
hdf5-7c927a35902d50a03088c56efb9e0ad773500d02.tar.gz
hdf5-7c927a35902d50a03088c56efb9e0ad773500d02.tar.bz2
added more tests
Diffstat (limited to 'fortran')
-rw-r--r--fortran/src/H5VLff.F9042
-rw-r--r--fortran/src/H5_f.c63
-rw-r--r--fortran/src/H5_ff.F9065
-rw-r--r--fortran/src/HDF5.F901
-rw-r--r--fortran/test/Makefile.am24
5 files changed, 117 insertions, 78 deletions
diff --git a/fortran/src/H5VLff.F90 b/fortran/src/H5VLff.F90
index 1e0dafb..5185c22 100644
--- a/fortran/src/H5VLff.F90
+++ b/fortran/src/H5VLff.F90
@@ -96,7 +96,7 @@ CONTAINS
SUBROUTINE H5VLregister_connector_by_value_f(connector_value, vol_id, hdferr, vipl_id)
IMPLICIT NONE
- INTEGER :: connector_value
+ INTEGER, INTENT(IN) :: connector_value
INTEGER(HID_T), INTENT(OUT) :: vol_id
INTEGER, INTENT(OUT) :: hdferr
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: vipl_id
@@ -108,7 +108,7 @@ CONTAINS
BIND(C,NAME='H5VLregister_connector_by_value')
IMPORT :: HID_T
IMPORT :: C_INT
- INTEGER(C_INT) :: connector_value
+ INTEGER(C_INT), VALUE :: connector_value
INTEGER(HID_T), INTENT(IN), VALUE :: vipl_id
END FUNCTION H5VLregister_connector_by_value
END INTERFACE
@@ -174,7 +174,7 @@ CONTAINS
! H5VLis_connector_registered_f
!
! PURPOSE
-! Tests whether a VOL class has been registered or not.
+! Retrieves the ID for a registered VOL connector.
!
! INPUTS
! cls -
@@ -202,8 +202,10 @@ CONTAINS
c_name = TRIM(name)//C_NULL_CHAR
vol_id = H5VLget_connector_id(c_name)
- hdferr = 0
- IF(vol_id.LT.0) hdferr = H5I_INVALID_HID_F
+ IF(vol_id.LT.0)THEN
+ hdferr = -1
+ vol_id = H5I_INVALID_HID_F
+ ENDIF
END SUBROUTINE H5VLget_connector_id_f
@@ -215,29 +217,34 @@ CONTAINS
INTEGER(SIZE_T), OPTIONAL :: name_len
!*****
CHARACTER(LEN=1,KIND=C_CHAR), DIMENSION(1:LEN(name)+1), TARGET :: c_name
+ INTEGER(SIZE_T) :: l
TYPE(C_PTR) :: f_ptr
INTERFACE
INTEGER(SIZE_T) FUNCTION H5VLget_connector_name(obj_id, name, size) BIND(C,NAME='H5VLget_connector_name')
- IMPORT :: HID_T, SIZE_T, C_PTR
+ IMPORT :: HID_T, SIZE_T, C_PTR, C_CHAR
IMPLICIT NONE
INTEGER(HID_T) , INTENT(IN), VALUE :: obj_id
- TYPE(C_PTR), VALUE :: name
+ CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: name
+ ! TYPE(C_PTR), value :: name
INTEGER(SIZE_T), INTENT(IN), VALUE :: size
END FUNCTION H5VLget_connector_name
END INTERFACE
hdferr = 0
IF(PRESENT(name_len))THEN
- name_len = INT(H5VLget_connector_name(obj_id, C_NULL_PTR, 0_SIZE_T), SIZE_T)
+ name_len = INT(H5VLget_connector_name(obj_id, c_name, 0_SIZE_T), SIZE_T)
IF(name_len.LT.0) hdferr = H5I_INVALID_HID_F
ELSE
- f_ptr = C_LOC(c_name(1)(1:1))
-
- IF(INT(H5VLget_connector_name(obj_id, f_ptr, INT(LEN(name)+1,SIZE_T)), SIZE_T).LT.0)THEN
+ ! f_ptr = C_LOC(c_name(1)(1:1))
+ PRINT*,LEN(name)+1
+ l = INT(LEN(name)+1,SIZE_T)
+ IF(INT(H5VLget_connector_name(obj_id, c_name, l), SIZE_T).LT.0)THEN
hdferr = H5I_INVALID_HID_F
ELSE
+ PRINT*,c_name
CALL HD5c2fstring(name,c_name,LEN(name))
+ PRINT*,"name", name
ENDIF
ENDIF
@@ -310,8 +317,17 @@ CONTAINS
END SUBROUTINE H5VLunregister_connector_f
-! H5VLcmp_connector_cls
-
+ !---------------------------------------------------------------------------
+ ! Function: H5VLcmp_connector_cls_f
+ !
+ ! Purpose: Compares two connector classes (based on their value field)
+ !
+ ! Return: Success: Non-negative, *cmp set to a value like strcmp
+ !
+ ! Failure: Negative, *cmp unset
+ !
+ !---------------------------------------------------------------------------
+
SUBROUTINE H5VLcmp_connector_cls_f(cmp, connector_id1, connector_id2, hdferr)
IMPLICIT NONE
INTEGER, INTENT(OUT), TARGET :: cmp
diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c
index bd8998e..fdf4b9e 100644
--- a/fortran/src/H5_f.c
+++ b/fortran/src/H5_f.c
@@ -720,38 +720,37 @@ h5init_flags_c( int_f *h5d_flags, size_t_f *h5d_size_flags,
h5vl_flags[32] = (int_f)H5VL_FILE_MOUNT;
h5vl_flags[33] = (int_f)H5VL_FILE_UNMOUNT;
h5vl_flags[34] = (int_f)H5VL_FILE_IS_ACCESSIBLE;
- h5vl_flags[35] = (int_f)H5VL_FILE_CACHE_VOL_CONN;
- h5vl_flags[36] = (int_f)H5VL_GROUP_GET_GCPL;
- h5vl_flags[37] = (int_f)H5VL_GROUP_GET_INFO;
- h5vl_flags[38] = (int_f)H5VL_GROUP_FLUSH;
- h5vl_flags[39] = (int_f)H5VL_GROUP_REFRESH;
- h5vl_flags[40] = (int_f)H5VL_LINK_CREATE_HARD;
- h5vl_flags[41] = (int_f)H5VL_LINK_CREATE_SOFT;
- h5vl_flags[42] = (int_f)H5VL_LINK_CREATE_UD;
- h5vl_flags[43] = (int_f)H5VL_LINK_GET_INFO;
- h5vl_flags[44] = (int_f)H5VL_LINK_GET_NAME;
- h5vl_flags[45] = (int_f)H5VL_LINK_GET_VAL;
- h5vl_flags[46] = (int_f)H5VL_LINK_DELETE;
- h5vl_flags[47] = (int_f)H5VL_LINK_EXISTS;
- h5vl_flags[48] = (int_f)H5VL_LINK_ITER;
- h5vl_flags[49] = (int_f)H5VL_REF_GET_NAME;
- h5vl_flags[50] = (int_f)H5VL_REF_GET_REGION;
- h5vl_flags[51] = (int_f)H5VL_REF_GET_TYPE;
- h5vl_flags[52] = (int_f)H5VL_ID_GET_NAME;
- h5vl_flags[53] = (int_f)H5VL_OBJECT_CHANGE_REF_COUNT;
- h5vl_flags[54] = (int_f)H5VL_OBJECT_EXISTS;
- h5vl_flags[55] = (int_f)H5VL_OBJECT_VISIT;
- h5vl_flags[56] = (int_f)H5VL_REF_CREATE;
- h5vl_flags[57] = (int_f)H5VL_OBJECT_FLUSH;
- h5vl_flags[58] = (int_f)H5VL_OBJECT_REFRESH;
- h5vl_flags[59] = (int_f)H5VL_REQUEST_WAITANY;
- h5vl_flags[60] = (int_f)H5VL_REQUEST_WAITSOME;
- h5vl_flags[61] = (int_f)H5VL_REQUEST_WAITALL;
- h5vl_flags[62] = (int_f)H5VL_OBJECT_BY_SELF;
- h5vl_flags[63] = (int_f)H5VL_OBJECT_BY_NAME;
- h5vl_flags[64] = (int_f)H5VL_OBJECT_BY_IDX;
- h5vl_flags[65] = (int_f)H5VL_OBJECT_BY_ADDR;
- h5vl_flags[66] = (int_f)H5VL_OBJECT_BY_REF;
+ h5vl_flags[35] = (int_f)H5VL_GROUP_GET_GCPL;
+ h5vl_flags[36] = (int_f)H5VL_GROUP_GET_INFO;
+ h5vl_flags[37] = (int_f)H5VL_GROUP_FLUSH;
+ h5vl_flags[38] = (int_f)H5VL_GROUP_REFRESH;
+ h5vl_flags[39] = (int_f)H5VL_LINK_CREATE_HARD;
+ h5vl_flags[40] = (int_f)H5VL_LINK_CREATE_SOFT;
+ h5vl_flags[41] = (int_f)H5VL_LINK_CREATE_UD;
+ h5vl_flags[42] = (int_f)H5VL_LINK_GET_INFO;
+ h5vl_flags[43] = (int_f)H5VL_LINK_GET_NAME;
+ h5vl_flags[44] = (int_f)H5VL_LINK_GET_VAL;
+ h5vl_flags[45] = (int_f)H5VL_LINK_DELETE;
+ h5vl_flags[46] = (int_f)H5VL_LINK_EXISTS;
+ h5vl_flags[47] = (int_f)H5VL_LINK_ITER;
+ h5vl_flags[48] = (int_f)H5VL_REF_GET_NAME;
+ h5vl_flags[49] = (int_f)H5VL_REF_GET_REGION;
+ h5vl_flags[50] = (int_f)H5VL_REF_GET_TYPE;
+ h5vl_flags[51] = (int_f)H5VL_ID_GET_NAME;
+ h5vl_flags[52] = (int_f)H5VL_OBJECT_CHANGE_REF_COUNT;
+ h5vl_flags[53] = (int_f)H5VL_OBJECT_EXISTS;
+ h5vl_flags[54] = (int_f)H5VL_OBJECT_VISIT;
+ h5vl_flags[55] = (int_f)H5VL_REF_CREATE;
+ h5vl_flags[56] = (int_f)H5VL_OBJECT_FLUSH;
+ h5vl_flags[57] = (int_f)H5VL_OBJECT_REFRESH;
+ h5vl_flags[58] = (int_f)H5VL_REQUEST_WAITANY;
+ h5vl_flags[59] = (int_f)H5VL_REQUEST_WAITSOME;
+ h5vl_flags[60] = (int_f)H5VL_REQUEST_WAITALL;
+ h5vl_flags[61] = (int_f)H5VL_OBJECT_BY_SELF;
+ h5vl_flags[62] = (int_f)H5VL_OBJECT_BY_NAME;
+ h5vl_flags[63] = (int_f)H5VL_OBJECT_BY_IDX;
+ h5vl_flags[64] = (int_f)H5VL_OBJECT_BY_ADDR;
+ h5vl_flags[65] = (int_f)H5VL_OBJECT_BY_REF;
/*
* H5Z flags
*/
diff --git a/fortran/src/H5_ff.F90 b/fortran/src/H5_ff.F90
index 2adc6aa..0d82f42 100644
--- a/fortran/src/H5_ff.F90
+++ b/fortran/src/H5_ff.F90
@@ -133,7 +133,7 @@ MODULE H5LIB
! H5VL flags declaration
!
- INTEGER, PARAMETER :: H5VL_FLAGS_LEN = 67
+ INTEGER, PARAMETER :: H5VL_FLAGS_LEN = 66
INTEGER, DIMENSION(1:H5VL_FLAGS_LEN) :: H5VL_flags
!
@@ -647,38 +647,37 @@ CONTAINS
H5VL_FILE_MOUNT_F = H5VL_flags(33)
H5VL_FILE_UNMOUNT_F = H5VL_flags(34)
H5VL_FILE_IS_ACCESSIBLE_F = H5VL_flags(35)
- H5VL_FILE_CACHE_VOL_CONN_F = H5VL_flags(36)
- H5VL_GROUP_GET_GCPL_F = H5VL_flags(37)
- H5VL_GROUP_GET_INFO_F = H5VL_flags(38)
- H5VL_GROUP_FLUSH_F = H5VL_flags(39)
- H5VL_GROUP_REFRESH_F = H5VL_flags(40)
- H5VL_LINK_CREATE_HARD_F = H5VL_flags(41)
- H5VL_LINK_CREATE_SOFT_F = H5VL_flags(42)
- H5VL_LINK_CREATE_UD_F = H5VL_flags(43)
- H5VL_LINK_GET_INFO_F = H5VL_flags(44)
- H5VL_LINK_GET_NAME_F = H5VL_flags(45)
- H5VL_LINK_GET_VAL_F = H5VL_flags(46)
- H5VL_LINK_DELETE_F = H5VL_flags(47)
- H5VL_LINK_EXISTS_F = H5VL_flags(48)
- H5VL_LINK_ITER_F = H5VL_flags(49)
- H5VL_REF_GET_NAME_F = H5VL_flags(50)
- H5VL_REF_GET_REGION_F = H5VL_flags(51)
- H5VL_REF_GET_TYPE_F = H5VL_flags(52)
- H5VL_ID_GET_NAME_F = H5VL_flags(53)
- H5VL_OBJECT_CHANGE_REF_COUNT_F = H5VL_flags(54)
- H5VL_OBJECT_EXISTS_F = H5VL_flags(55)
- H5VL_OBJECT_VISIT_F = H5VL_flags(56)
- H5VL_REF_CREATE_F = H5VL_flags(57)
- H5VL_OBJECT_FLUSH_F = H5VL_flags(58)
- H5VL_OBJECT_REFRESH_F = H5VL_flags(59)
- H5VL_REQUEST_WAITANY_F = H5VL_flags(60)
- H5VL_REQUEST_WAITSOME_F = H5VL_flags(61)
- H5VL_REQUEST_WAITALL_F = H5VL_flags(62)
- H5VL_OBJECT_BY_SELF_F = H5VL_flags(63)
- H5VL_OBJECT_BY_NAME_F = H5VL_flags(64)
- H5VL_OBJECT_BY_IDX_F = H5VL_flags(65)
- H5VL_OBJECT_BY_ADDR_F = H5VL_flags(66)
- H5VL_OBJECT_BY_REF_F = H5VL_flags(67)
+ H5VL_GROUP_GET_GCPL_F = H5VL_flags(36)
+ H5VL_GROUP_GET_INFO_F = H5VL_flags(37)
+ H5VL_GROUP_FLUSH_F = H5VL_flags(38)
+ H5VL_GROUP_REFRESH_F = H5VL_flags(39)
+ H5VL_LINK_CREATE_HARD_F = H5VL_flags(40)
+ H5VL_LINK_CREATE_SOFT_F = H5VL_flags(41)
+ H5VL_LINK_CREATE_UD_F = H5VL_flags(42)
+ H5VL_LINK_GET_INFO_F = H5VL_flags(43)
+ H5VL_LINK_GET_NAME_F = H5VL_flags(44)
+ H5VL_LINK_GET_VAL_F = H5VL_flags(45)
+ H5VL_LINK_DELETE_F = H5VL_flags(46)
+ H5VL_LINK_EXISTS_F = H5VL_flags(47)
+ H5VL_LINK_ITER_F = H5VL_flags(48)
+ H5VL_REF_GET_NAME_F = H5VL_flags(49)
+ H5VL_REF_GET_REGION_F = H5VL_flags(50)
+ H5VL_REF_GET_TYPE_F = H5VL_flags(51)
+ H5VL_ID_GET_NAME_F = H5VL_flags(52)
+ H5VL_OBJECT_CHANGE_REF_COUNT_F = H5VL_flags(53)
+ H5VL_OBJECT_EXISTS_F = H5VL_flags(54)
+ H5VL_OBJECT_VISIT_F = H5VL_flags(55)
+ H5VL_REF_CREATE_F = H5VL_flags(56)
+ H5VL_OBJECT_FLUSH_F = H5VL_flags(57)
+ H5VL_OBJECT_REFRESH_F = H5VL_flags(58)
+ H5VL_REQUEST_WAITANY_F = H5VL_flags(59)
+ H5VL_REQUEST_WAITSOME_F = H5VL_flags(60)
+ H5VL_REQUEST_WAITALL_F = H5VL_flags(61)
+ H5VL_OBJECT_BY_SELF_F = H5VL_flags(62)
+ H5VL_OBJECT_BY_NAME_F = H5VL_flags(63)
+ H5VL_OBJECT_BY_IDX_F = H5VL_flags(64)
+ H5VL_OBJECT_BY_ADDR_F = H5VL_flags(65)
+ H5VL_OBJECT_BY_REF_F = H5VL_flags(66)
!
! H5Z flags
!
diff --git a/fortran/src/HDF5.F90 b/fortran/src/HDF5.F90
index 0370224..fe38b7d 100644
--- a/fortran/src/HDF5.F90
+++ b/fortran/src/HDF5.F90
@@ -38,6 +38,7 @@ MODULE HDF5
USE H5O
USE H5P
USE H5R
+ USE H5VL
USE H5Z
USE H5_gen
USE H5LIB
diff --git a/fortran/test/Makefile.am b/fortran/test/Makefile.am
index 8613cf9..ef6cd7e 100644
--- a/fortran/test/Makefile.am
+++ b/fortran/test/Makefile.am
@@ -30,14 +30,35 @@ noinst_LTLIBRARIES=libh5test_fortran.la
# want to build a shared C library and a static Fortran library. If so,
# pass the -static flag to the library linker.
if FORTRAN_SHARED_CONDITIONAL
+ TEST_SCRIPT = test_vol_connector.sh
+ SCRIPT_DEPEND = vol_connector$(EXEEXT)
else
AM_LDFLAGS+=-static
endif
+check_SCRIPTS = $(TEST_SCRIPT)
+
# Our main targets, the tests themselves
TEST_PROG=fortranlib_test fflush1 fflush2 fortranlib_test_1_8 fortranlib_test_F03
check_PROGRAMS=$(TEST_PROG)
+if FORTRAN_SHARED_CONDITIONAL
+ check_PROGRAMS+= vol_connector
+endif
+
+if FORTRAN_SHARED_CONDITIONAL
+ # The libh5test library provides common support code for the tests.
+ # The filter_plugin* libraries are for use in filter_plugin.c.
+ # Build them as shared libraries if that option was enabled in configure.
+ noinst_LTLIBRARIES += libnull_vol_connector.la
+
+ # VOL plugin test libraries
+ #
+ # null_vol_connector is used for testing basic VOL plugin functionality.
+ libnull_vol_connector_la_SOURCES=null_vol_connector.c
+ libnull_vol_connector_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere
+endif
+
libh5test_fortran_la_SOURCES = tf_gen.F90 tf.F90 t.c
@@ -50,6 +71,7 @@ fortranlib_test_1_8_SOURCES = tH5O.F90 tH5A_1_8.F90 tH5G_1_8.F90 tH5MISC_1_8.F90
fortranlib_test_F03_SOURCES = tH5E_F03.F90 tH5F_F03.F90 tH5L_F03.F90 \
tH5O_F03.F90 tH5P_F03.F90 tH5T_F03.F90 tHDF5_F03.F90 fortranlib_test_F03.F90
+vol_connector_SOURCES=vol_connector.F90
fflush1_SOURCES=fflush1.F90
fflush2_SOURCES=fflush2.F90
@@ -95,6 +117,8 @@ H5_test_buildiface_SOURCES = H5_test_buildiface.F90
H5_test_buildiface_LDADD =
+DISTCLEANFILES=test_vol_connector.sh # TODO:CHECK IF WORKS MSB
+
# fflush2 depends on files created by fflush1
fflush2.chkexe_: fflush1.chkexe_