summaryrefslogtreecommitdiffstats
path: root/tests/auto/sql/kernel
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2022-02-02 18:10:03 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2022-02-10 19:20:59 +0100
commit325303732923a74e843e4584fda106468dc46489 (patch)
treef595c599ca19115e6d6ac5ae06ee1077ab369181 /tests/auto/sql/kernel
parent9030ffdffb612f37f498065d04cd6b33bf930669 (diff)
Suppress, and thus verify we do get, two warnings in tst_QSqlQuery
Expected warnings are clutter for anyone reding the output, so suppress them when they're correct behavior. Change-Id: Idf47ba4fab8069237067d9b20afef3041e0c2f8c Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'tests/auto/sql/kernel')
-rw-r--r--tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
index 06469cb832..0fcee19dba 100644
--- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
@@ -1762,6 +1762,7 @@ void tst_QSqlQuery::isNull()
// For a non existent field, it should be returning true.
QVERIFY(q.isNull(2));
+ QTest::ignoreMessage(QtWarningMsg, "QSqlQuery::isNull: unknown field name 'unknown'");
QVERIFY(q.isNull("unknown"));
}
@@ -3039,6 +3040,10 @@ void tst_QSqlQuery::queryOnInvalidDatabase()
});
// Note: destruction of db needs to happen before we call removeDatabase.
QTest::ignoreMessage( QtWarningMsg, "QSqlDatabase: INVALID driver not loaded" );
+#if QT_CONFIG(regularexpression)
+ QTest::ignoreMessage(QtWarningMsg,
+ QRegularExpression("QSqlDatabase: available drivers: "));
+#endif
QSqlDatabase db = QSqlDatabase::addDatabase( "INVALID", "invalidConnection" );
QVERIFY2( db.lastError().isValid(),
qPrintable( QString( "db.lastError().isValid() should be true!" ) ) );