Skip to content

Commit d87619d

Browse files
committed
increasing coverage for info routines.
1 parent 229f3be commit d87619d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/tests/jf_test_19.f90

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,21 @@ subroutine test_19(error_cnt)
7777
end if
7878
end if
7979

80+
!now test with a variable that is NOT a matrix:
81+
call json%get(p,'matrix(1)',p_matrix)
82+
call json%matrix_info(p_matrix,is_matrix,var_type,n_sets,set_size,name)
83+
if (json%failed()) then
84+
call json%print_error_message(error_unit)
85+
error_cnt = error_cnt + 1
86+
else
87+
if (.not. is_matrix) then
88+
write(error_unit,'(A)') '...success'
89+
else
90+
write(error_unit,'(A)') 'Error: this should not be a matrix:'
91+
error_cnt = error_cnt + 1
92+
end if
93+
end if
94+
8095
! now, test by path:
8196
call json%matrix_info(p,'matrix',is_matrix,&
8297
var_type=var_type,n_sets=n_sets,&
@@ -114,6 +129,17 @@ subroutine test_19(error_cnt)
114129
error_cnt = error_cnt + 1
115130
end if
116131

132+
!now test with a variable that is NOT a matrix:
133+
call json%matrix_info(p,'matrix(1)',is_matrix,found=found,&
134+
var_type=var_type,n_sets=n_sets,&
135+
set_size=set_size,name=name)
136+
if (.not. is_matrix) then
137+
write(error_unit,'(A)') '...success'
138+
else
139+
write(error_unit,'(A)') 'Error: this should not be a matrix:'
140+
error_cnt = error_cnt + 1
141+
end if
142+
117143
! cleanup:
118144
call json%destroy(p)
119145

0 commit comments

Comments
 (0)