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()
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 assertEqualTwoIntegerArrays1D(expectedValue, actualValue)
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
integer,
|
intent(in), |
|
DIMENSION(:)
|
:: |
expectedValue |
|
integer,
|
intent(in), |
|
DIMENSION(:)
|
:: |
actualValue |
|
-
private subroutine assertEqualTwoIntegerArrays2D(expectedValue, actualValue)
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
integer,
|
intent(in), |
|
DIMENSION(:,:)
|
:: |
expectedValue |
|
integer,
|
intent(in), |
|
DIMENSION(:,:)
|
:: |
actualValue |
|
-
private subroutine assertWithinToleranceTwoReal(expectedValue, actualValue, tol, msg)
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
real,
|
intent(in) |
|
|
:: |
expectedValue |
|
real,
|
intent(in) |
|
|
:: |
actualValue |
|
real,
|
intent(in) |
|
|
:: |
tol |
|
character(len=*),
|
|
optional |
|
:: |
msg |
|
-
private subroutine assertWithinToleranceTwoRealArrays1D(expectedValue, actualValue, tol, msg)
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
real,
|
intent(in), |
|
DIMENSION(:)
|
:: |
expectedValue |
|
real,
|
intent(in), |
|
DIMENSION(:)
|
:: |
actualValue |
|
real,
|
intent(in) |
|
|
:: |
tol |
|
character(len=*),
|
|
optional |
|
:: |
msg |
|
-
private subroutine assertWithinToleranceTwoRealArrays2D(expectedValue, actualValue, tol)
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
real,
|
intent(in), |
|
DIMENSION(:,:)
|
:: |
expectedValue |
|
real,
|
intent(in), |
|
DIMENSION(:,:)
|
:: |
actualValue |
|
real,
|
intent(in) |
|
|
:: |
tol |
|
-
private subroutine assertWithinToleranceTwoDouble(expectedValue, actualValue, tol, msg)
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
double precision,
|
intent(in) |
|
|
:: |
expectedValue |
|
double precision,
|
intent(in) |
|
|
:: |
actualValue |
|
double precision,
|
intent(in) |
|
|
:: |
tol |
|
character(len=*),
|
|
optional |
|
:: |
msg |
|
-
private subroutine assertWithinToleranceTwoDoubleArrays1D(expectedValue, actualValue, tol, msg)
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
double precision,
|
intent(in), |
|
DIMENSION(:)
|
:: |
expectedValue |
|
double precision,
|
intent(in), |
|
DIMENSION(:)
|
:: |
actualValue |
|
double precision,
|
intent(in) |
|
|
:: |
tol |
|
character(len=*),
|
|
optional |
|
:: |
msg |
|
-
private subroutine assertWithinToleranceTwoDoubleArrays2D(expectedValue, actualValue, tol)
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
double precision,
|
intent(in), |
|
DIMENSION(:,:)
|
:: |
expectedValue |
|
double precision,
|
intent(in), |
|
DIMENSION(:,:)
|
:: |
actualValue |
|
double precision,
|
intent(in) |
|
|
:: |
tol |
|
-
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) |
|
|
:: |
tol |
|
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
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) |
|
|
:: |
tol |
|
character(len=*),
|
|
optional |
|
:: |
msg |
|