Use value::status to keep track of data status in DeckItem

With this commit the DeckItem::push_backDummyDefault() function will push back a
default value T( ). This will give a change in behaviour in downstream code
which has used getData<T> to get DeckItem data unchecked.
This commit is contained in:
Joakim Hove
2019-11-17 14:46:00 +01:00
parent 3156448f99
commit 6cc3b578f5
8 changed files with 64 additions and 54 deletions

View File

@@ -1247,7 +1247,7 @@ BOOST_AUTO_TEST_CASE(Parse_RawRecordTooFewItems) {
BOOST_CHECK_NO_THROW(parserRecord.parse(parseContext, errors, rawRecord, unit_system, unit_system, "KEWYORD", "filename"));
auto record = parserRecord.parse(parseContext, errors , rawRecord, unit_system, unit_system, "KEYWORD", "filename");
BOOST_CHECK_NO_THROW(record.getItem(2));
BOOST_CHECK_THROW(record.getItem(2).get< int >(0), std::out_of_range);
BOOST_CHECK_THROW(record.getItem(2).get< int >(0), std::invalid_argument);
}