diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-01 10:06:42 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-01 10:06:42 (GMT) |
commit | a842b7e0a937a934e8af7b1edad324db8425ba8f (patch) | |
tree | b65fe71996ca9bc320854d6dc405993810a55f0a /tests | |
parent | 532861d77b661f332e5a16c031926da38a813ec5 (diff) | |
parent | 70ba57c4716749c99e302a4eda4695942d0b45fe (diff) | |
download | Qt-a842b7e0a937a934e8af7b1edad324db8425ba8f.zip Qt-a842b7e0a937a934e8af7b1edad324db8425ba8f.tar.gz Qt-a842b7e0a937a934e8af7b1edad324db8425ba8f.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:
doc: Added DITA XML generator
Fix build failure on Symbian 3.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.cpp | 15 | ||||
-rw-r--r-- | tests/auto/qnetworkcookie/tst_qnetworkcookie.cpp | 6 |
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() |