Skip to content

Commit 4ae4800

Browse files
authored
Merge pull request #61 from BerkeleyLab/pr-55-to-do
fix(test_diagnosis): finish To Do item from PR #55
2 parents 37bcc95 + 9dfd298 commit 4ae4800

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/julienne/julienne_test_diagnosis_s.F90

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@
158158

159159
module procedure within_real
160160

161-
if (abs(operands%actual - operands%expected) < tolerance) then
161+
if (abs(operands%actual - operands%expected) <= tolerance) then
162+
! We use <= to allow for tolerance=0, which could never be satisfied if we used < instead:
162163
test_diagnosis = test_diagnosis_t(test_passed=.true., diagnostics_string="")
163164
else
164165
test_diagnosis = test_diagnosis_t(test_passed=.false. &
@@ -172,7 +173,8 @@
172173

173174
module procedure within_double_precision
174175

175-
if (abs(operands%actual - operands%expected) < tolerance) then
176+
if (abs(operands%actual - operands%expected) <= tolerance) then
177+
! We use <= to allow for tolerance=0, which could never be satisfied if we used < instead:
176178
test_diagnosis = test_diagnosis_t(test_passed=.true., diagnostics_string="")
177179
else
178180
test_diagnosis = test_diagnosis_t(test_passed=.false. &

0 commit comments

Comments
 (0)