Make some tests and benchmarks pass with QT_NO_QSTRINGBUILDER
authorStephen Kelly <stephen.kelly@kdab.com>
Wed, 29 Feb 2012 22:53:20 +0000 (23:53 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 1 Mar 2012 10:02:28 +0000 (11:02 +0100)
Change-Id: I6c91a613007043d0f26ac11e98353a0b9ce646ae
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
tests/auto/network/kernel/qauthenticator/tst_qauthenticator.cpp
tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
tests/benchmarks/corelib/tools/containers-associative/main.cpp
tests/benchmarks/corelib/tools/containers-sequential/main.cpp
tests/benchmarks/dbus/qdbustype/main.cpp
tests/benchmarks/gui/styles/qstylesheetstyle/main.cpp

index 9c1b8c3..7cb5dfd 100644 (file)
@@ -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);
index 2c2b551..08938be 100644 (file)
@@ -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");
index 7f2e7b6..ab1c406 100644 (file)
@@ -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;
     }
 }
 
index e42a40b..43eadb6 100644 (file)
@@ -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;
     }
 }
 
index 0e0ce35..b0f6988 100644 (file)
@@ -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;
 }
 
index fcddf5e..45acd41 100644 (file)
@@ -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;
         }
 }