summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp')
-rw-r--r--tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp
index 95e24b22fb..afc16078b8 100644
--- a/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp
+++ b/tests/auto/corelib/tools/qstringbuilder/qstringbuilder1/stringbuilder.cpp
@@ -66,10 +66,8 @@
void runScenario()
{
- // set codec for C strings to 0, enforcing Latin1
- QTextCodec::setCodecForCStrings(0);
- QVERIFY(!QTextCodec::codecForCStrings());
-
+ // this code is latin1. TODO: replace it with the utf8 block below, once
+ // strings default to utf8.
QLatin1Literal l1literal(LITERAL);
QLatin1String l1string(LITERAL);
QString string(l1string);
@@ -130,7 +128,10 @@ void runScenario()
r = string P ba;
QCOMPARE(r, r2);
+#if 0
// now test with codec for C strings set
+ // TODO: to be re-enabled once strings default to utf8, in place of the
+ // latin1 code above.
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
QVERIFY(QTextCodec::codecForCStrings());
QCOMPARE(QTextCodec::codecForCStrings()->name(), QByteArray("UTF-8"));
@@ -153,6 +154,7 @@ void runScenario()
QCOMPARE(r, r3);
r = string P ba;
QCOMPARE(r, r3);
+#endif
ba = QByteArray(); // empty
r = ba P string;
@@ -212,9 +214,12 @@ void runScenario()
str += QLatin1String(LITERAL) P str;
QCOMPARE(str, QString::fromUtf8(UTF8_LITERAL LITERAL UTF8_LITERAL));
#ifndef QT_NO_CAST_FROM_ASCII
+#if 0
+ // TODO: this relies on strings defaulting to utf8, so disable this for now.
str = (QString::fromUtf8(UTF8_LITERAL) += QLatin1String(LITERAL) P UTF8_LITERAL);
QCOMPARE(str, QString::fromUtf8(UTF8_LITERAL LITERAL UTF8_LITERAL));
#endif
+#endif
}
//operator QByteArray +=
@@ -229,11 +234,14 @@ void runScenario()
ba2 += ba2 P withZero;
QCOMPARE(ba2, QByteArray(withZero + withZero + withZero));
#ifndef QT_NO_CAST_TO_ASCII
+#if 0
+ // TODO: this relies on strings defaulting to utf8, so disable this for now.
ba = UTF8_LITERAL;
ba2 = (ba += QLatin1String(LITERAL) + QString::fromUtf8(UTF8_LITERAL));
QCOMPARE(ba2, ba);
QCOMPARE(ba, QByteArray(UTF8_LITERAL LITERAL UTF8_LITERAL));
#endif
+#endif
}
}