@@ -21,6 +21,7 @@ subroutine test_25(error_cnt)
21
21
22
22
type (json_value),pointer :: p, tmp
23
23
type (json_core) :: json
24
+ type (json_file) :: f
24
25
logical (lk) :: found
25
26
character (kind= CK,len= :),dimension (:),allocatable :: vec ! ! array of strings from JSON
26
27
integer (ik),dimension (:),allocatable :: ilen ! ! array of string lengths
@@ -102,6 +103,35 @@ subroutine test_25(error_cnt)
102
103
end if
103
104
#endif
104
105
106
+ ! test json_file interface
107
+ f = json_file(p)
108
+ call f% get(' str_array' , vec, ilen, found)
109
+ if (f% failed()) then
110
+ call f% print_error_message(error_unit)
111
+ error_cnt = error_cnt + 1
112
+ end if
113
+ if (all (ilen==[1 ,2 ,3 ,5 ])) then
114
+ write (error_unit,' (A)' ) ' json_file success!'
115
+ else
116
+ write (error_unit,' (A,1X,*(I5,1X))' ) ' json_file failed: ' , ilen
117
+ error_cnt = error_cnt + 1
118
+ end if
119
+ #ifdef USE_UCS4
120
+ ! unicode test
121
+ f = json_file(p)
122
+ call f% get(CDK_' str_array' , vec, ilen, found)
123
+ if (f% failed()) then
124
+ call f% print_error_message(error_unit)
125
+ error_cnt = error_cnt + 1
126
+ end if
127
+ if (all (ilen==[1 ,2 ,3 ,5 ])) then
128
+ write (error_unit,' (A)' ) ' json_file success!'
129
+ else
130
+ write (error_unit,' (A,1X,*(I5,1X))' ) ' json_file failed: ' , ilen
131
+ error_cnt = error_cnt + 1
132
+ end if
133
+ #endif
134
+
105
135
! clean up
106
136
write (error_unit,' (A)' ) ' '
107
137
write (error_unit,' (A)' ) ' destroy...'
0 commit comments