File: main.cpp

package info (click to toggle)
qt6-remoteobjects 6.9.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,812 kB
  • sloc: cpp: 20,883; sh: 29; makefile: 26
file content (34 lines) | stat: -rw-r--r-- 1,003 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (C) 2019 Ford Motor Company
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#include <QCoreApplication>
#include <QtRemoteObjects/qremoteobjectnode.h>
#include <QtTest/QtTest>

#include "../../../shared/testutils.h"

class tst_Proxy_Process : public QObject
{
    Q_OBJECT

private Q_SLOTS:
    void testRun()
    {
        m_hostNode.reset(new QRemoteObjectHost);
        m_hostNode->setHostUrl(QUrl(QStringLiteral("tcp://127.0.0.1:65213")));
        m_hostNode->proxy(QUrl(LOCAL_SOCKET ":testRegistry"));

        // our proxied object should be added, and then later removed when the server shuts down
        QSignalSpy addSpy(m_hostNode.data(), &QRemoteObjectNode::remoteObjectAdded);
        QSignalSpy removeSpy(m_hostNode.data(), &QRemoteObjectNode::remoteObjectRemoved);
        QVERIFY(addSpy.wait());
        QVERIFY(removeSpy.wait());
    }

private:
    QScopedPointer<QRemoteObjectHost> m_hostNode;
};

QTEST_MAIN(tst_Proxy_Process)

#include "main.moc"