[poppler] qt5/tests qt6/tests

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 30 13:10:42 UTC 2023


 qt5/tests/check_utf8document.cpp |   10 +++++-----
 qt6/tests/check_utf8document.cpp |   10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit badfea70ce6d81ce7c9ce0a671c80f53d92a4b83
Author: Sune Vuorela <sune at vuorela.dk>
Date:   Fri Jun 30 15:04:42 2023 +0200

    MSVC unhappy with utf8 in QStringLiteral

diff --git a/qt5/tests/check_utf8document.cpp b/qt5/tests/check_utf8document.cpp
index ebeb22c6..2b14b493 100644
--- a/qt5/tests/check_utf8document.cpp
+++ b/qt5/tests/check_utf8document.cpp
@@ -33,9 +33,9 @@ void TestUtf8Document::checkStrings()
 
     QVERIFY(doc->getOptContentConfig() && doc->getOptContentConfig()->hasOCGs());
 
-    QCOMPARE(Poppler::UnicodeParsedString(doc->getDocInfoTitle().get()), QStringLiteral("表ポあA鷗ŒéB逍Üߪąñ丂㐀𠀀"));
+    QCOMPARE(Poppler::UnicodeParsedString(doc->getDocInfoTitle().get()), QString::fromUtf8("表ポあA鷗ŒéB逍Üߪąñ丂㐀𠀀")); // clazy:exclude=qstring-allocations
 
-    QSet<QString> expectedNames { QStringLiteral("گچپژ"), QStringLiteral("Layer 1") };
+    QSet<QString> expectedNames { QString::fromUtf8("گچپژ"), QString::fromUtf8("Layer 1") }; // clazy:exclude=qstring-allocations
     QSet<QString> foundNames;
 
     for (auto &[ref, group] : doc->getOptContentConfig()->getOCGs()) {
@@ -47,9 +47,9 @@ void TestUtf8Document::checkStrings()
     QVERIFY(outlineItems);
     QCOMPARE(outlineItems->size(), 3);
 
-    QCOMPARE(outlineItemTitle(outlineItems->at(0)), QStringLiteral("PDF 2.0 with UTF-8 test file"));
-    QCOMPARE(outlineItemTitle(outlineItems->at(1)), QStringLiteral("\u202A\u202Atest\u202A"));
-    QCOMPARE(outlineItemTitle(outlineItems->at(2)), QStringLiteral("🌈️\n" /*emoji rainbow flag*/));
+    QCOMPARE(outlineItemTitle(outlineItems->at(0)), QString::fromUtf8("PDF 2.0 with UTF-8 test file")); // clazy:exclude=qstring-allocations
+    QCOMPARE(outlineItemTitle(outlineItems->at(1)), QString::fromUtf8("\u202A\u202Atest\u202A")); // clazy:exclude=qstring-allocations
+    QCOMPARE(outlineItemTitle(outlineItems->at(2)), QString::fromUtf8("🌈️\n" /*emoji rainbow flag*/)); // clazy:exclude=qstring-allocations
 }
 
 QTEST_GUILESS_MAIN(TestUtf8Document)
diff --git a/qt6/tests/check_utf8document.cpp b/qt6/tests/check_utf8document.cpp
index ebeb22c6..2b14b493 100644
--- a/qt6/tests/check_utf8document.cpp
+++ b/qt6/tests/check_utf8document.cpp
@@ -33,9 +33,9 @@ void TestUtf8Document::checkStrings()
 
     QVERIFY(doc->getOptContentConfig() && doc->getOptContentConfig()->hasOCGs());
 
-    QCOMPARE(Poppler::UnicodeParsedString(doc->getDocInfoTitle().get()), QStringLiteral("表ポあA鷗ŒéB逍Üߪąñ丂㐀𠀀"));
+    QCOMPARE(Poppler::UnicodeParsedString(doc->getDocInfoTitle().get()), QString::fromUtf8("表ポあA鷗ŒéB逍Üߪąñ丂㐀𠀀")); // clazy:exclude=qstring-allocations
 
-    QSet<QString> expectedNames { QStringLiteral("گچپژ"), QStringLiteral("Layer 1") };
+    QSet<QString> expectedNames { QString::fromUtf8("گچپژ"), QString::fromUtf8("Layer 1") }; // clazy:exclude=qstring-allocations
     QSet<QString> foundNames;
 
     for (auto &[ref, group] : doc->getOptContentConfig()->getOCGs()) {
@@ -47,9 +47,9 @@ void TestUtf8Document::checkStrings()
     QVERIFY(outlineItems);
     QCOMPARE(outlineItems->size(), 3);
 
-    QCOMPARE(outlineItemTitle(outlineItems->at(0)), QStringLiteral("PDF 2.0 with UTF-8 test file"));
-    QCOMPARE(outlineItemTitle(outlineItems->at(1)), QStringLiteral("\u202A\u202Atest\u202A"));
-    QCOMPARE(outlineItemTitle(outlineItems->at(2)), QStringLiteral("🌈️\n" /*emoji rainbow flag*/));
+    QCOMPARE(outlineItemTitle(outlineItems->at(0)), QString::fromUtf8("PDF 2.0 with UTF-8 test file")); // clazy:exclude=qstring-allocations
+    QCOMPARE(outlineItemTitle(outlineItems->at(1)), QString::fromUtf8("\u202A\u202Atest\u202A")); // clazy:exclude=qstring-allocations
+    QCOMPARE(outlineItemTitle(outlineItems->at(2)), QString::fromUtf8("🌈️\n" /*emoji rainbow flag*/)); // clazy:exclude=qstring-allocations
 }
 
 QTEST_GUILESS_MAIN(TestUtf8Document)


More information about the poppler mailing list