From 9e1eb7ff69436f624a23c336ac76025d2b6e401a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 30 Aug 2023 12:20:13 -0700 Subject: [PATCH] tst_QFileInfo::stdfilesystem: add extra Unicode string tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I2b24e1d3cad44897906efffd17803f70bd4d60f6 Reviewed-by: Ahmad Samir Reviewed-by: Mårten Nordheim (cherry picked from commit 5b9e2f31bd4bc636cf596ef3375317f33041cad5) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp index 4601c0391c3..84f7095de7a 100644 --- a/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp +++ b/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp @@ -2329,6 +2329,18 @@ void tst_QFileInfo::stdfilesystem() COMPARE_CONSTRUCTION("./filæ.txt"); #endif + // Test unicode strings + QCOMPARE(QFileInfo(fs::path(u"./filæ.txt")).absoluteFilePath(), + QFileInfo(u"./filæ.txt"_s).absoluteFilePath()); + QCOMPARE(QFileInfo(base, fs::path(u"./filæ.txt")).absoluteFilePath(), + QFileInfo(base, u"./filæ.txt"_s).absoluteFilePath()); +#ifdef __cpp_char8_t + QCOMPARE(QFileInfo(fs::path(u8"./filæ.txt")).absoluteFilePath(), + QFileInfo(u8"./filæ.txt").absoluteFilePath()); + QCOMPARE(QFileInfo(base, fs::path(u8"./filæ.txt")).absoluteFilePath(), + QFileInfo(base, u8"./filæ.txt").absoluteFilePath()); +#endif + #undef COMPARE_CONSTRUCTION { // One proper comparison with operator== for each ctor