Warning, file /network/neochat/autotests/chatdocumenthandlertest.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // SPDX-FileCopyrightText: 2023 James Graham <james.h.graham@protonmail.com>
0002 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0003 
0004 #include <QObject>
0005 #include <QTest>
0006 
0007 #include "chatdocumenthandler.h"
0008 #include "neochatconfig.h"
0009 
0010 class ChatDocumentHandlerTest : public QObject
0011 {
0012     Q_OBJECT
0013 
0014 private:
0015     ChatDocumentHandler emptyHandler;
0016 
0017 private Q_SLOTS:
0018     void initTestCase();
0019 
0020     void nullComplete();
0021 };
0022 
0023 void ChatDocumentHandlerTest::initTestCase()
0024 {
0025     // HACK: this is to stop KStatusNotifierItem SEGFAULTING on cleanup.
0026     NeoChatConfig::self()->setSystemTray(false);
0027 }
0028 
0029 void ChatDocumentHandlerTest::nullComplete()
0030 {
0031     QTest::ignoreMessage(QtWarningMsg, "complete called with m_document set to nullptr.");
0032     emptyHandler.complete(0);
0033 }
0034 
0035 QTEST_MAIN(ChatDocumentHandlerTest)
0036 #include "chatdocumenthandlertest.moc"