diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2024-10-08 13:45:25 +0200 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2024-10-24 14:19:24 +0200 |
| commit | 46795bcfaa79582a50bc2c308e9d921f8697268b (patch) | |
| tree | 7a3858d7b5f8a20f3e829ac97ce0dc3298e67c58 /tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | |
| parent | 40a96513ba92ebd35e25af0e86b329712c7bdd98 (diff) | |
tst_qmlcppcodegen: Prevent crashes on failure
You can QCOMPARE a QString to a unicode literal, but if the comparison
fails, it cannot print the result.
Change-Id: Iceea7074ecb893bc0c514d3b872e33b786edac84
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp')
| -rw-r--r-- | tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp index a669ca4e39..70ad1cb926 100644 --- a/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp +++ b/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp @@ -1799,11 +1799,11 @@ void tst_QmlCppCodegen::equalityVarAndStorable() QVERIFY(p->objectName().isEmpty()); QMetaObject::invokeMethod(p.data(), "typeErasedRemoveOne", v.data()); - QCOMPARE(p->objectName(), u"n"); + QCOMPARE(p->objectName(), u"n"_s); v->setProperty("value", 1); QMetaObject::invokeMethod(p.data(), "typeErasedRemoveOne", v.data()); - QCOMPARE(p->objectName(), u"nd"); + QCOMPARE(p->objectName(), u"nd"_s); QQmlComponent constraint(&engine, QUrl(u"qrc:/qt/qml/TestTypes/BaseConstraint.qml"_s)); QVERIFY2(!constraint.isError(), qPrintable(constraint.errorString())); |
