Change-Id: I6c91a613007043d0f26ac11e98353a0b9ce646ae
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QVERIFY(priv->phase == QAuthenticatorPrivate::Start);
QList<QPair<QByteArray, QByteArray> > headers;
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);
priv->parseHttpResponse(headers, /*isProxy = */ false);
QCOMPARE(auth.realm(), realm);
QVERIFY(priv->phase == QAuthenticatorPrivate::Start);
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()
}
void tst_QAuthenticator::ntlmAuth_data()
// NTLM phase 2: challenge
headers.clear();
// 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);
priv->parseHttpResponse(headers, /*isProxy = */ false);
QEXPECT_FAIL("with-realm", "NTLM authentication code doesn't extract the realm", Continue);
QString::fromLatin1("Could not start %1: %2").arg(processExe, serverProcess.errorString())));
while (!serverProcess.canReadLine())
QVERIFY(serverProcess.waitForReadyRead(10000));
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;
// Start client
QProcess clientProcess;
QString::fromLatin1("Could not start %1: %2").arg(processExe, clientProcess.errorString())));
while (!clientProcess.canReadLine())
QVERIFY(clientProcess.waitForReadyRead(10000));
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");
// Let them play for a while
qDebug("Running stress test for 5 seconds");
const QByteArray sizeString = QByteArray::number(size);
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;
const QByteArray sizeString = QByteArray::number(size);
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;
for (int size = 10; size < 20000; size += 100) {
const QByteArray sizeString = QByteArray::number(size);
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;
for (int size = 10; size < LARGE_MAX_SIZE; size += 100) {
const QByteArray sizeString = QByteArray::number(size);
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;
for (int size = 10; size < 20000; size += 100) {
const QByteArray sizeString = QByteArray::number(size);
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;
for (int size = 10; size < LARGE_MAX_SIZE; size += 100) {
const QByteArray sizeString = QByteArray::number(size);
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;
static inline void benchmarkAddRow(const char *name, const char *data)
{
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;
}
QTest::newRow(name) << data << false;
}
QTest::addColumn<int>("N");
for (int n = 5; n <= 25; n += 5) {
const QByteArray nString = QByteArray::number(n*n);
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;