swift
Loading...
Searching...
No Matches
testprocess.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2016 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
7
8#include <QCoreApplication>
9#include <QTest>
10
11#include "test.h"
12
13#include "misc/processinfo.h"
14
15using namespace swift::misc;
16
17namespace MiscTest
18{
20 class CTestProcess : public QObject
21 {
23
24 private slots:
26 void processInfo();
27 };
28
29 void CTestProcess::processInfo()
30 {
31 CProcessInfo invalid;
32 QVERIFY2(!invalid.exists(), "Invalid process shall not exist");
33
37 QVERIFY2(current1.exists(), "Current process shall exist");
38 QVERIFY2(current1 == current2, "Current process equals process with current PID");
39 QVERIFY2(current1 == current3, "Current process equals process with current PID and name");
40 }
41} // namespace MiscTest
42
45
46#include "testprocess.moc"
47
Testing process tools.
Value class identifying a process, with a PID and a name.
Definition processinfo.h:22
bool exists() const
True if this object identifies a process that exists.
Definition processinfo.h:37
static CProcessInfo currentProcess()
Return an object identifying the current process.
Definition processinfo.h:34
Free functions in swift::misc.
qint64 applicationPid()
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
#define SWIFTTEST_MAIN(TestObject)
Implements a main() function that executes all tests in TestObject including instantiating a QCoreApp...
Definition test.h:57