Skip to content

Commit 5f586dd

Browse files
committed
documentation formatting updates for unit tests.
1 parent ca9df02 commit 5f586dd

9 files changed

+113
-122
lines changed

robodoc.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ items:
3232
RESULT
3333
SEE ALSO
3434
USAGE
35+
USES
3536
WARNINGS
3637
source line comments:
3738
!

src/tests/jf_test_1.f90

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
!*******************************************************************************************************
2-
!****f* JSON/test_1
2+
!****u* JSON/jf_test_1
33
!
44
! NAME
5-
! json_test
5+
! jf_test_1
66
!
77
! DESCRIPTION
88
! First unit test
@@ -12,11 +12,11 @@
1212
! iso_fortran_env (intrinsic)
1313
!
1414
! HISTORY
15-
! Izaak Beekman : 2/18/2015 : Created
15+
! Izaak Beekman : 2/18/2015 : Created (refactoried original json_example.f90 file)
1616
!
17-
! COPYRIGHT
17+
! LICENSE
1818
!
19-
! JSON-FORTRAN: A Fortran 2003/2008 JSON API
19+
! JSON-FORTRAN: A Fortran 2008 JSON API
2020
! https://github.com/jacobwilliams/json-fortran
2121
!
2222
! Copyright (c) 2014, Jacob Williams
@@ -47,22 +47,23 @@
4747
! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4848
!
4949
! SOURCE
50+
5051
module jf_test_1_mod
52+
5153
use json_module
5254
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
55+
5356
implicit none
54-
character(len=*),parameter :: dir = '../files/' !working directory
5557

58+
character(len=*),parameter :: dir = '../files/' !working directory
5659
character(len=*),parameter :: filename1 = 'test1.json'
5760

5861
contains
59-
!**************************************************************
60-
subroutine test_1(error_cnt)
61-
!**************************************************************
62-
!
63-
! Read a sample JSON file and retrieve some data from it
64-
!
65-
!**************************************************************
62+
63+
subroutine test_1(error_cnt)
64+
65+
! Read a sample JSON file and retrieve some data from it
66+
6667
implicit none
6768

6869
integer,intent(out) :: error_cnt
@@ -278,12 +279,9 @@ subroutine test_1(error_cnt)
278279
error_cnt = error_cnt + 1
279280
end if
280281

281-
!**************************************************************
282282
end subroutine test_1
283-
!**************************************************************
284283

285284
end module jf_test_1_mod
286-
!*******************************************************************************************************
287285

288286
program jf_test_1
289287
use jf_test_1_mod , only: test_1
@@ -293,3 +291,5 @@ program jf_test_1
293291
call test_1(n_errors)
294292
if (n_errors /= 0) stop 1
295293
end program jf_test_1
294+
295+
!*******************************************************************************************************

src/tests/jf_test_2.f90

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
!*******************************************************************************************************
2-
!****f* JSON/test_2
2+
!****u* JSON/jf_test_2
33
!
44
! NAME
5-
! json_test
5+
! jf_test_2
66
!
77
! DESCRIPTION
88
! Second unit test
@@ -12,11 +12,11 @@
1212
! iso_fortran_env (intrinsic)
1313
!
1414
! HISTORY
15-
! Izaak Beekman : 2/18/2015 : Created
15+
! Izaak Beekman : 2/18/2015 : Created (refactoried original json_example.f90 file)
1616
!
17-
! COPYRIGHT
17+
! LICENSE
1818
!
19-
! JSON-FORTRAN: A Fortran 2003/2008 JSON API
19+
! JSON-FORTRAN: A Fortran 2008 JSON API
2020
! https://github.com/jacobwilliams/json-fortran
2121
!
2222
! Copyright (c) 2014, Jacob Williams
@@ -47,22 +47,23 @@
4747
! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4848
!
4949
! SOURCE
50+
5051
module jf_test_2_mod
52+
5153
use json_module
5254
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
55+
5356
implicit none
54-
character(len=*),parameter :: dir = '../files/' !working directory
5557

58+
character(len=*),parameter :: dir = '../files/' !working directory
5659
character(len=*),parameter :: filename2 = 'test2.json'
5760

5861
contains
59-
!**************************************************************
60-
subroutine test_2(error_cnt)
61-
!**************************************************************
62-
!
63-
! Populate a JSON structure and write it to a file.
64-
!
65-
!**************************************************************
62+
63+
subroutine test_2(error_cnt)
64+
65+
! Populate a JSON structure and write it to a file.
66+
6667
implicit none
6768

6869
integer,intent(out) :: error_cnt
@@ -196,15 +197,10 @@ subroutine test_2(error_cnt)
196197

197198
write(error_unit,'(A)') ''
198199

199-
!**************************************************************
200200
end subroutine test_2
201-
!**************************************************************
202201

203-
!**************************************************************
204202
subroutine add_variables_to_input(me, variable, units, frame, center, rdata, error_cnt)
205-
!**************************************************************
206-
! Used by test_2.
207-
!**************************************************************
203+
!Used by test_2.
208204

209205
implicit none
210206

@@ -264,12 +260,9 @@ subroutine add_variables_to_input(me, variable, units, frame, center, rdata, err
264260
!cleanup:
265261
nullify(var)
266262

267-
!**************************************************************
268263
end subroutine add_variables_to_input
269-
!**************************************************************
270264

271265
end module jf_test_2_mod
272-
!*******************************************************************************************************
273266

274267
program jf_test_2
275268
use jf_test_2_mod , only: test_2
@@ -279,3 +272,5 @@ program jf_test_2
279272
call test_2(n_errors)
280273
if (n_errors /= 0) stop 1
281274
end program jf_test_2
275+
276+
!*******************************************************************************************************

src/tests/jf_test_3.f90

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
!*******************************************************************************************************
2-
!****f* JSON/test_3
2+
!****u* JSON/jf_test_3
33
!
44
! NAME
5-
! json_test
5+
! jf_test_3
66
!
77
! DESCRIPTION
88
! Third unit test
@@ -12,11 +12,11 @@
1212
! iso_fortran_env (intrinsic)
1313
!
1414
! HISTORY
15-
! Izaak Beekman : 2/18/2015 : Created
15+
! Izaak Beekman : 2/18/2015 : Created (refactoried original json_example.f90 file)
1616
!
17-
! COPYRIGHT
17+
! LICENSE
1818
!
19-
! JSON-FORTRAN: A Fortran 2003/2008 JSON API
19+
! JSON-FORTRAN: A Fortran 2008 JSON API
2020
! https://github.com/jacobwilliams/json-fortran
2121
!
2222
! Copyright (c) 2014, Jacob Williams
@@ -47,24 +47,23 @@
4747
! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4848
!
4949
! SOURCE
50+
5051
module jf_test_3_mod
52+
5153
use json_module
5254
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
55+
5356
implicit none
54-
character(len=*),parameter :: dir = '../files/' !working directory
5557

58+
character(len=*),parameter :: dir = '../files/' !working directory
5659
character(len=*),parameter :: filename2 = 'test2.json'
5760

5861
contains
5962

60-
!**************************************************************
6163
subroutine test_3(error_cnt)
62-
!**************************************************************
63-
!
64-
! Read the file generated in test_2, and extract
65-
! some data from it.
66-
!
67-
!**************************************************************
64+
65+
! Read the file generated in jf_test_2, and extract some data from it.
66+
6867
implicit none
6968

7069
integer,intent(out) :: error_cnt
@@ -163,12 +162,9 @@ subroutine test_3(error_cnt)
163162
error_cnt = error_cnt + 1
164163
end if
165164

166-
!**************************************************************
167165
end subroutine test_3
168-
!**************************************************************
169166

170167
end module jf_test_3_mod
171-
!*******************************************************************************************************
172168

173169
program jf_test_3
174170
use jf_test_3_mod , only: test_3
@@ -178,3 +174,5 @@ program jf_test_3
178174
call test_3(n_errors)
179175
if (n_errors /= 0) stop 1
180176
end program jf_test_3
177+
178+
!*******************************************************************************************************

src/tests/jf_test_4.f90

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
!*******************************************************************************************************
2-
!****f* JSON/test_4
2+
!****u* JSON/jf_test_4
33
!
44
! NAME
5-
! json_test
5+
! jf_test_4
66
!
77
! DESCRIPTION
88
! Fourth unit test
@@ -12,11 +12,11 @@
1212
! iso_fortran_env (intrinsic)
1313
!
1414
! HISTORY
15-
! Izaak Beekman : 2/18/2015 : Created
15+
! Izaak Beekman : 2/18/2015 : Created (refactoried original json_example.f90 file)
1616
!
17-
! COPYRIGHT
17+
! LICENSE
1818
!
19-
! JSON-FORTRAN: A Fortran 2003/2008 JSON API
19+
! JSON-FORTRAN: A Fortran 2008 JSON API
2020
! https://github.com/jacobwilliams/json-fortran
2121
!
2222
! Copyright (c) 2014, Jacob Williams
@@ -47,27 +47,28 @@
4747
! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4848
!
4949
! SOURCE
50+
5051
module jf_test_4_mod
52+
5153
use json_module
5254
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
55+
5356
implicit none
54-
character(len=*),parameter :: dir = '../files/' !working directory
5557

58+
character(len=*),parameter :: dir = '../files/' !working directory
5659
character(len=*),parameter :: filename4 = 'test4.json'
5760

5861
contains
5962

60-
!**************************************************************
63+
6164
subroutine test_4(error_cnt)
62-
!**************************************************************
63-
!
65+
6466
! Populate a JSON structure, write it to a file,
6567
! then read it.
6668
!
6769
! Also tests the json_value_to_string routine to write
6870
! the file to a character string.
69-
!
70-
!**************************************************************
71+
7172
implicit none
7273

7374
integer,intent(out) :: error_cnt
@@ -162,7 +163,6 @@ subroutine test_4(error_cnt)
162163
error_cnt = error_cnt + 1
163164
end if
164165

165-
166166
write(error_unit,'(A)') ''
167167
write(error_unit,'(A)') 'cleanup'
168168
call json%destroy()
@@ -171,12 +171,9 @@ subroutine test_4(error_cnt)
171171
error_cnt = error_cnt + 1
172172
end if
173173

174-
!**************************************************************
175174
end subroutine test_4
176-
!**************************************************************
177175

178176
end module jf_test_4_mod
179-
!*******************************************************************************************************
180177

181178
program jf_test_4
182179
use jf_test_4_mod , only: test_4
@@ -186,3 +183,5 @@ program jf_test_4
186183
call test_4(n_errors)
187184
if (n_errors /= 0) stop 1
188185
end program jf_test_4
186+
187+
!*******************************************************************************************************

0 commit comments

Comments
 (0)