diff options
Diffstat (limited to 'hl/fortran/test/tstds.F90')
-rw-r--r-- | hl/fortran/test/tstds.F90 | 84 |
1 files changed, 50 insertions, 34 deletions
diff --git a/hl/fortran/test/tstds.F90 b/hl/fortran/test/tstds.F90 index cbf6c38..f5df4ef 100644 --- a/hl/fortran/test/tstds.F90 +++ b/hl/fortran/test/tstds.F90 @@ -12,25 +12,59 @@ ! * 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. * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -PROGRAM test_ds + +MODULE TSTDS + +CONTAINS + +!------------------------------------------------------------------------- +! test_begin +!------------------------------------------------------------------------- + +SUBROUTINE test_begin(string) + CHARACTER(LEN=*), INTENT(IN) :: string + WRITE(*, fmt = '(A)', advance = 'no') ADJUSTL(string) +END SUBROUTINE test_begin + +!------------------------------------------------------------------------- +! passed/failed +!------------------------------------------------------------------------- +SUBROUTINE write_test_status( test_result) + +! Writes the results of the tests IMPLICIT NONE - INTEGER :: err + INTEGER, INTENT(IN) :: test_result ! negative, failed + ! 0 , passed - CALL test_testds(err) +! Controls the output style for reporting test results - IF(err.LT.0)THEN - WRITE(*,'(5X,A)') "DIMENSION SCALES TEST *FAILED*" + CHARACTER(LEN=8) :: error_string + CHARACTER(LEN=8), PARAMETER :: success = ' PASSED ' + CHARACTER(LEN=8), PARAMETER :: failure = '*FAILED*' + + error_string = failure + IF (test_result .EQ. 0) THEN + error_string = success ENDIF + + WRITE(*, fmt = '(T34, A)') error_string -END PROGRAM test_ds +END SUBROUTINE write_test_status + +END MODULE TSTDS + +MODULE TSTDS_TESTS + +CONTAINS SUBROUTINE test_testds(err) USE HDF5 USE H5LT USE H5DS + USE TSTDS ! module for testing dataset support routines IMPLICIT NONE @@ -44,7 +78,6 @@ SUBROUTINE test_testds(err) CHARACTER(LEN=6), PARAMETER :: DSET_NAME = "Mydata" CHARACTER(LEN=5), PARAMETER :: DS_1_NAME = "Yaxis" - CHARACTER(LEN=5), PARAMETER :: DS_1_NAME_A = "Yaxiz" CHARACTER(LEN=5), PARAMETER :: DS_2_NAME = "Xaxis" @@ -316,38 +349,21 @@ SUBROUTINE test_testds(err) END SUBROUTINE test_testds -!------------------------------------------------------------------------- -! test_begin -!------------------------------------------------------------------------- - -SUBROUTINE test_begin(string) - CHARACTER(LEN=*), INTENT(IN) :: string - WRITE(*, fmt = '(A)', advance = 'no') ADJUSTL(string) -END SUBROUTINE test_begin +END MODULE TSTDS_TESTS -!------------------------------------------------------------------------- -! passed/failed -!------------------------------------------------------------------------- -SUBROUTINE write_test_status( test_result) - -! Writes the results of the tests +PROGRAM test_ds + USE TSTDS_TESTS ! module for testing dataset routines + IMPLICIT NONE - INTEGER, INTENT(IN) :: test_result ! negative, failed - ! 0 , passed - -! Controls the output style for reporting test results + INTEGER :: err - CHARACTER(LEN=8) :: error_string - CHARACTER(LEN=8), PARAMETER :: success = ' PASSED ' - CHARACTER(LEN=8), PARAMETER :: failure = '*FAILED*' + CALL test_testds(err) - error_string = failure - IF (test_result .EQ. 0) THEN - error_string = success + IF(err.LT.0)THEN + WRITE(*,'(5X,A)') "DIMENSION SCALES TEST *FAILED*" ENDIF - - WRITE(*, fmt = '(T34, A)') error_string -END SUBROUTINE write_test_status +END PROGRAM test_ds + |