summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtextstream
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-06-11 12:59:23 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-06-11 19:04:15 (GMT)
commitf6aa5d8cfbec4f4ffacf20a94a1653c1a8ee2134 (patch)
tree2ac49d8f20eb83067932bb655939d6bb044a0fb0 /tests/auto/qtextstream
parent52392292c8fa096e3b0bb692dedce66924ab3305 (diff)
downloadQt-f6aa5d8cfbec4f4ffacf20a94a1653c1a8ee2134.zip
Qt-f6aa5d8cfbec4f4ffacf20a94a1653c1a8ee2134.tar.gz
Qt-f6aa5d8cfbec4f4ffacf20a94a1653c1a8ee2134.tar.bz2
UTF-8 text codec should be able to convert data when fed one by one byte.
When the input data is fed to utf-8 by one byte it couldn't parse the BOM correctly. So we wait until the BOM is composed into a code point and check it afterwards. Reviewed-by: Olivier Goffart
Diffstat (limited to 'tests/auto/qtextstream')
-rw-r--r--tests/auto/qtextstream/tst_qtextstream.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qtextstream/tst_qtextstream.cpp b/tests/auto/qtextstream/tst_qtextstream.cpp
index cf495d5..9573957 100644
--- a/tests/auto/qtextstream/tst_qtextstream.cpp
+++ b/tests/auto/qtextstream/tst_qtextstream.cpp
@@ -553,6 +553,13 @@ void tst_QTextStream::generateLineData(bool for_QString)
QTest::newRow("threelines/crlf/crlf/nothing") << QByteArray("ole\r\ndole\r\ndoffen") << (QStringList() << "ole" << "dole" << "doffen");
if (!for_QString) {
+ // utf-8
+ QTest::newRow("utf8/twolines")
+ << QByteArray("\xef\xbb\xbf"
+ "\x66\x67\x65\x0a"
+ "\x66\x67\x65\x0a", 11)
+ << (QStringList() << "fge" << "fge");
+
// utf-16
// one line
QTest::newRow("utf16-BE/nothing")