Assertions are functions that return true or false
that can be placed in a program to test whether
a predicate is true.
To use the assertions module, it must be initialized,
usually in the main program. When it is no longer needed,
it is finalized. Assertions are posted to the module as they
are called, and can be summarized later at an appropriate time.
Initialization
CALL initializeSharedAssertionsManager
Finalization
CALL finalizeSharedAssertionsManager
Asserting
CALL FTAssertEqual(expectedValue,resultValue,message)
Summarizing Assertions
CALL SummarizeFTAssertions(title,unit)
Additional enquiry functions
INTEGER :: nf, nA
nF = numberOfAssertionFailures()
nA = numberOfAssertions()
module~~ftassertions~~UsesGraph
module~ftassertions
FTAssertions
iso_fortran_env
iso_fortran_env
module~ftassertions->iso_fortran_env
module~comparisonsmodule
ComparisonsModule
module~ftassertions->module~comparisonsmodule
module~ftolconstants
FTOLConstants
module~ftassertions->module~ftolconstants
module~comparisonsmodule->iso_fortran_env
module~comparisonsmodule->module~ftolconstants
Nodes of different colours represent the following:
Graph Key
Module
Module
Submodule
Submodule
Subroutine
Subroutine
Function
Function
Program
Program
This Page's Entity
This Page's Entity
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
module~~ftassertions~~UsedByGraph
module~ftassertions
FTAssertions
module~ftobjectlibrary
FTObjectLibrary
module~ftobjectlibrary->module~ftassertions
Nodes of different colours represent the following:
Graph Key
Module
Module
Submodule
Submodule
Subroutine
Subroutine
Function
Function
Program
Program
This Page's Entity
This Page's Entity
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
Variables
Type
Visibility Attributes
Name
Initial
integer,
public,
parameter
::
FT_ASSERTION_STRING_LENGTH
=
128
Interfaces
private subroutine assertEqualTwoIntegers(expectedValue, actualValue, msg)
Arguments
Type
Intent Optional Attributes
Name
integer,
intent(in)
::
expectedValue
integer,
intent(in)
::
actualValue
character(len=*),
optional
::
msg
private subroutine assertWithinToleranceTwoReal(expectedValue, actualValue, relTol, absTol, msg)
Arguments
Type
Intent Optional Attributes
Name
real,
intent(in)
::
expectedValue
real,
intent(in)
::
actualValue
real,
intent(in)
::
relTol
real,
intent(in),
optional
::
absTol
character(len=*),
optional
::
msg
private subroutine assertWithinToleranceTwoDouble(expectedValue, actualValue, relTol, absTol, msg)
Arguments
Type
Intent Optional Attributes
Name
double precision,
intent(in)
::
expectedValue
double precision,
intent(in)
::
actualValue
double precision,
intent(in)
::
relTol
double precision,
intent(in),
optional
::
absTol
character(len=*),
optional
::
msg
public subroutine assertWithinToleranceTwoQuad (expectedValue, actualValue, relTol, absTol, msg)
Arguments
Type
Intent Optional Attributes
Name
real(kind=SELECTED_REAL_KIND(QUAD_DIGITS)),
intent(in)
::
expectedValue
real(kind=SELECTED_REAL_KIND(QUAD_DIGITS)),
intent(in)
::
actualValue
real(kind=SELECTED_REAL_KIND(QUAD_DIGITS)),
intent(in)
::
relTol
real(kind=SELECTED_REAL_KIND(QUAD_DIGITS)),
intent(in),
optional
::
absTol
character(len=*),
optional
::
msg
private subroutine assertEqualTwoLogicals(expectedValue, actualValue, msg)
Arguments
Type
Intent Optional Attributes
Name
logical,
intent(in)
::
expectedValue
logical,
intent(in)
::
actualValue
character(len=*),
optional
::
msg
private subroutine assertEqualString(expectedValue, actualValue, msg)
Arguments
Type
Intent Optional Attributes
Name
character(len=*)
::
expectedValue
character(len=*)
::
actualValue
character(len=*),
optional
::
msg
Functions
Arguments
Return Value
integer
Arguments
Return Value
integer
Arguments
Type
Intent Optional Attributes
Name
integer
::
assertionNumber
character(len=*)
::
assertionType
character(len=*)
::
expected
character(len=*)
::
actual
character(len=*)
::
msg
Return Value
integer
Subroutines
Arguments
Type
Intent Optional Attributes
Name
logical
::
test
character(len=*),
optional
::
msg
Arguments
Type
Intent Optional Attributes
Name
real(kind=SELECTED_REAL_KIND(QUAD_DIGITS)),
intent(in)
::
expectedValue
real(kind=SELECTED_REAL_KIND(QUAD_DIGITS)),
intent(in)
::
actualValue
real(kind=SELECTED_REAL_KIND(QUAD_DIGITS)),
intent(in)
::
relTol
real(kind=SELECTED_REAL_KIND(QUAD_DIGITS)),
intent(in),
optional
::
absTol
character(len=*),
optional
::
msg