Make some tests and benchmarks pass with QT_NO_QSTRINGBUILDER
Change-Id: I6c91a613007043d0f26ac11e98353a0b9ce646ae Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
parent
1cd4d6b181
commit
e174405862
@ -93,7 +93,7 @@ void tst_QAuthenticator::basicAuth()
|
||||
QVERIFY(priv->phase == QAuthenticatorPrivate::Start);
|
||||
|
||||
QList<QPair<QByteArray, QByteArray> > headers;
|
||||
headers << qMakePair(QByteArray("WWW-Authenticate"), "Basic " + data.toUtf8());
|
||||
headers << qMakePair<QByteArray, QByteArray>(QByteArray("WWW-Authenticate"), "Basic " + data.toUtf8());
|
||||
priv->parseHttpResponse(headers, /*isProxy = */ false);
|
||||
|
||||
QCOMPARE(auth.realm(), realm);
|
||||
@ -104,7 +104,7 @@ void tst_QAuthenticator::basicAuth()
|
||||
|
||||
QVERIFY(priv->phase == QAuthenticatorPrivate::Start);
|
||||
|
||||
QCOMPARE(priv->calculateResponse("GET", "/").constData(), ("Basic " + expectedReply).constData());
|
||||
QCOMPARE(priv->calculateResponse("GET", "/").constData(), QByteArray("Basic " + expectedReply).constData());
|
||||
}
|
||||
|
||||
void tst_QAuthenticator::ntlmAuth_data()
|
||||
@ -138,7 +138,7 @@ void tst_QAuthenticator::ntlmAuth()
|
||||
|
||||
// NTLM phase 2: challenge
|
||||
headers.clear();
|
||||
headers << qMakePair(QByteArray("WWW-Authenticate"), "NTLM " + data.toUtf8());
|
||||
headers << qMakePair<QByteArray, QByteArray>(QByteArray("WWW-Authenticate"), "NTLM " + data.toUtf8());
|
||||
priv->parseHttpResponse(headers, /*isProxy = */ false);
|
||||
|
||||
QEXPECT_FAIL("with-realm", "NTLM authentication code doesn't extract the realm", Continue);
|
||||
|
@ -2240,7 +2240,7 @@ void tst_QTcpSocket::suddenRemoteDisconnect()
|
||||
QString::fromLatin1("Could not start %1: %2").arg(processExe, serverProcess.errorString())));
|
||||
while (!serverProcess.canReadLine())
|
||||
QVERIFY(serverProcess.waitForReadyRead(10000));
|
||||
QCOMPARE(serverProcess.readLine().data(), (server.toLatin1() + "\n").data());
|
||||
QCOMPARE(serverProcess.readLine().data(), QByteArray(server.toLatin1() + "\n").data());
|
||||
|
||||
// Start client
|
||||
QProcess clientProcess;
|
||||
@ -2250,7 +2250,7 @@ void tst_QTcpSocket::suddenRemoteDisconnect()
|
||||
QString::fromLatin1("Could not start %1: %2").arg(processExe, clientProcess.errorString())));
|
||||
while (!clientProcess.canReadLine())
|
||||
QVERIFY(clientProcess.waitForReadyRead(10000));
|
||||
QCOMPARE(clientProcess.readLine().data(), (client.toLatin1() + "\n").data());
|
||||
QCOMPARE(clientProcess.readLine().data(), QByteArray(client.toLatin1() + "\n").data());
|
||||
|
||||
// Let them play for a while
|
||||
qDebug("Running stress test for 5 seconds");
|
||||
|
@ -72,8 +72,8 @@ void tst_associative_containers::insert_data()
|
||||
|
||||
const QByteArray sizeString = QByteArray::number(size);
|
||||
|
||||
QTest::newRow(("hash--" + sizeString).constData()) << true << size;
|
||||
QTest::newRow(("map--" + sizeString).constData()) << false << size;
|
||||
QTest::newRow(QByteArray("hash--" + sizeString).constData()) << true << size;
|
||||
QTest::newRow(QByteArray("map--" + sizeString).constData()) << false << size;
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,8 +104,8 @@ void tst_associative_containers::lookup_data()
|
||||
|
||||
const QByteArray sizeString = QByteArray::number(size);
|
||||
|
||||
QTest::newRow(("hash--" + sizeString).constData()) << true << size;
|
||||
QTest::newRow(("map--" + sizeString).constData()) << false << size;
|
||||
QTest::newRow(QByteArray("hash--" + sizeString).constData()) << true << size;
|
||||
QTest::newRow(QByteArray("map--" + sizeString).constData()) << false << size;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -176,8 +176,8 @@ void tst_vector_vs_std::insert_int_data()
|
||||
|
||||
for (int size = 10; size < 20000; size += 100) {
|
||||
const QByteArray sizeString = QByteArray::number(size);
|
||||
QTest::newRow(("std::vector-int--" + sizeString).constData()) << true << size;
|
||||
QTest::newRow(("QVector-int--" + sizeString).constData()) << false << size;
|
||||
QTest::newRow(QByteArray("std::vector-int--" + sizeString).constData()) << true << size;
|
||||
QTest::newRow(QByteArray("QVector-int--" + sizeString).constData()) << false << size;
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,8 +199,8 @@ void tst_vector_vs_std::insert_Large_data()
|
||||
|
||||
for (int size = 10; size < LARGE_MAX_SIZE; size += 100) {
|
||||
const QByteArray sizeString = QByteArray::number(size);
|
||||
QTest::newRow(("std::vector-Large--" + sizeString).constData()) << true << size;
|
||||
QTest::newRow(("QVector-Large--" + sizeString).constData()) << false << size;
|
||||
QTest::newRow(QByteArray("std::vector-Large--" + sizeString).constData()) << true << size;
|
||||
QTest::newRow(QByteArray("QVector-Large--" + sizeString).constData()) << false << size;
|
||||
}
|
||||
}
|
||||
|
||||
@ -222,8 +222,8 @@ void tst_vector_vs_std::lookup_int_data()
|
||||
|
||||
for (int size = 10; size < 20000; size += 100) {
|
||||
const QByteArray sizeString = QByteArray::number(size);
|
||||
QTest::newRow(("std::vector-int--" + sizeString).constData()) << true << size;
|
||||
QTest::newRow(("QVector-int--" + sizeString).constData()) << false << size;
|
||||
QTest::newRow(QByteArray("std::vector-int--" + sizeString).constData()) << true << size;
|
||||
QTest::newRow(QByteArray("QVector-int--" + sizeString).constData()) << false << size;
|
||||
}
|
||||
}
|
||||
|
||||
@ -245,8 +245,8 @@ void tst_vector_vs_std::lookup_Large_data()
|
||||
|
||||
for (int size = 10; size < LARGE_MAX_SIZE; size += 100) {
|
||||
const QByteArray sizeString = QByteArray::number(size);
|
||||
QTest::newRow(("std::vector-Large--" + sizeString).constData()) << true << size;
|
||||
QTest::newRow(("QVector-Large--" + sizeString).constData()) << false << size;
|
||||
QTest::newRow(QByteArray("std::vector-Large--" + sizeString).constData()) << true << size;
|
||||
QTest::newRow(QByteArray("QVector-Large--" + sizeString).constData()) << false << size;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ private Q_SLOTS:
|
||||
|
||||
static inline void benchmarkAddRow(const char *name, const char *data)
|
||||
{
|
||||
QTest::newRow(QByteArray("native-") + name) << data << true;
|
||||
QTest::newRow(QByteArray(QByteArray("native-") + name)) << data << true;
|
||||
QTest::newRow(name) << data << false;
|
||||
}
|
||||
|
||||
|
@ -153,9 +153,9 @@ void tst_qstylesheetstyle::grid_data()
|
||||
QTest::addColumn<int>("N");
|
||||
for (int n = 5; n <= 25; n += 5) {
|
||||
const QByteArray nString = QByteArray::number(n*n);
|
||||
QTest::newRow(("simple--" + nString).constData()) << false << false << n;
|
||||
QTest::newRow(("events--" + nString).constData()) << true << false << n;
|
||||
QTest::newRow(("show--" + nString).constData()) << true << true << n;
|
||||
QTest::newRow(QByteArray("simple--" + nString).constData()) << false << false << n;
|
||||
QTest::newRow(QByteArray("events--" + nString).constData()) << true << false << n;
|
||||
QTest::newRow(QByteArray("show--" + nString).constData()) << true << true << n;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user