9 integer,
parameter :: long_k = selected_int_kind(18)
10 double precision :: pi = 4*atan(1.d0)
16 call test% assert_equal(-121, -11**2)
18 call test% assert_equal([1, -10, 1899010], [1, -10, 1899010])
20 call test% assert_equal([0.2420243742417814d0, 0.4924788296716989d0, &
21 0.8541147722227219d0, 0.267520651034313d0 , 0.6948550035165076d0], &
22 [0.2420243742417814d0, 0.4924788296716989d0, &
23 0.8541147722227219d0, 0.267520651034313d0 , 0.6948550035165076d0])
25 call test% assert_close(0.d0, sin(pi))
27 call test% assert_equal(0.d0, 0*1.d0)
29 call test% assert_equal(.true., 2 > 1)
31 call test% assert_equal(1.0, 1.0)
33 call test% assert_equal( &
34 [7.2936402920067644, 3.0975232096437191, 9.2077205929200456, &
35 9.0014871205366358], &
36 [7.2936402920067644, 3.0975232096437191, 9.2077205929200456, &
39 call test% assert_close(1.d0, (1.d0+1.d-16))
41 call test% assert_close(1., (1.+1.e-7))
43 call test% assert_close([ 0.58557761, 0.04035789, 0.30463428, &
44 0.57437861, 0.4879709 , 0.00986957], &
45 [ 0.58557761+epsilon(1.0), 0.04035789, 0.30463428+2*epsilon(1.0), &
46 0.57437861, 0.4879709 , 0.00986957-epsilon(1.0)])
48 call test% assert_close([1.d0, 2.d0], [1.d0, 2.d0])
50 call test% assert_positive(epsilon(1.))
51 call test% assert_positive(0.1)
52 call test% assert_positive(0.1d0)
54 call test% assert_positive([1., 2., 0.])
55 call test% assert_positive([1.d0, huge(1.d0)])
57 call test% assert_equal(1, 1)
58 call test% assert_equal(1_long_k, 1_long_k)
59 call test% assert_equal([1, -huge(1), huge(1), 0], [1, -huge(1), huge(1), 0])
60 call test% assert_equal([1_long_k, -huge(1_long_k), huge(1_long_k), 0_long_k], &
61 [1_long_k, -huge(1_long_k), huge(1_long_k), 0_long_k])
63 call test% assert_positive(2**30)
64 call test% assert_positive(2_long_k**62)
65 call test% assert_positive([2**30, 1, 0])
66 call test% assert_positive([2_long_k**62, 1_long_k, 0_long_k])
Routines to test Fortran programs.