summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-06-01 03:32:36 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-06-01 03:32:36 (GMT)
commit918b7d92a1c27d0fa10a75db975dcf30963acc94 (patch)
treeec93afad8058af542bf2938b1051efb364aa38a2 /tests
parentc9bb16f0b34f180bf955682ab31fc1ff63d5de84 (diff)
parente3f05380d79ca9b23c120b496104ea44b5ab5b5a (diff)
downloadQt-918b7d92a1c27d0fa10a75db975dcf30963acc94.zip
Qt-918b7d92a1c27d0fa10a75db975dcf30963acc94.tar.gz
Qt-918b7d92a1c27d0fa10a75db975dcf30963acc94.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Add the Qt::TextBypassShaping flag. QTextEngine: skip an unnecessary call to GetDeviceCaps on Windows. Add my 4.7.0 changes qdoc: Added DITA XML generator doc: Fixed confusing ownership issue. update Russian translations for Qt tools update Russian translation for Qt libraries QXmlSchema documentation correction doc: Changed last breadcrumb to not be a link. doc: Fixed reference to setSize(), which is in QRectF. QNetworkCookie: do not accept cookies with non-alNum domain QtDeclarative: Remove trailing commas in enums Doc: MonotonicClock is obviously monotonic
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qfontmetrics/tst_qfontmetrics.cpp15
-rw-r--r--tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp6
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
index 5d73764..81e064e 100644
--- a/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
+++ b/tests/auto/qfontmetrics/tst_qfontmetrics.cpp
@@ -71,6 +71,7 @@ private slots:
void elidedText();
void veryNarrowElidedText();
void averageCharWidth();
+ void bypassShaping();
void elidedMultiLength();
void elidedMultiLengthF();
void bearingIncludedInBoundingRect();
@@ -219,6 +220,20 @@ void tst_QFontMetrics::averageCharWidth()
QVERIFY(fmf.averageCharWidth() != 0);
}
+void tst_QFontMetrics::bypassShaping()
+{
+ QFont f;
+ QFontMetrics fm(f);
+ QString text = " A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z";
+ int textWidth = fm.width(text, -1, Qt::TextBypassShaping);
+ QVERIFY(textWidth != 0);
+ int charsWidth = 0;
+ for (int i = 0; i < text.size(); ++i)
+ charsWidth += fm.width(text[i]);
+ // This assertion is needed in QtWebKit's WebCore::Font::offsetForPositionForSimpleText
+ QCOMPARE(textWidth, charsWidth);
+}
+
template<class FontMetrics> void elidedMultiLength_helper()
{
QString text1 = "Long Text 1\x9cShorter\x9csmall";
diff --git a/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp b/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp
index 5854ae1..72d8eda 100644
--- a/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp
+++ b/tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp
@@ -693,6 +693,12 @@ void tst_QNetworkCookie::parseMultipleCookies_data()
cookieA.setPath("/foo");
list = QList<QNetworkCookie>() << cookieA << cookieB;
QTest::newRow("real-3") << "a=b; expires=Mar 10 07:00:00 2009 GMT, Tue; path=/foo\nc=d; expires=Fri Mar 20 07:00:00 2009 GMT" << list;
+
+ // do not accept cookies with non-alphanumeric characters in domain field (QTBUG-11029)
+ cookie = QNetworkCookie("NonAlphNumDomName", "NonAlphNumDomValue");
+ cookie.setDomain("!@#$%^&*();:."); // the ';' is actually problematic, because it is a separator
+ list = QList<QNetworkCookie>();
+ QTest::newRow("domain-non-alpha-numeric") << "NonAlphNumDomName=NonAlphNumDomValue; domain=!@#$%^&*()" << list;
}
void tst_QNetworkCookie::parseMultipleCookies()