summaryrefslogtreecommitdiffstats
path: root/tests/auto
Commit message (Collapse)AuthorAgeFilesLines
* QDate: fix calculation of the week number for the last days of 2020Thiago Macieira2016-01-091-10/+31
| | | | | | | | | | Off-by-one error: we should have calculated whether the current year is leap, not the next year. This affected any 53-week leap years. Task-number: QTBUG-50273 Change-Id: I134ce5db2f82468585ffffff14264cb9f12998fd Reviewed-by: Martin Klapetek <mklapetek@kde.org> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* don't rely on transitive dependenciesOswald Buddenhagen2016-01-085-0/+8
| | | | | | Change-Id: Ide872b452e02ebefb3eeb51464c8d59e8bf58bc4 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Prospective fix for running cmake tests with -no-widgetsSimon Hausmann2016-01-071-1/+1
| | | | | | | Don't try to run test_interface when Qt is configured without QtWidgets. Change-Id: If6c376c250215c1d639b06881d16c0141091f288 Reviewed-by: Stephen Kelly <ske@ableton.com>
* dbus: Add method serial() and replySerial() to class DBusMessage.Ralf Habacker2016-01-071-0/+7
| | | | | | | | | | | | | This patch includes setup of class member 'msg' in QDBusMessagePrivate::toDBusMessage() to be able to get the serial after message sending. Testcases for comparing the 'reply serial to' with the 'serial' are included. Task-number: QTBUG-44490 Change-Id: Iae7c48f5b0c70a6c5ae500904072b38b46dfd876 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Blacklist failing tst_QFile tests (OS X)Timur Pocheptsov2016-01-061-0/+4
| | | | | | | | | | | openStandardStreamsFileDescriptors and openStandardStreamsBufferedStreams fail on OS X: lseek somehow works on sequential streams (standard streams) but QFile has pos() == 0 (since it's sequential). Change-Id: I6a6161c012a91de189f59c533880fb8fe7a66d37 Task-number: QTBUG-49841 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Tony Sarajärvi <tony.sarajarvi@theqtcompany.com>
* winrt: Use winsock2 API for hostname resolution on WinRT/WinPhoneOliver Wolff2016-01-051-0/+2
| | | | | | | | | | | | | | | That API has been available for WinRT and Windows Phone for some time now. By using it to get the machine name and for hostname resolution we can get rid of some winrt-only code and use qhostinfo_win.cpp on WinRT and Windows phone as well. Additionally the required capability was added to tst_qhostinfo so that this auto test can be run without any manual editing. Change-Id: I63fa5521bf8cdb0c919bd5a0100ea977c865622a Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* tst_Gesture - fix failing tests on OS X 10.11Timur Pocheptsov2016-01-051-19/+37
| | | | | | | | | | | | This test seems to be quite broken on OS X: qWaitForWindowExposed returns too early (while no window is on screen) so gestures can not be dispatched QApplication::topLevelAt(pt) - returns null. Use qWait + isExposed combo instead (similar to qWaitForWindowExposed, but there is no isExposed test before the loop). Change-Id: I85fbd773ccce0ca92b2dceb1749d67ef767aa0cf Task-number: QTBUG-49849 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Make use of preprocessor easier to understand.Edward Welbourne2016-01-041-17/+17
| | | | | | | | The #if had a condition that was needlessly hard to understand; and was widely separated from its #else clause. Change-Id: I43f4282993f4f2e8c4b5ad07dc2c2e06a6b95aa9 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* Autotest: Make sure that we can place calls with disabled deliveryThiago Macieira2016-01-031-2/+4
| | | | | | | | This often happens in applications. Besides, we are expecting at least a call to RequestName to happen. Change-Id: Ifd2454ffba454fd591d0ffff1425a84563267d19 Reviewed-by: David Faure <david.faure@kdab.com>
* Autotest: test both libdbus-1 load failure and connection failureThiago Macieira2016-01-023-1/+9
| | | | | Change-Id: I39cc61d0d59846ab8c23ffff14242294649c1a45 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Autotest: Mark D-Bus tests that don't connect to the bus as parallelThiago Macieira2016-01-025-5/+5
| | | | | | | There's no problem running them in parallel. Change-Id: I39cc61d0d59846ab8c23ffff142420a127ab6968 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Suspend processing of some messages in the default busses by defaultThiago Macieira2016-01-023-0/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To retain a bit compatibility with applications developed in the last 9 years that expect that QDBusConnections won't process their events until the event loop runs, we now suspend the handling of incoming messages in the two default buses (and only in them) and resume when the event loop starts. This is required because the new threaded QtDBus would otherwise process incoming messages that the application didn't expect it to. For example, if the application first acquires names on the bus and only after that registers objects with QtDBus, there's a small window in which the name is acquired and visible to other applications, but no objects are registered yet. Calls to those objects may be received, would then be processed in the QDBusConnectionManager thread and fail. The work around is to disable the actual handling of method calls and signals in QDBusConnectionPrivate::handleMessage. Instead, those messages are queued until later. Due to the way that libdbus-1 works, outgoing method calls that are waiting for replies are not affected, since their processing does not happen in handleMessage(). [ChangeLog][Important Behavior Changes] QtDBus now uses threads to implement processing of incoming and outgoing messages. This solves a number of thread safety issues and fixes an architectural problem that would cause all processing to stop if a particular thread (usually the main thread) were blocked in any operation. On the flip side, application developers need to know that modifications to a QDBusConnection may be visible immediately on the connection, so they should be done in an order that won't allow for incomplete states to be observed (for example, first register all objects, then acquire service names). Change-Id: I39cc61d0d59846ab8c23ffff1423c6d555f6ee0a Reviewed-by: David Faure <david.faure@kdab.com>
* QMimeDatabase: follow symlinks when checking for FIFO etc.David Faure2015-12-292-0/+28
| | | | | | | | | This was documented, but not what the code did. Task-number: QTBUG-48529 Change-Id: I4849778c61dcae13be27c62b24717693c0c07d78 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Enable a test for QFilePrivate::fileName offset on 32 bit LinuxAlex Trotsenko2015-12-231-1/+1
| | | | | Change-Id: I3577ff7126263ddbe4b7714095480e6f1da7b661 Reviewed-by: hjk <hjk@theqtcompany.com>
* tst_collections: "explicit instantiation of 'NS::QList' must occur in ↵Marc Mutz2015-12-231-0/+2
| | | | | | | | | | | namespace 'NS'" Probably correct. The question is just why this code has survived for so many years. Change-Id: Iaf01850476f9b066243abebb9ee6c5928d7ada19 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* tst_QTemporaryDir::nonWritableCurrentDir: Add a check for write protection.Friedemann Kleint2015-12-221-6/+13
| | | | | | | | /home has been observed to be writable on some CI machines. Add checks verifying existence and correct permissions. Change-Id: Ie0f952e20d0d8eb0b57234eea2e2ecb78f5a7b58 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* Fix QJsonValue::fromVariant() if the variant contains a json objectLars Knoll2015-12-221-0/+6
| | | | | | | | | | | | | If the variant contains a known json type (value, array, object or document), simply unwrap those. In the case of the json document wrap the contained object/array into a QJsonValue. This should be the expected behavior, and makes more sense than returning a null QJsonValue. Task-number: QTBUG-41234 Change-Id: Id084fc11220d51aaf78b7694fd0ebef1411f5c51 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QUrl: revert path-normalization in setPath().David Faure2015-12-221-11/+43
| | | | | | | | | | | | Path normalization should happen only when NormalizePathSegments is set. Use a less intrusive fix for the setPath("//path") issue that commit aba336c2b4ad8 was about. This allows fromLocalFile("/tmp/.") to keep the "/." at the end, which is useful for appending to the path later on (e.g. to get "/tmp/.hidden") Change-Id: Ibc3d4d3276c1d3aaee1774e21e24d01af38fa880 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStandardPaths: warn if $XDG_RUNTIME_DIR doesn't existDavid Faure2015-12-221-0/+23
| | | | | | | | | | | | | If the environment variable is set, but points to a non-existing directory, the user would get a warning about chmod failing. Better be clear and warn about the fact that the directory itself doesn't exist. Also warn if $XDG_RUNTIME_DIR points to a file rather than a directory. Task-number: QTBUG-48771 Change-Id: If84e72d768528ea4b80260afbbc18709b7b738a8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* add enablers for printing project errors in cumulative modeOswald Buddenhagen2015-12-211-2/+2
| | | | | | | | | | this doesn't actually do anything in qmake. Change-Id: Ia14953a5a9dc31af56ad6c338017dd5b85bb4494 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> (cherry picked from qttools/08d0cb6f8e90a818bf6d3bec7a6d00f16419b8c0) Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* make write_file() capable of making files (not) executableOswald Buddenhagen2015-12-211-2/+9
| | | | | Change-Id: I9ca96bc3408160261781697a3471c1f446c86c3a Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Stabilize tst_qtimeline::resumeJędrzej Nowacki2015-12-211-5/+4
| | | | | Change-Id: Ife0ce27c680196ed1fe3d037ea0367e511560c96 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Speedup tst_qtimeline::finishedJędrzej Nowacki2015-12-211-2/+1
| | | | | Change-Id: Id9ae42663d8830365d4dcfab92b48621eb1b409f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Get rid of qWait in tst_qtimeline::restart to make it less flakyJędrzej Nowacki2015-12-211-6/+3
| | | | | Change-Id: Iba3a9e5dce6bd7ff6e241fae738cfc51386f0c75 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Improve tst_qtimeline::valueJędrzej Nowacki2015-12-211-11/+7
| | | | | | | | | | | | | The test was improved by: - Use QCOMPARE instead of QVERIFY - Use QTRY_ macro instead arbitrary qWait - Use longer time line The test executes faster and it should be less vulnerable to an unreliable timer. Change-Id: I92675015a6251b47eaf20b0fc916f3a36b52d783 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Improve tst_qtimeline::currentFrameJędrzej Nowacki2015-12-211-7/+4
| | | | | | | The test run faster and it less vulnerable to an inaccurate time. Change-Id: I19475095395dcf1e6d47fdbba5eeffabab1fc7b9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Improve tst_qtimeline::currentTimeJędrzej Nowacki2015-12-211-17/+13
| | | | | | | Now the test is less fragile to time and it executes 4s faster Change-Id: Id3eb8ed2c03317e7d2f2c3cd17f889a8d8e7e5b4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Make tst_qtimeline::range less prune to timing errorsJędrzej Nowacki2015-12-211-18/+9
| | | | | Change-Id: I5fd84c58250a9dfa237fcb7fca4da50c35a9f57e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Make tst_qtimeline::duration less fragile to timingsJędrzej Nowacki2015-12-211-6/+4
| | | | | | | The test still can fail because 1s is quite a short time. Change-Id: I6f42c182f2932d5a053f6a69667210529c9a7697 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Windows: Restore window geometry after normal->maximized->fullscreen->normal.Friedemann Kleint2015-12-171-0/+67
| | | | | | | | | | | - Do not save geometry when going from maximized->fullscreen - Use SW_SHOWNA instead SW_SHOWNOACTIVATE as otherwise the maximized geometry is restored. - Add a test for Windows. Task-number: QTBUG-49709 Change-Id: Ic81e7398ee90d499a50b02192a45cb09276a2105 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* qmake: teach findMocs to handle backslash-newline gracefully.Edward Welbourne2015-12-178-11/+103
| | | | | Change-Id: Id71352c0cf71ab84bd81d4f3d11bb19dc7965903 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* qmake: teach moc-detector to handle C++-11 raw stringsEdward Welbourne2015-12-151-2/+1
| | | | | | | | As for the #include-parser, the moc-detector's minimal C preprocessor could be confused by a raw string into ignoring large chunks of code. Change-Id: Id688e9a1f04628ce75a51a7d15269078c734288e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* qmake: Fix comment false-alarm bug in findMocs().Edward Welbourne2015-12-151-0/+1
| | | | | | | | | | If a / wasn't part of a comment-start, it and the character after it were none the less stepped over. If the character after started an enclosure, this would duly be missed, leading to mis-parsing of the subsequent text. As for similar bug recently fixed in findDeps(). Change-Id: Ie5329ec633c23a554b42a6351723c980e27fb9a9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Complete a test for QFilePrivate::fileName offset on Linuxhjk2015-12-151-1/+1
| | | | | | | | This extends the test suite introduced in 497f0af1f7 for a known-to-be-good case also for 32 bit systems. Change-Id: Ia231bcb9b0102c28483d932be18767662b7a6afd Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
* QDockAreaLayout/QPlaceHolderItem: Store geometry excluding frame.Friedemann Kleint2015-12-151-1/+15
| | | | | | | | | | | | | | | | Previously, the geometry stored for floating dock widgets in QPlaceHolderItem::topLevelRect and QDockAreaLayoutInfo::saveState() included the window frame (frame position/content area size). This does not work in the case where a floating dock widget is deleted since the geometry is determined after reparenting the widget when the frame geometry is no longer available. Change the behavior to store the geometry excluding frame to avoid such problems and adapt QDockWidgetPrivate::setWindowState() accordingly. Task-number: QTBUG-49832 Task-number: QTBUG-45780 Change-Id: I84b5c80df6e1c9e738bbb1407b9047cc84719ce0 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Extend blacklisting of tst_qsettings to OSX 10.11Tony Sarajärvi2015-12-151-0/+1
| | | | | | | | | This test is marked as blacklisted on 10.10, and it is found to still fail in 10.11. Task-number: QTBUG-49834 Change-Id: Ibddb1af6b61f3fca2b2aea18102bbaa5390a40d3 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Rewrote qmake's #include-detection to be more faithful to CPP.Edward Welbourne2015-12-155-11/+126
| | | | | | | | | | | The C preprocessor allows backslash-newline anywhere and allows comments anywhere it allows space. Testing wilfully perverse applications of that revealed qmake's parsing of #include directives wasn't very robust. So rework to actually follow the rules and add those tests. Change-Id: If5cc7bfb65f9994e9ab9ed216dd1ee7285c63934 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Revert "tests: fixed compilation of tst_qtextstream"Edward Welbourne2015-12-151-1/+1
| | | | | | | | | This reverts commit 9a6a58a95af31816627550c573c1b2ac39fc404e, which was a work-around for a qmake bug, now fixed. Task-number: QTBUG-19393 Change-Id: Id467bb5907a88f03eac0e29a90f4ff7e97045423 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Fix compilation for WinRTMaurice Kalinowski2015-12-1419-25/+34
| | | | | | | | TEST_HELPER_INSTALLS cannot be used on platforms with no QProcess support. Change-Id: I2a6a283d94ca4487fc628449c53fc37140dd291d Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* QFileSystemModel: report special files which are not symlinksGiuseppe D'Angelo2015-12-131-0/+44
| | | | | | | | | | | | | | Since special files have file size == -1, they were always filtered out by QFileSystemModel, even when passing QDir::System as filtering option. Keep them instead. The testcase is more convoluted than it should be because QFSM is so broken that it returns valid indexes for invisible elements in the model (such as filtered out elements). Change-Id: I023a9813dbfeed7be99dded42c66b1191afdc17e Task-number: QTBUG-20968 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QFileSystemModel autotest: fix a broken sort() testGiuseppe D'Angelo2015-12-121-7/+10
| | | | | | | | | | The test was comparing an "unsorted" file listing read from disk with a reference listing, checking whether the two were different. Obviously that's a nonsense test, as there's no stable order for the entries returned by readdir_r and friends. Change-Id: I1d781a6513c42bb0b585d02e57a771c5336c7df4 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QLineEdit: a validator fixup() should keep it modified; add failing testGiuseppe D'Angelo2015-12-121-0/+24
| | | | | | | | | I still have no idea how to fix this properly given the absolute mess of QWidgetLineControl. For now add a failing test. Change-Id: Ieb5ad6994c8ce7deb0cd0f2f47d51073d042244e Task-number: QTBUG-49295 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Don't ignore first character after a string.Edward Welbourne2015-12-111-0/+3
| | | | | | | | | | | | The parser in QMakeSourceFileInfo::findDeps() would step over the closing quote of a string, only to have a for loop then step over the character just after that closing quote, which was thus never studied; this could lead to problems in various ways. Fixed that and expanded findDeps() test to catch regressions. Task-number: QTBUG-17533 Change-Id: I7dec5222e38fa188495b39376ffee70bc7bbc87f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* QFileDialog test: make the right subwidget visibleGiuseppe D'Angelo2015-12-101-4/+6
| | | | | | | | | | | It makes little sense to give focus to a hidden widget; in order to make the treeview visible, we need to set the view mode to Detail. Change-Id: I453111e83593a790a656651b603a9c9b1a78dd9d Task-number: QTBUG-7690 Reviewed-by: Jan Blumschein <jan@jan-blumschein.de> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* QFileSystemModel: do not unwatch directories if removal failsGiuseppe D'Angelo2015-12-101-0/+31
| | | | | | | | | ... otherwise we would not detect subsequent file/directories added into the non-removed one. Change-Id: I43018dfb9a9c6c0399190800da3f0d572ec5d8d8 Task-number: QTBUG-49307 Reviewed-by: David Faure <david.faure@kdab.com>
* QFileDialog: Call reject() on Key_Escape even when itemview has focusGiuseppe D'Angelo2015-12-091-11/+22
| | | | | | | | | | | | | | Replace hide() call (present in itemViewKeyboardEvent since Qt 4.5) by reject(). Add signal spy to existing test function. QDialog doc states that reject() will always be called on Key_Escape. hide() is not enough: it makes exec() terminate and return the proper value, but the signals finished(int) and rejected() will not be sent. Task-number: QTBUG-7690 Change-Id: Ica4ae2843574478c5b9a7672f871f3ef3f16f3c9 Done-with: Jan Blumschein <jan@jan-blumschein.de> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* QString: where possible, re-use existing capacity in op(QChar/QL1S)Marc Mutz2015-12-081-0/+66
| | | | | | | | | If the LHS is detached and has existing capacity that is large enough to hold the RHS, re-use the memory instead of allocating a new buffer and throwing away the old. Change-Id: I53d42825da92c264c7301e8e771cba9fb35c321b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Teach qmake's #include parser to recognize C++11 Raw strings.Edward Welbourne2015-12-084-0/+101
| | | | | | | | | | | | | Can't sensibly test unless the compiler does support raw strings, since any test that would catch qmake's (prior) inability to parse raw strings would necessarily confuse the C++ compiler in the same way. This even applies (in test app code) to any #if-ery around the raw string, since tokenization happens before preprocessor directives are resolved. So the #if-ery on Q_COMPILER_RAW_STRINGS has to be in tst_qmake.cpp, not the test app it builds. Change-Id: I4a461f515adff288b54fb273fd9996f9b906d11c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* QNetworkInterface: fix support for address labels on Linux interfacesThiago Macieira2015-12-081-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 64a1448d87727878d9789906b2f4f5b9e3d74e38 (Qt 5.2) caused QNetworkInterface to report address labels (a.k.a. interface aliases) as separate interfaces. This is caused by the fact that glibc, uClibc and MUSL copy the address label (netlink address attribute IFA_LABEL) to the ifa_name field, which made QNetworkInterfaceManager think that it was an interface it hadn't yet seen. Address labels are the old way to add more than one IP address to an interface on Linux, for example: ifconfig eth0:1 192.0.2.2 Those do not create a new interface, so the "eth0:1" label maps to the same interface index as the parent interface. This has been deprecated for 10 years, but there are still tools out there that add addresses in this manner. This commit restores behavior compatibility with Qt 4.2-5.1. The Qt 5.2-5.5 behavior is incorrect because it reports more than one interface with the same index. On systems configured like the above, the tst_QNetworkInterface::interfaceFromXXX test was failing. Change-Id: I8de47ed6c7be4847b99bffff141c2d9de8cf7329 Reviewed-by: Richard J. Moore <rich@kde.org>
* Fix constructing a QSharedPointer<const> of a QEnableSharedFromThis typeThiago Macieira2015-12-081-6/+44
| | | | | | | | | | | | It should compile, since the std::shared_ptr does. [ChangeLog][QtCore][QSharedPointer] Fixed a problem that would cause a compilation error when constructing a QSharedPointer of a const type when the type derives from QEnableSharedFromThis. Task-number: QTBUG-49748 Change-Id: I8de47ed6c7be4847b99bffff141c84f5e0b6bea8 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>