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

View File

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