summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
diff options
context:
space:
mode:
authorYuhang Zhao <2546789017@qq.com>2022-10-21 20:54:10 +0800
committerYuhang Zhao <2546789017@qq.com>2022-10-28 09:27:13 +0000
commit32774f13d961c138f82dc50c085c1d66d0a91dd1 (patch)
treeeb23b29139874d8885970a3803db73e97fa50baf /tests/auto/corelib
parent19857fda75d049e64e39ff353d7f5ed3bd342d61 (diff)
QWinRegistryKey: Fix how we handle the default value, take 2
It seems the value name correction is not needed at all, and we must not do such correction. Amends commit 738e05a55a4047268553eea6b9f4809d42181eef Task-number: QTBUG-107794 Change-Id: I903a762aafab4b55275beb8438e6769285821567 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r--tests/auto/corelib/kernel/qwinregistrykey/tst_qwinregistrykey.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/tests/auto/corelib/kernel/qwinregistrykey/tst_qwinregistrykey.cpp b/tests/auto/corelib/kernel/qwinregistrykey/tst_qwinregistrykey.cpp
index 81f75a7bea..897f638dc9 100644
--- a/tests/auto/corelib/kernel/qwinregistrykey/tst_qwinregistrykey.cpp
+++ b/tests/auto/corelib/kernel/qwinregistrykey/tst_qwinregistrykey.cpp
@@ -20,7 +20,7 @@ static const QPair<QStringView, quint32> TEST_DWORD = qMakePair(u"dword", 123);
static const QPair<QStringView, quint64> TEST_QWORD = qMakePair(u"qword", 456);
static const QPair<QStringView, QByteArray> TEST_BINARY = qMakePair(u"binary", "binary\0"_ba);
static const QPair<QStringView, QVariant> TEST_NOT_EXIST = qMakePair(u"not_exist", QVariant());
-static const QPair<QStringView, QVariant> TEST_DEFAULT = qMakePair(u"Default", u"default"_s);
+static const QPair<QStringView, QVariant> TEST_DEFAULT = qMakePair(u"", u"default"_s);
[[nodiscard]] static inline bool write(const HKEY key, const QStringView name, const QVariant &value)
{
@@ -217,12 +217,6 @@ void tst_qwinregistrykey::qwinregistrykey()
}
{
- const auto value = registry.value<QString>(L"");
- QVERIFY(value.has_value());
- QCOMPARE(value.value_or(QString()), TEST_DEFAULT.second);
- }
-
- {
const QString value = registry.stringValue(TEST_STRING.first);
QVERIFY(!value.isEmpty());
QCOMPARE(value, TEST_STRING.second);