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>
bb10
Edward Welbourne 2021-06-23 10:43:48 +02:00
parent 5edb27c9f5
commit b3deb6a161
1 changed files with 6 additions and 4 deletions

View File

@ -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() );