diff options
author | Jyri Tahtela <jyri.tahtela@nokia.com> | 2011-05-19 13:56:55 (GMT) |
---|---|---|
committer | Jyri Tahtela <jyri.tahtela@nokia.com> | 2011-05-19 13:56:55 (GMT) |
commit | 94051a438e64eaede021b4e926ef58f793a09a70 (patch) | |
tree | 9860dc49d8e6453df356f51da9126b583ac35206 | |
parent | 06557b8d7c472c6298f7d8b310feda225864265f (diff) | |
parent | 35b5f15c3fe5c2f1f0d046d09b9d95dee3bb91b5 (diff) | |
download | Qt-94051a438e64eaede021b4e926ef58f793a09a70.zip Qt-94051a438e64eaede021b4e926ef58f793a09a70.tar.gz Qt-94051a438e64eaede021b4e926ef58f793a09a70.tar.bz2 |
Merge remote-tracking branch 'qt/4.8'
-rw-r--r-- | doc/src/platforms/platform-notes.qdoc | 2 | ||||
-rw-r--r-- | doc/src/snippets/qstring/stringbuilder.cpp | 7 | ||||
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexJIT.cpp | 6 | ||||
-rw-r--r-- | src/corelib/tools/qbytearray.h | 13 | ||||
-rw-r--r-- | src/corelib/tools/qstring.cpp | 10 | ||||
-rw-r--r-- | src/corelib/tools/qstring.h | 8 | ||||
-rw-r--r-- | src/corelib/tools/qstringbuilder.h | 4 | ||||
-rw-r--r-- | src/network/kernel/qhostaddress.cpp | 31 | ||||
-rw-r--r-- | src/network/kernel/qnetworkproxy_symbian.cpp | 89 | ||||
-rw-r--r-- | src/plugins/codecs/jp/qsjiscodec.cpp | 4 | ||||
-rw-r--r-- | src/qbase.pri | 2 | ||||
-rw-r--r-- | tests/auto/q3dns/tst_q3dns.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qhostaddress/tst_qhostaddress.cpp | 40 | ||||
-rw-r--r-- | tests/auto/qnetworkproxyfactory/tst_qnetworkproxyfactory.cpp | 6 | ||||
-rw-r--r-- | tests/auto/qstringbuilder1/tst_qstringbuilder1.cpp | 3 | ||||
-rw-r--r-- | tests/auto/qstringbuilder2/tst_qstringbuilder2.cpp | 3 | ||||
-rw-r--r-- | tests/auto/qstringbuilder3/tst_qstringbuilder3.cpp | 3 | ||||
-rw-r--r-- | tests/auto/qstringbuilder4/tst_qstringbuilder4.cpp | 3 | ||||
-rw-r--r-- | tests/auto/qtextcodec/tst_qtextcodec.cpp | 15 |
19 files changed, 154 insertions, 97 deletions
diff --git a/doc/src/platforms/platform-notes.qdoc b/doc/src/platforms/platform-notes.qdoc index ebee54b..c2e47c2 100644 --- a/doc/src/platforms/platform-notes.qdoc +++ b/doc/src/platforms/platform-notes.qdoc @@ -612,7 +612,7 @@ Qt::WA_MacNormalSize, Qt::WA_MacSmallSize, Qt::WA_MacMiniSize, Qt::WA_MacVariableSize, Qt::WA_MacBrushedMetal, Qt::WA_MacAlwaysShowToolWindow, Qt::WA_MacFrameworkScaled, Qt::WA_MacNoShadow, Qt::Sheet, Qt::Drawer, Qt::MacWindowToolBarButtonHint, - QMainWindow::unifiedTitleAndToolBarOnMac + QMainWindow::unifiedTitleAndToolBarOnMac, WA_MacNoCocoaChildWindow \section2 Mixing Qt with native code Two classes are awailable for either adding native Cocoa views/controls diff --git a/doc/src/snippets/qstring/stringbuilder.cpp b/doc/src/snippets/qstring/stringbuilder.cpp index 8ff1dd8..b8acbc1 100644 --- a/doc/src/snippets/qstring/stringbuilder.cpp +++ b/doc/src/snippets/qstring/stringbuilder.cpp @@ -49,14 +49,9 @@ //! [0] //! [3] - #define QT_USE_FAST_CONCATENATION + DEFINES *= QT_USE_QSTRINGBUILDER //! [3] -//! [4] - #define QT_USE_FAST_CONCATENATION - #define QT_USE_FAST_OPERATOR_PLUS -//! [4] - //! [5] #include <QStringBuilder> diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexJIT.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexJIT.cpp index fcb8d86..1015923 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexJIT.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/yarr/RegexJIT.cpp @@ -1312,6 +1312,9 @@ class RegexGenerator : private MacroAssembler { push(ARMRegisters::r4); push(ARMRegisters::r5); push(ARMRegisters::r6); +#if CPU(ARM_TRADITIONAL) + push(ARMRegisters::r8); // scratch register +#endif move(ARMRegisters::r3, output); #endif } @@ -1327,6 +1330,9 @@ class RegexGenerator : private MacroAssembler { pop(X86Registers::ebx); pop(X86Registers::ebp); #elif CPU(ARM) +#if CPU(ARM_TRADITIONAL) + pop(ARMRegisters::r8); // scratch register +#endif pop(ARMRegisters::r6); pop(ARMRegisters::r5); pop(ARMRegisters::r4); diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h index 218b25f..2cb79c3 100644 --- a/src/corelib/tools/qbytearray.h +++ b/src/corelib/tools/qbytearray.h @@ -57,9 +57,10 @@ # ifdef QT_USE_FAST_OPERATOR_PLUS # undef QT_USE_FAST_OPERATOR_PLUS # endif -# ifdef QT_USE_FAST_CONCATENATION -# undef QT_USE_FAST_CONCATENATION +# ifdef QT_USE_QSTRINGBUILDER +# undef QT_USE_QSTRINGBUILDER # endif + #endif @@ -559,8 +560,7 @@ inline bool operator>=(const QByteArray &a1, const char *a2) { return qstrcmp(a1, a2) >= 0; } inline bool operator>=(const char *a1, const QByteArray &a2) { return qstrcmp(a1, a2) >= 0; } -#ifndef QT_USE_FAST_OPERATOR_PLUS -# ifndef QT_USE_FAST_CONCATENATION +#if !defined(QT_USE_QSTRINGBUILDER) inline const QByteArray operator+(const QByteArray &a1, const QByteArray &a2) { return QByteArray(a1) += a2; } inline const QByteArray operator+(const QByteArray &a1, const char *a2) @@ -571,8 +571,7 @@ inline const QByteArray operator+(const char *a1, const QByteArray &a2) { return QByteArray(a1) += a2; } inline const QByteArray operator+(char a1, const QByteArray &a2) { return QByteArray(&a1, 1) += a2; } -# endif // QT_USE_FAST_CONCATENATION -#endif // QT_USE_FAST_OPERATOR_PLUS +#endif // QT_USE_QSTRINGBUILDER inline QBool QByteArray::contains(const char *c) const { return QBool(indexOf(c) != -1); } inline QByteArray &QByteArray::replace(char before, const char *c) @@ -615,7 +614,7 @@ QT_END_NAMESPACE QT_END_HEADER -#ifdef QT_USE_FAST_CONCATENATION +#ifdef QT_USE_QSTRINGBUILDER #include <QtCore/qstring.h> #endif diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 1be711b..8ad4e70 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -777,16 +777,12 @@ const QString::Null QString::null = { }; \snippet doc/src/snippets/qstring/stringbuilder.cpp 5 - A more global approach is to include this define: + A more global approach which is the most convenient but + not entirely source compatible, is to this define in your + .pro file: \snippet doc/src/snippets/qstring/stringbuilder.cpp 3 - and use \c{'%'} instead of \c{'+'} for string concatenation - everywhere. The third approach, which is the most convenient but - not entirely source compatible, is to include two defines: - - \snippet doc/src/snippets/qstring/stringbuilder.cpp 4 - and the \c{'+'} will automatically be performed as the \c{QStringBuilder} \c{'%'} everywhere. diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index b75f2b5..c61d09e 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -1016,8 +1016,7 @@ inline int QByteArray::findRev(const QString &s, int from) const # endif // QT3_SUPPORT #endif // QT_NO_CAST_TO_ASCII -#ifndef QT_USE_FAST_OPERATOR_PLUS -# ifndef QT_USE_FAST_CONCATENATION +#if !defined(QT_USE_FAST_OPERATOR_PLUS) && !defined(QT_USE_QSTRINGBUILDER) inline const QString operator+(const QString &s1, const QString &s2) { QString t(s1); t += s2; return t; } inline const QString operator+(const QString &s1, QChar s2) @@ -1038,8 +1037,7 @@ inline QT_ASCII_CAST_WARN const QString operator+(const QByteArray &ba, const QS inline QT_ASCII_CAST_WARN const QString operator+(const QString &s, const QByteArray &ba) { QString t(s); t += QString::fromAscii(ba.constData(), qstrnlen(ba.constData(), ba.size())); return t; } # endif // QT_NO_CAST_FROM_ASCII -# endif // QT_USE_FAST_CONCATENATION -#endif // QT_USE_FAST_OPERATOR_PLUS +#endif // QT_USE_QSTRINGBUILDER #ifndef QT_NO_STL inline std::string QString::toStdString() const @@ -1288,7 +1286,7 @@ QT_END_NAMESPACE QT_END_HEADER -#ifdef QT_USE_FAST_CONCATENATION +#if defined(QT_USE_FAST_OPERATOR_PLUS) || defined(QT_USE_QSTRINGBUILDER) #include <QtCore/qstringbuilder.h> #endif diff --git a/src/corelib/tools/qstringbuilder.h b/src/corelib/tools/qstringbuilder.h index 5a261cf..709d84a 100644 --- a/src/corelib/tools/qstringbuilder.h +++ b/src/corelib/tools/qstringbuilder.h @@ -410,7 +410,9 @@ operator%(const A &a, const B &b) return QStringBuilder<typename QConcatenable<A>::type, typename QConcatenable<B>::type>(a, b); } -#ifdef QT_USE_FAST_OPERATOR_PLUS +// QT_USE_FAST_OPERATOR_PLUS was introduced in 4.7, QT_USE_QSTRINGBUILDER is to be used from 4.8 onwards +// QT_USE_FAST_OPERATOR_PLUS does not remove the normal operator+ for QByteArray +#if defined(QT_USE_FAST_OPERATOR_PLUS) || defined(QT_USE_QSTRINGBUILDER) template <typename A, typename B> QStringBuilder<typename QConcatenable<A>::type, typename QConcatenable<B>::type> operator+(const A &a, const B &b) diff --git a/src/network/kernel/qhostaddress.cpp b/src/network/kernel/qhostaddress.cpp index f55f383..7eeb4e5 100644 --- a/src/network/kernel/qhostaddress.cpp +++ b/src/network/kernel/qhostaddress.cpp @@ -720,7 +720,8 @@ Q_IPV6ADDR QHostAddress::toIPv6Address() const Returns the address as a string. For example, if the address is the IPv4 address 127.0.0.1, the - returned string is "127.0.0.1". + returned string is "127.0.0.1". For IPv6 the string format will + follow the RFC5952 recommendation. \sa toIPv4Address() */ @@ -741,8 +742,32 @@ QString QHostAddress::toString() const ugle[i] = (quint16(d->a6[2*i]) << 8) | quint16(d->a6[2*i+1]); } QString s; - s.sprintf("%X:%X:%X:%X:%X:%X:%X:%X", - ugle[0], ugle[1], ugle[2], ugle[3], ugle[4], ugle[5], ugle[6], ugle[7]); + QString temp; + bool zeroDetected = false; + bool zeroShortened = false; + for (int i = 0; i < 8; i++) { + if ((ugle[i] != 0) || zeroShortened) { + temp.sprintf("%X", ugle[i]); + s.append(temp); + if (zeroDetected) + zeroShortened = true; + } else { + if (!zeroDetected) { + if (i<7 && (ugle[i+1] == 0)) { + s.append(QLatin1Char(':')); + zeroDetected = true; + } else { + temp.sprintf("%X", ugle[i]); + s.append(temp); + if (i<7) + s.append(QLatin1Char(':')); + } + } + } + if (i<7 && ((ugle[i] != 0) || zeroShortened || (i==0 && zeroDetected))) + s.append(QLatin1Char(':')); + } + if (!d->scopeId.isEmpty()) s.append(QLatin1Char('%') + d->scopeId); return s; diff --git a/src/network/kernel/qnetworkproxy_symbian.cpp b/src/network/kernel/qnetworkproxy_symbian.cpp index 1be8de3..73068d6 100644 --- a/src/network/kernel/qnetworkproxy_symbian.cpp +++ b/src/network/kernel/qnetworkproxy_symbian.cpp @@ -68,74 +68,80 @@ QT_BEGIN_NAMESPACE class SymbianIapId { public: - enum State{ - NotValid, - Valid - }; - Q_DECLARE_FLAGS(States, State) - SymbianIapId() {} + SymbianIapId() : valid(false), id(0) {} ~SymbianIapId() {} - void setIapId(TUint32 iapId) { iapState |= Valid; id = iapId; } - bool isValid() { return iapState == Valid; } + void setIapId(TUint32 iapId) { valid = true; id = iapId; } + bool isValid() { return valid; } TUint32 iapId() { return id; } private: - QFlags<States> iapState; + bool valid; TUint32 id; }; -Q_DECLARE_OPERATORS_FOR_FLAGS(SymbianIapId::States) - class SymbianProxyQuery { public: static QNetworkConfiguration findCurrentConfiguration(QNetworkConfigurationManager& configurationManager); + static QNetworkConfiguration findCurrentConfigurationFromServiceNetwork(const QNetworkConfiguration& serviceNetwork); static SymbianIapId getIapId(QNetworkConfigurationManager &configurationManager, const QNetworkProxyQuery &query); static CCDIAPRecord *getIapRecordLC(TUint32 aIAPId, CMDBSession &aDb); static CMDBRecordSet<CCDProxiesRecord> *prepareQueryLC(TUint32 serviceId, TDesC& serviceType); static QList<QNetworkProxy> proxyQueryL(TUint32 aIAPId, const QNetworkProxyQuery &query); }; +QNetworkConfiguration SymbianProxyQuery::findCurrentConfigurationFromServiceNetwork(const QNetworkConfiguration& serviceNetwork) +{ + // Note: This code assumes that the only unambigious way to + // find current proxy config is if there is only one access point + // or if the found access point is immediately usable. + QList<QNetworkConfiguration> childConfigurations = serviceNetwork.children(); + if (childConfigurations.isEmpty()) { + qWarning("QNetworkProxyFactory::systemProxyForQuery called with empty service network"); + return QNetworkConfiguration(); + } else if (childConfigurations.count() == 1) { + //if only one IAP in the service network, it's always going to be used. + return childConfigurations.at(0); + } else { + //use highest priority active config, if available + for (int index = 0; index < childConfigurations.count(); index++) { + QNetworkConfiguration childConfig = childConfigurations.at(index); + if (childConfig.isValid() && childConfig.state() == QNetworkConfiguration::Active) + return childConfig; + } + //otherwise use highest priority discovered config (that's the one which will be activated if start were called now) + for (int index = 0; index < childConfigurations.count(); index++) { + QNetworkConfiguration childConfig = childConfigurations.at(index); + if (childConfig.isValid() && childConfig.state() == QNetworkConfiguration::Discovered) + return childConfig; + } + //otherwise the highest priority defined (most likely to be activated if all were available when start is called) + qWarning("QNetworkProxyFactory::systemProxyForQuery called with service network, but none of its IAPs are available"); + return childConfigurations.at(0); + } +} + QNetworkConfiguration SymbianProxyQuery::findCurrentConfiguration(QNetworkConfigurationManager& configurationManager) { QList<QNetworkConfiguration> activeConfigurations = configurationManager.allConfigurations( QNetworkConfiguration::Active); - QNetworkConfiguration currentConfig; if (activeConfigurations.count() > 0) { - currentConfig = activeConfigurations.at(0); + return activeConfigurations.at(0); } else { // No active configurations, try default one QNetworkConfiguration defaultConfiguration = configurationManager.defaultConfiguration(); if (defaultConfiguration.isValid()) { switch (defaultConfiguration.type()) { case QNetworkConfiguration::InternetAccessPoint: - currentConfig = defaultConfiguration; - break; + return defaultConfiguration; case QNetworkConfiguration::ServiceNetwork: - { - // Note: This code assumes that the only unambigious way to - // find current proxy config is if there is only one access point - // or if the found access point is immediately usable. - QList<QNetworkConfiguration> childConfigurations = defaultConfiguration.children(); - if (childConfigurations.count() == 1) { - currentConfig = childConfigurations.at(0); - } else { - for (int index = 0; index < childConfigurations.count(); index++) { - QNetworkConfiguration childConfig = childConfigurations.at(index); - if (childConfig.isValid() && childConfig.state() == QNetworkConfiguration::Discovered) { - currentConfig = childConfig; - break; - } - } - } - } - break; + return findCurrentConfigurationFromServiceNetwork(defaultConfiguration); case QNetworkConfiguration::UserChoice: - // User choice is not a valid configuration for proxy discovery + qWarning("QNetworkProxyFactory::systemProxyForQuery called with user choice configuration, which is not valid"); break; } } } - return currentConfig; + return QNetworkConfiguration(); } SymbianIapId SymbianProxyQuery::getIapId(QNetworkConfigurationManager& configurationManager, const QNetworkProxyQuery &query) @@ -147,7 +153,11 @@ SymbianIapId SymbianProxyQuery::getIapId(QNetworkConfigurationManager& configura //If config is not specified, then try to find out an active or default one currentConfig = findCurrentConfiguration(configurationManager); } - if (currentConfig.isValid()) { + if (currentConfig.isValid() && currentConfig.type() == QNetworkConfiguration::ServiceNetwork) { + //convert service network to the real IAP. + currentConfig = findCurrentConfigurationFromServiceNetwork(currentConfig); + } + if (currentConfig.isValid() && currentConfig.type() == QNetworkConfiguration::InternetAccessPoint) { // Note: the following code assumes that the identifier is in format // I_xxxx where xxxx is the identifier of IAP. This is meant as a // temporary solution until there is a support for returning @@ -236,7 +246,12 @@ QList<QNetworkProxy> SymbianProxyQuery::proxyQueryL(TUint32 aIAPId, const QNetwo CleanupStack::Pop(); // serverName TUint32 port = proxyRecord->iPortNumber; - QNetworkProxy proxy(QNetworkProxy::HttpProxy, serverNameQt, port); + //Symbian config doesn't include proxy type, assume http unless the port matches assigned port of another type + //Mobile operators use a wide variety of port numbers for http proxies. + QNetworkProxy::ProxyType proxyType = QNetworkProxy::HttpProxy; + if (port == 1080) //IANA assigned port for SOCKS + proxyType = QNetworkProxy::Socks5Proxy; + QNetworkProxy proxy(proxyType, serverNameQt, port); foundProxies.append(proxy); } } diff --git a/src/plugins/codecs/jp/qsjiscodec.cpp b/src/plugins/codecs/jp/qsjiscodec.cpp index ffd75e8..2a732ff 100644 --- a/src/plugins/codecs/jp/qsjiscodec.cpp +++ b/src/plugins/codecs/jp/qsjiscodec.cpp @@ -155,7 +155,9 @@ QString QSjisCodec::convertToUnicode(const char* chars, int len, ConverterState uchar ch = chars[i]; switch (nbuf) { case 0: - if (ch < 0x80 || IsKana(ch)) { + if (ch < 0x80) { + result += QValidChar(ch); + } else if (IsKana(ch)) { // JIS X 0201 Latin or JIS X 0201 Kana u = conv->jisx0201ToUnicode(ch); result += QValidChar(u); diff --git a/src/qbase.pri b/src/qbase.pri index ce69757..c4d081f 100644 --- a/src/qbase.pri +++ b/src/qbase.pri @@ -163,7 +163,7 @@ contains(QT_PRODUCT, OpenSource.*):DEFINES *= QT_OPENSOURCE DEFINES *= QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARNINGS contains(QT_CONFIG, qt3support):DEFINES *= QT3_SUPPORT DEFINES *= QT_MOC_COMPAT #we don't need warnings from calling moc code in our generated code -DEFINES *= QT_USE_FAST_OPERATOR_PLUS QT_USE_FAST_CONCATENATION +DEFINES *= QT_USE_QSTRINGBUILDER TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end 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"); |