summaryrefslogtreecommitdiff
path: root/tests/auto/websocketprotocol
diff options
context:
space:
mode:
authorKurt Pattyn <pattyn.kurt@gmail.com>2013-12-22 18:24:21 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-23 19:26:09 +0100
commit23ccec8ce246634799b06f55b85478b3fbbb356d (patch)
tree7144ceb793362636931c4d26f9cc5f1561672fda /tests/auto/websocketprotocol
parent19d8d19af44b9075f745790380c3fe663d8e7fd0 (diff)
downloadqtwebsockets-23ccec8ce246634799b06f55b85478b3fbbb356d.tar.gz
Add optimizations
Change-Id: Icd293f832e2d7a6272d4953c1994065d16222375 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
Diffstat (limited to 'tests/auto/websocketprotocol')
-rw-r--r--tests/auto/websocketprotocol/tst_websocketprotocol.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/auto/websocketprotocol/tst_websocketprotocol.cpp b/tests/auto/websocketprotocol/tst_websocketprotocol.cpp
index 8e73921..433d53a 100644
--- a/tests/auto/websocketprotocol/tst_websocketprotocol.cpp
+++ b/tests/auto/websocketprotocol/tst_websocketprotocol.cpp
@@ -101,10 +101,11 @@ void tst_WebSocketProtocol::tst_validMasks_data()
QTest::addColumn<QString>("inputdata");
QTest::addColumn<QByteArray>("result");
- QTest::newRow("Empty payload") << 0x12345678u << QString("") << QByteArray("");
- QTest::newRow("ASCII payload of 8 characters") << 0x12345678u << QString("abcdefgh") << QByteArray("\x73\x56\x35\x1C\x77\x52\x31\x10");
- QTest::newRow("ASCII payload of 9 characters") << 0x12345678u << QString("abcdefghi") << QByteArray("\x73\x56\x35\x1C\x77\x52\x31\x10\x7B");
- QTest::newRow("UTF-8 payload") << 0x12345678u << QString("∫∂ƒ©øØ") << QByteArray("\x2D\x0B\x69\xD1\xEA\xEC");
+ QTest::newRow("Empty payload") << 0x12345678u << QStringLiteral("") << QByteArrayLiteral("");
+ QTest::newRow("ASCII payload of 8 characters") << 0x12345678u << QStringLiteral("abcdefgh") << QByteArrayLiteral("\x73\x56\x35\x1C\x77\x52\x31\x10");
+ QTest::newRow("ASCII payload of 9 characters") << 0x12345678u << QStringLiteral("abcdefghi") << QByteArrayLiteral("\x73\x56\x35\x1C\x77\x52\x31\x10\x7B");
+ //MSVC doesn't like UTF-8 in source code; the following text is represented in the string below: ∫∂ƒ©øØ
+ QTest::newRow("UTF-8 payload") << 0x12345678u << QString::fromUtf8("\xE2\x88\xAB\xE2\x88\x82\xC6\x92\xC2\xA9\xC3\xB8\xC3\x98") << QByteArrayLiteral("\x2D\x0B\x69\xD1\xEA\xEC");
}
void tst_WebSocketProtocol::tst_validMasks()
@@ -162,12 +163,12 @@ void tst_WebSocketProtocol::tst_closeCodes_data()
for (int i = 0; i < 1000; ++i)
{
- QTest::newRow(QString("Close code %1").arg(i).toLatin1().constData()) << i << false;
+ QTest::newRow(QStringLiteral("Close code %1").arg(i).toLatin1().constData()) << i << false;
}
for (int i = 1000; i < 1004; ++i)
{
- QTest::newRow(QString("Close code %1").arg(i).toLatin1().constData()) << i << true;
+ QTest::newRow(QStringLiteral("Close code %1").arg(i).toLatin1().constData()) << i << true;
}
QTest::newRow("Close code 1004") << 1004 << false;
@@ -176,17 +177,17 @@ void tst_WebSocketProtocol::tst_closeCodes_data()
for (int i = 1007; i < 1012; ++i)
{
- QTest::newRow(QString("Close code %1").arg(i).toLatin1().constData()) << i << true;
+ QTest::newRow(QStringLiteral("Close code %1").arg(i).toLatin1().constData()) << i << true;
}
for (int i = 1013; i < 3000; ++i)
{
- QTest::newRow(QString("Close code %1").arg(i).toLatin1().constData()) << i << false;
+ QTest::newRow(QStringLiteral("Close code %1").arg(i).toLatin1().constData()) << i << false;
}
for (int i = 3000; i < 5000; ++i)
{
- QTest::newRow(QString("Close code %1").arg(i).toLatin1().constData()) << i << true;
+ QTest::newRow(QStringLiteral("Close code %1").arg(i).toLatin1().constData()) << i << true;
}
QTest::newRow("Close code 5000") << 1004 << false;