Skip to content

Commit

Permalink
Fix output_yaml test
Browse files Browse the repository at this point in the history
This fixes an issue where the filename argument of `write_yaml_from_struct_3` is
passed as a Fortran-style string, when a null-terminated string is expected.
When built with the Cray compiler, this issue causes `test.yaml` to be created
with junk characters at the end of the filename.
  • Loading branch information
Jesse Lentz authored and Jesse Lentz committed Oct 23, 2024
1 parent 95cd7b0 commit 7cee5bc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test_fms/parser/test_output_yaml.F90
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,12 @@ program test_output_yaml
call yaml_out_add_level2key( "order 4",k1(1))
call yaml_out_add_level2key( "sides", k2(1))
call yaml_out_add_level2key( "specials", k2(2))
call write_yaml_from_struct_3 (trim(filename), 1, k1, v1, a2, k2, v2, a3, (/1, 1, 1, 1, 2, 1/), k3, v3, &
& (/ 1, 1, 1 , 1, 0 ,0 ,0 ,0/))
call write_yaml_from_struct_3 (trim(filename) // c_null_char, 1, k1, v1, a2, k2, v2, a3, &
& (/1, 1, 1, 1, 2, 1/), k3, v3, (/ 1, 1, 1 , 1, 0 ,0 ,0 ,0/))
else
!> Write the yaml
call write_yaml_from_struct_3 (trim(filename), 1, k1, v1, a2, k2, v2, a3, a3each, k3, v3,(/3, 0, 0, 0, 0, 0, 0, 0/))
call write_yaml_from_struct_3 (trim(filename) // c_null_char, 1, k1, v1, a2, k2, v2, a3, &
& a3each, k3, v3, (/3, 0, 0, 0, 0, 0, 0, 0/))
endif

!> Check yaml output against reference
Expand Down

0 comments on commit 7cee5bc

Please sign in to comment.