Skip to content

Commit 68e9fa4

Browse files
committed
update unit test.
1 parent f4c3594 commit 68e9fa4

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/tests/jf_test_38.F90

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ subroutine test_38(error_cnt)
2828
integer,intent(out) :: error_cnt !! report number of errors to caller
2929

3030
type(json_file) :: f
31-
type(json_value),pointer :: p, p_value
31+
type(json_value),pointer :: p, p_value, p_vec
3232
type(json_core) :: json
3333
logical(LK) :: found
3434
real(wp) :: rval !! a single-precision number
@@ -67,6 +67,18 @@ subroutine test_38(error_cnt)
6767
end if
6868

6969
call json%create_double(p_value,1.0,'d')
70+
call json%get(p_value, rval)
71+
if (rval /= 1.0) then
72+
write(error_unit,*) 'Error: 1.0 /= ', rval
73+
error_cnt = error_cnt + 1
74+
end if
75+
76+
call json%get(p, 'vec1', p_vec)
77+
call json%get(p_vec, rvec)
78+
if (any([1.0_wp, 2.0_wp, 3.0_wp]/=rvec)) then
79+
write(error_unit,*) 'Error: [1.0_wp, 2.0_wp, 3.0_wp] /= ', rvec
80+
error_cnt = error_cnt + 1
81+
end if
7082

7183
call json%destroy(p)
7284
call json%destroy(p_value)

0 commit comments

Comments
 (0)