Skip to content

Commit 2b22aeb

Browse files
committed
fix(test_diagnosis_test): match across compilers
This commit fixes & reorganizes test_diagnosis_test_m so that the same tests are run for gfortran as for other compilers.
1 parent ec64934 commit 2b22aeb

1 file changed

Lines changed: 38 additions & 39 deletions

File tree

test/modules/test_diagnosis_test_m.F90

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -50,65 +50,64 @@ function results() result(test_results)
5050

5151
#if HAVE_PROCEDURE_ACTUAL_FOR_POINTER_DUMMY
5252
associate(descriptions => [ &
53-
test_description_t("construction from a real expression of the form 'x .approximates. y .within. tolerance'", check_approximates_real) &
54-
,test_description_t("construction from a double precision expression of the form 'x .approximates. y .within. tolerance'", check_approximates_double) &
55-
,test_description_t("construction from the real expression 'x .approximates. y .withinFraction. tolerance'", check_approximates_real_fraction) &
56-
,test_description_t("construction from the double precision expression 'x .approximates. y .withinFraction. tolerance'", check_approximates_double_fraction) &
57-
,test_description_t("construction from the real expression 'x .approximates. y .withinPercentage. tolerance'", check_approximates_real_percentage) &
53+
test_description_t("construction from the real expression 'x .approximates. y .within. tolerance'" , check_approximates_real) &
54+
,test_description_t("construction from the real expression 'x .approximates. y .withinFraction. tolerance'" , check_approximates_real_fraction) &
55+
,test_description_t("construction from the real expression 'x .approximates. y .withinPercentage. tolerance'" , check_approximates_real_percentage) &
56+
,test_description_t("construction from the real expression 'x .lessThan. y" , check_less_than_real) &
57+
,test_description_t("construction from the real expression 'x .greaterThan. y" , check_greater_than_real) &
58+
,test_description_t("construction from the double precision expression 'x .approximates. y .within. tolerance'" , check_approximates_double) &
59+
,test_description_t("construction from the double precision expression 'x .approximates. y .withinFraction. tolerance'" , check_approximates_double_fraction) &
5860
,test_description_t("construction from the double precision expression 'x .approximates. y .withinPercentage. tolerance'", check_approximates_double_percentage) &
59-
,test_description_t("construction from an integer expression of the form 'i .equalsExpected. j", check_equals_integer) &
60-
,test_description_t("construction from a real expression of the form 'x .lessThan. y", check_less_than_real) &
61-
,test_description_t("construction from a double precision expression of the form 'x .lessThan. y", check_less_than_double) &
62-
,test_description_t("construction from a integer expression of the form 'i .lessThan. j", check_less_than_integer) &
63-
,test_description_t("construction from a real expression of the form 'x .greaterThan. y", check_greater_than_real) &
64-
,test_description_t("construction from a double precision expression of the form 'x .greaterThan. y", check_greater_than_double) &
65-
,test_description_t("construction from a integer expression of the form 'i .greaterThan. j", check_greater_than_integer) &
66-
,test_description_t("construction from a integer expression of the form '[i,j] .lessThanOrEqualTo. k", check_less_than_or_equal_to_integer) &
67-
,test_description_t("construction from a integer expression of the form '[i,j] .greaterThanOrEqualTo. k", check_greater_than_or_equal_to_integer) &
68-
,test_description_t("construction from a scalar test_diagnostics_t expression of the form 't .and. u'", check_and_with_scalar_operands) &
69-
,test_description_t("construction from vector test_diagnostics_t expressions with operands like 'i .equalsExpected. [j,k]'", check_and_with_vector_operands) &
61+
,test_description_t("construction from the double precision expression 'x .lessThan. y" , check_less_than_double) &
62+
,test_description_t("construction from the double precision expression 'x .greaterThan. y" , check_greater_than_double) &
63+
,test_description_t("construction from the integer expression 'i .equalsExpected. j" , check_equals_integer) &
64+
,test_description_t("construction from the integer expression 'i .lessThan. j" , check_less_than_integer) &
65+
,test_description_t("construction from the integer expression '[i,j] .lessThanOrEqualTo. k" , check_less_than_or_equal_to_integer) &
66+
,test_description_t("construction from the integer expression 'i .greaterThan. j" , check_greater_than_integer) &
67+
,test_description_t("construction from the integer expression '[i,j] .greaterThanOrEqualTo. k" , check_greater_than_or_equal_to_integer) &
68+
,test_description_t("construction from the scalar test_diagnostics_t expression 't .and. u'" , check_and_with_scalar_operands) &
69+
,test_description_t("construction from the vector test_diagnostics_t expressions 'i .equalsExpected. [j,k]'" , check_and_with_vector_operands) &
7070
] )
7171
#else
7272
! Work around missing Fortran 2008 feature: associating a procedure actual argument with a procedure pointer dummy argument:
7373
type(test_description_t), allocatable :: descriptions(:)
7474
procedure(diagnosis_function_i), pointer :: &
7575
check_approximates_real_ptr => check_approximates_real &
76-
,check_approximates_double_ptr => check_approximates_double &
7776
,check_approximates_real_fraction_ptr => check_approximates_real_fraction &
78-
,check_approximates_double_fraction_ptr => check_approximates_double_fraction &
7977
,check_approximates_real_percentage_ptr => check_approximates_real_percentage &
80-
,check_approximates_double_percentage_ptr => check_approximates_double_percentage &
81-
,check_equals_integer_ptr => check_equals_integer &
8278
,check_less_than_real_ptr => check_less_than_real &
79+
,check_greater_than_real_ptr => check_greater_than_real &
80+
,check_approximates_double_percentage_ptr => check_approximates_double_percentage &
81+
,check_approximates_double_ptr => check_approximates_double &
82+
,check_approximates_double_fraction_ptr => check_approximates_double_fraction &
8383
,check_less_than_double_ptr => check_less_than_double &
84+
,check_greater_than_double_ptr => check_greater_than_double &
85+
,check_equals_integer_ptr => check_equals_integer &
8486
,check_less_than_integer_ptr => check_less_than_integer &
8587
,check_less_than_or_equal_to_integer_ptr => check_less_than_or_equal_to_integer &
86-
,check_greater_than_real_ptr => check_greater_than_real &
87-
,check_greater_than_double_ptr => check_greater_than_double &
8888
,check_greater_than_integer_ptr => check_greater_than_integer &
8989
,check_greater_than_or_equal_to_integer_ptr => check_greater_than_or_equal_to_integer &
9090
,check_and_with_scalar_operands_ptr => check_and_with_scalar_operands &
9191
,check_and_with_vector_operands_ptr => check_and_with_vector_operands
9292

9393
descriptions = [ &
94-
test_description_t("construction from a real expression of the form `x .approximates. y .within. tolerance`" , check_approximates_real_ptr) &
95-
,test_description_t("construction from a double-precision expression of the form `x .approximates. y .within. tolerance`", check_approximates_double_ptr) &
96-
,test_description_t("construction from the real expression 'x .approximates. y .withinFraction. tolerance'", check_approximates_real_fraction_ptr) &
97-
,test_description_t("construction from a double-precision expression of the form `x .approximates. y .within. tolerance`", check_approximates_double_ptr) &
98-
,test_description_t("construction from the real expression 'x .approximates. y .withinPercentage. tolerance'", check_approximates_real_percentage_ptr) &
94+
test_description_t("construction from the real expression 'x .approximates. y .within. tolerance'" , check_approximates_real_ptr) &
95+
,test_description_t("construction from the real expression 'x .approximates. y .withinFraction. tolerance'" , check_approximates_real_fraction_ptr) &
96+
,test_description_t("construction from the real expression 'x .approximates. y .withinPercentage. tolerance'" , check_approximates_real_percentage_ptr) &
97+
,test_description_t("construction from the real expression 'x .lessThan. y" , check_less_than_real_ptr) &
98+
,test_description_t("construction from the real expression 'x .greaterThan. y" , check_greater_than_real_ptr) &
99+
,test_description_t("construction from the double precision expression 'x .approximates. y .within. tolerance'" , check_approximates_double_ptr) &
100+
,test_description_t("construction from the double precision expression 'x .approximates. y .withinFraction. tolerance'" , check_approximates_double_fraction_ptr) &
99101
,test_description_t("construction from the double precision expression 'x .approximates. y .withinPercentage. tolerance'", check_approximates_double_percentage_ptr) &
100-
,test_description_t("construction from an integer expression of the form `i .equalsExpected. j`" , check_equals_integer_ptr) &
101-
,test_description_t("construction from a real expression of the form 'x .lessThan. y" , check_less_than_real_ptr) &
102-
,test_description_t("construction from a double precision expression of the form 'x .lessThan. y" , check_less_than_double_ptr) &
103-
,test_description_t("construction from a integer expression of the form 'i .lessThan. j" , check_less_than_integer_ptr) &
104-
,test_description_t("construction from a integer expression of the form '[i,j] .lessThanOrEqualTo. k", check_less_than_or_equal_to_integer_ptr) &
105-
,test_description_t("construction from a real expression of the form 'x .greaterThan. y" , check_greater_than_real_ptr) &
106-
,test_description_t("construction from a double precision expression of the form 'x .greaterThan. y" , check_greater_than_double_ptr) &
107-
,test_description_t("construction from a integer expression of the form 'i .greaterThan. j" , check_greater_than_integer_ptr) &
108-
,test_description_t("construction from a integer expression of the form 'i .greaterThanOrEqualTo. j", check_greater_than_or_equal_to_integer_ptr) &
109-
,test_description_t("construction from a scalar test_diagnostics_t expression with operands like 'i .equalsExpected. j'", check_and_with_scalar_operands_ptr) &
110-
,test_description_t("construction from test_diagnostics_t vector expressions with operands like 'i .equalsExpected. [j,k]'", check_and_with_vector_operands_ptr) &
111-
,test_description_t("construction from vector test_diagnostics_t expressions with operands like 'i .equalsExpected. [j,k]'", check_and_with_vector_operands_ptr) &
102+
,test_description_t("construction from the double precision expression 'x .lessThan. y" , check_less_than_double_ptr) &
103+
,test_description_t("construction from the double precision expression 'x .greaterThan. y" , check_greater_than_double_ptr) &
104+
,test_description_t("construction from the integer expression 'i .equalsExpected. j" , check_equals_integer_ptr) &
105+
,test_description_t("construction from the integer expression 'i .lessThan. j" , check_less_than_integer_ptr) &
106+
,test_description_t("construction from the integer expression '[i,j] .lessThanOrEqualTo. k" , check_less_than_or_equal_to_integer_ptr) &
107+
,test_description_t("construction from the integer expression 'i .greaterThan. j" , check_greater_than_integer_ptr) &
108+
,test_description_t("construction from the integer expression '[i,j] .greaterThanOrEqualTo. k" , check_greater_than_or_equal_to_integer_ptr) &
109+
,test_description_t("construction from the scalar test_diagnostics_t expression 't .and. u'" , check_and_with_scalar_operands_ptr) &
110+
,test_description_t("construction from the vector test_diagnostics_t expressions 'i .equalsExpected. [j,k]'" , check_and_with_vector_operands_ptr) &
112111
]
113112
#endif
114113

0 commit comments

Comments
 (0)