Commit b20712a
Yu Leng (from Dev Box)
PowerDisplay: Drop VcpProbeDisposition and the duplicated probe-attempt log
VcpProbeDisposition was a three-state enum carrying one bit anything branched
on. Only PhysicalMonitorUnavailable drove a decision -- the abort in ProbeAsync
-- while Success and Indeterminate existed to be mapped back to strings for a
single log line. The bit was already computable from LastError through the same
classifier the derived property called, so it is now a plain
IsPhysicalMonitorUnavailable on the observation and the enum is gone.
The status word in Complete() reads off IsSuccess and that property directly.
Every emitted string is unchanged: IsSuccess true with a handle-class LastError
is unreachable, because handle-class codes are not transient, so they break out
of the attempt loop and fall through to the terminal Indeterminate, whose value
is VcpFeatureValue.Invalid.
The two per-attempt LogDebug templates in the success arm differed in one token
after the early-return change made both arms terminal. They collapse into one
call with the status word interpolated, and the two Complete() calls into one
over a conditional observation.
Tests keep the same coverage: the six Disposition assertions become IsSuccess /
IsPhysicalMonitorUnavailable pairs, except the one in
ProbeAsync_TransientFailureThenSuccessRetriesWithPacing, which restated the
IsSuccess assertion directly above it and is dropped.1 parent ca3cd3c commit b20712a
2 files changed
Lines changed: 29 additions & 43 deletions
File tree
- src/modules/powerdisplay
- PowerDisplay.Lib.UnitTests
- PowerDisplay.Lib/Drivers/DDC
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
| |||
99 | 98 | | |
100 | 99 | | |
101 | 100 | | |
102 | | - | |
| 101 | + | |
103 | 102 | | |
104 | 103 | | |
105 | 104 | | |
| |||
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
118 | | - | |
119 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
| 157 | + | |
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
| |||
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
172 | | - | |
| 173 | + | |
| 174 | + | |
173 | 175 | | |
174 | 176 | | |
175 | 177 | | |
| |||
Lines changed: 21 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
108 | 101 | | |
109 | 102 | | |
110 | 103 | | |
111 | 104 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
120 | 111 | | |
121 | 112 | | |
122 | 113 | | |
| |||
142 | 133 | | |
143 | 134 | | |
144 | 135 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
151 | 141 | | |
152 | 142 | | |
153 | 143 | | |
| |||
169 | 159 | | |
170 | 160 | | |
171 | 161 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | 162 | | |
180 | 163 | | |
181 | 164 | | |
| |||
197 | 180 | | |
198 | 181 | | |
199 | 182 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
205 | 189 | | |
206 | 190 | | |
207 | 191 | | |
| |||
0 commit comments