Mercurial > trustbridge
comparison ui/tests/downloadertest.cpp @ 45:c6125d73faf4
Move SSLConnection into it's own class
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Fri, 14 Mar 2014 16:40:53 +0000 |
parents | 5910bf9016cd |
children | d28e2624c1d5 |
comparison
equal
deleted
inserted
replaced
44:b3e8e047bc2c | 45:c6125d73faf4 |
---|---|
37 void DownloaderTest::initTestCase() { | 37 void DownloaderTest::initTestCase() { |
38 QStringList arguments; | 38 QStringList arguments; |
39 serverProc.setProgram(HIAWATHA_EXECUTABLE); | 39 serverProc.setProgram(HIAWATHA_EXECUTABLE); |
40 arguments << "-d" << "-c" << serverConfigDir.path(); | 40 arguments << "-d" << "-c" << serverConfigDir.path(); |
41 serverProc.setArguments(arguments); | 41 serverProc.setArguments(arguments); |
42 qRegisterMetaType<Downloader::ErrorCode>("Downloader::ErrorCode"); | 42 qRegisterMetaType<SSLConnection::ErrorCode>("SSLConnection::ErrorCode"); |
43 startServer(); | 43 startServer(); |
44 QTest::qWait(1000); /* Wait for the server to settle */ | 44 QTest::qWait(1000); /* Wait for the server to settle */ |
45 } | 45 } |
46 | 46 |
47 void DownloaderTest::downloaderError(const QString &message, Downloader::ErrorCode error) | 47 void DownloaderTest::downloaderError(const QString &message, SSLConnection::ErrorCode error) |
48 { | 48 { |
49 qDebug() << "Downloader Error: " << error << " Msg: " << message; | 49 qDebug() << "Downloader Error: " << error << " Msg: " << message; |
50 } | 50 } |
51 | 51 |
52 void DownloaderTest::testNewList() | 52 void DownloaderTest::testNewList() |
67 QSignalSpy newListAvailable(downloader, | 67 QSignalSpy newListAvailable(downloader, |
68 SIGNAL(newListAvailable(const QString&, const QDateTime&))); | 68 SIGNAL(newListAvailable(const QString&, const QDateTime&))); |
69 QSignalSpy newSoftwareAvailable(downloader, | 69 QSignalSpy newSoftwareAvailable(downloader, |
70 SIGNAL(newSoftwareAvailable(const QString&, const QDateTime&))); | 70 SIGNAL(newSoftwareAvailable(const QString&, const QDateTime&))); |
71 QSignalSpy errors(downloader, SIGNAL(error(const QString &, | 71 QSignalSpy errors(downloader, SIGNAL(error(const QString &, |
72 Downloader::ErrorCode))); | 72 SSLConnection::ErrorCode))); |
73 connect(downloader, SIGNAL(error(const QString &, Downloader::ErrorCode)), | 73 connect(downloader, SIGNAL(error(const QString &, SSLConnection::ErrorCode)), |
74 this, SLOT(downloaderError(const QString &, Downloader::ErrorCode))); | 74 this, SLOT(downloaderError(const QString &, SSLConnection::ErrorCode))); |
75 | 75 |
76 downloader->start(); | 76 downloader->start(); |
77 | 77 |
78 int waited = 0; | 78 int waited = 0; |
79 while (newListAvailable.count() == 0 && | 79 while (newListAvailable.count() == 0 && |