From 7cee5bcf646197893f354f1917d2eaa2ca08761d Mon Sep 17 00:00:00 2001 From: Jesse Lentz Date: Wed, 23 Oct 2024 12:03:08 -0400 Subject: [PATCH] Fix output_yaml test 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. --- test_fms/parser/test_output_yaml.F90 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test_fms/parser/test_output_yaml.F90 b/test_fms/parser/test_output_yaml.F90 index 6122ff7ab..e5a144cab 100644 --- a/test_fms/parser/test_output_yaml.F90 +++ b/test_fms/parser/test_output_yaml.F90 @@ -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