If new "axis" enum values are added in the future, the test should
report a meaningful warning in the test output rather than aborting with
a meaningless message in debug builds and failing silently in release
builds.
Change-Id: Ifdc7a9492c3ee196d7f0e6958eec34693efd244f
Task-number: QTBUG-17582
Reviewed-by: Rohan McGovern
(cherry picked from commit
f859ab10715a3cb69aa3f03574a046c886d34b44)
return internal->precedingSibling ? createIndex(internal->precedingSibling) : QXmlNodeModelIndex();
case NextSibling:
return internal->followingSibling ? createIndex(internal->followingSibling) : QXmlNodeModelIndex();
+ default:
+ qWarning("%s: unknown axis enum value %d", Q_FUNC_INFO, static_cast<int>(axis));
+ return QXmlNodeModelIndex();
}
-
- Q_ASSERT(false);
- return QXmlNodeModelIndex();
}
QVector<QXmlNodeModelIndex> LoadingModel::attributes(const QXmlNodeModelIndex &ni) const