summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Port QHostAddress to use the new IP utilities in QtCoreThiago Macieira2012-03-281-15/+17
| | | | | | | | | | | The new code now generates lowercase hex instead of uppercase, so adapt the unit tests to pass. Also, "123.0.0" is now considered valid (compatibility with inet_aton). Change-Id: I07b5125abf60106dc5e706033d60836fb690a41f Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Add support for IPv6 parsing and reconstructing the addressThiago Macieira2012-03-281-0/+285
| | | | | | | | | Similarly, only test against the libc function on Linux, as other OS sometimes have different behaviour. Change-Id: I9b8ef9a3d660a59882396d695202865ca307e528 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Add a function to parse IPv4 addresses in QtCoreThiago Macieira2012-03-283-1/+225
| | | | | | | | | | In the unit test, check against inet_aton on Linux with GLIBC only. Other platforms have this function too, but they sometimes have different behaviour, so don't try to test them equally. Change-Id: I1a77e405ac7e713d4cf1cee03ea5ce17fb47feef Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* Remove WA_PaintOutsidePaintEventDebao Zhang2012-03-282-42/+0
| | | | | | | | | WA_PaintOutsidePaintEvent is only suggested to be used when porting Qt3 code to Qt 4 under X11 platform. and it has been broken now. Change-Id: Ie4297b2a449f1055ca10ada9efb930e6018b1efb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Allow auto tests to stay away from the user's configuration.David Faure2012-03-281-2/+55
| | | | | | | | | | | | | | | QStandardPaths now knows a "test mode" which changes writable locations to point to test directories, in order to prevent auto tests from reading from or writing to the current user's configuration. This affects the locations into which test programs might write files: GenericDataLocation, DataLocation, ConfigLocation, GenericCacheLocation, CacheLocation. Other locations are not affected. Change-Id: I29606c2e74714360edd871a8c387a5c1ef7d1f54 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Improve output on test failuresJoão Abecasis2012-03-281-16/+14
| | | | | | | | | | | | | | | | | | | | This adds checks to ensure Q_ALIGNOF is returning the desired alignment for explicitly-aligned types. The alignment check is now inlined in the test inside QCOMPARE so we get slightly more informative errors: FAIL! : tst_Collections::alignment() Compared values are not the same Actual (quintptr(&it.value()) % Value::PreferredAlignment): 64 Expected (quintptr(0)): 0 Loc: [tst_collections.cpp(3384)] In this case, this is enough to notice "non-native" alignments are being requested. Having test parameters otherwise hidden in template arguments doesn't help the situation. Change-Id: I05267fd25b71f183cfb98fb5b0a7dfd6c28da816 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Silence unused comparison result warnings (clang)João Abecasis2012-03-281-4/+4
| | | | | | | | | | | | | The intent is to force instantiation of template container classes and semantics or behaviour are otherwise irrelevant in this context. tst_collections.cpp:3036:15: warning: inequality comparison result unused tst_collections.cpp:3037:15: warning: equality comparison result unused tst_collections.cpp:3100:15: warning: inequality comparison result unused tst_collections.cpp:3101:15: warning: equality comparison result unused Change-Id: I70ad38b18dcbc43879e36a34b1da460aee5f7b07 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix loop conditions, after warnings from clangJoão Abecasis2012-03-281-2/+4
| | | | | | | | tst_qmap.cpp:697:43: warning: inequality comparison result unused tst_qmap.cpp:717:50: warning: inequality comparison result unused Change-Id: I300f9e10b7748306b99c3c8c38f3cc2661a569ad Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Don't hardcode the order of elements in QHashesThiago Macieira2012-03-282-32/+15
| | | | | | | | | Instead use QMap if we want a stable order. Task-number: QTBUG-24995 Change-Id: I93f643df236f5078768f539615fa47163e5262e8 Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Unit-test the additional QBasicAtomicXXX expansionsThiago Macieira2012-03-282-6/+114
| | | | | | | | | | | Test that they do expand properly and don't produce errors. This is templated code, so it doesn't get tested fully unless we instantiate them. Also check that the alignments are correct. Change-Id: I2a8ee2165167f54b652b4227411e209850974b8e Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Remove workaround for QComboBox not having a USER property.Stephen Kelly2012-03-281-0/+31
| | | | | | | | | | QComboBox does in fact have a user property since b1b87a73012342dc1619a8e907ea9954d59ca564. Change-Id: I24eb2ef267cec5d8a9f7348954b703fa6df04fa5 Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: David Faure <faure@kde.org>
* Add USER properties to QDateEdit and QTimeEdit.Stephen Kelly2012-03-281-0/+10
| | | | | | | | | | | | Both classes had such components before, but there were issues with the NOTIFY signal not being in the same class as the Q_PROPERTY. This patch solves that problem by using a signal of a different name. Task-number: QTBUG-15731 Change-Id: Ibc7ce4dba8a6b88c05d62a90e14d0101c5cd3082 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* Make QTranslator testcase independent of WidgetsJoão Abecasis2012-03-282-9/+7
| | | | | | | | There isn't really a need for the dependency as LanguageChange events can be caught in QObject::eventFilter, directly. Change-Id: I39778fbe1663924d97705b514ae399cfd3749776 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Merge master into api_changesKent Hansen2012-03-2714-41/+415
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qisenum.h src/dbus/qdbusconnection_p.h src/widgets/kernel/qwidget.cpp tests/auto/other/qaccessibility/tst_qaccessibility.cpp Change-Id: I85102515d5fec835832cc20ffdc5c1ba578bd01d
| * Mark tst_qdialog as insignificant on mac.Rohan McGovern2012-03-271-0/+1
| | | | | | | | | | | | | | | | | | This autotest gives different results on consecutive runs, and is therefore insignificant for the purpose of detecting regressions. Task-number: QTBUG-24977 Change-Id: I5c4dfd663ce5df6b60ae47a29d332c06e3c0585f Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
| * Cocoa: don't show window when calling raise()Bradley T. Hughes2012-03-261-3/+0
| | | | | | | | | | | | | | | | | | | | | | Calling raise() on a hidden window should not show it. The setVisible() function will ensure that the window is raised (since we use orderFront or makeKeyAndOrderFront). This fixes the failing tst_QDockWidget::task169808_setFloating() test as well. Task-number: QTBUG-24774 Change-Id: If34472ebbcd615c10654efafd54c84c03d10bc8c Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
| * Fix measurement system for the UKLars Knoll2012-03-261-0/+17
| | | | | | | | | | | | | | | | THe UK still uses the Imperial system at least for distances and many other things. Change-Id: I99379de35620114328ad6a7fc9b226a46692bedd Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
| * Password editor mask delay stylable by platform pluginPekka Vuorela2012-03-261-6/+4
| | | | | | | | | | | | | | | | | | Replaced hard coding as QT_GUI_PASSWORD_ECHO_DELAY with a style hint. Change-Id: I0b78ebad723dbe19d9b9496583203e31545874e2 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
| * Test mouse events more thoroughly in QWindow autotestLaszlo Agocs2012-03-261-5/+118
| | | | | | | | | | | | | | | | | | | | Apparently there are still issues here and there (e.g. in declarative) with properly recognizing more complex event sequences (like triple clicks). The behavior of qtbase is correct but we need a test case that makes sure the functionality will not regress. Change-Id: I08c558fcfdde0dd06e194b4f0affc6f6896573bf Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
| * Fix QGuiApplication::keyboardModifiers()Bradley T. Hughes2012-03-261-0/+75
| | | | | | | | | | | | | | | | | | Make sure that the keybaord modifiers are maintained properly when handling window system events. Change-Id: Ie75cbe5eb509c29e3d2291694f2de509fbf3098a Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
| * Fixed qthreadstorage unittest to work from install directoryKurt Korbatits2012-03-261-0/+4
| | | | | | | | | | | | | | - Added install of crashonexit sub program Change-Id: I2cc3043d5c1b879665930552487b4fe54407fd25 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
| * Work around what apparently is a GCC 4.6.0 bugThiago Macieira2012-03-251-1/+1
| | | | | | | | | | | | | | | | The QFlags::operator int() isn't being called, so GCC complains that this isn't an integer expression. Change-Id: I537d06fd4a52ecbcddf0ef67807b298c42d3e911 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * Improve accessibility test to handle more text events.Frederik Gladhorn2012-03-251-9/+36
| | | | | | | | | | Change-Id: I67ece6c9bb755e84c786b32e8e3396eaf634fda1 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
| * Restore Qt4 compat in QDesktopServices::DataLocationDavid Faure2012-03-241-2/+33
| | | | | | | | | | | | | | "/data/" was appended to the base directory. Change-Id: I220f2ce74c36b795bc49c7c84106feb0709d1547 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QPrinterInfo: remove a test that is too earlyThiago Macieira2012-03-241-1/+1
| | | | | | | | | | | | | | | | If we want to have any chance of getting the missing printers reported, we cannot check the size beforehand. Change-Id: I450897fe53c04aeb1a4b217bd0c1f548c455a428 Reviewed-by: John Layt <jlayt@kde.org>
| * Fix compilation of tst_QSqlThread: no need to use QBasicAtomicInt hereThiago Macieira2012-03-241-1/+1
| | | | | | | | | | | | Change-Id: Ib474fe62501ee1ee5e3d7008c3b561f8db79265c Reviewed-by: Mark Brand <mabrand@mabrand.nl> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Make sure windows send accessibility activated updates.Frederik Gladhorn2012-03-241-4/+44
| | | | | | | | | | | | | | | | Both QWindow and QWidgetWindow should update with the active state signal. Change-Id: I0219f803aa0fb109765f0faa0aedb120c2a439f0 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
| * Added QAccessibleGroupBoxFrederik Gladhorn2012-03-241-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a new accessible interface for QGroupBox, as QAccessibleDisplay is not good enough when the QGroupBox is checkable. AccessibleFactory was modified to return a QAccessibleGroupBox when the accessible interface of a QGroupBox is requested. Created tst_QAccessibility::groupBoxTest Port to Qt5 of the patch by José Millán Soto <fid@gpul.org> Change-Id: I6c23dcf5562b3ea269b04102e78463b65827188a Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com> (cherry picked from commit c03ceb203c65d9e3485fad848bfc0c4b6ee3e9aa)
| * API cleanup: remove CoordinateType enumJan-Arve Saether2012-03-241-4/+5
| | | | | | | | | | | | | | | | The bridge can do the mapping to and from screen position. This is now done in the windows bridge. Change-Id: I5ca5df0fbeeb58202539f55a0f62717fb1685092 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
| * Implement QSystemTrayIcon for X11.Friedemann Kleint2012-03-231-2/+5
| | | | | | | | | | | | | | Reimplement using a QWidget. Use X Change-Id: I7f8326598fb7210d59bc1d682cdada4526d5b6dd Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
| * Remove #if 0 sections from QRegExp autotestGiuseppe D'Angelo2012-03-231-3/+3
| | | | | | | | | | | | | | | | | | | | Use QEXPECT_FAIL instead (QRegExp is bugged w.r.t. the specific test data). Task-number: QTBUG-22466 Change-Id: Id5af01fa0d5c0536845fd4db19d4264498a8675b Reviewed-by: hjk <qthjk@ovi.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* | Enable endianness conversions on q(u)int8João Abecasis2012-03-253-1/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lack of support for these types is not a real issue as endian conversions on byte-sized types are no-ops. Still, the conversions are useful as they facilitate writing of generic code. They can also be used explicitly as a way to document in code an endian-specific binary format: uchar *data; quint8 tag = qFromLittleEndian<quint8>(data++); quint32 size = qFromLittleEndian<quint32>(data); This commit also adds a test for functions documented in the QtEndian header. Change-Id: I2f6c876ce89d2adb8c03a1c8a25921d225bf6f92 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Update QLocale data from CLDR v1.8.1 to CLDR v1.9.1Jędrzej Nowacki2012-03-241-1/+1
| | | | | | | | | | Change-Id: Ic84bbc82b364b92605c1bba64b6ec815bff970cb Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Add the Q_CORE_EXPORT macros to unit-test-exported codeThiago Macieira2012-03-231-2/+2
| | | | | | | | | | Change-Id: If21658bd5e4af0fdcc403b054fc1b8f46b5fcfb0 Reviewed-by: David Faure <faure@kde.org>
* | Fallback implementation of Q_ALIGNOFJoão Abecasis2012-03-232-30/+115
| | | | | | | | | | | | | | | | | | | | | | | | For all practical purposes, the fallback introduced here returns the desired value. Having a fallback enables unconditional use of Q_ALIGNOF. For compilers that provide native support for it, Q_ALIGNOF is otherwise #defined in qcompilerdetection.h. Change-Id: Ie148ca8936cbbf8b80fe87771a14797c39a9d30c Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add test cases to tst_QByteArrayJędrzej Nowacki2012-03-231-0/+137
| | | | | | | | | | | | | | | | | | | | Internally we construct QByteArrays from QStaticByteArrays. For example moc is generating QStaticByteArray structure for every string it saves. New test cases check if a QByteArray constructed from a QStaticByteArray behaves as a not statically constructed one. Change-Id: Ia4aa9a1a5bc0209507636c683a782dda00eae85c Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* | Merge "Merge master into api_changes" into refs/staging/api_changesKent Hansen2012-03-23186-833678/+529
|\ \
| * | Merge master into api_changesKent Hansen2012-03-23186-833678/+529
| |\| | | | | | | | | | Change-Id: I93551e4d13a1b0815b359b9415060e9089477db1
| | * Fixed QLineEdit to emit selectionChangedPekka Vuorela2012-03-231-4/+17
| | | | | | | | | | | | | | | | | | | | | Was not emitted when removed by input method event. Change-Id: Ia2c0dcb09d42826188d4612f4c1705a41874a31d Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
| | * Fix QPrinter test in WindowsMiikka Heikkinen2012-03-231-11/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed Q_WS_WIN flagging to Q_OS_WIN in QPrinter API and related implementation to make API match the documentation and Qt 4.8. Also Removed the unused internal HDC related functions from the API, that were previously behind Q_WS_WIN flag. Some of the properties tested are documented to be valid for native print engine only in X11 environment, so skipped testing those in non-xcb environments. Copy collation is also apparently not supported in Windows native print engine, though this seems to be undocumented, so skipped that only in Windows. At least one of the test blocks in tst_QPrinter::valuePreservation() failed due to default printer not getting set properly, so fixed that, too. Task-number: QTBUG-24191 Task-number: QTBUG-22927 Change-Id: I44a5e3d647a1279fcc7f1e99de6881f9be330246 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
| | * More UTF8 fix of raster autotestaavit2012-03-221-2/+1
| | | | | | | | | | | | | | | | | | | | | This completes 6c98fd2, for systems where default codec is not UTF8. Change-Id: I94795785d5d172558c40c06bd3ef4ffaba1624c5 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
| | * Allow autobound UDP sockets to send to IPv4 and IPv6Shane Kearns2012-03-221-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When writeDatagram is called without first binding the UDP socket, then bind it as QHostAddress::Any. This allows the same socket to be used to sent to both IPv4 and IPv6 destination addresses. Allowing the OS to autobind the socket inside sendTo() may result in a single protocol socket. Task-number: QTBUG-5275 Change-Id: I2b76507e8a8a38369c6eafb61ce4191d1d6cc930 Reviewed-by: Richard J. Moore <rich@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
| | * Significantly speed up insertion into QJsonObject/ArrayLars Knoll2012-03-221-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code was only allocating memory for the next insertion leading to a reallocation of the whole data for every single insertion. The code now reserves some space and uses a decent growth strategy to avoid repeated reallocs. Change-Id: I48b0feab71ba8ca73e7037f8460080f198b2f009 Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
| | * Make tst_qmovie work in shadow buildsThiago Macieira2012-03-221-2/+2
| | | | | | | | | | | | | | | Change-Id: I8fe4b5e98ce2fb1ac8420bf568f5c9c973165fbf Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
| | * Fix QSysInfo::WindowsVersion checking (QSysInfo::WV_NT_based is a mask)Joerg Bornemann2012-03-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Manual merge of the original fix 1ef309e9 in the Qt 4.8 repo. Task-number: QTBUG-20480 Change-Id: Id08500c2dd16965af3942e65cff1f4afa24180b0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
| | * Fixed QInputMethod API to use isVisible() instead of visible().Samuel Rødal2012-03-221-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Deprecate the old API for now as not to break existing usages. Change-Id: I7abbbbe8a34951282537a9d74cded03743f44df7 Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
| | * FocusAboutToChange event to be send before focus changesPekka Vuorela2012-03-222-21/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Focus change happen as: FocusAboutToChange event -> focus change -> FocusOut event -> FocusIn event. Input method need to have focus when calling commit(). Notification on focus about to be lost allows QWindow implementations to commit in time. Also changes QWidget documentation to match code reality. Change-Id: I17a8a374a33dd700909f79e370b42348869261a6 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
| | * Make comment() work in the C locale too.David Faure2012-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The parser makes the default language en_US, and no mimetype xml says <comment xml:lang="C">, so use the en_US string for the C locale, rather than returning an empty string. Change-Id: Iad7c142e8078abe357773249416e7ce9b3e29a92 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Return all expected paths in QStandardPaths::standardLocationsDavid Faure2012-03-221-31/+77
| | | | | | | | | | | | | | | | | | | | | | | | ApplicationsLocation and DataLocation were returning only the local path, rather than system paths + local path. Change-Id: I653d14e5bbe1e08c5fa1ecd5a6106336d1cd0369 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Cocoa: fix setting color with alpha channel value for color dialogTeemu Katajisto2012-03-221-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure that if ShowAlphaChannel option is set then also setShowsAlpha needs to be set for the panel before setting the current color, otherwise alpha channel value is omitted. Task-number: QTBUG-24320 Change-Id: Ifb3822711af8ffd0cf6cb4c8aab2b0020d296663 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>