Cable verdict folded into one console cell (length green, fault name red, xover amber, fail; diag rule lines and counters-reset line gone), reset fires at the press not diag completion, and the measure's blip is suppressed at every counter source instead of counted-hidden-reverted: worker error adds, loss-window write-offs (quiet slides state without charging; leaving the quiet era presumes in-window holes delivered so the gap's tail is never charged late), NIC poller tracks raw without accumulating, socket drops discarded, modules un-primed by the measure itself; display hold deleted so pre-existing errors no longer blink out during a measure
This commit is contained in:
+7
-14
@@ -19,8 +19,8 @@ func TestPhyDisplayWorstMarginAndFault(t *testing.T) {
|
||||
if !d.haveSNR || d.worstMargin != 0.5 {
|
||||
t.Errorf("worstMargin = %v (have %v), want 0.5", d.worstMargin, d.haveSNR)
|
||||
}
|
||||
if d.metres != "44" || d.metresClass != clsBad {
|
||||
t.Errorf("metres = %q class %d, want the healthy mean 44 painted bad", d.metres, d.metresClass)
|
||||
if d.metres != "OPEN" || d.metresClass != clsBad {
|
||||
t.Errorf("cable cell = %q class %d, want the fault named bad", d.metres, d.metresClass)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,10 +51,13 @@ func TestCableSummary(t *testing.T) {
|
||||
class int
|
||||
}{
|
||||
{"clean", cableInfo{ecd: healthy, maps: [2]byte{pairIdentityMap, pairIdentityMap}, haveMaps: [2]bool{true, true}}, false, "49", clsGood},
|
||||
{"far-end swap", cableInfo{ecd: healthy, maps: [2]byte{pairIdentityMap, 0xE1}, haveMaps: [2]bool{true, true}}, false, "49", clsWarn},
|
||||
{"far-end swap", cableInfo{ecd: healthy, maps: [2]byte{pairIdentityMap, 0xE1}, haveMaps: [2]bool{true, true}}, false, "xover", clsWarn},
|
||||
{"one-end map only", cableInfo{ecd: healthy, maps: [2]byte{pairIdentityMap, 0}, haveMaps: [2]bool{true, false}}, false, "49", clsGood},
|
||||
{"fault", cableInfo{ecd: ecdResult{verdicts: [4]int{pairOK, pairShort, pairXtalk, pairOK}, metres: [4]int{50, 12, 30, 51}}}, false, "SHORT", clsBad},
|
||||
{"fault beats swap", cableInfo{ecd: ecdResult{verdicts: [4]int{pairOpen, pairOK, pairOK, pairOK}}, maps: [2]byte{pairIdentityMap, 0xE1}, haveMaps: [2]bool{true, true}}, false, "OPEN", clsBad},
|
||||
{"diag failed", cableInfo{failed: true}, false, "fail", clsBad},
|
||||
{"no diag yet", cableInfo{}, false, "-", clsNone},
|
||||
{"measuring", cableInfo{ecd: healthy, maps: [2]byte{pairIdentityMap, pairIdentityMap}, haveMaps: [2]bool{true, true}}, true, "...", clsNone},
|
||||
{"measuring", cableInfo{ecd: healthy, maps: [2]byte{pairIdentityMap, pairIdentityMap}, haveMaps: [2]bool{true, true}}, true, "-", clsNone},
|
||||
} {
|
||||
s, cl := cableSummary(c.cable, c.measuring)
|
||||
if s != c.want || cl != c.class {
|
||||
@@ -104,13 +107,3 @@ func TestSNRClass(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestVerdictString(t *testing.T) {
|
||||
ok := ecdResult{verdicts: [4]int{1, 1, 1, 1}, metres: [4]int{45, 45, 41, 46}}
|
||||
if got := verdictString(ok); got != "all pairs ok, 45/45/41/46 m" {
|
||||
t.Errorf("healthy = %q", got)
|
||||
}
|
||||
bad := ecdResult{verdicts: [4]int{1, 2, 4, 1}, metres: [4]int{45, 12, 30, 46}}
|
||||
if got := verdictString(bad); got != "B OPEN at 12m, C XTALK at 30m" {
|
||||
t.Errorf("faulted = %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user