tester_t Derived Type

type, public :: tester_t

The main tester class.


Components

Type Visibility Attributes Name Initial
integer(kind=int32), public :: n_errors = 0_int32

Number of errors.

integer(kind=int32), public :: n_tests = 0_int32

Number of tests.

real(kind=real32), public :: tolerance32 = 2._real32*epsilon(1._real32)

Real tolerance, 32 bits.

real(kind=real64), public :: tolerance64 = 2._real64*epsilon(1._real64)

Real tolerance, 64 bits.


Type-Bound Procedures

procedure, public :: init

Initialize the tester.

  • private subroutine init(this, tolerance32, tolerance64)

    Initialize the tester.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(out) :: this

    The tester.

    real(kind=real32), intent(in), optional :: tolerance32

    Real tolerance, 32 bits.

    real(kind=real64), intent(in), optional :: tolerance64

    Real tolerance, 64 bits.

procedure, public :: print

Print tests results.

  • private subroutine print(this, errorstop)

    Print tests results.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(in) :: this

    The tester.

    logical, intent(in), optional :: errorstop

    Flag to activate error stop if one test fails.

Check if two values (integer, real, complex or logical) are equal.

  • private subroutine assert_equal_i8(this, i1, i2)

    Check if two integers (8 bits) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int8), intent(in) :: i1

    Value to compare.

    integer(kind=int8), intent(in) :: i2

    Value to compare.

  • private subroutine assert_equal_i16(this, i1, i2)

    Check if two integers (16 bits) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int16), intent(in) :: i1

    Value to compare.

    integer(kind=int16), intent(in) :: i2

    Value to compare.

  • private subroutine assert_equal_i32(this, i1, i2)

    Check if two integers (32 bits) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int32), intent(in) :: i1

    Value to compare.

    integer(kind=int32), intent(in) :: i2

    Value to compare.

  • private subroutine assert_equal_i64(this, i1, i2)

    Check if two integers (64 bits) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int64), intent(in) :: i1

    Value to compare.

    integer(kind=int64), intent(in) :: i2

    Value to compare.

  • private subroutine assert_equal_r32(this, r1, r2)

    Check if two reals (32 bits) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real32), intent(in) :: r1

    Value to compare.

    real(kind=real32), intent(in) :: r2

    Value to compare.

  • private subroutine assert_equal_r64(this, r1, r2)

    Check if two reals (64 bits) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real64), intent(in) :: r1

    Value to compare.

    real(kind=real64), intent(in) :: r2

    Value to compare.

  • private subroutine assert_equal_c32(this, c1, c2)

    Check if two complex numbers (32 bits) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    complex(kind=real32), intent(in) :: c1

    Value to compare.

    complex(kind=real32), intent(in) :: c2

    Value to compare.

  • private subroutine assert_equal_c64(this, c1, c2)

    Check if two complex numbers (64 bits) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    complex(kind=real64), intent(in) :: c1

    Value to compare.

    complex(kind=real64), intent(in) :: c2

    Value to compare.

  • private subroutine assert_equal_l(this, l1, l2)

    Check if two logicals are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    logical, intent(in) :: l1

    Value to compare.

    logical, intent(in) :: l2

    Value to compare.

  • private subroutine assert_equal_i8_1(this, i1, i2)

    Check if two integer (8 bits) arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int8), intent(in), dimension(:) :: i1

    Value to compare.

    integer(kind=int8), intent(in), dimension(:) :: i2

    Value to compare.

  • private subroutine assert_equal_i16_1(this, i1, i2)

    Check if two integer (16 bits) arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int16), intent(in), dimension(:) :: i1

    Value to compare.

    integer(kind=int16), intent(in), dimension(:) :: i2

    Value to compare.

  • private subroutine assert_equal_i32_1(this, i1, i2)

    Check if two integer (32 bits) arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int32), intent(in), dimension(:) :: i1

    Value to compare.

    integer(kind=int32), intent(in), dimension(:) :: i2

    Value to compare.

  • private subroutine assert_equal_i64_1(this, i1, i2)

    Check if two integer (64 bits) arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int64), intent(in), dimension(:) :: i1

    Value to compare.

    integer(kind=int64), intent(in), dimension(:) :: i2

    Value to compare.

  • private subroutine assert_equal_r32_1(this, r1, r2)

    Check if two real (32 bits) arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real32), intent(in), dimension(:) :: r1

    Value to compare.

    real(kind=real32), intent(in), dimension(:) :: r2

    Value to compare.

  • private subroutine assert_equal_r64_1(this, r1, r2)

    Check if two real (64 bits) arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real64), intent(in), dimension(:) :: r1

    Value to compare.

    real(kind=real64), intent(in), dimension(:) :: r2

    Value to compare.

  • private subroutine assert_equal_c32_1(this, c1, c2)

    Check if two complex (32 bits) arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    complex(kind=real32), intent(in), dimension(:) :: c1

    Value to compare.

    complex(kind=real32), intent(in), dimension(:) :: c2

    Value to compare.

  • private subroutine assert_equal_c64_1(this, c1, c2)

    Check if two complex (64 bits) arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    complex(kind=real64), intent(in), dimension(:) :: c1

    Value to compare.

    complex(kind=real64), intent(in), dimension(:) :: c2

    Value to compare.

  • private subroutine assert_equal_l_1(this, l1, l2)

    Check if two logical arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    logical, intent(in), dimension(:) :: l1

    Value to compare.

    logical, intent(in), dimension(:) :: l2

    Value to compare.

procedure, private :: assert_equal_i8

Check if two integers (8 bits) are equal.

  • private subroutine assert_equal_i8(this, i1, i2)

    Check if two integers (8 bits) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int8), intent(in) :: i1

    Value to compare.

    integer(kind=int8), intent(in) :: i2

    Value to compare.

procedure, private :: assert_equal_i16

Check if two integers (16 bits) are equal.

  • private subroutine assert_equal_i16(this, i1, i2)

    Check if two integers (16 bits) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int16), intent(in) :: i1

    Value to compare.

    integer(kind=int16), intent(in) :: i2

    Value to compare.

procedure, private :: assert_equal_i32

Check if two integers (32 bits) are equal.

  • private subroutine assert_equal_i32(this, i1, i2)

    Check if two integers (32 bits) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int32), intent(in) :: i1

    Value to compare.

    integer(kind=int32), intent(in) :: i2

    Value to compare.

procedure, private :: assert_equal_i64

Check if two integers (64 bits) are equal.

  • private subroutine assert_equal_i64(this, i1, i2)

    Check if two integers (64 bits) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int64), intent(in) :: i1

    Value to compare.

    integer(kind=int64), intent(in) :: i2

    Value to compare.

procedure, private :: assert_equal_r32

Check if two reals (32 bits) are equal.

  • private subroutine assert_equal_r32(this, r1, r2)

    Check if two reals (32 bits) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real32), intent(in) :: r1

    Value to compare.

    real(kind=real32), intent(in) :: r2

    Value to compare.

procedure, private :: assert_equal_r64

Check if two reals (64 bits) are equal.

  • private subroutine assert_equal_r64(this, r1, r2)

    Check if two reals (64 bits) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real64), intent(in) :: r1

    Value to compare.

    real(kind=real64), intent(in) :: r2

    Value to compare.

procedure, private :: assert_equal_c32

Check if two complex numbers (32 bits) are equal.

  • private subroutine assert_equal_c32(this, c1, c2)

    Check if two complex numbers (32 bits) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    complex(kind=real32), intent(in) :: c1

    Value to compare.

    complex(kind=real32), intent(in) :: c2

    Value to compare.

procedure, private :: assert_equal_c64

Check if two complex numbers (64 bits) are equal.

  • private subroutine assert_equal_c64(this, c1, c2)

    Check if two complex numbers (64 bits) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    complex(kind=real64), intent(in) :: c1

    Value to compare.

    complex(kind=real64), intent(in) :: c2

    Value to compare.

procedure, private :: assert_equal_l

Check if two logicals are equal.

  • private subroutine assert_equal_l(this, l1, l2)

    Check if two logicals are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    logical, intent(in) :: l1

    Value to compare.

    logical, intent(in) :: l2

    Value to compare.

procedure, private :: assert_equal_i8_1

Check if two integer (8 bits) arrays (rank 1) are equal.

  • private subroutine assert_equal_i8_1(this, i1, i2)

    Check if two integer (8 bits) arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int8), intent(in), dimension(:) :: i1

    Value to compare.

    integer(kind=int8), intent(in), dimension(:) :: i2

    Value to compare.

procedure, private :: assert_equal_i16_1

Check if two integer (16 bits) arrays (rank 1) are equal.

  • private subroutine assert_equal_i16_1(this, i1, i2)

    Check if two integer (16 bits) arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int16), intent(in), dimension(:) :: i1

    Value to compare.

    integer(kind=int16), intent(in), dimension(:) :: i2

    Value to compare.

procedure, private :: assert_equal_i32_1

Check if two integer (32 bits) arrays (rank 1) are equal.

  • private subroutine assert_equal_i32_1(this, i1, i2)

    Check if two integer (32 bits) arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int32), intent(in), dimension(:) :: i1

    Value to compare.

    integer(kind=int32), intent(in), dimension(:) :: i2

    Value to compare.

procedure, private :: assert_equal_i64_1

Check if two integer (64 bits) arrays (rank 1) are equal.

  • private subroutine assert_equal_i64_1(this, i1, i2)

    Check if two integer (64 bits) arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int64), intent(in), dimension(:) :: i1

    Value to compare.

    integer(kind=int64), intent(in), dimension(:) :: i2

    Value to compare.

procedure, private :: assert_equal_r32_1

Check if two real (32 bits) arrays (rank 1) are equal.

  • private subroutine assert_equal_r32_1(this, r1, r2)

    Check if two real (32 bits) arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real32), intent(in), dimension(:) :: r1

    Value to compare.

    real(kind=real32), intent(in), dimension(:) :: r2

    Value to compare.

procedure, private :: assert_equal_r64_1

Check if two real (64 bits) arrays (rank 1) are equal.

  • private subroutine assert_equal_r64_1(this, r1, r2)

    Check if two real (64 bits) arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real64), intent(in), dimension(:) :: r1

    Value to compare.

    real(kind=real64), intent(in), dimension(:) :: r2

    Value to compare.

procedure, private :: assert_equal_c32_1

Check if two complex (32 bits) arrays (rank 1) are equal.

  • private subroutine assert_equal_c32_1(this, c1, c2)

    Check if two complex (32 bits) arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    complex(kind=real32), intent(in), dimension(:) :: c1

    Value to compare.

    complex(kind=real32), intent(in), dimension(:) :: c2

    Value to compare.

procedure, private :: assert_equal_c64_1

Check if two complex (64 bits) arrays (rank 1) are equal.

  • private subroutine assert_equal_c64_1(this, c1, c2)

    Check if two complex (64 bits) arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    complex(kind=real64), intent(in), dimension(:) :: c1

    Value to compare.

    complex(kind=real64), intent(in), dimension(:) :: c2

    Value to compare.

procedure, private :: assert_equal_l_1

Check if two logical arrays (rank 1) are equal.

  • private subroutine assert_equal_l_1(this, l1, l2)

    Check if two logical arrays (rank 1) are equal.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    logical, intent(in), dimension(:) :: l1

    Value to compare.

    logical, intent(in), dimension(:) :: l2

    Value to compare.

Check if a number (integer or real) is positive.

  • private subroutine assert_positive_i8(this, i)

    Check if a integer (32 bits) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int8), intent(in) :: i

    Value to check.

  • private subroutine assert_positive_i16(this, i)

    Check if a integer (16 bits) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int16), intent(in) :: i

    Value to check.

  • private subroutine assert_positive_i32(this, i)

    Check if a integer (32 bits) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int32), intent(in) :: i

    Value to check.

  • private subroutine assert_positive_i64(this, i)

    Check if a integer (32 bits) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int64), intent(in) :: i

    Value to check.

  • private subroutine assert_positive_r32(this, r)

    Check if a real (32 bits) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real32), intent(in) :: r

    Value to check.

  • private subroutine assert_positive_r64(this, r)

    Check if a real (64 bits) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real64), intent(in) :: r

    Value to check.

  • private subroutine assert_positive_i8_1(this, i)

    Check if a integer (8 bits) array (rank 1) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int8), intent(in), dimension(:) :: i

    Value to check.

  • private subroutine assert_positive_i16_1(this, i)

    Check if a integer (16 bits) array (rank 1) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int16), intent(in), dimension(:) :: i

    Value to check.

  • private subroutine assert_positive_i32_1(this, i)

    Check if a integer (32 bits) array (rank 1) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int32), intent(in), dimension(:) :: i

    Value to check.

  • private subroutine assert_positive_i64_1(this, i)

    Check if a integer (64 bits) array (rank 1) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int64), intent(in), dimension(:) :: i

    Value to check.

  • private subroutine assert_positive_r32_1(this, r)

    Check if a real (32 bits) array (rank 1) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real32), intent(in), dimension(:) :: r

    Value to check.

  • private subroutine assert_positive_r64_1(this, r)

    Check if a real (64 bits) array (rank 1) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real64), intent(in), dimension(:) :: r

    Value to check.

procedure, private :: assert_positive_i8

Check if a integer (8 bits) is positive.

  • private subroutine assert_positive_i8(this, i)

    Check if a integer (32 bits) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int8), intent(in) :: i

    Value to check.

procedure, private :: assert_positive_i16

Check if a integer (16 bits) is positive.

  • private subroutine assert_positive_i16(this, i)

    Check if a integer (16 bits) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int16), intent(in) :: i

    Value to check.

procedure, private :: assert_positive_i32

Check if a integer (32 bits) is positive.

  • private subroutine assert_positive_i32(this, i)

    Check if a integer (32 bits) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int32), intent(in) :: i

    Value to check.

procedure, private :: assert_positive_i64

Check if a integer (64 bits) is positive.

  • private subroutine assert_positive_i64(this, i)

    Check if a integer (32 bits) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int64), intent(in) :: i

    Value to check.

procedure, private :: assert_positive_r32

Check if a real (32 bits) is positive.

  • private subroutine assert_positive_r32(this, r)

    Check if a real (32 bits) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real32), intent(in) :: r

    Value to check.

procedure, private :: assert_positive_r64

Check if a real (64 bits) is positive.

  • private subroutine assert_positive_r64(this, r)

    Check if a real (64 bits) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real64), intent(in) :: r

    Value to check.

procedure, private :: assert_positive_i8_1

Check if a integer (8 bits) array (rank 1) is positive.

  • private subroutine assert_positive_i8_1(this, i)

    Check if a integer (8 bits) array (rank 1) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int8), intent(in), dimension(:) :: i

    Value to check.

procedure, private :: assert_positive_i16_1

Check if a integer (16 bits) array (rank 1) is positive.

  • private subroutine assert_positive_i16_1(this, i)

    Check if a integer (16 bits) array (rank 1) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int16), intent(in), dimension(:) :: i

    Value to check.

procedure, private :: assert_positive_i32_1

Check if a integer (32 bits) array (rank 1) is positive.

  • private subroutine assert_positive_i32_1(this, i)

    Check if a integer (32 bits) array (rank 1) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int32), intent(in), dimension(:) :: i

    Value to check.

procedure, private :: assert_positive_i64_1

Check if a integer (64 bits) array (rank 1) is positive.

  • private subroutine assert_positive_i64_1(this, i)

    Check if a integer (64 bits) array (rank 1) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    integer(kind=int64), intent(in), dimension(:) :: i

    Value to check.

procedure, private :: assert_positive_r32_1

Check if a real (32 bits) array (rank 1) is positive.

  • private subroutine assert_positive_r32_1(this, r)

    Check if a real (32 bits) array (rank 1) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real32), intent(in), dimension(:) :: r

    Value to check.

procedure, private :: assert_positive_r64_1

Check if a real (64 bits) array (rank 1) is positive.

  • private subroutine assert_positive_r64_1(this, r)

    Check if a real (64 bits) array (rank 1) is positive.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real64), intent(in), dimension(:) :: r

    Value to check.

Check if two values (real or complex) are close with respect a tolerance.

  • private subroutine assert_close_r32(this, r1, r2)

    Check if two reals (32 bits) are close with respect a tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real32), intent(in) :: r1

    Value to compare.

    real(kind=real32), intent(in) :: r2

    Value to compare.

  • private subroutine assert_close_r64(this, r1, r2)

    Check if two reals (64 bits) are close with respect a tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real64), intent(in) :: r1

    Value to compare.

    real(kind=real64), intent(in) :: r2

    Value to compare.

  • private subroutine assert_close_c32(this, c1, c2)

    Check if two complex numbers (32 bits) are close with respect a tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    complex(kind=real32), intent(in) :: c1

    Value to compare.

    complex(kind=real32), intent(in) :: c2

    Value to compare.

  • private subroutine assert_close_c64(this, r1, c2)

    Check if two complex numbers (64 bits) are close with respect a tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    complex(kind=real64), intent(in) :: r1

    Value to compare.

    complex(kind=real64), intent(in) :: c2

    Value to compare.

  • private subroutine assert_close_r32_1(this, r1, r2)

    Check if two real (32 bits) arrays (rank 1) are close with respect a tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real32), intent(in), dimension(:) :: r1

    Value to compare.

    real(kind=real32), intent(in), dimension(:) :: r2

    Value to compare.

  • private subroutine assert_close_r64_1(this, r1, r2)

    Check if two real (64 bits) arrays (rank 1) are close with respect a tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real64), intent(in), dimension(:) :: r1

    Value to compare.

    real(kind=real64), intent(in), dimension(:) :: r2

    Value to compare.

  • private subroutine assert_close_c32_1(this, c1, c2)

    Check if two complex (32 bits) arrays (rank 1) are close with respect a tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    complex(kind=real32), intent(in), dimension(:) :: c1

    Value to compare.

    complex(kind=real32), intent(in), dimension(:) :: c2

    Value to compare.

  • private subroutine assert_close_c64_1(this, c1, c2)

    Check if two real (64 bits) arrays (rank 1) are close with respect a tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    complex(kind=real64), intent(in), dimension(:) :: c1

    Value to compare.

    complex(kind=real64), intent(in), dimension(:) :: c2

    Value to compare.

procedure, private :: assert_close_r32

Check if two reals (32 bits) are close with respect a tolerance.

  • private subroutine assert_close_r32(this, r1, r2)

    Check if two reals (32 bits) are close with respect a tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real32), intent(in) :: r1

    Value to compare.

    real(kind=real32), intent(in) :: r2

    Value to compare.

procedure, private :: assert_close_r64

Check if two reals (64 bits) are close with respect a tolerance.

  • private subroutine assert_close_r64(this, r1, r2)

    Check if two reals (64 bits) are close with respect a tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real64), intent(in) :: r1

    Value to compare.

    real(kind=real64), intent(in) :: r2

    Value to compare.

procedure, private :: assert_close_c32

Check if two complex numbers (32 bits) are close with respect a tolerance.

  • private subroutine assert_close_c32(this, c1, c2)

    Check if two complex numbers (32 bits) are close with respect a tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    complex(kind=real32), intent(in) :: c1

    Value to compare.

    complex(kind=real32), intent(in) :: c2

    Value to compare.

procedure, private :: assert_close_c64

Check if two complex numbers (64 bits) are close with respect a tolerance.

  • private subroutine assert_close_c64(this, r1, c2)

    Check if two complex numbers (64 bits) are close with respect a tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    complex(kind=real64), intent(in) :: r1

    Value to compare.

    complex(kind=real64), intent(in) :: c2

    Value to compare.

procedure, private :: assert_close_r32_1

Check if two real (32 bits) arrays (rank 1) are close with respect a tolerance.

  • private subroutine assert_close_r32_1(this, r1, r2)

    Check if two real (32 bits) arrays (rank 1) are close with respect a tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real32), intent(in), dimension(:) :: r1

    Value to compare.

    real(kind=real32), intent(in), dimension(:) :: r2

    Value to compare.

procedure, private :: assert_close_r64_1

Check if two real (64 bits) arrays (rank 1) are close with respect a tolerance.

  • private subroutine assert_close_r64_1(this, r1, r2)

    Check if two real (64 bits) arrays (rank 1) are close with respect a tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    real(kind=real64), intent(in), dimension(:) :: r1

    Value to compare.

    real(kind=real64), intent(in), dimension(:) :: r2

    Value to compare.

procedure, private :: assert_close_c32_1

Check if two complex (32 bits) arrays (rank 1) are close with respect a tolerance.

  • private subroutine assert_close_c32_1(this, c1, c2)

    Check if two complex (32 bits) arrays (rank 1) are close with respect a tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    complex(kind=real32), intent(in), dimension(:) :: c1

    Value to compare.

    complex(kind=real32), intent(in), dimension(:) :: c2

    Value to compare.

procedure, private :: assert_close_c64_1

Check if two complex (64 bits) arrays (rank 1) are close with respect a tolerance.

  • private subroutine assert_close_c64_1(this, c1, c2)

    Check if two real (64 bits) arrays (rank 1) are close with respect a tolerance.

    Arguments

    Type IntentOptional Attributes Name
    class(tester_t), intent(inout) :: this

    The tester.

    complex(kind=real64), intent(in), dimension(:) :: c1

    Value to compare.

    complex(kind=real64), intent(in), dimension(:) :: c2

    Value to compare.

Source Code

  type :: tester_t
     integer(int32) :: n_errors=0_int32                         !< Number of errors.
     integer(int32) :: n_tests=0_int32                          !< Number of tests.
     real(real32)   :: tolerance32=2._real32*epsilon(1._real32) !< Real tolerance, 32 bits.
     real(real64)   :: tolerance64=2._real64*epsilon(1._real64) !< Real tolerance, 64 bits.
   contains
     procedure :: init                           !< Initialize the tester.
     procedure :: print                          !< Print tests results.
     generic, public :: assert_equal =>     &
                        assert_equal_i8,    &
                        assert_equal_i16,   &
                        assert_equal_i32,   &
                        assert_equal_i64,   &
                        assert_equal_r32,   &
                        assert_equal_r64,   &
                        assert_equal_c32,   &
                        assert_equal_c64,   &
                        assert_equal_l,     &
                        assert_equal_i8_1,  &
                        assert_equal_i16_1, &
                        assert_equal_i32_1, &
                        assert_equal_i64_1, &
                        assert_equal_r32_1, &
                        assert_equal_r64_1, &
                        assert_equal_c32_1, &
                        assert_equal_c64_1, &
                        assert_equal_l_1         !< Check if two values (integer, real, complex or logical) are equal.
     procedure, private :: assert_equal_i8       !< Check if two integers (8  bits) are equal.
     procedure, private :: assert_equal_i16      !< Check if two integers (16 bits) are equal.
     procedure, private :: assert_equal_i32      !< Check if two integers (32 bits) are equal.
     procedure, private :: assert_equal_i64      !< Check if two integers (64 bits) are equal.
     procedure, private :: assert_equal_r32      !< Check if two reals (32 bits) are equal.
     procedure, private :: assert_equal_r64      !< Check if two reals (64 bits) are equal.
     procedure, private :: assert_equal_c32      !< Check if two complex numbers (32 bits) are equal.
     procedure, private :: assert_equal_c64      !< Check if two complex numbers (64 bits) are equal.
     procedure, private :: assert_equal_l        !< Check if two logicals are equal.
     procedure, private :: assert_equal_i8_1     !< Check if two integer (8  bits) arrays (rank 1) are equal.
     procedure, private :: assert_equal_i16_1    !< Check if two integer (16 bits) arrays (rank 1) are equal.
     procedure, private :: assert_equal_i32_1    !< Check if two integer (32 bits) arrays (rank 1) are equal.
     procedure, private :: assert_equal_i64_1    !< Check if two integer (64 bits) arrays (rank 1) are equal.
     procedure, private :: assert_equal_r32_1    !< Check if two real (32 bits) arrays (rank 1) are equal.
     procedure, private :: assert_equal_r64_1    !< Check if two real (64 bits) arrays (rank 1) are equal.
     procedure, private :: assert_equal_c32_1    !< Check if two complex (32 bits) arrays (rank 1) are equal.
     procedure, private :: assert_equal_c64_1    !< Check if two complex (64 bits) arrays (rank 1) are equal.
     procedure, private :: assert_equal_l_1      !< Check if two logical arrays (rank 1) are equal.
     generic, public :: assert_positive =>     &
                        assert_positive_i8,    &
                        assert_positive_i16,   &
                        assert_positive_i32,   &
                        assert_positive_i64,   &
                        assert_positive_r32,   &
                        assert_positive_r64,   &
                        assert_positive_i8_1,  &
                        assert_positive_i16_1, &
                        assert_positive_i32_1, &
                        assert_positive_i64_1, &
                        assert_positive_r32_1, &
                        assert_positive_r64_1    !< Check if a number (integer or real) is positive.
     procedure, private :: assert_positive_i8    !< Check if a integer (8  bits) is positive.
     procedure, private :: assert_positive_i16   !< Check if a integer (16 bits) is positive.
     procedure, private :: assert_positive_i32   !< Check if a integer (32 bits) is positive.
     procedure, private :: assert_positive_i64   !< Check if a integer (64 bits) is positive.
     procedure, private :: assert_positive_r32   !< Check if a real (32 bits) is positive.
     procedure, private :: assert_positive_r64   !< Check if a real (64 bits) is positive.
     procedure, private :: assert_positive_i8_1  !< Check if a integer (8  bits) array (rank 1) is positive.
     procedure, private :: assert_positive_i16_1 !< Check if a integer (16 bits) array (rank 1) is positive.
     procedure, private :: assert_positive_i32_1 !< Check if a integer (32 bits) array (rank 1) is positive.
     procedure, private :: assert_positive_i64_1 !< Check if a integer (64 bits) array (rank 1) is positive.
     procedure, private :: assert_positive_r32_1 !< Check if a real (32 bits) array (rank 1) is positive.
     procedure, private :: assert_positive_r64_1 !< Check if a real (64 bits) array (rank 1) is positive.
     generic, public :: assert_close =>     &
                        assert_close_r32,   &
                        assert_close_r64,   &
                        assert_close_c32,   &
                        assert_close_c64,   &
                        assert_close_r32_1, &
                        assert_close_r64_1, &
                        assert_close_c32_1, &
                        assert_close_c64_1       !< Check if two values (real or complex) are close with respect a tolerance.
     procedure, private :: assert_close_r32      !< Check if two reals (32 bits) are close with respect a tolerance.
     procedure, private :: assert_close_r64      !< Check if two reals (64 bits) are close with respect a tolerance.
     procedure, private :: assert_close_c32      !< Check if two complex numbers (32 bits) are close with respect a tolerance.
     procedure, private :: assert_close_c64      !< Check if two complex numbers (64 bits) are close with respect a tolerance.
     procedure, private :: assert_close_r32_1    !< Check if two real (32 bits) arrays (rank 1) are close with respect a tolerance.
     procedure, private :: assert_close_r64_1    !< Check if two real (64 bits) arrays (rank 1) are close with respect a tolerance.
     procedure, private :: assert_close_c32_1    !< Check if two complex (32 bits) arrays (rank 1) are close with respect a tolerance.
     procedure, private :: assert_close_c64_1    !< Check if two complex (64 bits) arrays (rank 1) are close with respect a tolerance.
  end type tester_t