diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-10 18:58:48 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-10 18:58:48 (GMT) |
commit | 0551521be2df929089f892dacce5bd64bc99096d (patch) | |
tree | 80ce18b7a620df94c2271beedb974271561bfba7 /tests/auto | |
parent | 3dc18b19ee2a02b93cc509a9162bf0a3900c6fd0 (diff) | |
parent | e26cba5c15ae02ae0fba9b73ed90c9b1f7b5286b (diff) | |
download | Qt-0551521be2df929089f892dacce5bd64bc99096d.zip Qt-0551521be2df929089f892dacce5bd64bc99096d.tar.gz Qt-0551521be2df929089f892dacce5bd64bc99096d.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:
Bearer management: Fix compilation with namespace.
fetch next token after class definition opening
delay next token fetching when opening namespace
don't let operator overloads confuse us
don't try to show source when no locations are given
Implement a private API for setting title widgets
Fix the bug for QSettings on Windows, to store qint32/quint32, qint64/quint64 in Windows registry.
fix CRLF
Added private API to install an x11EventFilter
NTLM code: Save domain in different variable
Update the error handling of invalid hostnames in QUrl.
Remove unsupported code from qobject.h for MSVC < .NET 2003
Properly implement qobject_cast for const pointers.
Revert "Doc: fixing page name bug caused by 07bbace404078dcfd82eff717daa97299b8ba52c changing qml elements page"
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp | 41 | ||||
-rw-r--r-- | tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result | 16 | ||||
-rw-r--r-- | tests/auto/qlineedit/tst_qlineedit.cpp | 18 | ||||
-rw-r--r-- | tests/auto/qmainwindow/tst_qmainwindow.cpp | 3 | ||||
-rw-r--r-- | tests/auto/qsettings/tst_qsettings.cpp | 63 | ||||
-rw-r--r-- | tests/auto/qurl/tst_qurl.cpp | 10 |
6 files changed, 140 insertions, 11 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp index f58f932..706e8d0 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/main.cpp @@ -302,3 +302,44 @@ static inline QString message2() } } + + + +// QTBUG-11426: operator overloads +class LotsaFun : public QObject +{ + Q_OBJECT +public: + int operator<<(int left, int right); +}; + +int LotsaFun::operator<<(int left, int right) +{ + tr("this is inside operator<<"); + return left << right; +} + + + +// QTBUG-12683: define in re-opened namespace +namespace NameSchpace { + +class YetMoreFun : public QObject +{ + Q_OBJECT +public: + void funStuff(); +}; + +} + +namespace NameSchpace { + +#define somevar 1 + +void YetMoreFun::funStuff() +{ + tr("funStuff!"); +} + +} diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result index 7ac318e..f73fc64 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result @@ -141,6 +141,22 @@ backslashed \ stuff.</source> </message> </context> <context> + <name>LotsaFun</name> + <message> + <location filename="main.cpp" line="318"/> + <source>this is inside operator<<</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> + <name>NameSchpace::YetMoreFun</name> + <message> + <location filename="main.cpp" line="342"/> + <source>funStuff!</source> + <translation type="unfinished"></translation> + </message> +</context> +<context> <name>Plurals, QCoreApplication</name> <message numerus="yes"> <location filename="main.cpp" line="81"/> diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp index bfa9406..93bd447 100644 --- a/tests/auto/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/qlineedit/tst_qlineedit.cpp @@ -3747,15 +3747,15 @@ void tst_QLineEdit::QTBUG697_paletteCurrentColorGroup() void tst_QLineEdit::QTBUG13520_textNotVisible() { LineEdit le; - le.setAlignment( Qt::AlignRight | Qt::AlignVCenter);
- le.show();
- QTest::qWaitForWindowShown(&le);
- le.setText("01-ST16-01SIL-MPL001wfgsdfgsdgsdfgsdfgsdfgsdfgsdfg");
- le.setCursorPosition(0);
- QTest::qWait(100); //just make sure we get he lineedit correcly painted
-
- QVERIFY(le.cursorRect().center().x() < le.width() / 2);
-
+ le.setAlignment( Qt::AlignRight | Qt::AlignVCenter); + le.show(); + QTest::qWaitForWindowShown(&le); + le.setText("01-ST16-01SIL-MPL001wfgsdfgsdgsdfgsdfgsdfgsdfgsdfg"); + le.setCursorPosition(0); + QTest::qWait(100); //just make sure we get he lineedit correcly painted + + QVERIFY(le.cursorRect().center().x() < le.width() / 2); + } diff --git a/tests/auto/qmainwindow/tst_qmainwindow.cpp b/tests/auto/qmainwindow/tst_qmainwindow.cpp index 1273e85..6f95672 100644 --- a/tests/auto/qmainwindow/tst_qmainwindow.cpp +++ b/tests/auto/qmainwindow/tst_qmainwindow.cpp @@ -1449,8 +1449,7 @@ Q_DECLARE_METATYPE(MoveList) void MoveSeparator::apply(QMainWindow *mw) const { - - QMainWindowLayout *l = qobject_cast<QMainWindowLayout*>(mw->layout()); + QMainWindowLayout *l = qFindChild<QMainWindowLayout *>(mw->layout()); QVERIFY(l); QList<int> path; diff --git a/tests/auto/qsettings/tst_qsettings.cpp b/tests/auto/qsettings/tst_qsettings.cpp index 058a750..0395eff 100644 --- a/tests/auto/qsettings/tst_qsettings.cpp +++ b/tests/auto/qsettings/tst_qsettings.cpp @@ -60,6 +60,10 @@ #include <io.h> #endif +#if defined(Q_OS_WIN) +#include <QtCore/qt_windows.h> +#endif + #ifndef QSETTINGS_P_H_VERSION #define QSETTINGS_P_H_VERSION 1 #endif @@ -127,6 +131,9 @@ private slots: #if !defined(Q_OS_WIN) && !defined(Q_OS_SYMBIAN) void dontReorderIniKeysNeedlessly(); #endif +#if defined(Q_OS_WIN) + void qtbug_13249(); +#endif /* These tests were developed for the Qt 3 QSettings class. @@ -3801,6 +3808,62 @@ void tst_QSettings::setPathBug() } #endif +#if defined(Q_OS_WIN) + +static DWORD readKeyType(HKEY handle, const QString &rSubKey) +{ + DWORD dataType; + DWORD dataSize; + LONG res = RegQueryValueEx(handle, reinterpret_cast<const wchar_t *>(rSubKey.utf16()), 0, &dataType, 0, &dataSize); + + if (res == ERROR_SUCCESS) + return dataType; + + return 0; +} + +void tst_QSettings::qtbug_13249() +{ + QSettings settings1(QSettings::UserScope, "software.org", "KillerAPP"); + + qint32 x = 1024; + settings1.setValue("qtbug_13249_a", (qint32)x); + QCOMPARE(settings1.value("qtbug_13249_a").toInt(), (qint32)1024); + settings1.setValue("qtbug_13249_b", (quint32)x); + QCOMPARE(settings1.value("qtbug_13249_b").toUInt(), (quint32)1024); + settings1.setValue("qtbug_13249_c", (qint64)x); + QCOMPARE(settings1.value("qtbug_13249_c").toLongLong(), (qint64)1024); + settings1.setValue("qtbug_13249_d", (quint64)x); + QCOMPARE(settings1.value("qtbug_13249_d").toULongLong(), (quint64)1024); + settings1.sync(); + + HKEY handle; + LONG res; + QString keyName = "Software\\software.org\\KillerAPP"; + res = RegOpenKeyEx(HKEY_CURRENT_USER, reinterpret_cast<const wchar_t *>(keyName.utf16()), 0, KEY_READ, &handle); + if (res == ERROR_SUCCESS) + { + DWORD dataType; + dataType = readKeyType(handle, QString("qtbug_13249_a")); + if (dataType != 0) { + QCOMPARE((int)REG_DWORD, (int)dataType); + } + dataType = readKeyType(handle, QString("qtbug_13249_b")); + if (dataType != 0) { + QCOMPARE((int)REG_DWORD, (int)dataType); + } + dataType = readKeyType(handle, QString("qtbug_13249_c")); + if (dataType != 0) { + QCOMPARE((int)REG_QWORD, (int)dataType); + } + dataType = readKeyType(handle, QString("qtbug_13249_d")); + if (dataType != 0) { + QCOMPARE((int)REG_QWORD, (int)dataType); + } + RegCloseKey(handle); + } +} +#endif /* // Not tested at the moment. void tst_QSettings::oldSubkeyList() diff --git a/tests/auto/qurl/tst_qurl.cpp b/tests/auto/qurl/tst_qurl.cpp index b5236e5..63f9721 100644 --- a/tests/auto/qurl/tst_qurl.cpp +++ b/tests/auto/qurl/tst_qurl.cpp @@ -2478,16 +2478,26 @@ void tst_QUrl::isValid() QUrl url = QUrl::fromEncoded("http://strange;hostname/here"); QVERIFY(!url.isValid()); QCOMPARE(url.path(), QString("/here")); + url.setAuthority("strange;hostname"); + QVERIFY(!url.isValid()); url.setAuthority("foobar@bar"); QVERIFY(url.isValid()); + url.setAuthority("strange;hostname"); + QVERIFY(!url.isValid()); + QVERIFY(url.errorString().contains("invalid hostname")); } { QUrl url = QUrl::fromEncoded("foo://stuff;1/g"); QVERIFY(!url.isValid()); QCOMPARE(url.path(), QString("/g")); + url.setHost("stuff;1"); + QVERIFY(!url.isValid()); url.setHost("stuff-1"); QVERIFY(url.isValid()); + url.setHost("stuff;1"); + QVERIFY(!url.isValid()); + QVERIFY(url.errorString().contains("invalid hostname")); } } |