fix(config): reject channel properties of the wrong type

- ptree::get(key, default) returns the default also for a value that
  does not convert, so a typo (e.g. sndBufSize=big) silently gave the
  default value
- Use the default only for a missing key; throw ParserError with the
  key and the value for a value of the wrong type
- Rethrow parser errors in the config plugin: before, the device
  logged the error and continued without its channel configuration
- Enable JSONParser and SuboptParser RejectsValuesOfTheWrongType
- Update the documentation pages that described the defect, and
  the source line links into the changed files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-11-04 20:31:06 +00:00
committed by Dennis Klein
parent 442b203d0d
commit b70595cebe
9 changed files with 73 additions and 55 deletions

View File

@@ -91,10 +91,9 @@ TEST(SuboptParser, Errors)
EXPECT_THROW(SuboptParser({"name=data"}, ""), ParserError);
}
// Known defect: see JSONParser.DISABLED_RejectsValuesOfTheWrongType.
TEST(SuboptParser, DISABLED_RejectsValuesOfTheWrongType)
TEST(SuboptParser, RejectsValuesOfTheWrongType)
{
EXPECT_THROW(SuboptParser({"name=data,sndBufSize=big"}, "dev"), boost::property_tree::ptree_bad_data);
EXPECT_THROW(SuboptParser({"name=data,sndBufSize=big"}, "dev"), ParserError);
}
} // namespace