diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-06-23 10:43:48 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-06-24 16:35:41 +0200 |
commit | b3deb6a1616582e89a88870f30c69bec74c6baed (patch) | |
tree | 034b49dd7d2a5fb6dc9df7683a4079c9dd4603db /tests/auto/corelib | |
parent | 5edb27c9f542da43d7eea25824b6d0c057acc861 (diff) |
Expand a test that QVariant isn't null even when what it wraps is
Match the checks in the constructor test that are similar.
Change-Id: Ifb62af09e31aac339f001f44bc30789330c85be6
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r-- | tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp index 4e5eb430a2..600a99e72c 100644 --- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp +++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com> ** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ @@ -410,9 +410,11 @@ void tst_QVariant::isNull() QVariant var; QVERIFY( var.isNull() ); - QString str1; - QVariant var1( str1 ); - QVERIFY( !var1.isNull() ); + QVariant empty = QString(); + QVERIFY(empty.toString().isNull()); + QVERIFY(!empty.isNull()); + QVERIFY(empty.isValid()); + QCOMPARE(empty.typeName(), "QString"); QVariant var3( QString( "blah" ) ); QVERIFY( !var3.isNull() ); |