FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
0001 — WinchableCable has no automated behavioural test of any kind
ID 0001
Class TEST
Severity 3
Status blocked
Models WinchableCable
Found 2026-09-24 test-coverage audit of da8e80f
Decision needed Model owner: resolve CORIBO-0004 first. A regression baseline needs a run that completes, and the shipped scenario does not complete today

Evidence

fhsim_coribo registers exactly one SimObject, WinchableCable (src/fhsim_coribo.cpp:9). There is no tests/ directory anywhere in the tree, and the top-level CMakeLists.txt never adds one:

if(FH_WITH_TESTS)
enable_testing()
#add_subdirectory(tests)
endif()

(CMakeLists.txt:47-50). Turning FH_WITH_TESTS on finds GTest and enables CTest but registers zero tests, because the add_subdirectory(tests) line is commented out and the directory it would add does not exist. openwiki/testing.md documents the same gap.

The only thing that runs at all is test_package/test_package.cpp, a Conan compile-and-link smoke check (test_package/test_package.cpp:13-68): it computes one GeometryTools::Distance between two points, resolves the getSimObject symbol, and constructs a WinchableCable. The constructor call is wrapped so that a thrown exception is logged as success (test_package/test_package.cpp:60-66):

try {
printer.WriteLog("Load WinchableCable", fhsim::LogLevel_Info);
auto simobj = simobjects("WinchableCable", "winch", &creator);
} catch (Exceptions &) {
printer.WriteLog("Successfully able to call constructor",
fhsim::LogLevel_Info);
}
return 0;

successfulness is assigned at line 44 and never read again; the program returns 0 unconditionally from this block. No port value, constraint force, integrator step, or Jacobian is ever checked, here or anywhere else in the repository. WinchableCable also declares no HasJacobians/OdeJacobian/HasPortJacobians override (include/fhsim_coribo/WinchableCable.h, src/SimObjects/WinchableCable.cpp), so its 15600-state ODE (cableStates, per the engine's registration log) runs on the engine's finite-difference fallback, itself unverified against anything.

README.md:127-131 documents an integration-test workflow (SFH_LICENSE_FILE plus -c tools.build:skip_tests=False) that assumes a test_fhsim_coribo* executable exists in the playpen build tree; CMakeLists.txt:98-108's bundle-exclusion list filters that name out of packages. Since no test target is configured, this workflow currently produces nothing to run — it documents an intended path, not a working one.

Effect

A green conan create proves the plugin links, the symbol resolves, and the constructor does not crash (and would still look green if it threw, per the swallowed-exception path above). It proves nothing about the winch drive, the cable segments, the constraint solve, the Baumgarte stabilization, or the reaction force on WinchForce. CHANGELOG.md records a real behavioural change in the 3.1.0 line — SetSymplecticStepSize() called again under Euler_i/Heun_i, changing numerical results under those integrators — with no regression test anywhere to have caught a mistake in it. Any future change to WinchableCable::OdeFcn, ConstraintSolver, or the segment/winch parameters in the constructor could silently change or break the simulated behaviour.

Possible fix

Mirror the pattern used elsewhere in FhSim 3.x (e.g. fhsim_base, fhsim_marine_elements): add a tests/ directory using the shared fhsim::test::RunTest(TestSpec) harness, uncomment add_subdirectory(tests) (CMakeLists.txt:49), and add at least one RunTest regression scenario built from examples/input/CoriboCable.xml (already configured with StableSolver_i, per the audit) under tests/in/WinchableCable/, with a reference-output CSV so the hard-coded model's behaviour is pinned. Because WinchableCable reports no HasJacobians(), TestJacobianMode = Auto would not engage a Jacobian check until/unless one is added — that is a fair starting point, but the reference output itself is the minimum needed to catch a regression.

Owner question: none for adding a first regression test; the harness and pattern are already established elsewhere in FhSim. Whether/how to also give WinchableCable an analytic OdeJacobian is a separate, larger decision (see CORIBO-0002 for the constraint-solver Jacobians that already exist and are unverified).

Test that would prove it

Any RunTest scenario over WinchableCable with a checked-in reference output: run it twice, confirm it currently passes only because nothing is compared, then confirm a deliberately wrong Beta or segment parameter would fail the comparison once one exists.

Why this was not fixed (2026-09-24 resolution pass)

Confirmed at 6921106: ctest in a configured FH_WITH_TESTS=ON build reports "No tests were found", and there is no tests/ directory. I did not add the proposed RunTest scenario, because the only scenario the repository ships, examples/input/CoriboCable.xml, does not run. FhSim stops in the initial-condition phase with "One or more initial conditions are not specified" for cableStates (CORIBO-0004). A reference CSV cannot be captured from a run that never produces output.

The only way to make a test pass today would be to supply all 15600 initial conditions in the test's XML, or to pin the failure itself. Supplying the conditions would invent initial physics for the model. Pinning the failure would enshrine a bug as the expected result. The pure-geometry Jacobian test for CORIBO-0002 does not need a running model, and it stands up the tests/ directory and the GTest target that this issue's scenario can later be added to.

Once CORIBO-0004 is resolved, this issue is ready: add tests/in/WinchableCable/ with the scenario and a reference output, and add a RunTest case to tests/.

Risk

None from filing this issue. Adding the first test is additive and does not touch WinchableCable's own code or physics.