Fix test to pass with QT_FORCE_ASSERTS
Add QT_FORCE_ASSERTS to condition with standard comment. Pick-to: 6.3 6.2 Change-Id: If493c7cdea8164f010228a755915a211c1cf1b39 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
72e1fc7c0b
commit
1af068332b
@ -3197,7 +3197,8 @@ void tst_QSortFilterProxyModel::mapFromToSource()
|
||||
QCOMPARE(proxy.mapFromSource(QModelIndex()), QModelIndex());
|
||||
QCOMPARE(proxy.mapToSource(QModelIndex()), QModelIndex());
|
||||
|
||||
#ifdef QT_NO_DEBUG //if Qt is compiled in debug mode, this will assert
|
||||
// Will assert in debug, so only test in release
|
||||
#if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
|
||||
QTest::ignoreMessage(QtWarningMsg, "QSortFilterProxyModel: index from wrong model passed to mapToSource");
|
||||
QCOMPARE(proxy.mapToSource(source.index(2, 3)), QModelIndex());
|
||||
QTest::ignoreMessage(QtWarningMsg, "QSortFilterProxyModel: index from wrong model passed to mapFromSource");
|
||||
|
@ -115,8 +115,9 @@ void tst_QAbstractSpinBox::getSetCheck()
|
||||
QLineEdit *var3 = new QLineEdit(0);
|
||||
obj1.setLineEdit(var3);
|
||||
QCOMPARE(var3, obj1.lineEdit());
|
||||
#ifndef QT_DEBUG
|
||||
obj1.setLineEdit((QLineEdit *)0); // Will assert in debug, so only test in release
|
||||
// Will assert in debug, so only test in release
|
||||
#if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS)
|
||||
obj1.setLineEdit(nullptr);
|
||||
QCOMPARE(var3, obj1.lineEdit()); // Setting 0 should keep the current editor
|
||||
#endif
|
||||
// delete var3; // No delete, since QAbstractSpinBox takes ownership
|
||||
|
Loading…
Reference in New Issue
Block a user