@@ -23,7 +23,7 @@ subroutine test_35(error_cnt)
23
23
integer ,intent (out ) :: error_cnt
24
24
25
25
type (json_core) :: json
26
- type (json_value),pointer :: p_root,p_array
26
+ type (json_value),pointer :: p_root,p_array,p_element
27
27
logical (LK) :: is_valid ! ! True if the structure is valid.
28
28
character (kind= CK,len= :),allocatable :: error_msg ! ! error message from `validate`
29
29
integer :: i ! ! counter
@@ -47,12 +47,11 @@ subroutine test_35(error_cnt)
47
47
call json% add(p_root,p_array)
48
48
call json% add(p_root,p_array) ! this creates a malformed JSON structure
49
49
elseif (i== 2 ) then
50
- call json% create_array(p_array, ' ' )
51
- call json% create_object(p_root, ' object' )
52
- call json% add(p_root,' int' ,1_IK )
53
- call json% add(p_array,p_root)
54
- call json% add(p_array,p_root) ! this creates a malformed JSON structure
55
- ! note: below we will destroy p_root, which is the duplicate array element
50
+ call json% create_array(p_root, ' ' )
51
+ call json% create_object(p_element, ' object' )
52
+ call json% add(p_element,' int' ,1_IK )
53
+ call json% add(p_root,p_element)
54
+ call json% add(p_root,p_element) ! this creates a malformed JSON structure
56
55
end if
57
56
58
57
! test initialize_json_core:
0 commit comments