Commit 2ed6b7b
ConfigurableParam: reject malformed container fields, drop redundant parseSet
Follow-up hardening on top of the std-container ConfigurableParam support.
1. split() no longer silently drops empty fields. A stray delimiter such as
"[1,,3]" previously parsed to a 2-element vector with no error, and "key:"
collapsed an empty map value away. Both now produce an empty token that is
rejected by parseScalar / the map-syntax check, so malformed configuration
surfaces as an error instead of corrupting element counts. The empty
container case ("[]" / "{}") is still short-circuited by the callers before
split() runs, so well-formed input is unaffected.
2. Removed the redundant parseSet() branch (and the now-unused HasPushBack
concept). Every non-map Container already satisfies SequenceContainer, so the
parseSet dispatch was reached for all sequence and set types and re-parsed the
string into a throwaway std::vector before copying element-by-element.
parseSequence inserts at end(), which std::set / std::unordered_set accept
just as well, so all non-map containers now share a single, single-pass path.
3. Re-enabled cleanup of test_config.root in ConfigurableParam_Container_FileIO_ROOT
(the std::remove was left commented out), restoring test isolation.
Adds regression tests: set/unordered_set/list/deque parsing through the unified
parseSequence path (incl. set de-duplication), and rejection of empty tokens in
both sequence and map parsing.
Note: container parse failures remain non-fatal (logged), matching the existing
scalar setValue behaviour; this commit does not change that contract.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 1baae2d commit 2ed6b7b
2 files changed
Lines changed: 53 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | 165 | | |
171 | 166 | | |
172 | 167 | | |
| |||
178 | 173 | | |
179 | 174 | | |
180 | 175 | | |
181 | | - | |
182 | | - | |
183 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
184 | 182 | | |
185 | 183 | | |
186 | 184 | | |
| |||
198 | 196 | | |
199 | 197 | | |
200 | 198 | | |
201 | | - | |
| 199 | + | |
202 | 200 | | |
203 | 201 | | |
204 | 202 | | |
| |||
251 | 249 | | |
252 | 250 | | |
253 | 251 | | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | 252 | | |
272 | 253 | | |
273 | 254 | | |
| |||
357 | 338 | | |
358 | 339 | | |
359 | 340 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
364 | 347 | | |
365 | 348 | | |
366 | 349 | | |
367 | 350 | | |
368 | | - | |
369 | | - | |
370 | | - | |
| 351 | + | |
371 | 352 | | |
372 | 353 | | |
373 | 354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| |||
200 | 205 | | |
201 | 206 | | |
202 | 207 | | |
| 208 | + | |
| 209 | + | |
| 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 | + | |
203 | 242 | | |
204 | 243 | | |
205 | 244 | | |
| |||
255 | 294 | | |
256 | 295 | | |
257 | 296 | | |
258 | | - | |
| 297 | + | |
259 | 298 | | |
0 commit comments