summaryrefslogtreecommitdiffstats
path: root/tests/auto/other
diff options
context:
space:
mode:
authorRobin Burchell <robin+qt@viroteck.net>2012-01-30 14:23:22 +0200
committerQt by Nokia <qt-info@nokia.com>2012-02-22 14:00:32 +0100
commit186692f81f2612c3cf3a4090cbf949f2fb1558f8 (patch)
treee4506e520a88a1c75086516a1edeb1ab2fb4d057 /tests/auto/other
parent9d173c92183c30144e8bd4f115b2cd93c3da0d40 (diff)
Remove custom text codec for C strings.
This setting is extremely harmful, as code cannot know whether or not to expect it. It also made the behaviour of QString::fromAscii and ::toAscii unintuitive, and caused a lot of people to make mistakes with it. Change-Id: I2f429fa7ef93bd75bb93a7f64c56db15b7283388 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'tests/auto/other')
-rw-r--r--tests/auto/other/collections/tst_collections.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/auto/other/collections/tst_collections.cpp b/tests/auto/other/collections/tst_collections.cpp
index 9bfed15fc4..dc6d7f4b55 100644
--- a/tests/auto/other/collections/tst_collections.cpp
+++ b/tests/auto/other/collections/tst_collections.cpp
@@ -2124,11 +2124,10 @@ void tst_Collections::qstring()
QVERIFY(s.toAscii().isNull());
s = "ascii";
- s += (uchar) 0xb0;
+ s += QChar((uchar) 0xb0);
QVERIFY(s.toUtf8() != s.toLatin1());
- QString sa = s.toLatin1().constData();
- QVERIFY(sa[sa.length()-1] == (ushort) 0xb0);
- QVERIFY(sa.left(sa.length()-1) == "ascii");
+ QCOMPARE(s[s.length()-1].unicode(), (ushort)0xb0);
+ QVERIFY(s.left(s.length()-1) == "ascii");
QVERIFY(s == QString::fromUtf8(s.toUtf8().constData()));