diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2018-05-19 17:21:38 -0500 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2018-07-05 14:56:12 +0000 |
commit | 340472534cec2bccd634b1e366c2f654a3448fac (patch) | |
tree | 75fdf562dc9484d3e27365eed1eaf8ab6f0c94b9 /tests | |
parent | 22c1a46a03bc3347afc0e7462e19558283d0e1b7 (diff) |
QCborValue: refactor extended types so isTag() is true
This makes QCborValue more future compatible, as code written today for
tags that QCborValue does not recognize will continue to work if
QCborValue gains support for it in the future.
This change also obviates the need for reinterpretAsTag(), which I had
not written unit tests for as I knew this change was coming.
Change-Id: I052407b777ec43f78378fffd15302bdc34f66755
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp index 7f0007b384..8ab43f9fc9 100644 --- a/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp +++ b/tests/auto/corelib/serialization/qcborvalue/tst_qcborvalue.cpp @@ -308,12 +308,13 @@ void tst_QCborValue::extendedTypes() { QFETCH(QCborValue, extended); QFETCH(QCborValue, tagged); - QVERIFY(!extended.isTag()); + QVERIFY(extended.isTag()); QVERIFY(tagged.isTag()); - - // despite that, they actually compare equal QVERIFY(extended == tagged); QVERIFY(tagged == extended); + + QCOMPARE(extended.tag(), tagged.tag()); + QCOMPARE(extended.taggedValue(), tagged.taggedValue()); } void tst_QCborValue::copyCompare() |