@@ -34,8 +34,11 @@ subroutine test_46(error_cnt)
3434 logical (LK) :: lval
3535 character (kind= CK,len= :),allocatable :: cval
3636 character (kind= CK,len= 1 ),dimension (:),allocatable :: cvec
37+ character (kind= CK,len= :),dimension (:),allocatable :: cvec2
38+ integer (IK),dimension (:),allocatable :: ilen
3739
3840 character (kind= CK,len= 1 ),dimension (1 ) :: cvec_default = [CK_' 1' ]
41+ integer (IK),dimension (1 ) :: ilen_default = [1 ]
3942
4043 write (error_unit,' (A)' ) ' '
4144 write (error_unit,' (A)' ) ' ================================='
@@ -89,6 +92,16 @@ subroutine test_46(error_cnt)
8992 write (error_unit,' (A)' ) ' Error using json_get_string_vec_by_path default'
9093 error_cnt = error_cnt + 1
9194 end if
95+ call json% get(p, CK_' not_there' , cvec2, ilen, found, default= cvec_default)
96+ if (json% failed() .or. found .or. all (cvec2 /= cvec_default) .or. all (ilen/= 1_IK )) then
97+ write (error_unit,' (A)' ) ' Error using json_get_alloc_string_vec_by_path default'
98+ error_cnt = error_cnt + 1
99+ end if
100+ call json% get(p, CK_' not_there' , cvec2, ilen, found, default= cvec_default, default_ilen= ilen_default)
101+ if (json% failed() .or. found .or. all (cvec2 /= cvec_default) .or. all (ilen/= 1_IK )) then
102+ write (error_unit,' (A)' ) ' Error using json_get_alloc_string_vec_by_path default'
103+ error_cnt = error_cnt + 1
104+ end if
92105
93106 ! default:
94107 call json% get(p, ' not_there' , ival, found, default= 99_IK )
@@ -120,6 +133,16 @@ subroutine test_46(error_cnt)
120133 write (error_unit,' (A)' ) ' Error using json_get_string_vec_by_path default'
121134 error_cnt = error_cnt + 1
122135 end if
136+ call json% get(p, ' not_there' , cvec2, ilen, found, default= cvec_default)
137+ if (json% failed() .or. found .or. all (cvec2 /= cvec_default) .or. all (ilen/= 1_IK )) then
138+ write (error_unit,' (A)' ) ' Error using json_get_alloc_string_vec_by_path default'
139+ error_cnt = error_cnt + 1
140+ end if
141+ call json% get(p, ' not_there' , cvec2, ilen, found, default= cvec_default, default_ilen= ilen_default)
142+ if (json% failed() .or. found .or. all (cvec2 /= cvec_default) .or. all (ilen/= 1_IK )) then
143+ write (error_unit,' (A)' ) ' Error using json_get_alloc_string_vec_by_path default'
144+ error_cnt = error_cnt + 1
145+ end if
123146
124147 call json% destroy(p)
125148
@@ -159,6 +182,16 @@ subroutine test_46(error_cnt)
159182 write (error_unit,' (A)' ) ' Error using json_get_string_vec_by_path default'
160183 error_cnt = error_cnt + 1
161184 end if
185+ call json_f% get(CK_' not_there' , cvec2, ilen, found, default= cvec_default)
186+ if (json% failed() .or. found .or. all (cvec2 /= cvec_default) .or. all (ilen/= 1_IK )) then
187+ write (error_unit,' (A)' ) ' Error using json_get_alloc_string_vec_by_path default'
188+ error_cnt = error_cnt + 1
189+ end if
190+ call json_f% get(CK_' not_there' , cvec2, ilen, found, default= cvec_default, default_ilen= ilen_default)
191+ if (json% failed() .or. found .or. all (cvec2 /= cvec_default) .or. all (ilen/= 1_IK )) then
192+ write (error_unit,' (A)' ) ' Error using json_get_alloc_string_vec_by_path default'
193+ error_cnt = error_cnt + 1
194+ end if
162195
163196 ! default:
164197 call json_f% get(' not_there' , ival, found, default= 99_IK )
@@ -190,6 +223,16 @@ subroutine test_46(error_cnt)
190223 write (error_unit,' (A)' ) ' Error using json_get_string_vec_by_path default'
191224 error_cnt = error_cnt + 1
192225 end if
226+ call json_f% get(' not_there' , cvec2, ilen, found, default= cvec_default)
227+ if (json% failed() .or. found .or. all (cvec2 /= cvec_default) .or. all (ilen/= 1_IK )) then
228+ write (error_unit,' (A)' ) ' Error using json_get_alloc_string_vec_by_path default'
229+ error_cnt = error_cnt + 1
230+ end if
231+ call json_f% get(' not_there' , cvec2, ilen, found, default= cvec_default, default_ilen= ilen_default)
232+ if (json% failed() .or. found .or. all (cvec2 /= cvec_default) .or. all (ilen/= 1_IK )) then
233+ write (error_unit,' (A)' ) ' Error using json_get_alloc_string_vec_by_path default'
234+ error_cnt = error_cnt + 1
235+ end if
193236
194237 if (error_cnt== 0 ) then
195238 write (error_unit,' (A)' ) ' Success!'
0 commit comments