[MusicXML import] replace assertions by proper error reporting

• Feb 7, 2021 - 09:44
Reported version
3.6
Type
Functional
Severity
S5 - Suggestion
Reproducibility
Always
Status
closed
Regression
No
Workaround
No
Project

The MusicXML parser contains several assertions checking start and end elements to verify the parser is still in sync. For end users they have no effect (resulting in incomplete import without any error), for a debug build they crash MuseScore when triggered.

Suggestion is to properly report "parser out of sync" to the end user and provide meaningful information (e.g. expected element name and type versus actual) to the developer.

Relates to #270643: [EPIC] MusicXML import/export issues


Comments

Status PR created fixed

Fixed in branch master, commit c1e06c3d46

_Fix #317099: [MusicXML import] replace assertions by proper error reporting

The MusicXML parser contains several assertions checking start and end elements to verify the parser is still in sync.
For end users they have no effect (resulting in incomplete import without any error), for a debug build they crash
MuseScore when triggered.

These assertions have been replaced by a dialog providing meaningful information (expected element name and type versus actual)
to the end user and the developer.

Other Q_ASSERTS have been replaced by ASSERT_IF_FAILED macros._

Fix version
4.0.0