fUnit 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,324 @@
1
+ ! FluxFunctionsTS.f90 - a Fortran mobility test suite for FluxFunctions.f90
2
+ !
3
+ ! [dynamically generated from FluxFunctionsTS.ftk
4
+ ! by FTKtest Ruby script Wed Nov 07 07:53:00 EST 2001]
5
+
6
+ module FluxFunctionsTS
7
+
8
+ use FluxFunctions
9
+
10
+ implicit none
11
+
12
+ private
13
+
14
+ public :: TSFluxFunctions
15
+
16
+ logical :: noAssertFailed
17
+
18
+ integer :: numTests = 0
19
+ integer :: numAsserts = 0
20
+ integer :: numAssertsTested = 0
21
+ integer :: numFailures = 0
22
+
23
+ ! $Id: FluxFunctionsTS.f90 112 2006-04-05 11:23:45Z kleb $
24
+
25
+ real :: leftState, rightState, interfaceFlux
26
+
27
+ contains
28
+
29
+
30
+ subroutine TestFluxZero
31
+
32
+ real :: state
33
+ state = 0
34
+
35
+ ! IsEqualWithin assertion
36
+ numAsserts = numAsserts + 1
37
+ if (noAssertFailed) then
38
+ if (.not.( 0+ 0.00001 .ge. Flux(state) &
39
+ .and. 0- 0.00001 .le. Flux(state))) then
40
+ print *, " FAILURE: IsEqualWithin in test FluxZero, &
41
+ &line 13 of FluxFunctionsTS.ftk"
42
+ print *, " ", " Flux(state) is not", 0,"within", 0.00001
43
+ noAssertFailed = .false.
44
+ numFailures = numFailures + 1
45
+ else
46
+ numAssertsTested = numAssertsTested + 1
47
+ endif
48
+ endif
49
+
50
+ numTests = numTests + 1
51
+
52
+ end subroutine TestFluxZero
53
+
54
+
55
+ subroutine TestFluxOne
56
+
57
+ real :: state = 1
58
+
59
+ ! IsEqualWithin assertion
60
+ numAsserts = numAsserts + 1
61
+ if (noAssertFailed) then
62
+ if (.not.( 0.5+ 0.00001 .ge. Flux(state) &
63
+ .and. 0.5- 0.00001 .le. Flux(state))) then
64
+ print *, " FAILURE: IsEqualWithin in test FluxOne, &
65
+ &line 18 of FluxFunctionsTS.ftk"
66
+ print *, " ", " Flux(state) is not", 0.5,"within", 0.00001
67
+ noAssertFailed = .false.
68
+ numFailures = numFailures + 1
69
+ else
70
+ numAssertsTested = numAssertsTested + 1
71
+ endif
72
+ endif
73
+
74
+ numTests = numTests + 1
75
+
76
+ end subroutine TestFluxOne
77
+
78
+
79
+ subroutine TestRoeAvgZero
80
+
81
+
82
+ ! IsRealEqual assertion
83
+ numAsserts = numAsserts + 1
84
+ if (noAssertFailed) then
85
+ if (.not.( 0 +2*spacing(real( 0 )).ge. RoeAvg(0.0,0.0) &
86
+ .and. 0 -2*spacing(real( 0 )).le. RoeAvg(0.0,0.0))) then
87
+ print *, " FAILURE: IsRealEqual in test RoeAvgZero, &
88
+ &line 22 of FluxFunctionsTS.ftk"
89
+ print *, " ", " RoeAvg(0.0,0.0) is not", 0 ,"within",2*spacing(real( 0 ))
90
+ noAssertFailed = .false.
91
+ numFailures = numFailures + 1
92
+ else
93
+ numAssertsTested = numAssertsTested + 1
94
+ endif
95
+ endif
96
+
97
+ ! IsFalse assertion
98
+ numAsserts = numAsserts + 1
99
+ if (noAssertFailed) then
100
+ if ( RoeAvg(0.0,0.0).ne.1 ) then
101
+ print *, " FAILURE: IsFalse in test RoeAvgZero, &
102
+ &line 23 of FluxFunctionsTS.ftk"
103
+ print *, " ", " RoeAvg(0.0,0.0).ne.1 is not false"
104
+ noAssertFailed = .false.
105
+ numFailures = numFailures + 1
106
+ else
107
+ numAssertsTested = numAssertsTested + 1
108
+ endif
109
+ endif
110
+
111
+ numTests = numTests + 1
112
+
113
+ end subroutine TestRoeAvgZero
114
+
115
+
116
+ subroutine TestRoeAvgKnown
117
+
118
+
119
+ ! IsRealEqual assertion
120
+ numAsserts = numAsserts + 1
121
+ if (noAssertFailed) then
122
+ if (.not.( 0.5 +2*spacing(real( 0.5 )).ge. RoeAvg(leftState,rightState) &
123
+ .and. 0.5 -2*spacing(real( 0.5 )).le. RoeAvg(leftState,rightState))) then
124
+ print *, " FAILURE: IsRealEqual in test RoeAvgKnown, &
125
+ &line 27 of FluxFunctionsTS.ftk"
126
+ print *, " ", " RoeAvg(leftState,rightState) is not", 0.5 ,"within",2*spacing(real( 0.5 ))
127
+ noAssertFailed = .false.
128
+ numFailures = numFailures + 1
129
+ else
130
+ numAssertsTested = numAssertsTested + 1
131
+ endif
132
+ endif
133
+
134
+ ! IsTrue assertion
135
+ numAsserts = numAsserts + 1
136
+ if (noAssertFailed) then
137
+ if (.not.( RoeAvg(leftState,rightState).lt.0 )) then
138
+ print *, " FAILURE: IsTrue in test RoeAvgKnown, &
139
+ &line 28 of FluxFunctionsTS.ftk"
140
+ print *, " ", " RoeAvg(leftState,rightState).lt.0 is not true"
141
+ noAssertFailed = .false.
142
+ numFailures = numFailures + 1
143
+ else
144
+ numAssertsTested = numAssertsTested + 1
145
+ endif
146
+ endif
147
+
148
+ numTests = numTests + 1
149
+
150
+ end subroutine TestRoeAvgKnown
151
+
152
+
153
+ subroutine TestCentralFluxKnown
154
+
155
+ call CentralFlux( leftState, rightState, interfaceFlux )
156
+
157
+ ! IsEqualWithin assertion
158
+ numAsserts = numAsserts + 1
159
+ if (noAssertFailed) then
160
+ if (.not.( 0.5+ 0.001 .ge. interfaceFlux &
161
+ .and. 0.5- 0.001 .le. interfaceFlux)) then
162
+ print *, " FAILURE: IsEqualWithin in test CentralFluxKnown, &
163
+ &line 33 of FluxFunctionsTS.ftk"
164
+ print *, " ", " interfaceFlux is not", 0.5,"within", 0.001
165
+ noAssertFailed = .false.
166
+ numFailures = numFailures + 1
167
+ else
168
+ numAssertsTested = numAssertsTested + 1
169
+ endif
170
+ endif
171
+
172
+ ! IsEqualWithin assertion
173
+ numAsserts = numAsserts + 1
174
+ if (noAssertFailed) then
175
+ if (.not.( 0.5+ 0.00000001 .ge. interfaceFlux &
176
+ .and. 0.5- 0.00000001 .le. interfaceFlux)) then
177
+ print *, " FAILURE: IsEqualWithin in test CentralFluxKnown, &
178
+ &line 34 of FluxFunctionsTS.ftk"
179
+ print *, " ", " interfaceFlux is not", 0.5,"within", 0.00000001
180
+ noAssertFailed = .false.
181
+ numFailures = numFailures + 1
182
+ else
183
+ numAssertsTested = numAssertsTested + 1
184
+ endif
185
+ endif
186
+
187
+ ! IsEqual assertion
188
+ numAsserts = numAsserts + 1
189
+ if (noAssertFailed) then
190
+ if (.not.( interfaceFlux== 0.5 )) then
191
+ print *, " FAILURE: IsEqual in test CentralFluxKnown, &
192
+ &line 35 of FluxFunctionsTS.ftk"
193
+ print *, " ", " interfaceFlux is not", 0.5
194
+ noAssertFailed = .false.
195
+ numFailures = numFailures + 1
196
+ else
197
+ numAssertsTested = numAssertsTested + 1
198
+ endif
199
+ endif
200
+
201
+ numTests = numTests + 1
202
+
203
+ end subroutine TestCentralFluxKnown
204
+
205
+
206
+ subroutine TestRoeFluxExpansionShock
207
+
208
+ leftState = -1
209
+ call RoeFlux( leftState, rightState, interfaceFlux )
210
+
211
+ ! IsEqual assertion
212
+ numAsserts = numAsserts + 1
213
+ if (noAssertFailed) then
214
+ if (.not.( interfaceFlux== 0 )) then
215
+ print *, " FAILURE: IsEqual in test RoeFluxExpansionShock, &
216
+ &line 41 of FluxFunctionsTS.ftk"
217
+ print *, " ", " interfaceFlux is not", 0
218
+ noAssertFailed = .false.
219
+ numFailures = numFailures + 1
220
+ else
221
+ numAssertsTested = numAssertsTested + 1
222
+ endif
223
+ endif
224
+
225
+ numTests = numTests + 1
226
+
227
+ end subroutine TestRoeFluxExpansionShock
228
+
229
+
230
+ subroutine TestRoeFluxZero
231
+
232
+ rightState = 0
233
+ call RoeFlux( leftState, rightState, interfaceFlux )
234
+
235
+ ! IsRealEqual assertion
236
+ numAsserts = numAsserts + 1
237
+ if (noAssertFailed) then
238
+ if (.not.( 0 +2*spacing(real( 0 )).ge. interfaceFlux &
239
+ .and. 0 -2*spacing(real( 0 )).le. interfaceFlux)) then
240
+ print *, " FAILURE: IsRealEqual in test RoeFluxZero, &
241
+ &line 47 of FluxFunctionsTS.ftk"
242
+ print *, " ", " interfaceFlux is not", 0 ,"within",2*spacing(real( 0 ))
243
+ noAssertFailed = .false.
244
+ numFailures = numFailures + 1
245
+ else
246
+ numAssertsTested = numAssertsTested + 1
247
+ endif
248
+ endif
249
+
250
+ ! IsEqual assertion
251
+ numAsserts = numAsserts + 1
252
+ if (noAssertFailed) then
253
+ if (.not.( interfaceFlux== 0 )) then
254
+ print *, " FAILURE: IsEqual in test RoeFluxZero, &
255
+ &line 48 of FluxFunctionsTS.ftk"
256
+ print *, " ", " interfaceFlux is not", 0
257
+ noAssertFailed = .false.
258
+ numFailures = numFailures + 1
259
+ else
260
+ numAssertsTested = numAssertsTested + 1
261
+ endif
262
+ endif
263
+
264
+ numTests = numTests + 1
265
+
266
+ end subroutine TestRoeFluxZero
267
+
268
+
269
+ subroutine Setup
270
+ leftState = 0
271
+ rightState = 1
272
+ noAssertFailed = .true.
273
+ end subroutine Setup
274
+
275
+
276
+ subroutine Teardown
277
+ end subroutine Teardown
278
+
279
+
280
+ subroutine TSFluxFunctions( nTests, nAsserts, nAssertsTested, nFailures )
281
+
282
+ integer :: nTests
283
+ integer :: nAsserts
284
+ integer :: nAssertsTested
285
+ integer :: nFailures
286
+
287
+ continue
288
+
289
+ call Setup
290
+ call TestFluxZero
291
+ call Teardown
292
+
293
+ call Setup
294
+ call TestFluxOne
295
+ call Teardown
296
+
297
+ call Setup
298
+ call TestRoeAvgZero
299
+ call Teardown
300
+
301
+ call Setup
302
+ call TestRoeAvgKnown
303
+ call Teardown
304
+
305
+ call Setup
306
+ call TestCentralFluxKnown
307
+ call Teardown
308
+
309
+ call Setup
310
+ call TestRoeFluxExpansionShock
311
+ call Teardown
312
+
313
+ call Setup
314
+ call TestRoeFluxZero
315
+ call Teardown
316
+
317
+ nTests = numTests
318
+ nAsserts = numAsserts
319
+ nAssertsTested = numAssertsTested
320
+ nFailures = numFailures
321
+
322
+ end subroutine TSFluxFunctions
323
+
324
+ end module FluxFunctionsTS