Conditionally disable parts of the tests testing the deprecated APIs

Somehow missed these during my first iteration.

Change-Id: Iaef0ab84d9320a98f49ec071c93cd6f2907d92c3
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
This commit is contained in:
Sona Kurazyan 2019-08-01 12:24:06 +02:00
parent b80b228240
commit 10845315b7
2 changed files with 4 additions and 2 deletions

View File

@ -50,8 +50,8 @@ private slots:
void installMessageHandler();
#if QT_DEPRECATED_SINCE(5, 0)
void installMsgHandler();
#endif
void installBothHandler();
#endif
#ifdef QT_BUILD_INTERNAL
void cleanupFuncinfo_data();
@ -163,7 +163,6 @@ void tst_qmessagehandler::installMsgHandler()
QtMsgHandler myHandler = qInstallMsgHandler(oldHandler);
QCOMPARE((void*)myHandler, (void*)customMsgHandler);
}
#endif
void tst_qmessagehandler::installBothHandler()
{
@ -178,6 +177,7 @@ void tst_qmessagehandler::installBothHandler()
QCOMPARE(s_function, Q_FUNC_INFO);
QCOMPARE(s_line, line);
}
#endif
# define ADD(x) QTest::newRow(x) << Q_FUNC_INFO << x;

View File

@ -379,11 +379,13 @@ void tst_QVariant::isNull()
QString str1;
QVariant var1( str1 );
QVERIFY( var1.isNull() );
#if QT_DEPRECATED_SINCE(5, 9)
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
QVariant var2( QString::null );
QT_WARNING_POP
QVERIFY( var2.isNull() );
#endif
QVariant var3( QString( "blah" ) );
QVERIFY( !var3.isNull() );