Changeset 3182 for palm/trunk/UTIL/inifor/tests/util.f90
- Timestamp:
- Jul 27, 2018 1:36:03 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/UTIL/inifor/tests/util.f90
r2718 r3182 21 21 ! Current revisions: 22 22 ! ----------------- 23 ! Expose error measure as parameter in assert_equal() 23 24 ! 24 25 ! … … 74 75 END SUBROUTINE end_test 75 76 76 LOGICAL FUNCTION assert_equal(a, b, msg) 77 LOGICAL FUNCTION assert_equal(a, b, msg, ratio) 78 REAL, OPTIONAL, INTENT(IN) :: ratio 77 79 REAL, DIMENSION(:), INTENT(IN) :: a, b 78 CHARACTER(LEN=*), INTENT(IN) :: msg80 CHARACTER(LEN=*), INTENT(IN) :: msg 79 81 80 assert_equal = assert(a, b, 'eq') 82 IF ( PRESENT(ratio) ) THEN 83 assert_equal = assert(a, b, 'eq', ratio) 84 ELSE 85 assert_equal = assert(a, b, 'eq') 86 END IF 87 81 88 IF (assert_equal .eqv. .TRUE.) THEN 82 89 PRINT *, "Equality assertion for ", msg, " was successful." … … 88 95 END FUNCTION assert_equal 89 96 90 LOGICAL FUNCTION assert(a, b, mode, eps)97 LOGICAL FUNCTION assert(a, b, mode, ratio) 91 98 92 99 REAL, DIMENSION(:), INTENT(IN) :: a, b 93 REAL, OPTIONAL, INTENT(IN) :: eps100 REAL, OPTIONAL, INTENT(IN) :: ratio 94 101 CHARACTER(LEN=*), INTENT(IN) :: mode 95 102 … … 98 105 99 106 max_rel_diff = 10 * EPSILON(1.0) 100 IF (PRESENT( eps)) max_rel_diff = eps107 IF (PRESENT(ratio)) max_rel_diff = ratio 101 108 102 109 SELECT CASE( TRIM(mode) )
Note: See TracChangeset
for help on using the changeset viewer.