summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2010-05-19 02:29:09 (GMT)
committerKurt Korbatits <kurt.korbatits@nokia.com>2010-05-19 02:29:09 (GMT)
commit93c1117b7c9d3a0142dc3d48223d27883b61cbef (patch)
tree2ff1d3132cc5304cc9eaa6eeea0cb9c16122fe47 /tests
parent787e9d163dea6b9423c21fbcbe4a7b82f06cb4b3 (diff)
parentdcfe68f66e5162f9f7a05552aa1133cdc1f0f9c3 (diff)
downloadQt-93c1117b7c9d3a0142dc3d48223d27883b61cbef.zip
Qt-93c1117b7c9d3a0142dc3d48223d27883b61cbef.tar.gz
Qt-93c1117b7c9d3a0142dc3d48223d27883b61cbef.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging into 4.6
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/compilerwarnings/tst_compilerwarnings.cpp30
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp18
-rw-r--r--tests/auto/qurl/tst_qurl.cpp33
3 files changed, 70 insertions, 11 deletions
diff --git a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp
index f910a18..82c327a 100644
--- a/tests/auto/compilerwarnings/tst_compilerwarnings.cpp
+++ b/tests/auto/compilerwarnings/tst_compilerwarnings.cpp
@@ -62,6 +62,9 @@ class tst_CompilerWarnings: public QObject
private slots:
void warnings_data();
void warnings();
+
+private:
+ bool shouldIgnoreWarning(QString const&);
};
#if 0
@@ -242,16 +245,37 @@ void tst_CompilerWarnings::warnings()
if (!errs.isEmpty()) {
errList = errs.split("\n");
qDebug() << "Arguments:" << args;
- foreach (QString err, errList) {
- qDebug() << err;
+ QStringList validErrors;
+ foreach (QString const& err, errList) {
+ bool ignore = shouldIgnoreWarning(err);
+ qDebug() << err << (ignore ? " [ignored]" : "");
+ if (!ignore) {
+ validErrors << err;
+ }
}
+ errList = validErrors;
}
QCOMPARE(errList.count(), 0); // verbose info how many lines of errors in output
- QVERIFY(errs.isEmpty());
tmpQSourceFile.remove();
}
+bool tst_CompilerWarnings::shouldIgnoreWarning(QString const& warning)
+{
+ if (warning.isEmpty()) {
+ return true;
+ }
+
+ // icecc outputs warnings if some icecc node breaks
+ if (warning.startsWith("ICECC[")) {
+ return true;
+ }
+
+ // Add more bogus warnings here
+
+ return false;
+}
+
QTEST_APPLESS_MAIN(tst_CompilerWarnings)
#include "tst_compilerwarnings.moc"
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index 74ed7fc..ca563ef 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -279,6 +279,8 @@ private Q_SLOTS:
void getAndThenDeleteObject_data();
void getAndThenDeleteObject();
+ void symbianOpenCDataUrlCrash();
+
// NOTE: This test must be last!
void parentingRepliesToTheApp();
};
@@ -4153,6 +4155,22 @@ void tst_QNetworkReply::getAndThenDeleteObject()
}
}
+// see https://bugs.webkit.org/show_bug.cgi?id=38935
+void tst_QNetworkReply::symbianOpenCDataUrlCrash()
+{
+ QString requestUrl("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAWCAYAAAA1vze2AAAAB3RJTUUH2AUSEgolrgBvVQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAARnQU1BAACxjwv8YQUAAAHlSURBVHja5VbNShxBEK6ZaXtnHTebQPA1gngNmfaeq+QNPIlIXkC9iQdJxJNvEHLN3VkxhxxE8gTmEhAVddXZ6Z3f9Ndriz89/sHmkBQUVVT1fB9d9c3uOERUKTunIdn3HzstxGpYBDS4wZk7TAJj/wlJ90J+jnuygqs8svSj+/rGHBos3rE18XBvfU3no7NzlJfUaY/5whAwl8Lr/WDUv4ODxTMb+P5xLExe5LmO559WqTX/MQR4WZYEAtSePS4pE0qSnuhnRUcBU5Gm2k9XljU4Z26I3NRxBrd80rj2fh+KNE0FY4xevRgTjREvPFpasAK8Xli6MUbbuKw3afAGgSBXozo5u4hkmncAlkl5wx8iMGbdyQjnCFEiEwGiosj1UQA/x2rVddiVoi+l4IxE0PTDnx+mrQBvvnx9cFz3krhVvuhzFn579/aq/n5rW8fbtTqiWhIQZEo17YBvbkxOXNVndnYpTvod7AtiuN2re0+siwcB9oH8VxxrNwQQAhzyRs30n7wTI2HIN2g2QtQwjjhJIQatOq7E8bIVCLwzpl83Lvtvl+NohWWlE8UZTWEMAGCcR77fHKhPnZF5tYie6dfdxCphACmLPM+j8bYfmTryg64kV9Vh3mV8jP0b/4wO/YUPiT/8i0MLf55lSQAAAABJRU5ErkJggg==");
+ QUrl url = QUrl::fromEncoded(requestUrl.toLatin1());
+ QNetworkRequest req(url);
+ QNetworkReplyPtr reply;
+
+ RUN_REQUEST(runSimpleRequest(QNetworkAccessManager::GetOperation, req, reply));
+
+ QCOMPARE(reply->url(), url);
+ QCOMPARE(reply->error(), QNetworkReply::NoError);
+
+ QCOMPARE(reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), qint64(598));
+}
+
// NOTE: This test must be last testcase in tst_qnetworkreply!
diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp
index 8dffebb..3cc0d78 100644
--- a/tests/auto/qurl/tst_qurl.cpp
+++ b/tests/auto/qurl/tst_qurl.cpp
@@ -1409,7 +1409,7 @@ void tst_QUrl::setUrl()
void tst_QUrl::i18n_data()
{
QTest::addColumn<QString>("input");
- QTest::addColumn<QByteArray>("punyOutput");
+ QTest::addColumn<QByteArray>("punyOutput");
QTest::newRow("øl") << QString::fromLatin1("http://ole:passord@www.øl.no/index.html?ole=æsemann&ilder gud=hei#top")
<< QByteArray("http://ole:passord@www.xn--l-4ga.no/index.html?ole=%C3%A6semann&ilder%20gud=hei#top");
@@ -1631,6 +1631,10 @@ void tst_QUrl::toString_data()
QTest::newRow("nopath_task31320") << QString::fromLatin1("host://protocol")
<< uint(QUrl::None)
<< QString::fromLatin1("host://protocol");
+
+ QTest::newRow("underscore_QTBUG-7434") << QString::fromLatin1("http://foo_bar.host.com/rss.php")
+ << uint(QUrl::None)
+ << QString::fromLatin1("http://foo_bar.host.com/rss.php");
}
void tst_QUrl::toString()
@@ -2160,25 +2164,25 @@ void tst_QUrl::toPercentEncoding_data()
QTest::addColumn<QByteArray>("includeInEncoding");
QTest::newRow("test_01") << QString::fromLatin1("abcdevghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678-._~")
- << QByteArray("abcdevghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678-._~")
+ << QByteArray("abcdevghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ012345678-._~")
<< QByteArray("")
<< QByteArray("");
QTest::newRow("test_02") << QString::fromLatin1("{\t\n\r^\"abc}")
- << QByteArray("%7B%09%0A%0D%5E%22abc%7D")
+ << QByteArray("%7B%09%0A%0D%5E%22abc%7D")
<< QByteArray("")
<< QByteArray("");
QTest::newRow("test_03") << QString::fromLatin1("://?#[]@!$&'()*+,;=")
- << QByteArray("%3A%2F%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D")
+ << QByteArray("%3A%2F%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D")
<< QByteArray("")
<< QByteArray("");
QTest::newRow("test_04") << QString::fromLatin1("://?#[]@!$&'()*+,;=")
- << QByteArray("%3A%2F%2F%3F%23%5B%5D%40!$&'()*+,;=")
+ << QByteArray("%3A%2F%2F%3F%23%5B%5D%40!$&'()*+,;=")
<< QByteArray("!$&'()*+,;=")
<< QByteArray("");
QTest::newRow("test_05") << QString::fromLatin1("abcd")
<< QByteArray("a%62%63d")
<< QByteArray("")
- << QByteArray("bc");
+ << QByteArray("bc");
}
void tst_QUrl::toPercentEncoding()
@@ -2188,7 +2192,7 @@ void tst_QUrl::toPercentEncoding()
QFETCH(QByteArray, excludeInEncoding);
QFETCH(QByteArray, includeInEncoding);
- QByteArray encodedUrl = QUrl::toPercentEncoding(original, excludeInEncoding, includeInEncoding);
+ QByteArray encodedUrl = QUrl::toPercentEncoding(original, excludeInEncoding, includeInEncoding);
QCOMPARE(encodedUrl.constData(), encoded.constData());
QCOMPARE(original, QUrl::fromPercentEncoding(encodedUrl));
}
@@ -2456,6 +2460,8 @@ void tst_QUrl::isValid()
QUrl url = QUrl::fromEncoded("http://strange<username>@ok-hostname/", QUrl::StrictMode);
QVERIFY(!url.isValid());
// < and > are not allowed in userinfo in strict mode
+ url.setUserName("normal_username");
+ QVERIFY(url.isValid());
}
{
QUrl url = QUrl::fromEncoded("http://strange<username>@ok-hostname/");
@@ -2466,7 +2472,18 @@ void tst_QUrl::isValid()
QUrl url = QUrl::fromEncoded("http://strange;hostname/here");
QVERIFY(!url.isValid());
QCOMPARE(url.path(), QString("/here"));
+ url.setAuthority("foobar@bar");
+ QVERIFY(url.isValid());
+ }
+
+ {
+ QUrl url = QUrl::fromEncoded("foo://stuff;1/g");
+ QVERIFY(!url.isValid());
+ QCOMPARE(url.path(), QString("/g"));
+ url.setHost("stuff-1");
+ QVERIFY(url.isValid());
}
+
}
void tst_QUrl::schemeValidator_data()
@@ -3269,7 +3286,6 @@ void tst_QUrl::std3violations_data()
QTest::newRow("question") << "foo?bar" << true;
QTest::newRow("at") << "foo@bar" << true;
QTest::newRow("backslash") << "foo\\bar" << false;
- QTest::newRow("underline") << "foo_bar" << false;
// these characters are transformed by NFKC to non-LDH characters
QTest::newRow("dot-like") << QString::fromUtf8("foo\342\200\244bar") << false; // U+2024 ONE DOT LEADER
@@ -3314,6 +3330,7 @@ void tst_QUrl::std3deviations_data()
QTest::newRow("ending-dot") << "example.com.";
QTest::newRow("ending-dot3002") << QString("example.com") + QChar(0x3002);
+ QTest::newRow("underline") << "foo_bar"; //QTBUG-7434
}
void tst_QUrl::std3deviations()