aboutsummaryrefslogtreecommitdiff
path: root/tests/qxmppatmmanager
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2022-12-26 21:35:16 +0100
committerLinus Jahn <lnj@kaidan.im>2022-12-26 22:00:07 +0100
commit46995fd3fd7da4d1b035f71a1279c041b2871ffd (patch)
tree788517dbefa88fc1680b05a97e84f0e1d7403815 /tests/qxmppatmmanager
parent71442ab927cd5c1c235528442fe3706f33e7ff6e (diff)
downloadqxmpp-46995fd3fd7da4d1b035f71a1279c041b2871ffd.tar.gz
Disable Qt keywords completely
Previously we had the policy that no qt keywords were allowed in headers that may be included by users. However since there was no automatic test verifying that in some places keywords were still used. This now disables qt keywords completely, also in tests and examples. Qt keywords are in general no good or really good idea as they even conflict with the standard library (`emit` at least). In some cases in the examples I just removed the slot tag if the functions didn't need to be slots (anymore). Closes #503.
Diffstat (limited to 'tests/qxmppatmmanager')
-rw-r--r--tests/qxmppatmmanager/tst_qxmppatmmanager.cpp59
1 files changed, 29 insertions, 30 deletions
diff --git a/tests/qxmppatmmanager/tst_qxmppatmmanager.cpp b/tests/qxmppatmmanager/tst_qxmppatmmanager.cpp
index c31190e0..40ec02ec 100644
--- a/tests/qxmppatmmanager/tst_qxmppatmmanager.cpp
+++ b/tests/qxmppatmmanager/tst_qxmppatmmanager.cpp
@@ -31,32 +31,31 @@ class tst_QXmppAtmManager : public QObject
{
Q_OBJECT
-signals:
- void unexpectedTrustMessageSent();
-
-private slots:
- void initTestCase();
- void testSendTrustMessage();
- void testMakePostponedTrustDecisions();
- void testDistrustAutomaticallyTrustedKeys();
- void testDistrust();
- void testAuthenticate_data();
- void testAuthenticate();
- void testMakeTrustDecisions();
- void testHandleMessage_data();
- void testHandleMessage();
- void testMakeTrustDecisionsNoKeys();
- void testMakeTrustDecisionsOwnKeys();
- void testMakeTrustDecisionsOwnKeysNoOwnEndpoints();
- void testMakeTrustDecisionsOwnKeysNoOwnEndpointsWithAuthenticatedKeys();
- void testMakeTrustDecisionsOwnKeysNoContactsWithAuthenticatedKeys();
- void testMakeTrustDecisionsSoleOwnKeyDistrusted();
- void testMakeTrustDecisionsContactKeys();
- void testMakeTrustDecisionsContactKeysNoOwnEndpoints();
- void testMakeTrustDecisionsContactKeysNoOwnEndpointsWithAuthenticatedKeys();
- void testMakeTrustDecisionsSoleContactKeyDistrusted();
+public:
+ Q_SIGNAL void unexpectedTrustMessageSent();
private:
+ Q_SLOT void initTestCase();
+ Q_SLOT void testSendTrustMessage();
+ Q_SLOT void testMakePostponedTrustDecisions();
+ Q_SLOT void testDistrustAutomaticallyTrustedKeys();
+ Q_SLOT void testDistrust();
+ Q_SLOT void testAuthenticate_data();
+ Q_SLOT void testAuthenticate();
+ Q_SLOT void testMakeTrustDecisions();
+ Q_SLOT void testHandleMessage_data();
+ Q_SLOT void testHandleMessage();
+ Q_SLOT void testMakeTrustDecisionsNoKeys();
+ Q_SLOT void testMakeTrustDecisionsOwnKeys();
+ Q_SLOT void testMakeTrustDecisionsOwnKeysNoOwnEndpoints();
+ Q_SLOT void testMakeTrustDecisionsOwnKeysNoOwnEndpointsWithAuthenticatedKeys();
+ Q_SLOT void testMakeTrustDecisionsOwnKeysNoContactsWithAuthenticatedKeys();
+ Q_SLOT void testMakeTrustDecisionsSoleOwnKeyDistrusted();
+ Q_SLOT void testMakeTrustDecisionsContactKeys();
+ Q_SLOT void testMakeTrustDecisionsContactKeysNoOwnEndpoints();
+ Q_SLOT void testMakeTrustDecisionsContactKeysNoOwnEndpointsWithAuthenticatedKeys();
+ Q_SLOT void testMakeTrustDecisionsSoleContactKeyDistrusted();
+
void testMakeTrustDecisionsOwnKeysDone();
void testMakeTrustDecisionsContactKeysDone();
void clearTrustStorage();
@@ -1023,7 +1022,7 @@ void tst_QXmppAtmManager::testMakeTrustDecisionsNoKeys()
// unexpected trust message
connect(&m_logger, &QXmppLogger::message, &context, [=](QXmppLogger::MessageType type, const QString &) {
if (type == QXmppLogger::SentMessage) {
- emit unexpectedTrustMessageSent();
+ Q_EMIT unexpectedTrustMessageSent();
}
});
@@ -1669,7 +1668,7 @@ void tst_QXmppAtmManager::testMakeTrustDecisionsSoleOwnKeyDistrusted()
parsePacket(message, text.toUtf8());
if (message.to() == QStringLiteral("alice@example.org")) {
- emit unexpectedTrustMessageSent();
+ Q_EMIT unexpectedTrustMessageSent();
}
}
});
@@ -1800,7 +1799,7 @@ void tst_QXmppAtmManager::testMakeTrustDecisionsContactKeys()
parsePacket(message, text.toUtf8());
if (message.to() == QStringLiteral("carol@example.net")) {
- emit unexpectedTrustMessageSent();
+ Q_EMIT unexpectedTrustMessageSent();
}
}
});
@@ -1850,7 +1849,7 @@ void tst_QXmppAtmManager::testMakeTrustDecisionsContactKeysNoOwnEndpoints()
QXmppMessage message;
parsePacket(message, text.toUtf8());
- emit unexpectedTrustMessageSent();
+ Q_EMIT unexpectedTrustMessageSent();
}
});
@@ -1929,7 +1928,7 @@ void tst_QXmppAtmManager::testMakeTrustDecisionsContactKeysNoOwnEndpointsWithAut
parsePacket(message, text.toUtf8());
if (message.to() != QStringLiteral("bob@example.com")) {
- emit unexpectedTrustMessageSent();
+ Q_EMIT unexpectedTrustMessageSent();
}
}
});
@@ -2013,7 +2012,7 @@ void tst_QXmppAtmManager::testMakeTrustDecisionsSoleContactKeyDistrusted()
parsePacket(message, text.toUtf8());
if (message.to() != QStringLiteral("alice@example.org")) {
- emit unexpectedTrustMessageSent();
+ Q_EMIT unexpectedTrustMessageSent();
}
}
});