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

0001 // clang-format off
0002 /*
0003  KDiff3 - Text Diff And Merge Tool
0004 
0005  SPDX-FileCopyrightText: 2020 Michael Reeves reeves.87@gmail.com
0006  SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 // clang-format on
0009 
0010 #include "../defmac.h"
0011 
0012 #include <qobjectdefs.h>
0013 #include <QTest>
0014 #include <QtGlobal>
0015 #include <QtTest/qtestcase.h>
0016 
0017 class SigTest: public QObject
0018 {
0019     Q_OBJECT
0020   public:
0021     bool fired = false;
0022    Q_SIGNALS:
0023      void signal();
0024 
0025    public Q_SLOTS:
0026      void slot() { fired=true;};
0027 };
0028 
0029 class ConnectionTest: public QObject
0030 {
0031     Q_OBJECT;
0032   private Q_SLOTS:
0033     void testConnect()
0034     {
0035         SigTest s;
0036 
0037         chk_connect(&s, &SigTest::signal, &s, &SigTest::slot);
0038         Q_EMIT s.signal();
0039         QVERIFY(s.fired);
0040     }
0041 };
0042 
0043 QTEST_MAIN(ConnectionTest);
0044 
0045 #include "connectiontest.moc"