summaryrefslogtreecommitdiffstats
path: root/tests/auto/installer/settings
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/installer/settings')
-rw-r--r--tests/auto/installer/settings/data/full_config.xml2
-rw-r--r--tests/auto/installer/settings/data/length_units_invalid.xml2
-rw-r--r--tests/auto/installer/settings/data/length_units_valid_em.xml2
-rw-r--r--tests/auto/installer/settings/data/length_units_valid_ex.xml2
-rw-r--r--tests/auto/installer/settings/data/length_units_valid_px.xml2
-rw-r--r--tests/auto/installer/settings/tst_settings.cpp43
6 files changed, 52 insertions, 1 deletions
diff --git a/tests/auto/installer/settings/data/full_config.xml b/tests/auto/installer/settings/data/full_config.xml
index 272a1b0d7..bccb6f7ca 100644
--- a/tests/auto/installer/settings/data/full_config.xml
+++ b/tests/auto/installer/settings/data/full_config.xml
@@ -37,7 +37,9 @@ File should contain all elements we allow in a config.xml
<DependsOnLocalInstallerBinary>true</DependsOnLocalInstallerBinary>
<AllowSpaceInPath>true</AllowSpaceInPath>
<AllowNonAsciiCharacters>true</AllowNonAsciiCharacters>
+ <AllowRepositoriesForOfflineInstaller>true</AllowRepositoriesForOfflineInstaller>
<DisableAuthorizationFallback>true</DisableAuthorizationFallback>
+ <DisableCommandLineInterface>true</DisableCommandLineInterface>
<RepositorySettingsPageVisible>false</RepositorySettingsPageVisible>
<CreateLocalRepository>false</CreateLocalRepository>
<TargetConfigurationFile>components.xml</TargetConfigurationFile>
diff --git a/tests/auto/installer/settings/data/length_units_invalid.xml b/tests/auto/installer/settings/data/length_units_invalid.xml
index b1dc5aa62..7c5e99dd0 100644
--- a/tests/auto/installer/settings/data/length_units_invalid.xml
+++ b/tests/auto/installer/settings/data/length_units_invalid.xml
@@ -4,4 +4,6 @@
<Version>1.2.3</Version>
<WizardDefaultWidth>800pt</WizardDefaultWidth>
<WizardDefaultHeight>600pt</WizardDefaultHeight>
+ <WizardMinimumWidth>640pt</WizardMinimumWidth>
+ <WizardMinimumHeight>480pt</WizardMinimumHeight>
</Installer>
diff --git a/tests/auto/installer/settings/data/length_units_valid_em.xml b/tests/auto/installer/settings/data/length_units_valid_em.xml
index af087fdfe..81eec5af7 100644
--- a/tests/auto/installer/settings/data/length_units_valid_em.xml
+++ b/tests/auto/installer/settings/data/length_units_valid_em.xml
@@ -4,4 +4,6 @@
<Version>1.2.3</Version>
<WizardDefaultWidth>800em</WizardDefaultWidth>
<WizardDefaultHeight>600em</WizardDefaultHeight>
+ <WizardMinimumWidth>640em</WizardMinimumWidth>
+ <WizardMinimumHeight>480em</WizardMinimumHeight>
</Installer>
diff --git a/tests/auto/installer/settings/data/length_units_valid_ex.xml b/tests/auto/installer/settings/data/length_units_valid_ex.xml
index 3b39cf7a7..633a239ef 100644
--- a/tests/auto/installer/settings/data/length_units_valid_ex.xml
+++ b/tests/auto/installer/settings/data/length_units_valid_ex.xml
@@ -4,4 +4,6 @@
<Version>1.2.3</Version>
<WizardDefaultWidth>800ex</WizardDefaultWidth>
<WizardDefaultHeight>600ex</WizardDefaultHeight>
+ <WizardMinimumWidth>640ex</WizardMinimumWidth>
+ <WizardMinimumHeight>480ex</WizardMinimumHeight>
</Installer>
diff --git a/tests/auto/installer/settings/data/length_units_valid_px.xml b/tests/auto/installer/settings/data/length_units_valid_px.xml
index 3553dd7d8..71518a71c 100644
--- a/tests/auto/installer/settings/data/length_units_valid_px.xml
+++ b/tests/auto/installer/settings/data/length_units_valid_px.xml
@@ -4,4 +4,6 @@
<Version>1.2.3</Version>
<WizardDefaultWidth>800px</WizardDefaultWidth>
<WizardDefaultHeight>600px</WizardDefaultHeight>
+ <WizardMinimumWidth>640px</WizardMinimumWidth>
+ <WizardMinimumHeight>480px</WizardMinimumHeight>
</Installer>
diff --git a/tests/auto/installer/settings/tst_settings.cpp b/tests/auto/installer/settings/tst_settings.cpp
index ab8611e12..15dcc98a1 100644
--- a/tests/auto/installer/settings/tst_settings.cpp
+++ b/tests/auto/installer/settings/tst_settings.cpp
@@ -1,3 +1,31 @@
+/**************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Qt Installer Framework.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+**************************************************************************/
+
#include "settings.h"
#include "errors.h"
#include "repository.h"
@@ -8,6 +36,8 @@
using namespace QInstaller;
+typedef QMap<QString, QVariant> ProductImageMap;
+
class tst_Settings : public QObject
{
Q_OBJECT
@@ -45,6 +75,7 @@ void tst_Settings::loadTutorialConfig()
QCOMPARE(settings.watermark(), QString());
QCOMPARE(settings.banner(), QString());
QCOMPARE(settings.background(), QString());
+ QCOMPARE(settings.pageListPixmap(), QString());
#if defined(Q_OS_WIN)
QCOMPARE(settings.installerApplicationIcon(), QLatin1String(":/installer.ico"));
QCOMPARE(settings.installerWindowIcon(), QLatin1String(":/installer.ico"));
@@ -59,8 +90,12 @@ void tst_Settings::loadTutorialConfig()
QCOMPARE(settings.systemIconSuffix(), QLatin1String(".png"));
#endif
QCOMPARE(settings.wizardStyle(), QString());
- QCOMPARE(settings.wizardDefaultWidth(), 0);
+ QCOMPARE(settings.wizardDefaultWidth(), settings.wizardShowPageList() ? 800 : 0);
QCOMPARE(settings.wizardDefaultHeight(), 0);
+ QCOMPARE(settings.wizardMinimumWidth(), 0);
+ QCOMPARE(settings.wizardMinimumHeight(), 0);
+ QCOMPARE(settings.wizardShowPageList(), true);
+ QCOMPARE(settings.productImages(), ProductImageMap());
QCOMPARE(settings.titleColor(), QString());
QCOMPARE(settings.runProgram(), QString());
QCOMPARE(settings.runProgramArguments(), QStringList());
@@ -74,7 +109,9 @@ void tst_Settings::loadTutorialConfig()
QCOMPARE(settings.repositorySettingsPageVisible(), true);
QCOMPARE(settings.allowSpaceInPath(), true);
QCOMPARE(settings.allowNonAsciiCharacters(), false);
+ QCOMPARE(settings.allowRepositoriesForOfflineInstaller(), true);
QCOMPARE(settings.disableAuthorizationFallback(), false);
+ QCOMPARE(settings.disableCommandLineInterface(), false);
QCOMPARE(settings.createLocalRepository(), false);
QCOMPARE(settings.installActionColumnVisible(), false);
@@ -212,6 +249,8 @@ void tst_Settings::loadConfigWithValidLengthUnits()
Settings settings = Settings::fromFileAndPrefix(":///data/length_units_valid_px.xml", ":///data");
QCOMPARE(settings.wizardDefaultWidth(), 800);
QCOMPARE(settings.wizardDefaultHeight(), 600);
+ QCOMPARE(settings.wizardMinimumWidth(), 640);
+ QCOMPARE(settings.wizardMinimumHeight(), 480);
// Cannot test the parsed values for these units portably since the
// pixel value depends on the font metrics. Let's just check for parse
@@ -229,6 +268,8 @@ void tst_Settings::loadConfigWithInvalidLengthUnits()
Settings settings = Settings::fromFileAndPrefix(":///data/length_units_invalid.xml", ":///data");
QCOMPARE(settings.wizardDefaultWidth(), 0);
QCOMPARE(settings.wizardDefaultHeight(), 0);
+ QCOMPARE(settings.wizardMinimumWidth(), 0);
+ QCOMPARE(settings.wizardMinimumHeight(), 0);
} catch (const Error &error) {
QFAIL(qPrintable(QString::fromLatin1("Exception caught: %1").arg(error.message())));
}