tst_QFileInfo::stdfilesystem: add extra Unicode string tests

Pick-to: 6.6
Change-Id: I2b24e1d3cad44897906efffd17803f70bd4d60f6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Thiago Macieira 2023-08-30 12:20:13 -07:00
parent cda98280ed
commit 5b9e2f31bd

View File

@ -2324,6 +2324,18 @@ void tst_QFileInfo::stdfilesystem()
COMPARE_CONSTRUCTION("../file.txt");
COMPARE_CONSTRUCTION("./filæ.txt");
// 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