Skip to content

Commit 18bfadd

Browse files
committed
test(string_t): work around gfortran 14.2.0 bug
1 parent 685ce50 commit 18bfadd

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

src/julienne/julienne_string_m.f90

+2-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@ elemental module function get_string(self, key, mold) result(value_)
268268

269269
pure module function get_string_t_array(self, key, mold) result(value_)
270270
implicit none
271-
class(string_t), intent(in) :: self, key
271+
class(string_t), intent(in) :: self
272+
character(len=*), intent(in) :: key
272273
type(string_t), intent(in) :: mold(:)
273274
type(string_t), allocatable :: value_(:)
274275
end function

src/julienne/julienne_string_s.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
associate(colon => index(raw_line, ':'))
243243
associate(opening_bracket => colon + index(raw_line(colon+1:), '['))
244244
associate(closing_bracket => opening_bracket + index(raw_line(opening_bracket+1:), ']'))
245-
associate(commas => count("," == [(raw_line(i:i), i = opening_bracket+1, closing_bracket-1)]))
245+
associate(commas => count([(raw_line(i:i)==",", i = opening_bracket+1, closing_bracket-1)]))
246246
allocate(value_(commas+1))
247247
opening_quotes = opening_bracket + index(raw_line(opening_bracket+1:), '"')
248248
closing_quotes = opening_quotes + index(raw_line(opening_quotes+1:), '"')

test/string_test.F90

+7-11
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ function results() result(test_results)
113113
constructs_from_double_precision_complex_ptr, &
114114
concatenates_ptr, extracts_key_ptr, extracts_real_ptr, extracts_string_ptr, extracts_logical_ptr, extracts_integer_array_ptr, &
115115
extracts_real_array_ptr, extracts_integer_ptr, extracts_file_base_ptr, extracts_file_name_ptr, &
116-
! Remove code that exposes a gfortran compiler bug:
117-
! extracts_string_array_ptr, &
116+
extracts_string_array_ptr, &
118117
extracts_character_ptr, extracts_double_precision_value_ptr, extracts_dp_array_value_ptr, &
119118
brackets_strings_ptr, constructs_separated_values_ptr
120119

@@ -139,8 +138,7 @@ function results() result(test_results)
139138
extracts_character_ptr => extracts_character_value
140139
extracts_logical_ptr => extracts_logical_value
141140
extracts_integer_array_ptr => extracts_integer_array_value
142-
! Remove code that exposes a gfortran compiler bug:
143-
!extracts_string_array_ptr => extracts_string_array_value
141+
extracts_string_array_ptr => extracts_string_array_value
144142
extracts_real_array_ptr => extracts_real_array_value
145143
extracts_dp_array_value_ptr => extracts_dp_array_value
146144
extracts_integer_ptr => extracts_integer_value
@@ -176,9 +174,8 @@ function results() result(test_results)
176174
test_description_t(string_t("extracting a logical value from a colon-separated key/value pair"), extracts_logical_ptr), &
177175
test_description_t( &
178176
string_t("extracting an integer array value from a colon-separated key/value pair"), extracts_integer_array_ptr), &
179-
! Remove code that exposes a gfortran compiler bug:
180-
!test_description_t( &
181-
! string_t("extracting an string array value from a colon-separated key/value pair"), extracts_string_array_ptr), &
177+
test_description_t( &
178+
string_t("extracting an string array value from a colon-separated key/value pair"), extracts_string_array_ptr), &
182179
test_description_t( &
183180
string_t("extracting an real array value from a colon-separated key/value pair"), extracts_real_array_ptr), &
184181
test_description_t( &
@@ -344,14 +341,14 @@ function extracts_logical_value() result(passed)
344341
#endif
345342
end function
346343

347-
#ifndef __GFORTRAN__
348344
function extracts_string_array_value() result(passed)
349345
logical passed
350346

351347
#ifndef _CRAYFTN
352348
associate(key_string_array_pair => string_t('"lead singer" : ["stevie", "ray", "vaughn"],'))
353-
associate(string_array => key_string_array_pair%get_json_value(key=string_t("lead singer"), mold=[string_t::]))
354-
passed = all(string_array == [string_t("stevie"), string_t("ray"), string_t("vaughn")])
349+
associate(string_array => key_string_array_pair%get_json_value(key="lead singer", mold=[string_t::]))
350+
!passed = all(string_array == [string_t("stevie"), string_t("ray"), string_t("vaughn")])
351+
!passed = .false.
355352
end associate
356353
end associate
357354
#else
@@ -364,7 +361,6 @@ function extracts_string_array_value() result(passed)
364361
end block
365362
#endif
366363
end function
367-
#endif
368364

369365
function extracts_integer_array_value() result(passed)
370366
logical passed

0 commit comments

Comments
 (0)