Commit d069e47
committed
Fix scalar unpacking in the C API example bridges
The managed input bridge unpacked four scalars, but only kwargs become
scalars: InputAdapterDef strips push_mode from the tail and AdapterDef
strips the manager from the head, leaving (typ, interval_ms,
push_group). That raised ValueError on macOS in test_cpp_examples.
The managed output bridge had the same miscount, masked rather than
raised: scalars is (prefix,), so `scalars[1] if len(scalars) > 1 else ""`
always took the else branch and the manager's prefix was silently
discarded on every call.
Replace the defensive index lookups with strict unpacking in all four
bridges so a future mismatch fails loudly instead of substituting a
default. Verified the delivered tuples for each of the four adapter
definitions against csp's wiring layer.
Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>1 parent 6858ca2 commit d069e47
1 file changed
Lines changed: 13 additions & 13 deletions
Lines changed: 13 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
129 | 131 | | |
130 | | - | |
| 132 | + | |
131 | 133 | | |
132 | 134 | | |
133 | 135 | | |
| |||
138 | 140 | | |
139 | 141 | | |
140 | 142 | | |
141 | | - | |
| 143 | + | |
| 144 | + | |
142 | 145 | | |
143 | | - | |
144 | | - | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| |||
211 | 213 | | |
212 | 214 | | |
213 | 215 | | |
214 | | - | |
215 | | - | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | | - | |
219 | | - | |
| 218 | + | |
220 | 219 | | |
221 | 220 | | |
222 | 221 | | |
| |||
228 | 227 | | |
229 | 228 | | |
230 | 229 | | |
| 230 | + | |
| 231 | + | |
231 | 232 | | |
232 | | - | |
233 | | - | |
| 233 | + | |
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| |||
0 commit comments