diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2022-10-12 19:57:43 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2022-10-18 14:13:28 +0200 |
commit | b9b516f42e8e99b85dac0f512686a43b9be3d2bb (patch) | |
tree | e67a525343e2381324df29966af399df51c09b2f /tests/auto/corelib | |
parent | d39f1da6e384b9540d2d163d7a7a84371e231c11 (diff) |
Ignore the warning for all types in tst_QCborValue's mapFromArray*()
For some reason the QTest::ignoreMessage() was conditioned on the type
being tested being Array; however, the warning is in fact produced for
all types. So anticipate it for all and make the test log less noisy.
Change-Id: I78681624252ff8a71f080204f8b031609ddac468
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r-- | tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp index 82e2309680..0a36aa2084 100644 --- a/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp +++ b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp @@ -900,11 +900,6 @@ template <typename T> static void mapFromArray_template(T key) if (v.isMap()) return; // already a map, nothing will happen - auto ignoreMessage = [type]() { - if (type == QCborValue::Array) - QTest::ignoreMessage(QtWarningMsg, "Using CBOR array as map forced conversion"); - }; - // verify forced conversions work // (our only Array row is an empty array, so it doesn't produce the warning) QCborValue v2 = v; @@ -918,7 +913,7 @@ template <typename T> static void mapFromArray_template(T key) // non-empty array conversions QCborValue va = QCborArray{v}; v2 = va; - ignoreMessage(); + QTest::ignoreMessage(QtWarningMsg, "Using CBOR array as map forced conversion"); QVERIFY(v2[key].isUndefined()); QCOMPARE(v2.type(), QCborValue::Map); QCOMPARE(va.type(), QCborValue::Array); |