TUV-x
Loading...
Searching...
No Matches
Data Types | Functions/Subroutines | Variables
musica_assert Module Reference

Assertion functions. More...

Data Types

interface  almost_equal
 
interface  are_equal
 
interface  assert_msg
 
interface  assert_warn_msg
 
interface  die_msg
 

Functions/Subroutines

subroutine assert_msg_string (code, condition, error_message)
 Asserts condition to be true or fails with provided message. More...
 
subroutine assert_msg_char (code, condition, error_message)
 Asserts condition to be true or fails with provided message. More...
 
subroutine assert (code, condition)
 Asserts condition to be true or fails. More...
 
subroutine assert_warn_msg_string (code, condition, warning_message)
 Asserts condition to be true or prints a provided warning message. More...
 
subroutine assert_warn_msg_char (code, condition, warning_message)
 Asserts condition to be true or prints a provided warning message. More...
 
subroutine die_msg_string (code, error_message)
 Errors immediately and prints a provided message. More...
 
subroutine die_msg_char (code, error_message)
 Errors immediately and prints a provided message. More...
 
subroutine die (code)
 Errors immediately. More...
 
logical function almost_equal_real (a, b, relative_tolerance, absolute_tolerance)
 Determines whether two real numbers are equal within a provided or standard tolerance. More...
 
logical function almost_equal_double (a, b, relative_tolerance, absolute_tolerance)
 Determines whether two real numbers are equal within a provided or standard tolerance. More...
 
logical function almost_equal_complex_real (a, b, relative_tolerance, absolute_tolerance)
 Determines whether two complex numbers are equal within a provided or standard tolerance. More...
 
logical function almost_equal_complex_double (a, b, relative_tolerance, absolute_tolerance)
 Determines whether two complex numbers are equal within a provided or standard tolerance. More...
 
logical pure function compare_arrays_1d_real (a, b)
 Compares two 1D arrays for equality. More...
 
logical pure function compare_arrays_2d_real (a, b)
 Compares two 2D arrays for equality. More...
 
logical pure function compare_arrays_1d_double (a, b)
 Compares two 1D arrays for equality. More...
 
logical pure function compare_arrays_2d_double (a, b)
 Compares two 2D arrays for equality. More...
 

Variables

integer, parameter kerrorfileid = 10
 Unit for error output files.
 
integer, parameter kerrorid = 0
 Error output id.
 

Detailed Description

Assertion functions.

Function/Subroutine Documentation

◆ almost_equal_complex_double()

logical function musica_assert::almost_equal_complex_double ( complex(kind=musica_dk), intent(in)  a,
complex(kind=musica_dk), intent(in)  b,
real(kind=musica_dk), intent(in), optional  relative_tolerance,
real(kind=musica_dk), intent(in), optional  absolute_tolerance 
)

Determines whether two complex numbers are equal within a provided or standard tolerance.

Parameters
[in]aFirst number to compare
[in]bSecond number to compare
[in]relative_toleranceRelative tolerance
[in]absolute_toleranceAbsolute tolerance

◆ almost_equal_complex_real()

logical function musica_assert::almost_equal_complex_real ( complex(kind=musica_rk), intent(in)  a,
complex(kind=musica_rk), intent(in)  b,
real(kind=musica_rk), intent(in), optional  relative_tolerance,
real(kind=musica_rk), intent(in), optional  absolute_tolerance 
)

Determines whether two complex numbers are equal within a provided or standard tolerance.

Parameters
[in]aFirst number to compare
[in]bSecond number to compare
[in]relative_toleranceRelative tolerance
[in]absolute_toleranceAbsolute tolerance

◆ almost_equal_double()

logical function musica_assert::almost_equal_double ( real(kind=musica_dk), intent(in)  a,
real(kind=musica_dk), intent(in)  b,
real(kind=musica_dk), intent(in), optional  relative_tolerance,
real(kind=musica_dk), intent(in), optional  absolute_tolerance 
)

Determines whether two real numbers are equal within a provided or standard tolerance.

Parameters
[in]aFirst number to compare
[in]bSecond number to compare
[in]relative_toleranceRelative tolerance
[in]absolute_toleranceAbsolute tolerance

◆ almost_equal_real()

logical function musica_assert::almost_equal_real ( real(kind=musica_rk), intent(in)  a,
real(kind=musica_rk), intent(in)  b,
real(kind=musica_rk), intent(in), optional  relative_tolerance,
real(kind=musica_rk), intent(in), optional  absolute_tolerance 
)

Determines whether two real numbers are equal within a provided or standard tolerance.

Parameters
[in]aFirst number to compare
[in]bSecond number to compare
[in]relative_toleranceRelative tolerance
[in]absolute_toleranceAbsolute tolerance

◆ assert()

subroutine musica_assert::assert ( integer, intent(in)  code,
logical, intent(in)  condition 
)

Asserts condition to be true or fails.

Parameters
[in]codeUnique code for the assertion
[in]conditionCondition to evaluate

◆ assert_msg_char()

subroutine musica_assert::assert_msg_char ( integer, intent(in)  code,
logical, intent(in)  condition,
character(len=*), intent(in)  error_message 
)

Asserts condition to be true or fails with provided message.

Parameters
[in]codeUnique code for the assertion
[in]conditionCondition to evaluate
[in]error_messageMessage to display on failure

◆ assert_msg_string()

subroutine musica_assert::assert_msg_string ( integer, intent(in)  code,
logical, intent(in)  condition,
type(string_t), intent(in)  error_message 
)

Asserts condition to be true or fails with provided message.

Parameters
[in]codeUnique code for the assertion
[in]conditionCondition to evaluate
[in]error_messageMessage to display on failure

◆ assert_warn_msg_char()

subroutine musica_assert::assert_warn_msg_char ( integer, intent(in)  code,
logical, intent(in)  condition,
character(len=*), intent(in)  warning_message 
)

Asserts condition to be true or prints a provided warning message.

Parameters
[in]codeUnique code for the assertion
[in]conditionCondition to evaluate
[in]warning_messageMessage to display on failure

◆ assert_warn_msg_string()

subroutine musica_assert::assert_warn_msg_string ( integer, intent(in)  code,
logical, intent(in)  condition,
type(string_t), intent(in)  warning_message 
)

Asserts condition to be true or prints a provided warning message.

Parameters
[in]codeUnique code for the assertion
[in]conditionCondition to evaluate
[in]warning_messageMessage to display on failure

◆ compare_arrays_1d_double()

logical pure function musica_assert::compare_arrays_1d_double ( real(kind=musica_dk), dimension(:), intent(in)  a,
real(kind=musica_dk), dimension(:), intent(in)  b 
)

Compares two 1D arrays for equality.

Parameters
[in]aFirst array to compare
[in]bSecond array to compare

◆ compare_arrays_1d_real()

logical pure function musica_assert::compare_arrays_1d_real ( real(kind=musica_rk), dimension(:), intent(in)  a,
real(kind=musica_rk), dimension(:), intent(in)  b 
)

Compares two 1D arrays for equality.

Parameters
[in]aFirst array to compare
[in]bSecond array to compare

◆ compare_arrays_2d_double()

logical pure function musica_assert::compare_arrays_2d_double ( real(kind=musica_dk), dimension(:,:), intent(in)  a,
real(kind=musica_dk), dimension(:,:), intent(in)  b 
)

Compares two 2D arrays for equality.

Parameters
[in]aFirst array to compare
[in]bSecond array to compare

◆ compare_arrays_2d_real()

logical pure function musica_assert::compare_arrays_2d_real ( real(kind=musica_rk), dimension(:,:), intent(in)  a,
real(kind=musica_rk), dimension(:,:), intent(in)  b 
)

Compares two 2D arrays for equality.

Parameters
[in]aFirst array to compare
[in]bSecond array to compare

◆ die()

subroutine musica_assert::die ( integer, intent(in)  code)

Errors immediately.

Parameters
[in]codeUnique code for the failure

◆ die_msg_char()

subroutine musica_assert::die_msg_char ( integer, intent(in)  code,
character(len=*), intent(in)  error_message 
)

Errors immediately and prints a provided message.

Parameters
[in]codeUnique code for the failure
[in]error_messageMessage to display with failure

◆ die_msg_string()

subroutine musica_assert::die_msg_string ( integer, intent(in)  code,
type(string_t), intent(in)  error_message 
)

Errors immediately and prints a provided message.

Parameters
[in]codeUnique code for the failure
[in]error_messageMessage to display with failure