|
FhSim
3.1.0
Marine systems simulation
|
| ID | 0115 |
| Class | BUG |
| Severity | 2 |
| Status | blocked |
Models: Trawl/ValuesDisplay
Found: 2026-10-19
Decision needed: should a headless build validate Corner (and the other parameters) the same way a visualization build does, so that a bad input file fails in both? The header currently documents the opposite ("a headless build ignores its inputs").
src/trawl/ValuesDisplay.cpp:21-27 reads and validates Corner only inside #ifdef FH_VISUALIZATION:
A build without visualization never calls GetEnumParam, so Corner = "Centre" is accepted silently. src/trawl/ValuesDisplay.h:36-39 documents this on purpose ("a headless build ignores its inputs").
tests/ValuesDisplay_Test.cpp:110-115, test SimObject_GUI.ValuesDisplay_RejectsAnUnknownCorner, expects EXPECT_ANY_THROW for Corner = "Centre". Since "Tests: labels, buckets and tiers (T1)" it is compiled only under #ifdef FH_VISUALIZATION. Before T1 it was compiled in headless builds too but always filtered out (_NEEDS_GUI), so the gap was hidden.
The same bad input file stops the run in a visualization build and runs without any message in a headless build. A typo in Corner is found only on a machine with visualization.
Read and validate Corner outside the #ifdef (store the enum, use it only when drawing). Or keep the current rule and document that headless builds skip all parameter checks. This is the owner's choice. The same question applies to the other parameters read only under FH_VISUALIZATION (FilterFrames, Signal<N> details).
Move ValuesDisplay_RejectsAnUnknownCorner out of the #ifdef FH_VISUALIZATION block (it then runs in every build). To reproduce now: build without visualization, compile the test without the #ifdef, run it; it fails with no throw. Or run a model with Corner = "Centre" headless.
Existing headless inputs with an invalid Corner start to fail. Low: the parameter has no effect there.