summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qtimeline/tst_qtimeline.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change license for tests filesLucie Gérard2024-02-041-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-031-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Use SPDX license identifiersLucie Gérard2022-05-161-27/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Port of QTimeLine to new property systemAndreas Buhr2021-04-261-14/+288
| | | | | | | | | | | | | The six properties duration, updateInterval, currentTime, direction, loopCount and easingCurve have been ported to the new property system and are now bindable. Drive-by renamed a local variable to avoid shadowing. Task-number: QTBUG-85520 Change-Id: Ibabf106f5200d2dd4329a1e1f96112eccc29d6b1 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-221-1/+2
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Deprecate QTimeLine's curveShape in favor of its easingCurveEdward Welbourne2020-07-161-11/+11
| | | | | | | | | | | | | | QEasingCurve has a richer variety of curves and curveShape was already implemented by changing the easingCurve property. [ChangeLog][QtCore][QTimeLine] Deprecated QTimeLine's curveShape property in favor of the easingCurve property. Pick-to: 5.15 Change-Id: I7261c0f24d7e02bc94624f0b74d699df62de1a52 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Improve QTest::qWait() precision and switch to QDeadlineTimerAllan Sandfeld Jensen2017-01-251-1/+1
| | | | | | | | | Do not wait up to the timeout ms after already having waited several times. At the same time upgrade to using the QDeadlineTimer which is designed for this purpose. Change-Id: Iaf5e4f4655605d5143ce91040c6eb6706752e504 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-121-8/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure src/corelib/io/qprocess_wince.cpp src/plugins/platforms/windows/qwindowstheme.cpp src/plugins/platforms/xcb/qxcbbackingstore.cpp tests/auto/corelib/tools/qtimezone/BLACKLIST tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: I26644d1cb3b78412c8ff285e2a55bea1bd641c01
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-061-8/+7
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/qtestlib/tutorial5/containers.cpp examples/widgets/tools/tools.pro src/corelib/io/qprocess.cpp src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/network/kernel/qdnslookup_unix.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp tools/configure/configureapp.cpp Change-Id: I838ae7f082535a67a4a53aa13a21ba5580758be8
| | * Improve tst_qtimeline::setPaused resilienceJędrzej Nowacki2016-05-041-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | The test should not depend on qWait explicitly Change-Id: I13c01c47c9f7bae8b0c30afa2ac8550dc0fbf028 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* | | QtCore: Remove Windows CE.Friedemann Kleint2016-03-301-4/+0
|/ / | | | | | | | | | | | | | | | | Remove QSysInfo::WV_CE_5/6 enumeration values, #ifdef sections for Q_OS_WINCE and wince .pro file clauses in library, examples and tests. Task-number: QTBUG-51673 Change-Id: Ib63463445f3a26e04d018b193e4655030002f5f9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* / Updated license headersJani Heikkinen2016-01-211-17/+12
|/ | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@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>
* Improve debug output of tst_QTimeLine::frameRate()Simon Hausmann2015-06-201-1/+1
| | | | | | | When the test fails, show the actual signals spy count. Change-Id: Id7312bfbfb6531404a9df73234031f13295c80ea Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Updated corelib's unit tests to use QSignalSpy's functor constructorKeith Gardner2014-05-081-12/+12
| | | | | | | | | The intent is to provide compile time validation of signals and to help detect signal overloading in the future. Change-Id: I9d5d46ed4b70c5d0cd407deb5928b1e76d37e007 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Fixed bug in QTimeLine::setPaused(false)Jan Arve Saether2013-03-131-0/+23
| | | | | | | | | | | The problem was that the elapsed timer was not restarted, causing the currentTime() not being adjusted for the time it was paused. Task-number: QTBUG-30108 Change-Id: Ib9b2c5a0dea52762109e0b25f1068dd7c88e15ba Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove metatype registration of built-in types.Stephen Kelly2013-01-031-2/+0
| | | | | | | | As they are built-in, they are effectively registered at compile-time already. Change-Id: I7ae6ba16088eab5d19213fa7b07c2a7760988a86 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Make failures in QTimeLine autotest more stable.Jason McDonald2012-04-171-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | QTimeLine appears to have very poor timing characteristics. Historical CI logs show roughly one failure in every twenty-five test runs on Windows, and less frequent failures on Mac and Linux. The root of the problem seems to be that QTimeLine's currentTime counter appears to run at a variable speed and the only guarantee is that it is slower than wall time. The frameChanged() test function waited for double the expected duration of the timeline and still found that the timeline had failed to finish in about one in every thirty test runs. The interpolation() test function also failed for the same reason, though less often. This commit makes the frameChanged test more strict so that the poor timing will be demonstrated more often, waiting only 1.5 times the duration instead of double the duration. It also makes the test fail gracefully so that this known issue won't disrupt CI when the test is made significant in a later commit. Task-number: QTBUG-24796 Change-Id: If469d43abb662e24445a9da619052eea9cf7c581 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix bug in tst_QTimeLine::duration().Jason McDonald2012-04-171-2/+3
| | | | | | | | | | | QTimeLine::currentTime() is an integer in the range [0..duration], not a float in the range [0.0..1.0]. The aim of the test appears to be to verify that currentTime() is at least 90% of the way to duration() when the timeline is almost due to finish, so verify that and give the corresponding 10% tolerance on reaching the end state. Change-Id: I38646947c3b9189a4e8e91a450c6071430ddc66a Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Cleanup corelib autotests.Jason McDonald2011-12-281-0/+12
| | | | | | | | | | | | | When using QSignalSpy, always verify that the signal spy is valid. This will cause the test to give a meaningful failure when spying on a non-existant signal. Without this change, tests that spy on a signal to ensure that it is not emitted (i.e. by comparing the spy count to zero) could pass erroneously if something went wrong when creating the signal spy, as an invalid QSignalSpy will always return a count of zero. Change-Id: I41f4a63d9f0de9190a86de237662dc96be802446 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove TESTED_CLASS/TESTED_FILES comments from tests.Jason McDonald2011-12-061-3/+0
| | | | | | | | | These comments were mostly empty or inaccurate. Appropriate naming of tests and appropriate placement of tests within the directory tree provide more reliable indicators of what is being tested. Change-Id: Ib6bf373d9e79917e4ab1417ee5c1264a2c2d7027 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove reset test from QTimeLine.Jason McDonald2011-11-221-40/+2
| | | | | | | | | | | | QTimeLine::reset() never made it into the public API. Instead QTimeLine::start() always starts from the beginning. Remove the commented-out test for reset() and related remnants in other tests. Restarting a timeline using QTimeLine::start() is already tested by the restart() test function. Change-Id: Ia5c767ddae0781d645a407fbea76e80672895aab Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add test for QTimeLine::toggleDirection()Jason McDonald2011-11-221-9/+10
| | | | | | | | | | Before QTimeLine made it into the public API, the toggle() function became toggleDirection() and isReversed() became the more generic direction(). This commit uncomments the old toggle() test and uses the final function names. Change-Id: Ie3379f32ff0c78436f33c2733232d795ca88152b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Cleanup corelib autotestsJason McDonald2011-11-101-5/+5
| | | | | | | Remove literal tabs. Change-Id: I210a0259773cceb20d35ebc80b889e3ebb88b540 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Cleanup corelib autotestsJason McDonald2011-11-071-28/+2
| | | | | | | Remove redundant empty constructors, destructors and test functions. Change-Id: Idb51368895e67ec3fc0345a9a5d33d77730c051b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Moving relevant tests to corelib/toolsHolger Ihrig2011-09-011-0/+730
Task-number: QTBUG-21066 Change-Id: I650f8f7826b9feea7c1484f06e03e10c68ec2b65 Reviewed-on: http://codereview.qt.nokia.com/3712 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>