2020-08-25 16:05:56 +02:00
|
|
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
2020-06-23 14:43:26 +02:00
|
|
|
*
|
|
|
|
* SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "Config.h"
|
|
|
|
|
|
|
|
#include "utils/Logger.h"
|
|
|
|
|
|
|
|
#include <QObject>
|
2020-08-25 23:44:08 +02:00
|
|
|
#include <QtTest/QtTest>
|
2020-06-23 14:43:26 +02:00
|
|
|
|
|
|
|
class TrackingTests : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
TrackingTests();
|
|
|
|
~TrackingTests() override;
|
|
|
|
|
|
|
|
private Q_SLOTS:
|
|
|
|
void initTestCase();
|
|
|
|
void testEmptyConfig();
|
|
|
|
};
|
|
|
|
|
|
|
|
TrackingTests::TrackingTests()
|
|
|
|
: QObject()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2020-08-25 23:44:08 +02:00
|
|
|
TrackingTests::~TrackingTests() {}
|
2020-06-23 14:43:26 +02:00
|
|
|
|
2020-08-25 23:44:08 +02:00
|
|
|
void
|
|
|
|
TrackingTests::initTestCase()
|
2020-06-23 14:43:26 +02:00
|
|
|
{
|
|
|
|
Logger::setupLogLevel( Logger::LOGDEBUG );
|
|
|
|
cDebug() << "Tracking test started.";
|
|
|
|
}
|
|
|
|
|
2020-08-25 23:44:08 +02:00
|
|
|
void
|
|
|
|
TrackingTests::testEmptyConfig()
|
2020-06-23 14:43:26 +02:00
|
|
|
{
|
|
|
|
Logger::setupLogLevel( Logger::LOGDEBUG );
|
|
|
|
|
|
|
|
Config* c = new Config;
|
|
|
|
QVERIFY( c->generalPolicy().isEmpty() );
|
|
|
|
QVERIFY( c->installTracking() ); // not-nullptr
|
|
|
|
|
|
|
|
cDebug() << "Install" << Logger::Pointer( c->installTracking() );
|
|
|
|
|
|
|
|
delete c; // also deletes the owned tracking-configs
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QTEST_GUILESS_MAIN( TrackingTests )
|
|
|
|
|
|
|
|
#include "utils/moc-warnings.h"
|
|
|
|
|
|
|
|
#include "Tests.moc"
|