summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJyri Tahtela <jyri.tahtela@nokia.com>2011-05-19 13:56:55 (GMT)
committerJyri Tahtela <jyri.tahtela@nokia.com>2011-05-19 13:56:55 (GMT)
commit94051a438e64eaede021b4e926ef58f793a09a70 (patch)
tree9860dc49d8e6453df356f51da9126b583ac35206 /tests
parent06557b8d7c472c6298f7d8b310feda225864265f (diff)
parent35b5f15c3fe5c2f1f0d046d09b9d95dee3bb91b5 (diff)
downloadQt-94051a438e64eaede021b4e926ef58f793a09a70.zip
Qt-94051a438e64eaede021b4e926ef58f793a09a70.tar.gz
Qt-94051a438e64eaede021b4e926ef58f793a09a70.tar.bz2
Merge remote-tracking branch 'qt/4.8'
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/q3dns/tst_q3dns.cpp2
-rw-r--r--tests/auto/qhostaddress/tst_qhostaddress.cpp40
-rw-r--r--tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp6
-rw-r--r--tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp3
-rw-r--r--tests/auto/qstringbuilder2/tst_qstringbuilder2.cpp3
-rw-r--r--tests/auto/qstringbuilder3/tst_qstringbuilder3.cpp3
-rw-r--r--tests/auto/qstringbuilder4/tst_qstringbuilder4.cpp3
-rw-r--r--tests/auto/qtextcodec/tst_qtextcodec.cpp15
8 files changed, 47 insertions, 28 deletions
diff --git a/tests/auto/q3dns/tst_q3dns.cpp b/tests/auto/q3dns/tst_q3dns.cpp
index 7b64806..7cfdfdc 100644
--- a/tests/auto/q3dns/tst_q3dns.cpp
+++ b/tests/auto/q3dns/tst_q3dns.cpp
@@ -144,7 +144,7 @@ void tst_Q3Dns::literals()
QCOMPARE((int) ip6literal1.addresses().count(), 0);
Q3Dns ip6literal2("::1", Q3Dns::Aaaa);
- QCOMPARE(ip6literal2.addresses().first().toString(), QString("0:0:0:0:0:0:0:1"));
+ QCOMPARE(ip6literal2.addresses().first().toString(), QString("::1"));
QCOMPARE((int) ip6literal2.addresses().count(), 1);
}
diff --git a/tests/auto/qhostaddress/tst_qhostaddress.cpp b/tests/auto/qhostaddress/tst_qhostaddress.cpp
index 8fd1cd2..08eb63c 100644
--- a/tests/auto/qhostaddress/tst_qhostaddress.cpp
+++ b/tests/auto/qhostaddress/tst_qhostaddress.cpp
@@ -164,21 +164,27 @@ void tst_QHostAddress::setAddress_QString_data()
QTest::newRow("ip4_04") << QString("255.3.2.1\r ") << (bool)TRUE << QString("255.3.2.1") << 4;
QTest::newRow("ip4_05") << QString("0.0.0.0") << (bool)TRUE << QString("0.0.0.0") << 4;
- // for the format of IPv6 addresses see also RFC 1884
+ // for the format of IPv6 addresses see also RFC 5952
QTest::newRow("ip6_00") << QString("FEDC:BA98:7654:3210:FEDC:BA98:7654:3210") << (bool)TRUE << QString("FEDC:BA98:7654:3210:FEDC:BA98:7654:3210") << 6;
- QTest::newRow("ip6_01") << QString("1080:0000:0000:0000:0008:0800:200C:417A") << (bool)TRUE << QString("1080:0:0:0:8:800:200C:417A") << 6;
- QTest::newRow("ip6_02") << QString("1080:0:0:0:8:800:200C:417A") << (bool)TRUE << QString("1080:0:0:0:8:800:200C:417A") << 6;
- QTest::newRow("ip6_03") << QString("1080::8:800:200C:417A") << (bool)TRUE << QString("1080:0:0:0:8:800:200C:417A") << 6;
- QTest::newRow("ip6_04") << QString("FF01::43") << (bool)TRUE << QString("FF01:0:0:0:0:0:0:43") << 6;
- QTest::newRow("ip6_05") << QString("::1") << (bool)TRUE << QString("0:0:0:0:0:0:0:1") << 6;
- QTest::newRow("ip6_06") << QString("1::") << (bool)TRUE << QString("1:0:0:0:0:0:0:0") << 6;
- QTest::newRow("ip6_07") << QString("::") << (bool)TRUE << QString("0:0:0:0:0:0:0:0") << 6;
- QTest::newRow("ip6_08") << QString("0:0:0:0:0:0:13.1.68.3") << (bool)TRUE << QString("0:0:0:0:0:0:D01:4403") << 6;
- QTest::newRow("ip6_09") << QString("::13.1.68.3") << (bool)TRUE << QString("0:0:0:0:0:0:D01:4403") << 6;
- QTest::newRow("ip6_10") << QString("0:0:0:0:0:FFFF:129.144.52.38") << (bool)TRUE << QString("0:0:0:0:0:FFFF:8190:3426") << 6;
- QTest::newRow("ip6_11") << QString("::FFFF:129.144.52.38") << (bool)TRUE << QString("0:0:0:0:0:FFFF:8190:3426") << 6;
- QTest::newRow("ip6_12") << QString("1::FFFF:129.144.52.38") << (bool)TRUE << QString("1:0:0:0:0:FFFF:8190:3426") << 6;
- QTest::newRow("ip6_13") << QString("A:B::D:E") << (bool)TRUE << QString("A:B:0:0:0:0:D:E") << 6;
+ QTest::newRow("ip6_01") << QString("1080:0000:0000:0000:0008:0800:200C:417A") << (bool)TRUE << QString("1080::8:800:200C:417A") << 6;
+ QTest::newRow("ip6_02") << QString("1080:0:0:0:8:800:200C:417A") << (bool)TRUE << QString("1080::8:800:200C:417A") << 6;
+ QTest::newRow("ip6_03") << QString("1080::8:800:200C:417A") << (bool)TRUE << QString("1080::8:800:200C:417A") << 6;
+ QTest::newRow("ip6_04") << QString("FF01::43") << (bool)TRUE << QString("FF01::43") << 6;
+ QTest::newRow("ip6_05") << QString("::1") << (bool)TRUE << QString("::1") << 6;
+ QTest::newRow("ip6_06") << QString("1::") << (bool)TRUE << QString("1::") << 6;
+ QTest::newRow("ip6_07") << QString("::") << (bool)TRUE << QString("::") << 6;
+ QTest::newRow("ip6_08") << QString("0:0:0:0:0:0:13.1.68.3") << (bool)TRUE << QString("::D01:4403") << 6;
+ QTest::newRow("ip6_09") << QString("::13.1.68.3") << (bool)TRUE << QString("::D01:4403") << 6;
+ QTest::newRow("ip6_10") << QString("0:0:0:0:0:FFFF:129.144.52.38") << (bool)TRUE << QString("::FFFF:8190:3426") << 6;
+ QTest::newRow("ip6_11") << QString("::FFFF:129.144.52.38") << (bool)TRUE << QString("::FFFF:8190:3426") << 6;
+ QTest::newRow("ip6_12") << QString("1::FFFF:129.144.52.38") << (bool)TRUE << QString("1::FFFF:8190:3426") << 6;
+ QTest::newRow("ip6_13") << QString("A:B::D:E") << (bool)TRUE << QString("A:B::D:E") << 6;
+ QTest::newRow("ip6_14") << QString("1080:0:1:0:8:800:200C:417A") << (bool)TRUE << QString("1080:0:1:0:8:800:200C:417A") << 6;
+ QTest::newRow("ip6_15") << QString("1080:0:1:0:8:800:200C:0") << (bool)TRUE << QString("1080:0:1:0:8:800:200C:0") << 6;
+ QTest::newRow("ip6_16") << QString("1080:0:1:0:8:800:0:0") << (bool)TRUE << QString("1080:0:1:0:8:800::") << 6;
+ QTest::newRow("ip6_17") << QString("1080:0:0:0:8:800:0:0") << (bool)TRUE << QString("1080::8:800:0:0") << 6;
+ QTest::newRow("ip6_18") << QString("0:1:1:1:8:800:0:0") << (bool)TRUE << QString("0:1:1:1:8:800::") << 6;
+ QTest::newRow("ip6_19") << QString("0:1:1:1:8:800:0:1") << (bool)TRUE << QString("0:1:1:1:8:800:0:1") << 6;
QTest::newRow("error_00") << QString("foobarcom") << (bool)FALSE << QString() << 0;
QTest::newRow("error_01") << QString("foo.bar.com") << (bool)FALSE << QString() << 0;
@@ -329,16 +335,16 @@ void tst_QHostAddress::scopeId()
{
QHostAddress address("fe80::2e0:4cff:fefb:662a%eth0");
QCOMPARE(address.scopeId(), QString("eth0"));
- QCOMPARE(address.toString().toLower(), QString("fe80:0:0:0:2e0:4cff:fefb:662a%eth0"));
+ QCOMPARE(address.toString().toLower(), QString("fe80::2e0:4cff:fefb:662a%eth0"));
QHostAddress address2("fe80::2e0:4cff:fefb:662a");
QCOMPARE(address2.scopeId(), QString());
address2.setScopeId(QString("en0"));
- QCOMPARE(address2.toString().toLower(), QString("fe80:0:0:0:2e0:4cff:fefb:662a%en0"));
+ QCOMPARE(address2.toString().toLower(), QString("fe80::2e0:4cff:fefb:662a%en0"));
address2 = address;
QCOMPARE(address2.scopeId(), QString("eth0"));
- QCOMPARE(address2.toString().toLower(), QString("fe80:0:0:0:2e0:4cff:fefb:662a%eth0"));
+ QCOMPARE(address2.toString().toLower(), QString("fe80::2e0:4cff:fefb:662a%eth0"));
}
void tst_QHostAddress::hashKey()
diff --git a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
index e03c8e9..136d4d8 100644
--- a/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
+++ b/tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp
@@ -174,6 +174,10 @@ void tst_QNetworkProxyFactory::systemProxyForQueryCalledFromThread()
void tst_QNetworkProxyFactory::fromConfigurations()
{
QNetworkConfigurationManager manager;
+ //update is done to get the active / discovered states
+ manager.updateConfigurations();
+ connect(&manager, SIGNAL(updateCompleted()), &QTestEventLoop::instance(), SLOT(exitLoop()));
+ QTestEventLoop::instance().enterLoop(10);
QList<QNetworkProxy> proxies;
QUrl url(QLatin1String("http://qt.nokia.com"));
//get from known configurations
@@ -261,8 +265,6 @@ void tst_QNetworkProxyFactory::inNetworkAccessManager()
foreach (QNetworkProxy proxy, proxies) {
qDebug() << formatProxyName(proxy);
}
- if (config.type() != QNetworkConfiguration::InternetAccessPoint)
- QEXPECT_FAIL("","QNetworkProxyFactory::systemProxyForQuery doesn't work for service networks yet", Continue);
QCOMPARE(factory->returnedList, proxies);
}
diff --git a/tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp b/tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp
index 9f81958..134da1d 100644
--- a/tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp
+++ b/tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp
@@ -44,8 +44,7 @@
// this is the "no harm done" version. Only operator% is active,
// with NO_CAST * defined
#define P %
-#undef QT_USE_FAST_OPERATOR_PLUS
-#undef QT_USE_FAST_CONCATENATION
+#undef QT_USE_QSTRINGBUILDER
#define QT_NO_CAST_FROM_ASCII
#define QT_NO_CAST_TO_ASCII
diff --git a/tests/auto/qstringbuilder2/tst_qstringbuilder2.cpp b/tests/auto/qstringbuilder2/tst_qstringbuilder2.cpp
index 0779f3a..b74cea0 100644
--- a/tests/auto/qstringbuilder2/tst_qstringbuilder2.cpp
+++ b/tests/auto/qstringbuilder2/tst_qstringbuilder2.cpp
@@ -45,8 +45,7 @@
// based version
// with NO_CAST * defined
#define P +
-#define QT_USE_FAST_OPERATOR_PLUS
-#define QT_USE_FAST_CONCATENATION
+#define QT_USE_QSTRINGBUILDER
#define QT_NO_CAST_FROM_ASCII
#define QT_NO_CAST_TO_ASCII
diff --git a/tests/auto/qstringbuilder3/tst_qstringbuilder3.cpp b/tests/auto/qstringbuilder3/tst_qstringbuilder3.cpp
index ef594db..0320ed2 100644
--- a/tests/auto/qstringbuilder3/tst_qstringbuilder3.cpp
+++ b/tests/auto/qstringbuilder3/tst_qstringbuilder3.cpp
@@ -44,8 +44,7 @@
// this is the "no harm done" version. Only operator% is active,
// with NO_CAST * _not_ defined
#define P %
-#undef QT_USE_FAST_OPERATOR_PLUS
-#undef QT_USE_FAST_CONCATENATION
+#undef QT_USE_QSTRINGBUILDER
#undef QT_NO_CAST_FROM_ASCII
#undef QT_NO_CAST_TO_ASCII
diff --git a/tests/auto/qstringbuilder4/tst_qstringbuilder4.cpp b/tests/auto/qstringbuilder4/tst_qstringbuilder4.cpp
index e75b874..7013780 100644
--- a/tests/auto/qstringbuilder4/tst_qstringbuilder4.cpp
+++ b/tests/auto/qstringbuilder4/tst_qstringbuilder4.cpp
@@ -45,8 +45,7 @@
// based version
// with NO_CAST * _not_ defined
#define P +
-#define QT_USE_FAST_OPERATOR_PLUS
-#define QT_USE_FAST_CONCATENATION
+#define QT_USE_QSTRINGBUILDER
#undef QT_NO_CAST_FROM_ASCII
#undef QT_NO_CAST_TO_ASCII
diff --git a/tests/auto/qtextcodec/tst_qtextcodec.cpp b/tests/auto/qtextcodec/tst_qtextcodec.cpp
index a0bfac6..049af79 100644
--- a/tests/auto/qtextcodec/tst_qtextcodec.cpp
+++ b/tests/auto/qtextcodec/tst_qtextcodec.cpp
@@ -106,6 +106,8 @@ private slots:
void moreToFromUnicode_data();
void moreToFromUnicode();
+
+ void shiftJis();
};
void tst_QTextCodec::toUnicode_data()
@@ -2236,6 +2238,19 @@ void tst_QTextCodec::moreToFromUnicode()
QCOMPARE(testData, cStr);
}
+void tst_QTextCodec::shiftJis()
+{
+ QByteArray backslashTilde("\\~");
+ QTextCodec* codec = QTextCodec::codecForName("shift_jis");
+ QString string = codec->toUnicode(backslashTilde);
+ QCOMPARE(string.length(), 2);
+ QCOMPARE(string.at(0), QChar(QLatin1Char('\\')));
+ QCOMPARE(string.at(1), QChar(QLatin1Char('~')));
+
+ QByteArray encoded = codec->fromUnicode(string);
+ QCOMPARE(encoded, backslashTilde);
+}
+
struct DontCrashAtExit {
~DontCrashAtExit() {
QTextCodec *c = QTextCodec::codecForName("utf8");