generic: adjust some tests to recent changes

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2016-05-15 10:45:42 +00:00
parent d8acd1a188
commit 2b452705c8
5 changed files with 6 additions and 9 deletions

View file

@ -132,7 +132,7 @@ target_link_libraries(kdecore-kmimeglobsfileparsertest ${KDE4_KDECORE_LIBS} ${QT
########### kfiltertest ############### ########### kfiltertest ###############
# compile httpfilter.cpp into the test since it's not part of kdelibs # compile httpfilter.cpp into the test since it's not part of kdelibs
# (only par of kio_http and kmultipart) # (only part of kio_http)
set(kfiltertest_SRCS kfiltertest.cpp ../../kio/httpfilter/httpfilter.cc) set(kfiltertest_SRCS kfiltertest.cpp ../../kio/httpfilter/httpfilter.cc)
include_directories( ${CMAKE_SOURCE_DIR}/kio/httpfilter ) include_directories( ${CMAKE_SOURCE_DIR}/kio/httpfilter )
kde4_add_test(kdecore-kfiltertest ${kfiltertest_SRCS}) kde4_add_test(kdecore-kfiltertest ${kfiltertest_SRCS})

View file

@ -269,7 +269,7 @@ void KDebugTest::testNoMainComponentData()
proc.setProcessEnvironment(procenv); proc.setProcessEnvironment(procenv);
proc.setReadChannel(QProcess::StandardError); proc.setReadChannel(QProcess::StandardError);
QVERIFY(QFile::exists(KDEBINDIR "/kdecore-kdebug_qcoreapptest")); QVERIFY(QFile::exists(KDEBINDIR "/kdecore-kdebug_qcoreapptest"));
QVERIFY(proc.execute(KDEBINDIR "/kdecore-kdebug_qcoreapptest")); QVERIFY(proc.execute(KDEBINDIR "/kdecore-kdebug_qcoreapptest") == 0);
const QByteArray allOutput = proc.readAllStandardError(); const QByteArray allOutput = proc.readAllStandardError();
const QList<QByteArray> receivedLines = allOutput.split('\n'); const QList<QByteArray> receivedLines = allOutput.split('\n');
//qDebug() << receivedLines; //qDebug() << receivedLines;

View file

@ -294,8 +294,6 @@ void KServiceTest::testServiceTypeTraderForReadOnlyPart()
// Only test for parts provided by kdelibs, or better, by this unittest: // Only test for parts provided by kdelibs, or better, by this unittest:
QVERIFY( offerListHasService( offers, "fakepart.desktop" ) ); QVERIFY( offerListHasService( offers, "fakepart.desktop" ) );
QVERIFY( offerListHasService( offers, "kmultipart.desktop" ) );
QVERIFY( offerListHasService( offers, "kwebkitpart.desktop" ) ); QVERIFY( offerListHasService( offers, "kwebkitpart.desktop" ) );
// Check ordering according to InitialPreference // Check ordering according to InitialPreference
@ -398,9 +396,8 @@ void KServiceTest::testWriteServiceTypeProfile()
//foreach( KService::Ptr service, offers ) //foreach( KService::Ptr service, offers )
// qDebug( "%s %s", qPrintable( service->name() ), qPrintable( service->entryPath() ) ); // qDebug( "%s %s", qPrintable( service->name() ), qPrintable( service->entryPath() ) );
QVERIFY( offers.count() >= 2 ); // at least 2, even QVERIFY( offers.count() >= 1 ); // at least 1, even
QCOMPARE( offers[0]->entryPath(), QString("fakepart.desktop") ); QCOMPARE( offers[0]->entryPath(), QString("fakepart.desktop") );
QVERIFY( offerListHasService( offers, "kmultipart.desktop" ) ); // should still be somewhere in there
QVERIFY( !offerListHasService( offers, "kwebkitpart.desktop" ) ); // it got disabled above QVERIFY( !offerListHasService( offers, "kwebkitpart.desktop" ) ); // it got disabled above
} }

View file

@ -61,8 +61,8 @@ void KGlobalSettingsTest::initTestCase()
QSignalSpy appearance_spy( settings, SIGNAL(appearanceChanged()) ) QSignalSpy appearance_spy( settings, SIGNAL(appearanceChanged()) )
static void callClient( const QString& opt, const char* signalToWaitFor ) { static void callClient( const QString& opt, const char* signalToWaitFor ) {
QVERIFY(QFile::exists("./kdeui-kglobalsettingsclient")); QVERIFY(QFile::exists(KDEBINDIR "/kdeui-kglobalsettingsclient"));
QVERIFY(QProcess::execute("./kdeui-kglobalsettingsclient", QStringList(opt))); QVERIFY(QProcess::execute(KDEBINDIR "/kdeui-kglobalsettingsclient", QStringList(opt)) == 0);
QVERIFY(QTest::kWaitForSignal(KGlobalSettings::self(), signalToWaitFor, 5000)); QVERIFY(QTest::kWaitForSignal(KGlobalSettings::self(), signalToWaitFor, 5000));
} }

View file

@ -30,7 +30,7 @@ QTEST_KDEMAIN(HeaderObjectTest, NoGUI)
static void runTest() static void runTest()
{ {
TestHTTPProtocol protocol("http", QByteArray(), "local://"); TestHTTPProtocol protocol("http", QByteArray(), "tcp://");
protocol.testParseContentDisposition(QLatin1String("inline; filename=\"foo.pdf\"")); protocol.testParseContentDisposition(QLatin1String("inline; filename=\"foo.pdf\""));
} }