mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-25 13:11:36 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user