Put fixed string length in test data
authorKurt Pattyn <pattyn.kurt@gmail.com>
Sun, 3 Nov 2013 20:25:16 +0000 (21:25 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sun, 3 Nov 2013 20:40:22 +0000 (21:40 +0100)
Change-Id: I01e24b17656278c77de431c5df49d2bbd996ee89
Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
tests/auto/dataprocessor/tst_dataprocessor.cpp

index 7c025b9..dacc470 100644 (file)
@@ -305,8 +305,10 @@ void tst_DataProcessor::goodTextFrame_data()
     }
 
     //UC 6.2
-    //QTest::newRow(QStringLiteral("Text frame containing Hello-µ@ßöäüàá-UTF-8!!").toStdString().data()) << QByteArray::fromHex("48656c6c6f2dc2b540c39fc3b6c3a4c3bcc3a0c3a12d5554462d382121") << QStringLiteral("Hello-µ@ßöäüàá-UTF-8!!").size();
-    QTest::newRow(QStringLiteral("Text frame containing Hello-µ@ßöäüàá-UTF-8!!").toStdString().data()) << QByteArray::fromHex("48656c6c6f2dc2b540c39fc3b6c3a4c3bcc3a0c3a12d5554462d382121") << QStringLiteral("Hello-\xC2\xB5\x40\xC3\x9F\xC3\xB6\xC3\xA4\xC3\xBC\xC3\xA0\xC3\xA1-UTF-8!!").size();
+    //the text string reads: Text frame containing Hello-µ@ßöäüàá-UTF-8!!
+    //Visual Studio doesn't like UTF-8 in source code, so we use escape codes for the string
+    //The number 22 refers to the length of the string; the length was incorrectly calculated on Visual Studio
+    QTest::newRow(QStringLiteral("Text frame containing Hello-\xC2\xB5\x40\xC3\x9F\xC3\xB6\xC3\xA4\xC3\xBC\xC3\xA0\xC3\xA1-UTF-8!!").toStdString().data()) << QByteArray::fromHex("48656c6c6f2dc2b540c39fc3b6c3a4c3bcc3a0c3a12d5554462d382121") << 22;
 }
 
 void tst_DataProcessor::goodTextFrame()