Prepare QSfera production release

This commit is contained in:
Курнат Андрей
2026-06-08 19:57:40 +03:00
parent 2315f25754
commit 43caef7a6a
27 changed files with 1159 additions and 42 deletions
+1
View File
@@ -13,6 +13,7 @@ qsfera_add_test(ConcatUrl)
qsfera_add_test(XmlParse)
qsfera_add_test(ChecksumValidator)
qsfera_add_test(ConnectionValidator)
qsfera_add_test(ConfigFile)
# TODO: we need keychain access for this test
+52
View File
@@ -0,0 +1,52 @@
/*
* Copyright (C) QSfera
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#include "configfile.h"
#include "common/version.h"
#include <QFile>
#include <QTemporaryDir>
#include <QtTest>
using namespace OCC;
using namespace Qt::Literals::StringLiterals;
class TestConfigFile : public QObject
{
Q_OBJECT
private Q_SLOTS:
void init()
{
QVERIFY(_configDir.isValid());
QVERIFY(ConfigFile::setConfDir(_configDir.path()));
QFile::remove(ConfigFile::configFile());
}
void testDefaultUpdateChannelMatchesBuildChannel()
{
const auto expectedChannel = Version::isBeta() ? u"beta"_s : u"stable"_s;
QCOMPARE(ConfigFile().updateChannel(), expectedChannel);
}
void testStoredUpdateChannelOverridesBuildDefault()
{
ConfigFile().setUpdateChannel(u"beta"_s);
QCOMPARE(ConfigFile().updateChannel(), u"beta"_s);
ConfigFile().setUpdateChannel(u"stable"_s);
QCOMPARE(ConfigFile().updateChannel(), u"stable"_s);
}
private:
QTemporaryDir _configDir;
};
QTEST_MAIN(TestConfigFile)
#include "testconfigfile.moc"