Skip to content

Commit 5744c85

Browse files
committed
.equalsExpected.(c_ptr): print output as hex
c_ptr always represents a memory address, and memory addresses are much easier to read/understand in hexadecimal
1 parent 50dfa06 commit 5744c85

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/julienne/julienne_test_diagnosis_s.F90

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,14 @@ pure function aggregate_vector_diagnosis(diagnoses) result(diagnosis)
280280
else
281281
block
282282
integer(c_intptr_t), parameter :: mold = 0_c_intptr_t
283+
character(len=18) :: str_actual, str_expect
283284

284-
associate(actual_c_loc => transfer(actual, mold), expected_c_loc => transfer(expected, mold))
285+
associate(actual_c_loc => transfer(actual, mold), expect_c_loc => transfer(expected, mold))
286+
write(str_actual, '(A2,Z16.16)') '0x',actual_c_loc
287+
write(str_expect, '(A2,Z16.16)') '0x',expect_c_loc
285288
test_diagnosis = test_diagnosis_t( &
286289
test_passed = .false. &
287-
,diagnostics_string = "expected " // string_t(expected_c_loc) // "; actual value is " // string_t(actual_c_loc) &
290+
,diagnostics_string = "expected " // str_expect // "; actual value is " // str_actual &
288291
)
289292
end associate
290293
end block

0 commit comments

Comments
 (0)