Open rgourova opened 5 months ago
PR #210 contains a test scenario (cpp/applications/openScenarioTester/res/exampleFilesVersion1_2/FollowTrajectory_Nurbs.xosc) which can be used for reproducing the reported issue. In that case the steps for reproducing the behavior will change to:
cpp/build/cgReleaseMakeShared/applications/OpenScenarioReader
./OpenScenarioReader -i <YOUR_PATH_TO>/cpp/applications/openScenarioTester/res/exampleFilesVersion1_2/FollowTrajectory_Nurbs.xosc -v1_2
Describe the bug
_occuredElementList
inXmlSequenceParser
does not increment correctly the numbers of occurrences of a given parser. Theemplace()
method is used every time irrespective if the map element already exists or not. This leads to the element being placed in the map when created for the first time, however any consecutive encounter of the same element is discarded as the parser for it already exists. When there are two required elements which have min occurrence larger than 1, the second element will fail checks inXmlSequenceParser::GetNextIndex
and the parsing of the scenario will fail with: "Required element is missing before XYZtag" .To Reproduce Steps to reproduce the behavior:
Expected behavior The parser should be able to parse correctly all scenarios irrespective of the number of min required occurrence of elements contained in a tag.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop:
Additional context My proposed solution is to replace:
https://github.com/RA-Consulting-GmbH/openscenario.api.test/blob/6c6d6c43764029033b35987d1b8d69cea3a873f0/cpp/openScenarioLib/src/parser/modelgroup/XmlSequenceParser.cpp#L73
by: