]> gitweb.michael.orlitzky.com - spline3.git/blob - test/TestSuite.hs
Add a bunch more exact volume tests.
[spline3.git] / test / TestSuite.hs
1 import Test.HUnit
2 import Test.QuickCheck
3
4 import Tests.Cardinal
5 import Tests.Cube as TC
6 import Tests.FunctionValues
7 import Tests.Grid
8 import Tests.Misc
9 import Tests.Tetrahedron as TT
10
11 -- The list of HUnit tests.
12 test_suite = TestList (concat [cardinal_tests,
13 function_values_tests,
14 grid_tests,
15 misc_tests,
16 tetrahedron_tests])
17
18 main :: IO ()
19 main = do
20 putStrLn "HUnit"
21 putStrLn "-----"
22 runTestTT test_suite
23 putStrLn ""
24 putStrLn "QuickCheck"
25 putStrLn "----------"
26 let qc_args = stdArgs { maxSuccess = 100,
27 maxDiscard = 500,
28 maxSize = 100 }
29
30
31 putStrLn "\nGrid Tests\n"
32
33 putStrLn "\nCube Tests\n"
34
35 putStr "prop_all_volumes_positive... "
36 quickCheckWith qc_args prop_all_volumes_positive
37
38 putStr "prop_tetrahedron0_volumes_exact... "
39 quickCheckWith qc_args prop_tetrahedron0_volumes_exact
40
41 putStr "prop_tetrahedron1_volumes_exact... "
42 quickCheckWith qc_args prop_tetrahedron1_volumes_exact
43
44 putStr "prop_tetrahedron2_volumes_exact... "
45 quickCheckWith qc_args prop_tetrahedron2_volumes_exact
46
47 putStr "prop_tetrahedron3_volumes_exact... "
48 quickCheckWith qc_args prop_tetrahedron3_volumes_exact
49
50 putStr "prop_tetrahedron4_volumes_exact... "
51 quickCheckWith qc_args prop_tetrahedron4_volumes_exact
52
53 putStr "prop_tetrahedron4_volumes_exact... "
54 quickCheckWith qc_args prop_tetrahedron4_volumes_exact
55
56 putStr "prop_tetrahedron5_volumes_exact... "
57 quickCheckWith qc_args prop_tetrahedron5_volumes_exact
58
59 putStr "prop_tetrahedron6_volumes_exact... "
60 quickCheckWith qc_args prop_tetrahedron6_volumes_exact
61
62 putStr "prop_tetrahedron7_volumes_exact... "
63 quickCheckWith qc_args prop_tetrahedron7_volumes_exact
64
65 putStr "prop_tetrahedron8_volumes_exact... "
66 quickCheckWith qc_args prop_tetrahedron8_volumes_exact
67
68 putStr "prop_tetrahedron9_volumes_exact... "
69 quickCheckWith qc_args prop_tetrahedron9_volumes_exact
70
71 putStr "prop_tetrahedron10_volumes_exact... "
72 quickCheckWith qc_args prop_tetrahedron10_volumes_exact
73
74 putStr "prop_tetrahedron11_volumes_exact... "
75 quickCheckWith qc_args prop_tetrahedron11_volumes_exact
76
77 putStr "prop_tetrahedron12_volumes_exact... "
78 quickCheckWith qc_args prop_tetrahedron12_volumes_exact
79
80 putStr "prop_tetrahedron13_volumes_exact... "
81 quickCheckWith qc_args prop_tetrahedron13_volumes_exact
82
83 putStr "prop_tetrahedron14_volumes_exact... "
84 quickCheckWith qc_args prop_tetrahedron14_volumes_exact
85
86 putStr "prop_tetrahedron15_volumes_exact... "
87 quickCheckWith qc_args prop_tetrahedron15_volumes_exact
88
89 putStr "prop_tetrahedron16_volumes_exact... "
90 quickCheckWith qc_args prop_tetrahedron16_volumes_exact
91
92 putStr "prop_tetrahedron17_volumes_exact... "
93 quickCheckWith qc_args prop_tetrahedron17_volumes_exact
94
95 putStr "prop_tetrahedron18_volumes_exact... "
96 quickCheckWith qc_args prop_tetrahedron18_volumes_exact
97
98 putStr "prop_tetrahedron19_volumes_exact... "
99 quickCheckWith qc_args prop_tetrahedron19_volumes_exact
100
101 putStr "prop_tetrahedron20_volumes_exact... "
102 quickCheckWith qc_args prop_tetrahedron20_volumes_exact
103
104 putStr "prop_tetrahedron21_volumes_exact... "
105 quickCheckWith qc_args prop_tetrahedron21_volumes_exact
106
107 putStr "prop_tetrahedron22_volumes_exact... "
108 quickCheckWith qc_args prop_tetrahedron22_volumes_exact
109
110 putStr "prop_tetrahedron23_volumes_exact... "
111 quickCheckWith qc_args prop_tetrahedron23_volumes_exact
112
113 putStr "prop_tetrahedron0_volumes_positive... "
114 quickCheckWith qc_args prop_tetrahedron0_volumes_positive
115
116 putStr "prop_tetrahedron1_volumes_positive... "
117 quickCheckWith qc_args prop_tetrahedron1_volumes_positive
118
119 putStr "prop_tetrahedron2_volumes_positive... "
120 quickCheckWith qc_args prop_tetrahedron2_volumes_positive
121
122 putStr "prop_tetrahedron3_volumes_positive... "
123 quickCheckWith qc_args prop_tetrahedron3_volumes_positive
124
125 putStr "prop_tetrahedron4_volumes_positive... "
126 quickCheckWith qc_args prop_tetrahedron4_volumes_positive
127
128 putStr "prop_tetrahedron5_volumes_positive... "
129 quickCheckWith qc_args prop_tetrahedron5_volumes_positive
130
131 putStr "prop_tetrahedron6_volumes_positive... "
132 quickCheckWith qc_args prop_tetrahedron6_volumes_positive
133
134 putStr "prop_tetrahedron7_volumes_positive... "
135 quickCheckWith qc_args prop_tetrahedron7_volumes_positive
136
137 putStr "prop_tetrahedron8_volumes_positive... "
138 quickCheckWith qc_args prop_tetrahedron8_volumes_positive
139
140 putStr "prop_tetrahedron9_volumes_positive... "
141 quickCheckWith qc_args prop_tetrahedron9_volumes_positive
142
143 putStr "prop_tetrahedron10_volumes_positive... "
144 quickCheckWith qc_args prop_tetrahedron10_volumes_positive
145
146 putStr "prop_tetrahedron11_volumes_positive... "
147 quickCheckWith qc_args prop_tetrahedron11_volumes_positive
148
149 putStr "prop_tetrahedron12_volumes_positive... "
150 quickCheckWith qc_args prop_tetrahedron12_volumes_positive
151
152 putStr "prop_tetrahedron13_volumes_positive... "
153 quickCheckWith qc_args prop_tetrahedron13_volumes_positive
154
155 putStr "prop_tetrahedron14_volumes_positive... "
156 quickCheckWith qc_args prop_tetrahedron14_volumes_positive
157
158 putStr "prop_tetrahedron15_volumes_positive... "
159 quickCheckWith qc_args prop_tetrahedron15_volumes_positive
160
161 putStr "prop_tetrahedron16_volumes_positive... "
162 quickCheckWith qc_args prop_tetrahedron16_volumes_positive
163
164 putStr "prop_tetrahedron17_volumes_positive... "
165 quickCheckWith qc_args prop_tetrahedron17_volumes_positive
166
167 putStr "prop_tetrahedron18_volumes_positive... "
168 quickCheckWith qc_args prop_tetrahedron18_volumes_positive
169
170 putStr "prop_tetrahedron19_volumes_positive... "
171 quickCheckWith qc_args prop_tetrahedron19_volumes_positive
172
173 putStr "prop_tetrahedron20_volumes_positive... "
174 quickCheckWith qc_args prop_tetrahedron20_volumes_positive
175
176 putStr "prop_tetrahedron21_volumes_positive... "
177 quickCheckWith qc_args prop_tetrahedron21_volumes_positive
178
179 putStr "prop_tetrahedron22_volumes_positive... "
180 quickCheckWith qc_args prop_tetrahedron22_volumes_positive
181
182 putStr "prop_tetrahedron23_volumes_positive... "
183 quickCheckWith qc_args prop_tetrahedron23_volumes_positive
184
185 putStr "prop_v0_all_equal... "
186 quickCheckWith qc_args prop_v0_all_equal
187
188 -- putStrLn "\np. 78, (2.5)\n"
189
190 -- putStr "prop_cijk1_identity... "
191 -- quickCheckWith qc_args prop_cijk1_identity
192
193
194 putStrLn "\np. 79, (2.6)\n"
195
196 putStr "prop_c0120_identity1... "
197 quickCheckWith qc_args TC.prop_c0120_identity1
198
199 putStr "prop_c0120_identity2... "
200 quickCheckWith qc_args TC.prop_c0120_identity2
201
202 putStr "prop_c0120_identity3... "
203 quickCheckWith qc_args TC.prop_c0120_identity3
204
205 putStr "prop_c0120_identity4... "
206 quickCheckWith qc_args TC.prop_c0120_identity4
207
208 putStr "prop_c0120_identity5... "
209 quickCheckWith qc_args TC.prop_c0120_identity5
210
211 putStr "prop_c0120_identity6... "
212 quickCheckWith qc_args TC.prop_c0120_identity6
213
214 putStr "prop_c0210_identity1... "
215 quickCheckWith qc_args TC.prop_c0210_identity1
216
217 putStr "prop_c0300_identity1... "
218 quickCheckWith qc_args TC.prop_c0300_identity1
219
220 putStr "prop_c1110_identity... "
221 quickCheckWith qc_args TC.prop_c1110_identity
222
223 putStr "prop_c1200_identity1... "
224 quickCheckWith qc_args TC.prop_c1200_identity1
225
226 putStr "prop_c2100_identity1... "
227 quickCheckWith qc_args TC.prop_c2100_identity1
228
229 putStrLn "\np. 79, (2.7)\n"
230
231 putStr "prop_c0102_identity1... "
232 quickCheckWith qc_args TC.prop_c0102_identity1
233
234 putStr "prop_c0201_identity1... "
235 quickCheckWith qc_args TC.prop_c0201_identity1
236
237 putStr "prop_c0300_identity2... "
238 quickCheckWith qc_args TC.prop_c0300_identity2
239
240 putStr "prop_c1101_identity... "
241 quickCheckWith qc_args TC.prop_c1101_identity
242
243 putStr "prop_c1200_identity2... "
244 quickCheckWith qc_args TC.prop_c1200_identity2
245
246 putStr "prop_c2100_identity2... "
247 quickCheckWith qc_args TC.prop_c2100_identity2
248
249 putStrLn "\np. 79, (2.8)\n"
250
251 putStr "prop_c3000_identity... "
252 quickCheckWith qc_args TC.prop_c3000_identity
253
254 putStr "prop_c2010_identity... "
255 quickCheckWith qc_args TC.prop_c2010_identity
256
257 putStr "prop_c2001_identity... "
258 quickCheckWith qc_args TC.prop_c2001_identity
259
260 putStr "prop_c1020_identity... "
261 quickCheckWith qc_args TC.prop_c1020_identity
262
263 putStr "prop_c1002_identity... "
264 quickCheckWith qc_args TC.prop_c1002_identity
265
266 putStr "prop_c1011_identity... "
267 quickCheckWith qc_args TC.prop_c1011_identity
268
269 putStrLn "\np. 80, (2.9)\n"
270
271 -- putStr "prop_c0120_identity2... "
272 -- quickCheckWith qc_args TF.prop_c0120_identity2
273
274 -- putStr "prop_c0102_identity2... "
275 -- quickCheckWith qc_args TF.prop_c0102_identity2
276
277 -- putStr "prop_c0111_identity... "
278 -- quickCheckWith qc_args TF.prop_c0111_identity
279
280 -- putStr "prop_c0210_identity2... "
281 -- quickCheckWith qc_args TF.prop_c0210_identity2
282
283 -- putStr "prop_c0201_identity2... "
284 -- quickCheckWith qc_args TF.prop_c0201_identity2
285
286 -- putStr "prop_c0300_identity3... "
287 -- quickCheckWith qc_args TF.prop_c0300_identity3
288
289 putStrLn "prop_interior_values_all_identical... "
290 quickCheckWith qc_args prop_interior_values_all_identical
291
292 putStrLn "prop_c_tilde_2100_rotation_correct... "
293 quickCheckWith qc_args prop_c_tilde_2100_rotation_correct
294
295 putStrLn "prop_x_rotation_doesnt_affect_front... "
296 quickCheckWith qc_args prop_x_rotation_doesnt_affect_front
297
298 putStrLn "prop_x_rotation_doesnt_affect_back... "
299 quickCheckWith qc_args prop_x_rotation_doesnt_affect_back
300
301 putStrLn "prop_y_rotation_doesnt_affect_left... "
302 quickCheckWith qc_args prop_y_rotation_doesnt_affect_left
303
304 putStrLn "prop_y_rotation_doesnt_affect_right... "
305 quickCheckWith qc_args prop_y_rotation_doesnt_affect_right
306
307 putStrLn "prop_z_rotation_doesnt_affect_top... "
308 quickCheckWith qc_args prop_z_rotation_doesnt_affect_top
309
310 putStrLn "prop_z_rotation_doesnt_affect_down... "
311 quickCheckWith qc_args prop_z_rotation_doesnt_affect_down
312
313 putStrLn "prop_c_tilde_2100_correct... "
314 quickCheckWith qc_args prop_c_tilde_2100_correct
315
316
317 putStrLn "\nEdge Incidence Tests\n"
318
319 putStr "prop_t0_shares_edge_with_t6... "
320 quickCheckWith qc_args prop_t0_shares_edge_with_t6
321
322 putStr "prop_t0_shares_edge_with_t1... "
323 quickCheckWith qc_args prop_t0_shares_edge_with_t1
324
325 putStr "prop_t0_shares_edge_with_t3... "
326 quickCheckWith qc_args prop_t0_shares_edge_with_t3
327
328 putStr "prop_t1_shares_edge_with_t2... "
329 quickCheckWith qc_args prop_t1_shares_edge_with_t2
330
331 putStr "prop_t1_shares_edge_with_t19... "
332 quickCheckWith qc_args prop_t1_shares_edge_with_t19
333
334 putStr "prop_t2_shares_edge_with_t3... "
335 quickCheckWith qc_args prop_t2_shares_edge_with_t3
336
337 putStr "prop_t2_shares_edge_with_t12... "
338 quickCheckWith qc_args prop_t2_shares_edge_with_t12
339
340 putStr "prop_t3_shares_edge_with_t21... "
341 quickCheckWith qc_args prop_t3_shares_edge_with_t21
342
343 putStr "prop_t4_shares_edge_with_t5... "
344 quickCheckWith qc_args prop_t4_shares_edge_with_t5
345
346 putStr "prop_t4_shares_edge_with_t7... "
347 quickCheckWith qc_args prop_t4_shares_edge_with_t7
348
349 putStr "prop_t4_shares_edge_with_t10... "
350 quickCheckWith qc_args prop_t4_shares_edge_with_t10
351
352 putStr "prop_t5_shares_edge_with_t6... "
353 quickCheckWith qc_args prop_t5_shares_edge_with_t6
354
355 putStr "prop_t5_shares_edge_with_t16... "
356 quickCheckWith qc_args prop_t5_shares_edge_with_t16
357
358 putStr "prop_t6_shares_edge_with_t7... "
359 quickCheckWith qc_args prop_t6_shares_edge_with_t7
360
361 putStr "prop_t7_shares_edge_with_t20... "
362 quickCheckWith qc_args prop_t7_shares_edge_with_t20
363
364 putStrLn "\nMisc Tests\n"
365
366 putStr "prop_factorial_greater... "
367 quickCheckWith qc_args prop_factorial_greater
368
369 putStrLn "\nTetrahedron Tests\n"
370
371 putStr "prop_b0_v0_always_unity... "
372 quickCheckWith qc_args prop_b0_v0_always_unity
373
374 putStr "prop_b0_v1_always_zero... "
375 quickCheckWith qc_args prop_b0_v1_always_zero
376
377 putStr "prop_b0_v2_always_zero... "
378 quickCheckWith qc_args prop_b0_v2_always_zero
379
380 putStr "prop_b0_v3_always_zero... "
381 quickCheckWith qc_args prop_b0_v3_always_zero
382
383 putStr "prop_b1_v1_always_unity... "
384 quickCheckWith qc_args prop_b1_v1_always_unity
385
386 putStr "prop_b1_v0_always_zero... "
387 quickCheckWith qc_args prop_b1_v0_always_zero
388
389 putStr "prop_b1_v2_always_zero... "
390 quickCheckWith qc_args prop_b1_v2_always_zero
391
392 putStr "prop_b1_v3_always_zero... "
393 quickCheckWith qc_args prop_b1_v3_always_zero
394
395 putStr "prop_b2_v2_always_unity... "
396 quickCheckWith qc_args prop_b2_v2_always_unity
397
398 putStr "prop_b2_v0_always_zero... "
399 quickCheckWith qc_args prop_b2_v0_always_zero
400
401 putStr "prop_b2_v1_always_zero... "
402 quickCheckWith qc_args prop_b2_v1_always_zero
403
404 putStr "prop_b2_v3_always_zero... "
405 quickCheckWith qc_args prop_b2_v3_always_zero
406
407 putStr "prop_b3_v3_always_unity... "
408 quickCheckWith qc_args prop_b3_v3_always_unity
409
410 putStr "prop_b3_v0_always_zero... "
411 quickCheckWith qc_args prop_b3_v0_always_zero
412
413 putStr "prop_b3_v1_always_zero... "
414 quickCheckWith qc_args prop_b3_v1_always_zero
415
416 putStr "prop_b3_v2_always_zero... "
417 quickCheckWith qc_args prop_b3_v2_always_zero
418
419 putStrLn "\np. 78, (2.4)\n"
420
421 putStr "prop_c3000_identity... "
422 quickCheckWith qc_args TT.prop_c3000_identity
423
424 putStr "prop_c2100_identity... "
425 quickCheckWith qc_args TT.prop_c2100_identity
426
427 putStr "prop_c1110_identity... "
428 quickCheckWith qc_args TT.prop_c1110_identity
429
430
431 putStrLn "\nCardinal Tests\n"
432
433 putStr "prop_ccwx_rotation_changes_direction... "
434 quickCheckWith qc_args prop_ccwx_rotation_changes_direction
435
436 putStr "prop_cwx_rotation_changes_direction... "
437 quickCheckWith qc_args prop_cwx_rotation_changes_direction
438
439 putStr "prop_ccwy_rotation_changes_direction... "
440 quickCheckWith qc_args prop_ccwy_rotation_changes_direction
441
442 putStr "prop_cwy_rotation_changes_direction... "
443 quickCheckWith qc_args prop_cwy_rotation_changes_direction
444
445 putStr "prop_ccwz_rotation_changes_direction... "
446 quickCheckWith qc_args prop_ccwz_rotation_changes_direction
447
448 putStr "prop_cwz_rotation_changes_direction... "
449 quickCheckWith qc_args prop_cwz_rotation_changes_direction
450
451 putStr "prop_ccwx_rotation_result_unique... "
452 quickCheckWith qc_args prop_ccwx_rotation_result_unique
453
454 putStr "prop_cwx_rotation_result_unique... "
455 quickCheckWith qc_args prop_cwx_rotation_result_unique
456
457 putStr "prop_ccwy_rotation_result_unique... "
458 quickCheckWith qc_args prop_ccwy_rotation_result_unique
459
460 putStr "prop_cwy_rotation_result_unique... "
461 quickCheckWith qc_args prop_cwy_rotation_result_unique
462
463 putStr "prop_ccwz_rotation_result_unique... "
464 quickCheckWith qc_args prop_ccwz_rotation_result_unique
465
466 putStr "prop_cwz_rotation_result_unique... "
467 quickCheckWith qc_args prop_cwz_rotation_result_unique
468
469 putStr "prop_four_cwx_is_identity... "
470 quickCheckWith qc_args prop_four_cwx_is_identity
471
472 putStr "prop_four_ccwx_is_identity... "
473 quickCheckWith qc_args prop_four_ccwx_is_identity
474
475 putStr "prop_four_cwy_is_identity... "
476 quickCheckWith qc_args prop_four_cwy_is_identity
477
478 putStr "prop_four_ccwy_is_identity... "
479 quickCheckWith qc_args prop_four_ccwy_is_identity
480
481 putStr "prop_four_cwz_is_identity... "
482 quickCheckWith qc_args prop_four_cwz_is_identity
483
484 putStr "prop_four_ccwz_is_identity... "
485 quickCheckWith qc_args prop_four_ccwz_is_identity
486
487 return ()