From 57f1b775197aed1d32e98b0299c0999339a7d5f6 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Sun, 2 Feb 2020 18:14:27 +0100 Subject: Run clang-format also on all cpp files --- .../tst_qxmppuploadrequestmanager.cpp | 166 ++++++++++----------- 1 file changed, 83 insertions(+), 83 deletions(-) (limited to 'tests/qxmppuploadrequestmanager/tst_qxmppuploadrequestmanager.cpp') diff --git a/tests/qxmppuploadrequestmanager/tst_qxmppuploadrequestmanager.cpp b/tests/qxmppuploadrequestmanager/tst_qxmppuploadrequestmanager.cpp index 0486f519..6b603e05 100644 --- a/tests/qxmppuploadrequestmanager/tst_qxmppuploadrequestmanager.cpp +++ b/tests/qxmppuploadrequestmanager/tst_qxmppuploadrequestmanager.cpp @@ -42,8 +42,8 @@ public: ~TestHelper(); public slots: - void onSlotReceived(const QXmppHttpUploadSlotIq &slot); - void onRequestFailed(const QXmppHttpUploadRequestIq &request); + void onSlotReceived(const QXmppHttpUploadSlotIq& slot); + void onRequestFailed(const QXmppHttpUploadRequestIq& request); private: bool expectedEvent; @@ -52,12 +52,11 @@ private: bool error; }; -TestHelper::TestHelper(bool p_expectedEvent, bool p_expectedError): - QObject(), - expectedEvent(p_expectedEvent), - expectedError(p_expectedError), - event(false), - error(false) +TestHelper::TestHelper(bool p_expectedEvent, bool p_expectedError) : QObject(), + expectedEvent(p_expectedEvent), + expectedError(p_expectedError), + event(false), + error(false) { } @@ -84,7 +83,7 @@ class tst_QXmppUploadRequestManager : public QObject Q_OBJECT protected slots: - void onLoggerMessage(QXmppLogger::MessageType type, const QString &text) const; + void onLoggerMessage(QXmppLogger::MessageType type, const QString& text) const; private slots: void initTestCase(); @@ -151,58 +150,58 @@ void tst_QXmppUploadRequestManager::testHandleStanza_data() "from='romeo@montague.example' " "to='romeo@montague.example/home' " "type='chat'>" - "" - "" - "" - "What man art thou that, thus bescreen'd in night, so stumblest on my counsel?" - "0e3141cd80894871a68e6fe6b1ec56fa" - "" - "" - "" - "") + "" + "" + "" + "What man art thou that, thus bescreen'd in night, so stumblest on my counsel?" + "0e3141cd80894871a68e6fe6b1ec56fa" + "" + "" + "" + "") << false << false << false; - + QTest::newRow("slotReceived") << QByteArray("" - "" - "" - "
Basic Base64String==
" - "
foo=bar; user=romeo
" - "
" - "" - "
" - "
") + "" + "" + "
Basic Base64String==
" + "
foo=bar; user=romeo
" + "
" + "" + "
" + "") << true << true << false; - + QTest::newRow("tooLargeError") << QByteArray("" - "" - "" - "" - "File too large. The maximum file size is 20000 bytes" - "" - "20000" - "" - "" - "") + "" + "" + "" + "File too large. The maximum file size is 20000 bytes" + "" + "20000" + "" + "" + "") << true << true << true; - + QTest::newRow("quotaReachedError") << QByteArray("" - "" - "" - "" - "Quota reached. You can only upload 5 files in 5 minutes" - "" - "" - "") + "" + "" + "" + "Quota reached. You can only upload 5 files in 5 minutes" + "" + "" + "") << true << true << true; } -void tst_QXmppUploadRequestManager::testHandleStanza() +void tst_QXmppUploadRequestManager::testHandleStanza() { QFETCH(QByteArray, xml); QFETCH(bool, accepted); @@ -229,29 +228,30 @@ void tst_QXmppUploadRequestManager::testDiscoveryService_data() QTest::newRow("mixDiscoveryStanzaIq") << QByteArray("" - "" - "" - "" - "" - "" - "") + "" + "" + "" + "" + "" + "") << false; QTest::newRow("HTTPUploadDiscoveryStanzaIq") << QByteArray("" - "" - "" - "" - "" - "" - "urn:xmpp:http:upload:0" - "" - "" - "" + QByteArray::number(maxFileSize) + "" - "" - "" - "" - "") + "" + "" + "" + "" + "" + "urn:xmpp:http:upload:0" + "" + "" + "" + + QByteArray::number(maxFileSize) + "" + "" + "" + "" + "") << true; } @@ -259,11 +259,11 @@ void tst_QXmppUploadRequestManager::testDiscoveryService() { QFETCH(QByteArray, xml); QFETCH(bool, discovered); - + QDomDocument doc; QCOMPARE(doc.setContent(xml, true), true); QDomElement element = doc.documentElement(); - + bool accepted = discovery->handleStanza(element); QCOMPARE(accepted, true); QCOMPARE(manager->serviceFound(), discovered); @@ -282,22 +282,22 @@ void tst_QXmppUploadRequestManager::testSending_data() QTest::addColumn("fileType"); QTest::newRow("fileInfo") - << QFileInfo(":/test.svg") - << "test.svg" - << 2280LL - << "image/svg+xml"; + << QFileInfo(":/test.svg") + << "test.svg" + << 2280LL + << "image/svg+xml"; QTest::newRow("fileWithSizeBelowLimit") - << QFileInfo() - << "whatever.jpeg" - << 698547LL - << "image/jpeg"; + << QFileInfo() + << "whatever.jpeg" + << 698547LL + << "image/jpeg"; QTest::newRow("fileWithSizeAboveLimit") - << QFileInfo() - << "some.pdf" - << 65896498547LL - << "application/pdf"; + << QFileInfo() + << "some.pdf" + << 65896498547LL + << "application/pdf"; // there is no size above limit handling in request manager // there is also no code that selects an upload service with proper @@ -312,7 +312,7 @@ void tst_QXmppUploadRequestManager::testSending() QFETCH(qint64, fileSize); QFETCH(QString, fileType); - QXmppLogger *logger = new QXmppLogger(); + QXmppLogger* logger = new QXmppLogger(); logger->setLoggingType(QXmppLogger::SignalLogging); client.setLogger(logger); -- cgit v1.2.3