Commit 0c11ac9
committed
test(opcua,#386): cover the missing AlarmStateMachine transition cells
Verification round on the post-#386 review found 9 untested cells in
the AlarmStateMachine transition matrix (issue #389 follow-up). Adding
focused tests so a future refactor cannot silently break a corner case.
New cells covered:
- ``DisabledClearsHealedAlarm`` - Healed exit via Rule 2 (was_active=true
for Healed too, so disabling a latched alarm must ClearFault, not just
flip to Suppressed).
- ``DisabledNoOpWhenAlreadyCleared`` - confirms Cleared+disabled lands at
Suppressed/NoOp (no spurious second clear).
- ``ShelvedClearsHealedAlarm`` / ``ShelvedNoOpWhenAlreadyCleared`` - same
pair via Rule 3.
- ``ActiveAlarmReportsConfirmedFromSuppressed`` - operator
unshelves/re-enables an alarm whose source is still active; Rule 4
must promote Suppressed -> Confirmed with ReportConfirmed (NOT NoOp).
This is exactly the unshelve+re-fire path scenario 2 of
run_alarm_tests.sh exercises end-to-end.
- ``BranchEventFromHealedNoOp`` / ``BranchEventFromSuppressedNoOp`` -
Rule 1 precedence holds across all four prev_status values.
- ``AckedAndConfirmedNoOpFromSuppressed`` - ``was_active=false`` branch
of Rule 5: a fully cleared event delivered while suppressed advances
next_status to Cleared but issues no ClearFault (no fault to clear).
- ``InactiveUnackedFromSuppressedReportsHealed`` - ditto but with the
ack/confirm bits unset, must surface as Healed/ReportHealed so the
unfinished ack/confirm workflow item stays visible.
State machine code itself is unchanged. 27 gtest cases, all PASSED.
Pure-function tests, deterministic, no I/O.1 parent f0e1eca commit 0c11ac9
1 file changed
Lines changed: 103 additions & 0 deletions
Lines changed: 103 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
211 | 314 | | |
0 commit comments