test_tester_1 Program

Uses

  • program~~test_tester_1~~UsesGraph program~test_tester_1 test_tester_1 module~tester tester program~test_tester_1->module~tester iso_fortran_env iso_fortran_env module~tester->iso_fortran_env

Calls

program~~test_tester_1~~CallsGraph program~test_tester_1 test_tester_1 none~assert_close tester::tester_t%assert_close program~test_tester_1->none~assert_close none~assert_equal tester::tester_t%assert_equal program~test_tester_1->none~assert_equal none~assert_positive tester::tester_t%assert_positive program~test_tester_1->none~assert_positive proc~init~2 tester::tester_t%init program~test_tester_1->proc~init~2 proc~assert_close_c32 tester::tester_t%assert_close_c32 none~assert_close->proc~assert_close_c32 proc~assert_close_c32_1 tester::tester_t%assert_close_c32_1 none~assert_close->proc~assert_close_c32_1 proc~assert_close_c64 tester::tester_t%assert_close_c64 none~assert_close->proc~assert_close_c64 proc~assert_close_c64_1 tester::tester_t%assert_close_c64_1 none~assert_close->proc~assert_close_c64_1 proc~assert_close_r32 tester::tester_t%assert_close_r32 none~assert_close->proc~assert_close_r32 proc~assert_close_r32_1 tester::tester_t%assert_close_r32_1 none~assert_close->proc~assert_close_r32_1 proc~assert_close_r64 tester::tester_t%assert_close_r64 none~assert_close->proc~assert_close_r64 proc~assert_close_r64_1 tester::tester_t%assert_close_r64_1 none~assert_close->proc~assert_close_r64_1 proc~assert_equal_c32 tester::tester_t%assert_equal_c32 none~assert_equal->proc~assert_equal_c32 proc~assert_equal_c32_1 tester::tester_t%assert_equal_c32_1 none~assert_equal->proc~assert_equal_c32_1 proc~assert_equal_c64 tester::tester_t%assert_equal_c64 none~assert_equal->proc~assert_equal_c64 proc~assert_equal_c64_1 tester::tester_t%assert_equal_c64_1 none~assert_equal->proc~assert_equal_c64_1 proc~assert_equal_i16 tester::tester_t%assert_equal_i16 none~assert_equal->proc~assert_equal_i16 proc~assert_equal_i16_1 tester::tester_t%assert_equal_i16_1 none~assert_equal->proc~assert_equal_i16_1 proc~assert_equal_i32 tester::tester_t%assert_equal_i32 none~assert_equal->proc~assert_equal_i32 proc~assert_equal_i32_1 tester::tester_t%assert_equal_i32_1 none~assert_equal->proc~assert_equal_i32_1 proc~assert_equal_i64 tester::tester_t%assert_equal_i64 none~assert_equal->proc~assert_equal_i64 proc~assert_equal_i64_1 tester::tester_t%assert_equal_i64_1 none~assert_equal->proc~assert_equal_i64_1 proc~assert_equal_i8 tester::tester_t%assert_equal_i8 none~assert_equal->proc~assert_equal_i8 proc~assert_equal_i8_1 tester::tester_t%assert_equal_i8_1 none~assert_equal->proc~assert_equal_i8_1 proc~assert_equal_l tester::tester_t%assert_equal_l none~assert_equal->proc~assert_equal_l proc~assert_equal_l_1 tester::tester_t%assert_equal_l_1 none~assert_equal->proc~assert_equal_l_1 proc~assert_equal_r32 tester::tester_t%assert_equal_r32 none~assert_equal->proc~assert_equal_r32 proc~assert_equal_r32_1 tester::tester_t%assert_equal_r32_1 none~assert_equal->proc~assert_equal_r32_1 proc~assert_equal_r64 tester::tester_t%assert_equal_r64 none~assert_equal->proc~assert_equal_r64 proc~assert_equal_r64_1 tester::tester_t%assert_equal_r64_1 none~assert_equal->proc~assert_equal_r64_1 proc~assert_positive_i16 tester::tester_t%assert_positive_i16 none~assert_positive->proc~assert_positive_i16 proc~assert_positive_i16_1 tester::tester_t%assert_positive_i16_1 none~assert_positive->proc~assert_positive_i16_1 proc~assert_positive_i32 tester::tester_t%assert_positive_i32 none~assert_positive->proc~assert_positive_i32 proc~assert_positive_i32_1 tester::tester_t%assert_positive_i32_1 none~assert_positive->proc~assert_positive_i32_1 proc~assert_positive_i64 tester::tester_t%assert_positive_i64 none~assert_positive->proc~assert_positive_i64 proc~assert_positive_i64_1 tester::tester_t%assert_positive_i64_1 none~assert_positive->proc~assert_positive_i64_1 proc~assert_positive_i8 tester::tester_t%assert_positive_i8 none~assert_positive->proc~assert_positive_i8 proc~assert_positive_i8_1 tester::tester_t%assert_positive_i8_1 none~assert_positive->proc~assert_positive_i8_1 proc~assert_positive_r32 tester::tester_t%assert_positive_r32 none~assert_positive->proc~assert_positive_r32 proc~assert_positive_r32_1 tester::tester_t%assert_positive_r32_1 none~assert_positive->proc~assert_positive_r32_1 proc~assert_positive_r64 tester::tester_t%assert_positive_r64 none~assert_positive->proc~assert_positive_r64 proc~assert_positive_r64_1 tester::tester_t%assert_positive_r64_1 none~assert_positive->proc~assert_positive_r64_1

Variables

Type Attributes Name Initial
integer, parameter :: long_k = selected_int_kind(18)
double precision :: pi = 4*atan(1.d0)
type(tester_t) :: test

Source Code

program test_tester_1
  use tester
  implicit none

  integer, parameter :: long_k = selected_int_kind(18)
  double precision :: pi = 4*atan(1.d0)

  type(tester_t) :: test

  call test% init()

  call test% assert_equal(-121, -11**2)

  call test% assert_equal([1, -10, 1899010], [1, -10, 1899010])

  call test% assert_equal([0.2420243742417814d0, 0.4924788296716989d0, &
       0.8541147722227219d0, 0.267520651034313d0 , 0.6948550035165076d0], &
       [0.2420243742417814d0, 0.4924788296716989d0, &
       0.8541147722227219d0, 0.267520651034313d0 , 0.6948550035165076d0])

  call test% assert_close(0.d0, sin(pi))

  call test% assert_equal(0.d0, 0*1.d0)

  call test% assert_equal(.true., 2 > 1)

  call test% assert_equal(1.0, 1.0)

  call test% assert_equal( &
       [7.2936402920067644, 3.0975232096437191, 9.2077205929200456, &
       9.0014871205366358], &
       [7.2936402920067644, 3.0975232096437191, 9.2077205929200456, &
       9.0014871205366358])

  call test% assert_close(1.d0, (1.d0+1.d-16))

  call test% assert_close(1., (1.+1.e-7))

  call test% assert_close([ 0.58557761, 0.04035789, 0.30463428, &
       0.57437861, 0.4879709 , 0.00986957], &
       [ 0.58557761+epsilon(1.0), 0.04035789, 0.30463428+2*epsilon(1.0), &
       0.57437861, 0.4879709 , 0.00986957-epsilon(1.0)])

  call test% assert_close([1.d0, 2.d0], [1.d0, 2.d0])

  call test% assert_positive(epsilon(1.))
  call test% assert_positive(0.1)
  call test% assert_positive(0.1d0)

  call test% assert_positive([1., 2., 0.])
  call test% assert_positive([1.d0, huge(1.d0)])

  call test% assert_equal(1, 1)
  call test% assert_equal(1_long_k, 1_long_k)
  call test% assert_equal([1, -huge(1), huge(1), 0], [1, -huge(1), huge(1), 0])
  call test% assert_equal([1_long_k, -huge(1_long_k), huge(1_long_k), 0_long_k], &
       [1_long_k, -huge(1_long_k), huge(1_long_k), 0_long_k])

  call test% assert_positive(2**30)
  call test% assert_positive(2_long_k**62)
  call test% assert_positive([2**30, 1, 0])
  call test% assert_positive([2_long_k**62, 1_long_k, 0_long_k])

  call test% print()

end program test_tester_1