forked from qt-creator/qt-creator
qstringbuilder: also accept QStringRef
This commit is contained in:
@@ -22,6 +22,7 @@ public:
|
||||
: l1literal("some string literal"),
|
||||
l1string("some string literal"),
|
||||
string(l1string),
|
||||
stringref(&string, 2, 10),
|
||||
achar('c')
|
||||
{}
|
||||
|
||||
@@ -90,6 +91,18 @@ private slots:
|
||||
}
|
||||
|
||||
|
||||
void separator_2c() { SEP("2 string refs"); }
|
||||
|
||||
void b_2_stringref() {
|
||||
QBENCHMARK { r = stringref % stringref; }
|
||||
COMPARE(r, stringref.toString() + stringref.toString());
|
||||
}
|
||||
void s_2_stringref() {
|
||||
QBENCHMARK { r = stringref.toString() + stringref.toString(); }
|
||||
COMPARE(r, QString(stringref % stringref));
|
||||
}
|
||||
|
||||
|
||||
void separator_2b() { SEP("3 strings"); }
|
||||
|
||||
void b_3_string() {
|
||||
@@ -188,6 +201,7 @@ private:
|
||||
const QLatin1Literal l1literal;
|
||||
const QLatin1String l1string;
|
||||
const QString string;
|
||||
const QStringRef stringref;
|
||||
const QLatin1Char achar;
|
||||
|
||||
QString r;
|
||||
|
||||
Reference in New Issue
Block a user