Replace uses of _qs with _s in tests
Task-number: QTBUG-101408 Change-Id: If092a68828a1e8056259cf90d035d9a87989244b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
f5174abec3
commit
a885f28933
@ -75,6 +75,8 @@ extern Q_CORE_EXPORT int qt_ntfs_permission_lookup;
|
||||
#include "private/qdir_p.h"
|
||||
#endif
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
static QByteArray msgDoesNotExist(const QString &name)
|
||||
{
|
||||
return (QLatin1Char('"') + QDir::toNativeSeparators(name)
|
||||
@ -490,7 +492,7 @@ void tst_QDir::mkdirWithPermissions()
|
||||
QFile::ReadOwner, QFile::WriteOwner, QFile::ExeOwner
|
||||
};
|
||||
|
||||
const QString path = u"tmpdir"_qs;
|
||||
const QString path = u"tmpdir"_s;
|
||||
QDir dir;
|
||||
auto deleteDirectory = qScopeGuard([&dir, &path] { dir.rmdir(path); });
|
||||
|
||||
@ -1332,19 +1334,19 @@ tst_QDir::cleanPath_data()
|
||||
QTest::newRow("unc-server-up") << "//server/path/.." << "//server";
|
||||
QTest::newRow("unc-server-above-root") << "//server/.." << "//server/..";
|
||||
|
||||
QTest::newRow("longpath") << uR"(\\?\d:\)"_qs << u"d:/"_qs;
|
||||
QTest::newRow("longpath-slash") << u"//?/d:/"_qs << u"d:/"_qs;
|
||||
QTest::newRow("longpath-mixed-slashes") << uR"(//?/d:\)"_qs << u"d:/"_qs;
|
||||
QTest::newRow("longpath-mixed-slashes-2") << uR"(\\?\d:/)"_qs << u"d:/"_qs;
|
||||
QTest::newRow("longpath") << uR"(\\?\d:\)"_s << u"d:/"_s;
|
||||
QTest::newRow("longpath-slash") << u"//?/d:/"_s << u"d:/"_s;
|
||||
QTest::newRow("longpath-mixed-slashes") << uR"(//?/d:\)"_s << u"d:/"_s;
|
||||
QTest::newRow("longpath-mixed-slashes-2") << uR"(\\?\d:/)"_s << u"d:/"_s;
|
||||
|
||||
QTest::newRow("unc-network-share") << uR"(\\?\UNC\localhost\c$\tmp.txt)"_qs
|
||||
<< u"//localhost/c$/tmp.txt"_qs;
|
||||
QTest::newRow("unc-network-share-slash") << u"//?/UNC/localhost/c$/tmp.txt"_qs
|
||||
<< u"//localhost/c$/tmp.txt"_qs;
|
||||
QTest::newRow("unc-network-share-mixed-slashes") << uR"(//?/UNC/localhost\c$\tmp.txt)"_qs
|
||||
<< u"//localhost/c$/tmp.txt"_qs;
|
||||
QTest::newRow("unc-network-share-mixed-slashes-2") << uR"(\\?\UNC\localhost/c$/tmp.txt)"_qs
|
||||
<< u"//localhost/c$/tmp.txt"_qs;
|
||||
QTest::newRow("unc-network-share") << uR"(\\?\UNC\localhost\c$\tmp.txt)"_s
|
||||
<< u"//localhost/c$/tmp.txt"_s;
|
||||
QTest::newRow("unc-network-share-slash") << u"//?/UNC/localhost/c$/tmp.txt"_s
|
||||
<< u"//localhost/c$/tmp.txt"_s;
|
||||
QTest::newRow("unc-network-share-mixed-slashes") << uR"(//?/UNC/localhost\c$\tmp.txt)"_s
|
||||
<< u"//localhost/c$/tmp.txt"_s;
|
||||
QTest::newRow("unc-network-share-mixed-slashes-2") << uR"(\\?\UNC\localhost/c$/tmp.txt)"_s
|
||||
<< u"//localhost/c$/tmp.txt"_s;
|
||||
#else
|
||||
QTest::newRow("data15") << "//c:/foo" << "/c:/foo";
|
||||
#endif // non-windows
|
||||
@ -1743,9 +1745,9 @@ void tst_QDir::dotAndDotDot()
|
||||
{
|
||||
QDir dir(QString((m_dataPath + "/testdir/")));
|
||||
QStringList entryList = dir.entryList(QDir::Dirs);
|
||||
QCOMPARE(entryList, QStringList({ u"."_qs, u".."_qs, u"dir"_qs, u"dir.lnk"_qs, u"spaces"_qs }));
|
||||
QCOMPARE(entryList, QStringList({ u"."_s, u".."_s, u"dir"_s, u"dir.lnk"_s, u"spaces"_s }));
|
||||
entryList = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||
QCOMPARE(entryList, QStringList({ u"dir"_qs, u"dir.lnk"_qs, u"spaces"_qs }));
|
||||
QCOMPARE(entryList, QStringList({ u"dir"_s, u"dir.lnk"_s, u"spaces"_s }));
|
||||
}
|
||||
|
||||
void tst_QDir::homePath()
|
||||
@ -1820,10 +1822,10 @@ void tst_QDir::nativeSeparators()
|
||||
QCOMPARE(QDir::fromNativeSeparators(QLatin1String("/")), QString("/"));
|
||||
QCOMPARE(QDir::fromNativeSeparators(QLatin1String("\\")), QString("/"));
|
||||
QCOMPARE(QDir::fromNativeSeparators(QLatin1String("\\\\?\\C:\\")), QString("C:/"));
|
||||
QCOMPARE(QDir::fromNativeSeparators(uR"(\\?\UNC\localhost\c$\tmp.txt)"_qs),
|
||||
u"//localhost/c$/tmp.txt"_qs);
|
||||
QCOMPARE(QDir::fromNativeSeparators(uR"(//?/UNC/localhost\c$\tmp.txt)"_qs),
|
||||
u"//localhost/c$/tmp.txt"_qs);
|
||||
QCOMPARE(QDir::fromNativeSeparators(uR"(\\?\UNC\localhost\c$\tmp.txt)"_s),
|
||||
u"//localhost/c$/tmp.txt"_s);
|
||||
QCOMPARE(QDir::fromNativeSeparators(uR"(//?/UNC/localhost\c$\tmp.txt)"_s),
|
||||
u"//localhost/c$/tmp.txt"_s);
|
||||
#else
|
||||
QCOMPARE(QDir::toNativeSeparators(QLatin1String("/")), QString("/"));
|
||||
QCOMPARE(QDir::toNativeSeparators(QLatin1String("\\")), QString("\\"));
|
||||
|
@ -119,6 +119,8 @@ QT_END_NAMESPACE
|
||||
#define QT_OPEN_BINARY 0
|
||||
#endif
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
Q_DECLARE_METATYPE(QFile::FileError)
|
||||
|
||||
|
||||
@ -1302,7 +1304,7 @@ void tst_QFile::createFilePermissions()
|
||||
QFile::ReadOwner, QFile::WriteOwner, QFile::ExeOwner
|
||||
};
|
||||
|
||||
const QString fileName = u"createme.txt"_qs;
|
||||
const QString fileName = u"createme.txt"_s;
|
||||
|
||||
QFile::remove(fileName);
|
||||
QVERIFY(!QFile::exists(fileName));
|
||||
|
@ -77,6 +77,8 @@ QT_END_NAMESPACE
|
||||
bool IsUserAdmin();
|
||||
#endif
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
inline bool qIsLikelyToBeFat(const QString &path)
|
||||
{
|
||||
QByteArray name = QStorageInfo(path).fileSystemType().toLower();
|
||||
@ -1853,14 +1855,14 @@ void tst_QFileInfo::ntfsJunctionPointsAndSymlinks()
|
||||
creationResult.target = creationResult.target.sliced(4);
|
||||
|
||||
// resolve volume to drive letter
|
||||
static const QRegularExpression matchVolumeRe(uR"(^Volume\{([a-z]|[0-9]|-)+\}\\)"_qs,
|
||||
static const QRegularExpression matchVolumeRe(uR"(^Volume\{([a-z]|[0-9]|-)+\}\\)"_s,
|
||||
QRegularExpression::CaseInsensitiveOption);
|
||||
auto matchVolume = matchVolumeRe.match(creationResult.target);
|
||||
if (matchVolume.hasMatch()) {
|
||||
Q_ASSERT(matchVolume.capturedStart() == 0);
|
||||
DWORD len;
|
||||
wchar_t buffer[MAX_PATH];
|
||||
const QString volumeName = uR"(\\?\)"_qs + matchVolume.captured();
|
||||
const QString volumeName = uR"(\\?\)"_s + matchVolume.captured();
|
||||
if (GetVolumePathNamesForVolumeName(reinterpret_cast<LPCWSTR>(volumeName.utf16()),
|
||||
buffer, MAX_PATH, &len) != 0) {
|
||||
creationResult.target.replace(0, matchVolume.capturedLength(),
|
||||
|
@ -30,6 +30,8 @@
|
||||
|
||||
#include <QtCore/private/qfilesystementry_p.h>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
class tst_QFileSystemEntry : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -106,12 +108,12 @@ void tst_QFileSystemEntry::getSetCheck_data()
|
||||
<< "A:dir/without/leading/backslash.bat" << "backslash.bat" << "backslash" << "backslash" << "bat" << "bat" << false << false;
|
||||
|
||||
QTest::newRow("longpath")
|
||||
<< uR"(\\?\D:\)"_qs
|
||||
<< uR"(\\?\D:\)"_s
|
||||
<< absPrefix + QLatin1String(R"(D:\)")
|
||||
<< "D:/" << "" << "" << "" << "" << "" << true << false;
|
||||
|
||||
QTest::newRow("uncprefix")
|
||||
<< uR"(\\?\UNC\localhost\C$\tmp.txt)"_qs
|
||||
<< uR"(\\?\UNC\localhost\C$\tmp.txt)"_s
|
||||
<< absPrefix + QLatin1String(R"(UNC\localhost\C$\tmp.txt)")
|
||||
<< "//localhost/C$/tmp.txt" << "tmp.txt" << "tmp" << "tmp" << "txt" << "txt" << true
|
||||
<< false;
|
||||
|
@ -51,6 +51,8 @@
|
||||
|
||||
#include <optional>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
class tst_QTemporaryDir : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -224,19 +226,19 @@ void tst_QTemporaryDir::fileTemplate_data()
|
||||
return; // skip if we have no drive letter
|
||||
|
||||
tmp.data()[1] = u'$';
|
||||
const auto tmpPath = tmp + uR"(\UNC.XXXXXX.tmpDir)"_qs;
|
||||
const auto tmpPath = tmp + uR"(\UNC.XXXXXX.tmpDir)"_s;
|
||||
|
||||
QTest::newRow("UNC-backslash")
|
||||
<< uR"(\\localhost\)"_qs + tmpPath << "UNC."
|
||||
<< uR"(\\localhost\)"_s + tmpPath << "UNC."
|
||||
<< ".tmpDir";
|
||||
QTest::newRow("UNC-prefix")
|
||||
<< uR"(\\?\UNC\localhost\)"_qs + tmpPath << "UNC."
|
||||
<< uR"(\\?\UNC\localhost\)"_s + tmpPath << "UNC."
|
||||
<< ".tmpDir";
|
||||
QTest::newRow("UNC-slash")
|
||||
<< u"//localhost/"_qs + QDir::fromNativeSeparators(tmpPath) << "UNC."
|
||||
<< u"//localhost/"_s + QDir::fromNativeSeparators(tmpPath) << "UNC."
|
||||
<< ".tmpDir";
|
||||
QTest::newRow("UNC-prefix-slash")
|
||||
<< uR"(//?/UNC/localhost/)"_qs + QDir::fromNativeSeparators(tmpPath) << "UNC."
|
||||
<< uR"(//?/UNC/localhost/)"_s + QDir::fromNativeSeparators(tmpPath) << "UNC."
|
||||
<< ".tmpDir";
|
||||
#endif
|
||||
}
|
||||
|
@ -60,6 +60,8 @@
|
||||
#include "qplatformdefs.h"
|
||||
#endif
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
class tst_QTemporaryFile : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -218,22 +220,22 @@ void tst_QTemporaryFile::fileTemplate_data()
|
||||
return; // skip if we have no drive letter
|
||||
|
||||
tmp.data()[1] = u'$';
|
||||
const auto tmpPath = tmp + uR"(\QTBUG-74291.XXXXXX.tmpFile)"_qs;
|
||||
const auto tmpPath = tmp + uR"(\QTBUG-74291.XXXXXX.tmpFile)"_s;
|
||||
|
||||
QTest::newRow("UNC-backslash")
|
||||
<< uR"(\\localhost\)"_qs + tmpPath << "QTBUG-74291."
|
||||
<< uR"(\\localhost\)"_s + tmpPath << "QTBUG-74291."
|
||||
<< ".tmpFile"
|
||||
<< "";
|
||||
QTest::newRow("UNC-prefix")
|
||||
<< uR"(\\?\UNC\localhost\)"_qs + tmpPath << "QTBUG-74291."
|
||||
<< uR"(\\?\UNC\localhost\)"_s + tmpPath << "QTBUG-74291."
|
||||
<< ".tmpFile"
|
||||
<< "";
|
||||
QTest::newRow("UNC-slash")
|
||||
<< u"//localhost/"_qs + QDir::fromNativeSeparators(tmpPath) << "QTBUG-74291."
|
||||
<< u"//localhost/"_s + QDir::fromNativeSeparators(tmpPath) << "QTBUG-74291."
|
||||
<< ".tmpFile"
|
||||
<< "";
|
||||
QTest::newRow("UNC-prefix-slash")
|
||||
<< uR"(//?/UNC/localhost/)"_qs + QDir::fromNativeSeparators(tmpPath) << "QTBUG-74291."
|
||||
<< uR"(//?/UNC/localhost/)"_s + QDir::fromNativeSeparators(tmpPath) << "QTBUG-74291."
|
||||
<< ".tmpFile"
|
||||
<< "";
|
||||
#endif
|
||||
|
@ -40,6 +40,8 @@
|
||||
|
||||
#include <QtTest/private/qemulationdetector_p.h>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
Q_DECLARE_METATYPE(QUrl::FormattingOptions)
|
||||
|
||||
class tst_QUrl : public QObject
|
||||
@ -2085,7 +2087,7 @@ void tst_QUrl::hasQuery()
|
||||
void tst_QUrl::nameprep()
|
||||
{
|
||||
// U+FB01 LATIN SMALL LIGATURE FI
|
||||
QUrl url(u"http://www.\uFB01le.de/"_qs);
|
||||
QUrl url(u"http://www.\uFB01le.de/"_s);
|
||||
QCOMPARE(url.toString(), QStringLiteral(u"http://www.file.de/"));
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,8 @@
|
||||
#define STRINGPREP_BIDI_BOTH_L_AND_RAL 4
|
||||
#define STRINGPREP_BIDI_LEADTRAIL_NOT_RAL 5
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
struct char16array {
|
||||
char16array() {}
|
||||
template <size_t N>
|
||||
@ -259,8 +261,8 @@ void tst_QUrlInternal::ace_testsuite_data()
|
||||
QTest::newRow("ascii-upper") << "FLUKE" << "fluke" << "fluke" << "fluke";
|
||||
|
||||
// U+FB01 LATIN SMALL LIGATURE FI
|
||||
QTest::newRow("asciifolded") << u"\uFB01le"_qs << "file" << "." << "file";
|
||||
QTest::newRow("asciifolded-dotcom") << u"\uFB01le.example.com"_qs << "file.example.com" << "." << "file.example.com";
|
||||
QTest::newRow("asciifolded") << u"\uFB01le"_s << "file" << "." << "file";
|
||||
QTest::newRow("asciifolded-dotcom") << u"\uFB01le.example.com"_s << "file.example.com" << "." << "file.example.com";
|
||||
QTest::newRow("greek-mu") << QString::fromLatin1("\265V")
|
||||
<<"xn--v-lmb"
|
||||
<< "."
|
||||
|
@ -41,7 +41,7 @@
|
||||
#endif
|
||||
|
||||
using namespace QtPrivate;
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
struct DtorCounter {
|
||||
static inline int counter = 0;
|
||||
@ -1697,9 +1697,9 @@ public:
|
||||
|
||||
Q_INVOKABLE bool bindingTest()
|
||||
{
|
||||
QProperty<QString> name(u"inThread"_qs);
|
||||
QProperty<QString> name(u"inThread"_s);
|
||||
bindableObjectName().setBinding([&]() -> QString { return name; });
|
||||
name = u"inThreadChanged"_qs;
|
||||
name = u"inThreadChanged"_s;
|
||||
const bool nameChangedCorrectly = objectName() == name;
|
||||
bindableObjectName().takeBinding();
|
||||
return nameChangedCorrectly;
|
||||
|
@ -44,6 +44,8 @@
|
||||
#include <QtGui/QPixmap>
|
||||
#include <QtGui/QTextLength>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
static_assert(QTypeTraits::has_ostream_operator_v<QDataStream, int>);
|
||||
static_assert(QTypeTraits::has_ostream_operator_v<QDataStream, QList<int>>);
|
||||
static_assert(QTypeTraits::has_ostream_operator_v<QDataStream, QMap<int, QString>>);
|
||||
@ -3904,7 +3906,7 @@ void tst_QDataStream::typedefQt5Compat()
|
||||
// writing in Qt 6 results in the same file
|
||||
QTemporaryDir dir;
|
||||
QVERIFY(dir.isValid());
|
||||
QFile file(dir.filePath(u"typedef.q6"_qs));
|
||||
QFile file(dir.filePath(u"typedef.q6"_s));
|
||||
file.open(QIODevice::WriteOnly);
|
||||
QDataStream stream(&file);
|
||||
stream.setVersion(QDataStream::Qt_5_15);
|
||||
|
@ -67,6 +67,8 @@
|
||||
# define ONLY_WIN(expr) QSKIP("This is a Windows-only test")
|
||||
#endif
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
template <typename T>
|
||||
constexpr inline bool CanConvert = std::is_convertible_v<T, QAnyStringView>;
|
||||
|
||||
@ -312,7 +314,7 @@ private Q_SLOTS:
|
||||
void fromChar16TContainers() const { fromContainers<char16_t>(); }
|
||||
void fromWCharTContainers() const { ONLY_WIN(fromContainers<wchar_t>()); }
|
||||
|
||||
void fromQStringBuilder_QString_QString() const { fromQStringBuilder(u"1"_qs % u"2"_qs, u"12"); }
|
||||
void fromQStringBuilder_QString_QString() const { fromQStringBuilder(u"1"_s % u"2"_s, u"12"); }
|
||||
|
||||
void comparison();
|
||||
|
||||
|
@ -56,6 +56,8 @@
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
Q_DECLARE_METATYPE(QLocale::FormatType)
|
||||
|
||||
class tst_QLocale : public QObject
|
||||
@ -2541,7 +2543,7 @@ void tst_QLocale::dayName_data()
|
||||
QTest::newRow("ru_RU short")
|
||||
<< QString("ru_RU") << QString::fromUtf8("\320\262\321\201") << 7 << QLocale::ShortFormat;
|
||||
QTest::newRow("ru_RU narrow")
|
||||
<< QString("ru_RU") << u"\u0412"_qs << 7 << QLocale::NarrowFormat;
|
||||
<< QString("ru_RU") << u"\u0412"_s << 7 << QLocale::NarrowFormat;
|
||||
}
|
||||
|
||||
void tst_QLocale::dayName()
|
||||
@ -3589,18 +3591,18 @@ void tst_QLocale::lcsToCode()
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::AnyLanguage), QString());
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::C), QString("C"));
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::English), QString("en"));
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::Albanian), u"sq"_qs);
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::Albanian, QLocale::ISO639Part1), u"sq"_qs);
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::Albanian, QLocale::ISO639Part2B), u"alb"_qs);
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::Albanian, QLocale::ISO639Part2T), u"sqi"_qs);
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::Albanian, QLocale::ISO639Part3), u"sqi"_qs);
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::Albanian), u"sq"_s);
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::Albanian, QLocale::ISO639Part1), u"sq"_s);
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::Albanian, QLocale::ISO639Part2B), u"alb"_s);
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::Albanian, QLocale::ISO639Part2T), u"sqi"_s);
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::Albanian, QLocale::ISO639Part3), u"sqi"_s);
|
||||
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::Taita), u"dav"_qs);
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::Taita), u"dav"_s);
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::Taita,
|
||||
QLocale::ISO639Part1 | QLocale::ISO639Part2B
|
||||
| QLocale::ISO639Part2T),
|
||||
QString());
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::Taita, QLocale::ISO639Part3), u"dav"_qs);
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::Taita, QLocale::ISO639Part3), u"dav"_s);
|
||||
QCOMPARE(QLocale::languageToCode(QLocale::English, QLocale::LanguageCodeTypes {}), QString());
|
||||
|
||||
// Legacy codes can only be used to convert them to Language values, not other way around.
|
||||
|
@ -32,6 +32,8 @@
|
||||
#include <qstringconverter.h>
|
||||
#include <qthreadpool.h>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
class tst_QStringConverter : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -171,7 +173,7 @@ void tst_QStringConverter::roundtrip_data()
|
||||
// TODO: include flag variations, too.
|
||||
|
||||
for (const auto code : codes) {
|
||||
QTest::addRow("empty-%s", code.name) << u""_qs << code.code;
|
||||
QTest::addRow("empty-%s", code.name) << u""_s << code.code;
|
||||
{
|
||||
const char32_t zeroVal = 0x11136; // Unicode's representation of Chakma zero
|
||||
const QChar data[] = {
|
||||
|
@ -55,6 +55,8 @@
|
||||
# undef interface
|
||||
#endif
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
class SenderObject : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -4305,7 +4307,7 @@ void tst_QFuture::whenAllDifferentTypesWithCanceled()
|
||||
QPromise<int> pInt;
|
||||
QPromise<QString> pString;
|
||||
|
||||
const QString someValue = u"some value"_qs;
|
||||
const QString someValue = u"some value"_s;
|
||||
|
||||
bool finished = false;
|
||||
using Futures = std::variant<QFuture<int>, QFuture<QString>>;
|
||||
@ -4344,7 +4346,7 @@ void tst_QFuture::whenAllDifferentTypesWithFailed()
|
||||
QPromise<int> pInt;
|
||||
QPromise<QString> pString;
|
||||
|
||||
const QString someValue = u"some value"_qs;
|
||||
const QString someValue = u"some value"_s;
|
||||
|
||||
bool finished = false;
|
||||
using Futures = std::variant<QFuture<int>, QFuture<QString>>;
|
||||
|
@ -39,6 +39,8 @@
|
||||
|
||||
#include <qsemaphore.h>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
class tst_QHash : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -2771,7 +2773,7 @@ void tst_QHash::lookupUsingKeyIterator()
|
||||
qsizetype rehashLimit = minCapacity == 64 ? 63 : 8;
|
||||
|
||||
for (char16_t c = u'a'; c <= u'a' + rehashLimit; ++c)
|
||||
hash.insert(QString(QChar(c)), u"h"_qs);
|
||||
hash.insert(QString(QChar(c)), u"h"_s);
|
||||
|
||||
for (auto it = hash.keyBegin(), end = hash.keyEnd(); it != end; ++it)
|
||||
QVERIFY(!hash[*it].isEmpty());
|
||||
|
@ -52,6 +52,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
#define WAITTIME 1000
|
||||
|
||||
// Will try to wait for the condition while allowing event processing
|
||||
@ -233,17 +235,17 @@ void tst_QFileSystemModel::rootPath()
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
// check case insensitive root node on windows, tests QTBUG-71701
|
||||
QModelIndex index = model->setRootPath(uR"(\\localhost\c$)"_qs);
|
||||
QModelIndex index = model->setRootPath(uR"(\\localhost\c$)"_s);
|
||||
QVERIFY(index.isValid());
|
||||
QCOMPARE(model->rootPath(), u"//localhost/c$"_qs);
|
||||
QCOMPARE(model->rootPath(), u"//localhost/c$"_s);
|
||||
|
||||
index = model->setRootPath(uR"(\\localhost\C$)"_qs);
|
||||
index = model->setRootPath(uR"(\\localhost\C$)"_s);
|
||||
QVERIFY(index.isValid());
|
||||
QCOMPARE(model->rootPath(), u"//localhost/C$"_qs);
|
||||
QCOMPARE(model->rootPath(), u"//localhost/C$"_s);
|
||||
|
||||
index = model->setRootPath(uR"(\\LOCALHOST\C$)"_qs);
|
||||
index = model->setRootPath(uR"(\\LOCALHOST\C$)"_s);
|
||||
QVERIFY(index.isValid());
|
||||
QCOMPARE(model->rootPath(), u"//LOCALHOST/C$"_qs);
|
||||
QCOMPARE(model->rootPath(), u"//LOCALHOST/C$"_s);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,8 @@
|
||||
#include <private/qfontengine_p.h>
|
||||
#include <qpa/qplatformfontdatabase.h>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
Q_LOGGING_CATEGORY(lcTests, "qt.text.tests")
|
||||
|
||||
class tst_QFontDatabase : public QObject
|
||||
@ -504,26 +506,26 @@ void tst_QFontDatabase::registerOpenTypePreferredNamesApplication()
|
||||
#ifdef Q_OS_WIN
|
||||
void tst_QFontDatabase::findCourier()
|
||||
{
|
||||
QFont font = QFontDatabase::font(u"Courier"_qs, u""_qs, 16);
|
||||
QFont font = QFontDatabase::font(u"Courier"_s, u""_s, 16);
|
||||
QFontInfo info(font);
|
||||
QCOMPARE(info.family(), u"Courier New"_qs);
|
||||
QCOMPARE(info.family(), u"Courier New"_s);
|
||||
QCOMPARE(info.pointSize(), 16);
|
||||
|
||||
font = QFontDatabase::font("Courier", "", 64);
|
||||
info = font;
|
||||
QCOMPARE(info.family(), u"Courier New"_qs);
|
||||
QCOMPARE(info.family(), u"Courier New"_s);
|
||||
QCOMPARE(info.pointSize(), 64);
|
||||
|
||||
// By setting "PreferBitmap" we should get Courier itself.
|
||||
font.setStyleStrategy(QFont::PreferBitmap);
|
||||
info = font;
|
||||
QCOMPARE(info.family(), u"Courier"_qs);
|
||||
QCOMPARE(info.family(), u"Courier"_s);
|
||||
// Which has an upper bound on point size
|
||||
QCOMPARE(info.pointSize(), 19);
|
||||
|
||||
font.setStyleStrategy(QFont::PreferDefault);
|
||||
info = font;
|
||||
QCOMPARE(info.family(), u"Courier New"_qs);
|
||||
QCOMPARE(info.family(), u"Courier New"_s);
|
||||
QCOMPARE(info.pointSize(), 64);
|
||||
}
|
||||
#endif
|
||||
|
@ -31,6 +31,8 @@
|
||||
#include <qdesktopservices.h>
|
||||
#include <qregularexpression.h>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
class tst_qdesktopservices : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -78,8 +80,8 @@ void tst_qdesktopservices::handlers()
|
||||
QDesktopServices::setUrlHandler(QString("bar"), &barHandler, "handle");
|
||||
#ifndef CAN_IMPLICITLY_UNSET
|
||||
const auto unsetHandlers = qScopeGuard([] {
|
||||
QDesktopServices::unsetUrlHandler(u"bar"_qs);
|
||||
QDesktopServices::unsetUrlHandler(u"foo"_qs);
|
||||
QDesktopServices::unsetUrlHandler(u"bar"_s);
|
||||
QDesktopServices::unsetUrlHandler(u"foo"_s);
|
||||
});
|
||||
#endif
|
||||
|
||||
|
@ -107,6 +107,8 @@ Q_DECLARE_METATYPE(QNetworkProxyQuery)
|
||||
|
||||
typedef QSharedPointer<QNetworkReply> QNetworkReplyPtr;
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
#if QT_CONFIG(ssl)
|
||||
QT_BEGIN_NAMESPACE
|
||||
// Technically, a workaround, and only needed for OpenSSL:
|
||||
@ -8050,10 +8052,10 @@ void tst_QNetworkReply::varyingCacheExpiry()
|
||||
server.doClose = false;
|
||||
|
||||
QUrl urls[4] = {
|
||||
u"http://localhost"_qs,
|
||||
u"http://localhost"_qs,
|
||||
u"http://localhost"_qs,
|
||||
u"http://localhost"_qs,
|
||||
u"http://localhost"_s,
|
||||
u"http://localhost"_s,
|
||||
u"http://localhost"_s,
|
||||
u"http://localhost"_s,
|
||||
};
|
||||
for (size_t i = 0; i < std::size(urls); ++i)
|
||||
urls[i].setPort(servers[i].serverPort());
|
||||
|
@ -33,6 +33,8 @@
|
||||
|
||||
#include "../qsqldatabase/tst_databases.h"
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
QString qtest;
|
||||
|
||||
class tst_QSqlQuery : public QObject
|
||||
@ -729,7 +731,7 @@ void tst_QSqlQuery::oraOutValues()
|
||||
" x := 'homer';\n"
|
||||
"end;\n").arg(tst_outValues)));
|
||||
QVERIFY(q.prepare(QLatin1String("call %1(?)").arg(tst_outValues)));
|
||||
q.addBindValue(u"maggy"_qs, QSql::Out);
|
||||
q.addBindValue(u"maggy"_s, QSql::Out);
|
||||
QVERIFY_SQL(q, exec());
|
||||
QCOMPARE(q.boundValue(0).toString(), u"homer");
|
||||
|
||||
@ -740,7 +742,7 @@ void tst_QSqlQuery::oraOutValues()
|
||||
" x := NULL;\n"
|
||||
"end;\n").arg(tst_outValues)));
|
||||
QVERIFY(q.prepare(QLatin1String("call %1(?)").arg(tst_outValues)));
|
||||
q.addBindValue(u"maggy"_qs, QSql::Out);
|
||||
q.addBindValue(u"maggy"_s, QSql::Out);
|
||||
QVERIFY_SQL(q, exec());
|
||||
QVERIFY(q.boundValue(0).isNull());
|
||||
|
||||
@ -762,7 +764,7 @@ void tst_QSqlQuery::oraOutValues()
|
||||
" y := x||'bubulalakikikokololo';\n"
|
||||
"end;\n").arg(tst_outValues)));
|
||||
QVERIFY(q.prepare(QLatin1String("call %1(?, ?)").arg(tst_outValues)));
|
||||
q.addBindValue(u"fifi"_qs, QSql::In);
|
||||
q.addBindValue(u"fifi"_s, QSql::In);
|
||||
QString out;
|
||||
out.reserve(50);
|
||||
q.addBindValue(out, QSql::Out);
|
||||
@ -824,7 +826,7 @@ void tst_QSqlQuery::oraClob()
|
||||
QVERIFY_SQL(q, prepare(QLatin1String("insert into %1 (id, cl, bl) values(?, ?, ?)")
|
||||
.arg(clobby)));
|
||||
q.addBindValue(2);
|
||||
q.addBindValue(u"lala"_qs, QSql::Binary);
|
||||
q.addBindValue(u"lala"_s, QSql::Binary);
|
||||
q.addBindValue("lala"_qba, QSql::Binary);
|
||||
QVERIFY_SQL(q, exec());
|
||||
|
||||
@ -1814,7 +1816,7 @@ void tst_QSqlQuery::writeNull()
|
||||
// cases from the QSqlResultPrivate::isVariantNull helper. Only PostgreSQL supports
|
||||
// QUuid.
|
||||
QMultiHash<QString, QVariant> nullableTypes = {
|
||||
{"varchar(20)", u"not null"_qs},
|
||||
{"varchar(20)", u"not null"_s},
|
||||
{"varchar(20)", "not null"_qba},
|
||||
{"date", QDateTime::currentDateTime()},
|
||||
{"date", QDate::currentDate()},
|
||||
@ -2202,7 +2204,7 @@ void tst_QSqlQuery::prepare_bind_exec()
|
||||
static const QString utf8str = QString::fromUtf8("काचं शक्नोम्यत्तुम् । नोपहिनस्ति माम् ॥");
|
||||
|
||||
static const QString values[6] = {
|
||||
u"Harry"_qs, u"Trond"_qs, u"Mark"_qs, u"Ma?rk"_qs, u"?"_qs, u":id"_qs
|
||||
u"Harry"_s, u"Trond"_s, u"Mark"_s, u"Ma?rk"_s, u"?"_s, u":id"_s
|
||||
};
|
||||
|
||||
bool useUnicode = db.driver()->hasFeature(QSqlDriver::Unicode);
|
||||
@ -2442,7 +2444,7 @@ void tst_QSqlQuery::prepare_bind_exec()
|
||||
QVERIFY(q.prepare(QLatin1String("insert into %1 (id, name) values (?, ?)")
|
||||
.arg(qtest_prepare)));
|
||||
q.addBindValue( 99 );
|
||||
q.addBindValue(u"something silly"_qs);
|
||||
q.addBindValue(u"something silly"_s);
|
||||
|
||||
QVERIFY(!q.exec());
|
||||
QVERIFY(q.lastError().isValid());
|
||||
@ -2561,7 +2563,7 @@ void tst_QSqlQuery::sqlServerLongStrings()
|
||||
QVERIFY_SQL(q, prepare(QLatin1String("INSERT INTO %1 VALUES (?, ?)").arg(tableName)));
|
||||
|
||||
q.addBindValue(0);
|
||||
q.addBindValue(u"bubu"_qs);
|
||||
q.addBindValue(u"bubu"_s);
|
||||
QVERIFY_SQL(q, exec());
|
||||
|
||||
const QString testStr(85000, QLatin1Char('a'));
|
||||
@ -2626,7 +2628,7 @@ void tst_QSqlQuery::batchExec()
|
||||
.arg(timeStampString, tableName)));
|
||||
|
||||
const QVariantList intCol = { 1, 2, QVariant(QMetaType(QMetaType::Int)) };
|
||||
const QVariantList charCol = { u"harald"_qs, u"boris"_qs,
|
||||
const QVariantList charCol = { u"harald"_s, u"boris"_s,
|
||||
QVariant(QMetaType(QMetaType::QString)) };
|
||||
const QDateTime currentDateTime = QDateTime(QDateTime::currentDateTime());
|
||||
const QVariantList dateCol = { currentDateTime.date(), currentDateTime.date().addDays(-1),
|
||||
@ -2795,7 +2797,7 @@ void tst_QSqlQuery::oraArrayBind()
|
||||
"END set_table; "
|
||||
"END ora_array_test; "));
|
||||
|
||||
QVariantList list = { u"lorem"_qs, u"ipsum"_qs, u"dolor"_qs, u"sit"_qs, u"amet"_qs };
|
||||
QVariantList list = { u"lorem"_s, u"ipsum"_s, u"dolor"_s, u"sit"_s, u"amet"_s };
|
||||
|
||||
QVERIFY_SQL(q, prepare("BEGIN "
|
||||
"ora_array_test.set_table(?); "
|
||||
@ -3258,7 +3260,7 @@ void tst_QSqlQuery::nextResult()
|
||||
QVERIFY_SQL(q, exec(QLatin1String("INSERT INTO %1 VALUES(4, 'four', 4.4, '');")
|
||||
.arg(tableName)));
|
||||
|
||||
const QString tstStrings[] = { u"one"_qs, u"two"_qs, u"three"_qs, u"four"_qs };
|
||||
const QString tstStrings[] = { u"one"_s, u"two"_s, u"three"_s, u"four"_s };
|
||||
|
||||
// Query that returns only one result set, nothing special about this
|
||||
QVERIFY_SQL(q, exec(QLatin1String("SELECT * FROM %1;").arg(tableName)));
|
||||
@ -4859,17 +4861,17 @@ void tst_QSqlQuery::dateTime_data()
|
||||
const QString tableNameDate(qTableName("dateTimeDate", __FILE__, db));
|
||||
QTest::newRow(QString(dbName + " timestamp with time zone").toLatin1())
|
||||
<< dbName << tableNameTSWithTimeZone
|
||||
<< u" (dt TIMESTAMP WITH TIME ZONE)"_qs
|
||||
<< u" (dt TIMESTAMP WITH TIME ZONE)"_s
|
||||
<< dateTimes << dateTimes;
|
||||
QTest::newRow(QString(dbName + " timestamp with local time zone").toLatin1())
|
||||
<< dbName << tableNameTSWithTimeZone
|
||||
<< u" (dt TIMESTAMP WITH LOCAL TIME ZONE)"_qs
|
||||
<< u" (dt TIMESTAMP WITH LOCAL TIME ZONE)"_s
|
||||
<< dateTimes << expectedDateTimesLocalTZ;
|
||||
QTest::newRow(QString(dbName + "timestamp").toLatin1())
|
||||
<< dbName << tableNameTS << u" (dt TIMESTAMP(3))"_qs
|
||||
<< dbName << tableNameTS << u" (dt TIMESTAMP(3))"_s
|
||||
<< dateTimes << expectedTimeStampDateTimes;
|
||||
QTest::newRow(QString(dbName + "date").toLatin1())
|
||||
<< dbName << tableNameDate << u" (dt DATE)"_qs
|
||||
<< dbName << tableNameDate << u" (dt DATE)"_s
|
||||
<< dateTimes << expectedDateTimes;
|
||||
}
|
||||
}
|
||||
@ -4960,13 +4962,13 @@ void tst_QSqlQuery::mysql_timeType()
|
||||
|
||||
// MySQL will convert days into hours and add them together so 17 days 11 hours becomes 419 hours
|
||||
const QString timeData[] = {
|
||||
u"-838:59:59.000000"_qs, u"-123:45:56.789"_qs, u"000:00:00.0"_qs, u"123:45:56.789"_qs,
|
||||
u"838:59:59.000000"_qs, u"15:50"_qs, u"12"_qs, u"1213"_qs, u"0 1:2:3"_qs, u"17 11:22:33"_qs
|
||||
u"-838:59:59.000000"_s, u"-123:45:56.789"_s, u"000:00:00.0"_s, u"123:45:56.789"_s,
|
||||
u"838:59:59.000000"_s, u"15:50"_s, u"12"_s, u"1213"_s, u"0 1:2:3"_s, u"17 11:22:33"_s
|
||||
};
|
||||
const QString resultTimeData[] = {
|
||||
u"-838:59:59.000000"_qs, u"-123:45:56.789000"_qs, u"00:00:00.000000"_qs,
|
||||
u"123:45:56.789000"_qs, u"838:59:59.000000"_qs, u"15:50:00.000000"_qs,
|
||||
u"00:00:12.000000"_qs, u"00:12:13.000000"_qs, u"01:02:03.000000"_qs, u"419:22:33.000000"_qs
|
||||
u"-838:59:59.000000"_s, u"-123:45:56.789000"_s, u"00:00:00.000000"_s,
|
||||
u"123:45:56.789000"_s, u"838:59:59.000000"_s, u"15:50:00.000000"_s,
|
||||
u"00:00:12.000000"_s, u"00:12:13.000000"_s, u"01:02:03.000000"_s, u"419:22:33.000000"_s
|
||||
};
|
||||
for (const QString &time : timeData) {
|
||||
QVERIFY_SQL(qry, exec(QLatin1String("insert into %2 (t) VALUES ('%1')")
|
||||
|
@ -50,6 +50,8 @@ QT_REQUIRE_CONFIG(process);
|
||||
|
||||
#include <QtTest/private/qemulationdetector_p.h>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
struct BenchmarkResult
|
||||
{
|
||||
qint64 total;
|
||||
@ -693,7 +695,7 @@ bool TestLogger::shouldIgnoreTest(const QString &test) const
|
||||
#if defined(__GNUC__) && (defined(__i386) || defined(__x86_64)) && defined(Q_OS_LINUX)
|
||||
// Check that it's actually available
|
||||
QProcess checkProcess;
|
||||
QStringList args{u"--version"_qs};
|
||||
QStringList args{u"--version"_s};
|
||||
checkProcess.start("valgrind", args);
|
||||
if (!checkProcess.waitForFinished(-1)) {
|
||||
WARN("Valgrind broken or not available. Not running benchlibcallgrind test!");
|
||||
|
@ -83,6 +83,7 @@
|
||||
#include <QtTest/private/qtesthelpers_p.h>
|
||||
|
||||
using namespace QTestPrivate;
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
# include <QtCore/qt_windows.h>
|
||||
@ -473,8 +474,8 @@ void tst_QWidget::getSetCheck()
|
||||
QVERIFY(var1.data() != obj1.style());
|
||||
QVERIFY(obj1.style() != nullptr); // style can never be 0 for a widget
|
||||
|
||||
const QRegularExpression negativeNotPossible(u"^.*Negative sizes \\(.*\\) are not possible$"_qs);
|
||||
const QRegularExpression largestAllowedSize(u"^.*The largest allowed size is \\(.*\\)$"_qs);
|
||||
const QRegularExpression negativeNotPossible(u"^.*Negative sizes \\(.*\\) are not possible$"_s);
|
||||
const QRegularExpression largestAllowedSize(u"^.*The largest allowed size is \\(.*\\)$"_s);
|
||||
// int QWidget::minimumWidth()
|
||||
// void QWidget::setMinimumWidth(int)
|
||||
obj1.setMinimumWidth(0);
|
||||
|
@ -39,6 +39,8 @@
|
||||
#include <QScreen>
|
||||
#include <QWindow>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
class TabBar;
|
||||
|
||||
class tst_QTabBar : public QObject
|
||||
@ -1013,8 +1015,8 @@ void tst_QTabBar::kineticWheel()
|
||||
window.show();
|
||||
QVERIFY(QTest::qWaitForWindowExposed(&window));
|
||||
|
||||
const auto *leftButton = tabbar.findChild<QAbstractButton*>(u"ScrollLeftButton"_qs);
|
||||
const auto *rightButton = tabbar.findChild<QAbstractButton*>(u"ScrollRightButton"_qs);
|
||||
const auto *leftButton = tabbar.findChild<QAbstractButton*>(u"ScrollLeftButton"_s);
|
||||
const auto *rightButton = tabbar.findChild<QAbstractButton*>(u"ScrollRightButton"_s);
|
||||
QVERIFY(leftButton && rightButton);
|
||||
QVERIFY(leftButton->isEnabled() && rightButton->isEnabled());
|
||||
|
||||
@ -1192,8 +1194,8 @@ void tst_QTabBar::scrollButtons()
|
||||
window.show();
|
||||
QVERIFY(QTest::qWaitForWindowActive(&window));
|
||||
|
||||
auto *leftB = tabWidget.tabBar()->findChild<QAbstractButton*>(u"ScrollLeftButton"_qs);
|
||||
auto *rightB = tabWidget.tabBar()->findChild<QAbstractButton*>(u"ScrollRightButton"_qs);
|
||||
auto *leftB = tabWidget.tabBar()->findChild<QAbstractButton*>(u"ScrollLeftButton"_s);
|
||||
auto *rightB = tabWidget.tabBar()->findChild<QAbstractButton*>(u"ScrollRightButton"_s);
|
||||
|
||||
QVERIFY(leftB->isVisible());
|
||||
QVERIFY(!leftB->isEnabled());
|
||||
|
Loading…
Reference in New Issue
Block a user