summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPekka Vuorela <pvuorela@iki.fi>2025-12-08 09:50:53 +0200
committerPekka Vuorela <pvuorela@iki.fi>2025-12-11 11:32:13 +0200
commite503dedbf6d73dc22a7ed32a78806075da589ae7 (patch)
tree273b0df42f5214a554f785c3f6f4a9f8ca36cfa3 /tests
parent15a73fae6aaffbedc287359fba119e57613a2ed1 (diff)
Clean up service plugin signal connections - minor API changes
The states and signals were painful to follow due to bad naming and excessive overloading. Here: - Renamed some API to avoid overloading, help readability and allow new connect() syntax without resolving the overloads. - updateStatus() signals and slots renamed a bit to make it clearer what is a signal and what is a slot. And avoiding overloading QMailMessageService::updateStatus() to simplify signal connection. - Cleaned up QMailTranport API. It's not doing urls but hostnames and the signals were especially hard to follow - Use the new connect() syntax in messageserver side - Avoiding some protected: / virtual methods when there's nothing even able to inherit the class. - At least print SSL errors instead of signal that's not connected anywhere. - Some minor simplifications and code style adjustments. The SSL error handling is still funny but at least a bit easier to track. Change-Id: If168e15ef068fedee46b9401d695ed5dae7962ba Reviewed-by: <matti.viljanen@kapsi.fi> Reviewed-by: Damien Caliste <dcaliste@free.fr> Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
Diffstat (limited to 'tests')
-rw-r--r--tests/tst_imap/tst_imap.cpp2
-rw-r--r--tests/tst_pop/tst_pop.cpp10
-rw-r--r--tests/tst_smtp/tst_smtp.cpp4
3 files changed, 8 insertions, 8 deletions
diff --git a/tests/tst_imap/tst_imap.cpp b/tests/tst_imap/tst_imap.cpp
index 04855e86..36f55f32 100644
--- a/tests/tst_imap/tst_imap.cpp
+++ b/tests/tst_imap/tst_imap.cpp
@@ -112,7 +112,7 @@ void tst_ImapClient::test_connection()
{
ConnectionStrategy strategy;
QSignalSpy completed(mClient, &ImapClient::retrievalCompleted);
- QSignalSpy updateStatus(mClient, &ImapClient::updateStatus);
+ QSignalSpy updateStatus(mClient, &ImapClient::statusChanged);
mClient->setStrategy(&strategy);
mClient->newConnection();
diff --git a/tests/tst_pop/tst_pop.cpp b/tests/tst_pop/tst_pop.cpp
index 9d24e119..7e6a0ee3 100644
--- a/tests/tst_pop/tst_pop.cpp
+++ b/tests/tst_pop/tst_pop.cpp
@@ -56,10 +56,6 @@ private:
PopClient *mClient = nullptr;
};
-QTEST_MAIN(tst_PopClient)
-
-#include "tst_pop.moc"
-
void tst_PopClient::initTestCase()
{
QMailAccount account;
@@ -94,7 +90,7 @@ void tst_PopClient::cleanupTestCase()
void tst_PopClient::test_connection()
{
QSignalSpy completed(mClient, &PopClient::retrievalCompleted);
- QSignalSpy updateStatus(mClient, &PopClient::updateStatus);
+ QSignalSpy updateStatus(mClient, &PopClient::statusChanged);
mClient->testConnection();
QVERIFY(!completed.wait(250)); // Fails with wrong credentials
@@ -105,3 +101,7 @@ void tst_PopClient::test_connection()
QCOMPARE(updateStatus.takeFirst().first().toString(), QString::fromLatin1("Connected"));
QCOMPARE(updateStatus.takeFirst().first().toString(), QString::fromLatin1("Logging in"));
}
+
+QTEST_MAIN(tst_PopClient)
+
+#include "tst_pop.moc"
diff --git a/tests/tst_smtp/tst_smtp.cpp b/tests/tst_smtp/tst_smtp.cpp
index 99d534af..5784e7c0 100644
--- a/tests/tst_smtp/tst_smtp.cpp
+++ b/tests/tst_smtp/tst_smtp.cpp
@@ -88,7 +88,7 @@ void tst_SmtpClient::cleanupTestCase()
void tst_SmtpClient::test_connection()
{
QSignalSpy completed(mClient, &SmtpClient::sendCompleted);
- QSignalSpy updateStatus(mClient, &SmtpClient::updateStatus);
+ QSignalSpy updateStatus(mClient, &SmtpClient::statusChanged);
mClient->newConnection();
QVERIFY(completed.wait());
@@ -102,7 +102,7 @@ void tst_SmtpClient::test_connection()
void tst_SmtpClient::test_auth()
{
QSignalSpy completed(mClient, &SmtpClient::sendCompleted);
- QSignalSpy updateStatus(mClient, &SmtpClient::updateStatus);
+ QSignalSpy updateStatus(mClient, &SmtpClient::statusChanged);
QMailAccountConfiguration config(mClient->account());
SmtpConfigurationEditor smtp(&config);