2011-08-18 22:32:47 +08:00
|
|
|
!****h* root/fortran/test/fortranlib_test.f90
|
|
|
|
!
|
|
|
|
! NAME
|
|
|
|
! fortranlib_test.f90
|
|
|
|
!
|
|
|
|
! FUNCTION
|
|
|
|
! Basic testing of Fortran API's functionality.
|
|
|
|
!
|
|
|
|
! COPYRIGHT
|
2010-01-30 12:29:13 +08:00
|
|
|
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-08 01:55:01 +08:00
|
|
|
! Copyright by The HDF Group. *
|
2002-09-24 06:06:01 +08:00
|
|
|
! 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 *
|
2007-02-08 01:55:01 +08:00
|
|
|
! 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. *
|
2010-01-30 12:29:13 +08:00
|
|
|
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
|
|
!
|
2011-08-18 22:32:47 +08:00
|
|
|
!*****
|
|
|
|
|
2015-09-01 22:00:14 +08:00
|
|
|
!#include <H5config_f.inc>
|
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
PROGRAM fortranlibtest
|
2010-01-30 12:29:13 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
USE HDF5
|
2014-04-06 23:56:21 +08:00
|
|
|
USE THDF5
|
2010-01-30 12:29:13 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
IMPLICIT NONE
|
|
|
|
INTEGER :: total_error = 0
|
|
|
|
INTEGER :: error
|
|
|
|
INTEGER :: majnum, minnum, relnum
|
|
|
|
LOGICAL :: szip_flag
|
|
|
|
INTEGER :: ret_total_error
|
2008-10-01 05:05:39 +08:00
|
|
|
LOGICAL :: cleanup, status
|
|
|
|
|
|
|
|
CALL h5open_f(error)
|
|
|
|
|
|
|
|
cleanup = .TRUE.
|
|
|
|
CALL h5_env_nocleanup_f(status)
|
|
|
|
IF(status) cleanup=.FALSE.
|
2008-05-21 23:02:24 +08:00
|
|
|
|
|
|
|
WRITE(*,*) ' ========================== '
|
|
|
|
WRITE(*,*) ' FORTRAN tests '
|
|
|
|
WRITE(*,*) ' ========================== '
|
|
|
|
CALL h5get_libversion_f(majnum, minnum, relnum, total_error)
|
|
|
|
IF(total_error .EQ. 0) THEN
|
|
|
|
|
|
|
|
WRITE(*, '(" FORTRANLIB_TEST is linked with HDF5 Library version ")', advance="NO")
|
|
|
|
WRITE(*, '(I1)', advance="NO") majnum
|
2010-01-30 12:29:13 +08:00
|
|
|
WRITE(*, '(".")', advance="NO")
|
2008-05-21 23:02:24 +08:00
|
|
|
WRITE(*, '(I1)', advance="NO") minnum
|
|
|
|
WRITE(*, '(" release ")', advance="NO")
|
|
|
|
WRITE(*, '(I3)') relnum
|
|
|
|
ELSE
|
|
|
|
total_error = total_error + 1
|
|
|
|
ENDIF
|
|
|
|
WRITE(*,*)
|
2008-10-02 03:57:52 +08:00
|
|
|
|
2017-01-07 05:25:21 +08:00
|
|
|
! CALL h5check_version_f(1,4,4,total_error)
|
|
|
|
! '========================================='
|
|
|
|
! 'Testing FILE Interface '
|
|
|
|
! '========================================='
|
2008-05-21 23:02:24 +08:00
|
|
|
|
|
|
|
ret_total_error = 0
|
|
|
|
CALL mountingtest(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Mounting test', total_error)
|
2010-01-30 12:29:13 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
ret_total_error = 0
|
|
|
|
CALL reopentest(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Reopen test', total_error)
|
2006-04-15 05:33:35 +08:00
|
|
|
|
2014-04-03 23:18:42 +08:00
|
|
|
ret_total_error = 0
|
2008-05-21 23:02:24 +08:00
|
|
|
CALL file_close(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' File open/close test', total_error)
|
|
|
|
|
|
|
|
ret_total_error = 0
|
2009-07-22 23:25:03 +08:00
|
|
|
CALL file_space("file_space",cleanup, ret_total_error)
|
2008-05-21 23:02:24 +08:00
|
|
|
CALL write_test_status(ret_total_error, ' File free space test', total_error)
|
2003-10-07 21:32:32 +08:00
|
|
|
|
2017-01-07 05:25:21 +08:00
|
|
|
!
|
|
|
|
! '========================================='
|
|
|
|
! 'Testing DATASET Interface '
|
|
|
|
! '========================================='
|
2000-09-20 04:06:49 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
ret_total_error = 0
|
|
|
|
CALL datasettest(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Dataset test', total_error)
|
2010-01-30 12:29:13 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
ret_total_error = 0
|
|
|
|
CALL extenddsettest(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Extendible dataset test', total_error)
|
2015-09-01 02:49:17 +08:00
|
|
|
|
2017-01-07 05:25:21 +08:00
|
|
|
CALL test_userblock_offset(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Dataset offset with user block', total_error)
|
2008-05-21 23:02:24 +08:00
|
|
|
|
2017-01-07 05:25:21 +08:00
|
|
|
!
|
|
|
|
! '========================================='
|
|
|
|
! 'Testing DATASPACE Interface '
|
|
|
|
! '========================================='
|
2000-09-20 04:06:49 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
ret_total_error = 0
|
|
|
|
CALL dataspace_basic_test(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Basic dataspace test', total_error)
|
2000-09-20 04:06:49 +08:00
|
|
|
|
2017-01-07 05:25:21 +08:00
|
|
|
!
|
|
|
|
! '========================================='
|
|
|
|
! 'Testing REFERENCE Interface '
|
|
|
|
! '========================================='
|
2000-09-20 04:06:49 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
ret_total_error = 0
|
|
|
|
CALL refobjtest(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Reference to object test', total_error)
|
2010-01-30 12:29:13 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
ret_total_error = 0
|
|
|
|
CALL refregtest(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Reference to dataset region test', total_error)
|
2000-09-20 04:06:49 +08:00
|
|
|
|
2017-01-07 05:25:21 +08:00
|
|
|
!
|
|
|
|
! '========================================='
|
|
|
|
! 'Testing selection functionalities '
|
|
|
|
! '========================================='
|
2000-09-20 04:06:49 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
ret_total_error = 0
|
|
|
|
CALL test_basic_select(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Basic selection test', total_error)
|
2000-09-20 04:06:49 +08:00
|
|
|
|
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
ret_total_error = 0
|
|
|
|
CALL test_select_hyperslab( cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Hyperslab selection test', total_error)
|
2010-01-30 12:29:13 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
ret_total_error = 0
|
|
|
|
CALL test_select_element(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Element selection test', total_error)
|
|
|
|
|
2008-09-24 05:52:19 +08:00
|
|
|
ret_total_error = 0
|
|
|
|
CALL test_select_point(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Element selection functions test ', total_error)
|
|
|
|
|
|
|
|
ret_total_error = 0
|
2014-04-06 23:56:21 +08:00
|
|
|
CALL test_select_combine(ret_total_error)
|
2008-09-24 05:52:19 +08:00
|
|
|
CALL write_test_status(ret_total_error, ' Selection combinations test ', total_error)
|
|
|
|
|
2008-09-25 00:23:54 +08:00
|
|
|
ret_total_error = 0
|
2014-04-06 23:56:21 +08:00
|
|
|
CALL test_select_bounds(ret_total_error)
|
2008-09-25 00:23:54 +08:00
|
|
|
CALL write_test_status(ret_total_error, ' Selection bounds test ', total_error)
|
2011-08-18 22:32:47 +08:00
|
|
|
|
2017-01-07 05:25:21 +08:00
|
|
|
!
|
|
|
|
! '========================================='
|
|
|
|
! 'Testing DATATYPE interface '
|
|
|
|
! '========================================='
|
2008-05-21 23:02:24 +08:00
|
|
|
ret_total_error = 0
|
2014-04-06 23:56:21 +08:00
|
|
|
CALL basic_data_type_test(ret_total_error)
|
2008-05-21 23:02:24 +08:00
|
|
|
CALL write_test_status(ret_total_error, ' Basic datatype test', total_error)
|
|
|
|
|
|
|
|
ret_total_error = 0
|
|
|
|
CALL compoundtest(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Compound datatype test', total_error)
|
2008-10-02 03:57:52 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
ret_total_error = 0
|
|
|
|
CALL enumtest(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Enum datatype test', total_error)
|
|
|
|
|
2008-09-17 01:31:33 +08:00
|
|
|
ret_total_error = 0
|
|
|
|
CALL test_derived_flt(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Derived float datatype test', total_error)
|
|
|
|
|
2017-01-07 05:25:21 +08:00
|
|
|
!
|
|
|
|
! '========================================='
|
|
|
|
! 'Testing PROPERTY interface '
|
|
|
|
! '========================================='
|
2000-10-21 04:51:49 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
ret_total_error = 0
|
|
|
|
CALL external_test(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' External dataset test', total_error)
|
|
|
|
|
2014-04-03 23:18:42 +08:00
|
|
|
ret_total_error = 0
|
2008-05-21 23:02:24 +08:00
|
|
|
CALL multi_file_test(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Multi file driver test', total_error)
|
|
|
|
|
2011-03-25 02:33:45 +08:00
|
|
|
ret_total_error = 0
|
2009-04-18 01:13:01 +08:00
|
|
|
CALL test_chunk_cache (cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Dataset chunk cache configuration', total_error)
|
|
|
|
|
2017-01-07 05:25:21 +08:00
|
|
|
!
|
|
|
|
! '========================================='
|
|
|
|
! 'Testing ATTRIBUTE interface '
|
|
|
|
! '========================================='
|
2000-10-21 04:51:49 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
ret_total_error = 0
|
|
|
|
CALL attribute_test(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Attribute test', total_error)
|
2000-10-21 04:51:49 +08:00
|
|
|
|
2017-01-07 05:25:21 +08:00
|
|
|
!
|
|
|
|
! '========================================='
|
|
|
|
! 'Testing IDENTIFIER interface '
|
|
|
|
! '========================================='
|
2000-10-21 04:51:49 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
ret_total_error = 0
|
|
|
|
CALL identifier_test(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Identifier test', total_error)
|
|
|
|
|
|
|
|
ret_total_error = 0
|
2014-04-06 23:56:21 +08:00
|
|
|
CALL filters_test(ret_total_error)
|
2008-05-21 23:02:24 +08:00
|
|
|
CALL write_test_status(ret_total_error, ' Filters test', total_error)
|
|
|
|
|
|
|
|
ret_total_error = 0
|
|
|
|
CALL szip_test(szip_flag, cleanup, ret_total_error)
|
2010-01-30 12:29:13 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
IF (.NOT. szip_flag) THEN ! test not available
|
|
|
|
CALL write_test_status(-1, ' SZIP filter test', total_error)
|
|
|
|
ELSE
|
|
|
|
CALL write_test_status(ret_total_error, ' SZIP filter test', total_error)
|
|
|
|
ENDIF
|
2003-04-12 12:11:30 +08:00
|
|
|
|
2017-01-07 05:25:21 +08:00
|
|
|
!
|
|
|
|
! '========================================='
|
|
|
|
! 'Testing GROUP interface '
|
|
|
|
! '========================================='
|
2000-11-08 02:18:41 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
ret_total_error = 0
|
|
|
|
CALL group_test(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Group test', total_error)
|
|
|
|
|
|
|
|
ret_total_error = 0
|
|
|
|
CALL error_report_test(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' Error test', total_error)
|
|
|
|
|
|
|
|
ret_total_error = 0
|
|
|
|
CALL vl_test_integer(cleanup, ret_total_error)
|
|
|
|
CALL vl_test_real(cleanup, ret_total_error)
|
|
|
|
CALL vl_test_string(cleanup, ret_total_error)
|
|
|
|
CALL write_test_status(ret_total_error, ' VL test', total_error)
|
2008-10-02 03:57:52 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
WRITE(*,*)
|
|
|
|
|
|
|
|
WRITE(*,*) ' ============================================ '
|
|
|
|
WRITE(*, fmt = '(19x, 27a)', advance='NO') ' FORTRAN tests completed with '
|
|
|
|
WRITE(*, fmt = '(i4)', advance='NO') total_error
|
|
|
|
WRITE(*, fmt = '(12a)' ) ' error(s) ! '
|
|
|
|
WRITE(*,*) ' ============================================ '
|
2010-01-30 12:29:13 +08:00
|
|
|
|
2008-05-21 23:02:24 +08:00
|
|
|
CALL h5close_f(error)
|
|
|
|
|
|
|
|
! if errors detected, exit with non-zero code.
|
|
|
|
IF (total_error .NE. 0) CALL h5_exit_f (1)
|
|
|
|
|
|
|
|
END PROGRAM fortranlibtest
|