FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
0113 — An empty `<Var Value="">` is exported as a Real parameter with no values
ID 0113
Class BUG
Severity 1
Status ready

Models: —

Found: 2026-10-25, plan Q1 (r2-wrong-numbers), observation 13. Owner ruling 2026-10-25: keep today's result, pin it with a test, file this issue.

Evidence

FmuPortMappingReader::Read (src/fmu/fhFMUexport/FmuPortMappingReader.cpp, the <VARIABLES> loop): Str2StrVec("") gives no tokens, so the parameter stays DataType::Real with signalSize 0 and no values. Pinned by FmuPortMappingReader.EmptyVarValueIsARealParameterWithNoValues.

Effect

An FMU with a zero-size Real parameter, where the model text is an empty string. Probably a String parameter holding the empty text is wanted; the engine reads an empty value as an empty string.

Possible fix

Classify an empty value as String with one empty value (signalSize 1). Check that the runtime writes it back as Value="". Update the pinning test.

Test that would prove it

Change EmptyVarValueIsARealParameterWithNoValues to expect String and one empty value.

Risk

A host that already reads the zero-size parameter sees a different modelDescription.xml. No consumer exports an FMU.