Hi Simon,

> This helper reimplements internal wdt-uclass details (the format
> string, the "every %ldms" text, and the hw_margin_ms / 4 calculation
> from wdt_pre_probe()). If any of that drifts, the tests silently rot
> rather than catching a real change. Please drop the string
> reconstruction and either match against a fixed literal...

Agreed, v3 drops the helper and asserts a fixed literal.

> Sandbox does not select
> CONFIG_WATCHDOG, so I suspect the ut_assert_nextline() calls below
> will not match today.

That would be true from sandbox_defconfig alone, but CONFIG_WDT has
'imply WATCHDOG', so the sandbox build ends up with CONFIG_WATCHDOG=y.
ut dm wdt_base prints:
  WDT:   Started wdt@0 with servicing every 50ms (0s timeout)
v3 will expect that line.

> The clamped case only exercises timeout_ms > max_timeout_ms. The
> uclass code has a second branch, the sub-second difference guard, that
> suppresses req_str when the whole-second value would be unchanged. How
> about a case where timeout_ms is greater than max but rounds to the
> same whole second (e.g. max + 100ms), to lock down that behaviour?

Good idea, will be added to v3.

Best,
Juuso

Reply via email to