aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler/tests/qmlprofilerattachdialog_test.cpp
blob: 8cbd70df3d9147fb7bc1ab8a68386d1b4f489ee6 (plain)
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
35
36
37
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include "qmlprofilerattachdialog_test.h"

#include <projectexplorer/kitmanager.h>
#include <projectexplorer/kit.h>

#include <QTest>

namespace QmlProfiler::Internal {

QmlProfilerAttachDialogTest::QmlProfilerAttachDialogTest() = default;

void QmlProfilerAttachDialogTest::testAccessors()
{
    QmlProfilerAttachDialog dialog;

    int port = dialog.port();
    QVERIFY(port >= 0);
    QVERIFY(port < 65536);

    dialog.setPort(4444);
    QCOMPARE(dialog.port(), 4444);

    ProjectExplorer::KitManager *kitManager = ProjectExplorer::KitManager::instance();
    QVERIFY(kitManager);
    ProjectExplorer::Kit * const newKit = ProjectExplorer::KitManager::registerKit({}, "dings");
    QVERIFY(newKit);

    dialog.setKitId("dings");
    QCOMPARE(dialog.kit(), newKit);

    ProjectExplorer::KitManager::deregisterKit(newKit);
}

} // namespace QmlProfiler::Internal