summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-096-30/+30
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qwindow.cpp src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/windows/qwindowssystemtrayicon.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp tests/auto/widgets/kernel/qaction/tst_qaction.cpp Change-Id: Ifa515dc0ece7eb1471b00c1214149629a7e6a233
| * Fix tst_QFile::openDirectory for systems using builtin test dataOliver Wolff2017-11-091-2/+3
| | | | | | | | | | | | | | | | To obtain "proper" directory behavior, we have to check against the extracted "resources" directory instead of its qrc counterpart. Change-Id: I4996ba74419945f78d356ad953a5b826ff663687 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
| * Fix tst_QFile::handle for systems using builtin test dataOliver Wolff2017-11-091-2/+3
| | | | | | | | | | | | | | | | | | To obtain the file's handle, we need to obtain it from the extracted test data instead of qrc. Change-Id: I89c5c3f3a7da7e36205a439581a6d83efffdc07c Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Fix tst_QFile::useQFileInAFileHandler for systems using resources for test dataOliver Wolff2017-11-091-1/+12
| | | | | | | | | | | | | | | | | | | | | | Resource files are extracted to m_dataDir in tst_QFile::initTestCase. Instead of trying to access the file from the resource on systems that use qrc for bundling the test data, we have to use the files that were extracted at the beginning of the test. Change-Id: I35453fbdeb27e317d1342ff1cb7bbea9cebea14d Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * qfile tests: Make sure files are writable before deleting themOliver Wolff2017-11-091-0/+2
| | | | | | | | | | | | | | | | | | | | On some platforms (like UWP) files that are copied during qfile auto tests are not writable by default. The cleanup will fail for these files if the permissions are not set accordingly. Change-Id: Id925dcadfc6b505c87f1f55d5ea05e286b60a5a5 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * testlib: start sharing common helper functionsGatis Paeglis2017-11-044-25/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... by moving them in QTestPrivate namespace (qtesthelpers_p.h). This header file is a convenient staging area for helper APIs, eventually some could be moved to public QTest API. This header file utilizes the same pattern as other qtestlib header files - wrapping functions with QT_${LIBNAME}_LIB to automatically enable certain APIs based on what is in the projects dependencies, e.g. QT += widgets. Change-Id: Ic0266429939c1f3788912ad8b84fc6e0d5edd68b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * macOS: Blacklist ↵Friedemann Kleint2017-11-031-0/+2
| | | | | | | | | | | | | | | | tst_QSequentialAnimationGroup::groupWithZeroDurationAnimations() Task-number: QTBUG-64109 Change-Id: Iebe5a07d108ba647baa74ded71b730c867bd1c41 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* | Change almost all other uses of qrand() to QRandomGeneratorThiago Macieira2017-11-087-17/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The vast majority is actually switched to QRandomGenerator::bounded(), which gives a mostly uniform distribution over the [0, bound) range. There are very few floating point cases left, as many of those that did use floating point did not need to, after all. (I did leave some that were too ugly for me to understand) This commit also found a couple of calls to rand() instead of qrand(). This commit does not include changes to SSL code that continues to use qrand() (job for someone else): src/network/ssl/qsslkey_qt.cpp src/network/ssl/qsslsocket_mac.cpp tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-307-23/+109
|\| | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/windows/qwindowswindow.cpp tests/auto/widgets/kernel/qaction/tst_qaction.cpp Change-Id: Ia017a825ed2ca2d53ac586f4ae48df6f65818d40
| * tst_QFile::largeUncFileSupport(): Use QTRY_VERIFY() to open the fileFriedemann Kleint2017-10-271-5/+31
| | | | | | | | | | | | | | | | Open failures due to sharing violations have been observed in Coin. Change-Id: If7fbe01a454b3c343c0b87f73db50c28eae901c3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
| * tst_QFile: Introduce StdioFileGuardFriedemann Kleint2017-10-271-21/+43
| | | | | | | | | | | | | | | | Guard the FILE * obtained by fopen() by a RAI class ensuring the file is closed on destruction. Change-Id: I9297f91ca2120238f3a44bad92bca5f920e01aa8 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
| * QUrl: make sure setPort(nonnegative) is taken as part of authorityThiago Macieira2017-10-261-0/+35
| | | | | | | | | | | | | | | | | | | | | | There were a couple of corner cases where doing setPort() would result in QUrl thinking that an authority was not present. Since the full URL parsing implies that a host is always present if the authority is present, then we also imply that setting the port number makes the host be present too. Change-Id: I69f37f9304f24709a823fffd14e67c12da18d69f Reviewed-by: David Faure <david.faure@kdab.com>
| * Remove duplicate qnx from the platform file selector namesLiang Qi2017-10-245-1/+4
| | | | | | | | | | | | | | | | Update the QFileSelector tests for QNX. Co-authored-by: James McDonnell <jmcdonnell@blackberry.com> Change-Id: I68a8fde86725596323b539433287ac1a18fac1eb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Mark the previously public qstringalgorithms.h functions privateThiago Macieira2017-10-291-30/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Discussed during Qt Contributor Summit 2017. We concluded that we don't want to make these functions public, as they do not follow Qt coding style API. Specifically, qStartsWith(a, b) is not easily understood which argument is the needle and which argument is the haystack (same problem memcpy() has). Compare that to a.startsWith(b) which can clearly be read in English as a subject-verb-object sentence. This commit removes the unit tests that called compare(). Discussed-on: http://lists.qt-project.org/pipermail/development/2017-October/031060.html Change-Id: Icaa86fc7b54d4b368c0efffd14ee6205eb9043fb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | QRandomGenerator: add system() and global()Thiago Macieira2017-10-291-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now,this does really nothing. This commit is just to allow us to transition the other modules (besides qtbase) to use the syntax that will become the API. I've marked three places to use the system CSPRNG: 1) the QHash seed 2) QUuid 3) QAuthenticator I didn't think the HTTP multipart boundary needed to be cryptographically safe, so I changed that one to the global generator. Change-Id: Ib17dde1a1dbb49a7bba8fffd14ecf1938bd8ff61 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-231-0/+3
|\| | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/direct2d/direct2d.pro src/plugins/platforms/ios/qiosclipboard.mm src/plugins/platforms/windows/windows.pro Change-Id: Idffa03b3990bd642784f528821c5446b2e1008ef
| * Blacklist and skip failing tests for Boot2Qt / 64 bit armSami Nurmenniemi2017-10-211-0/+3
| | | | | | | | | | | | Task-number: QTBUG-60263 Change-Id: I05978915b5bb7ae31069e8e9ae1dc273e483ddb0 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* | QRandomGenerator: improve floating-point random generationThiago Macieira2017-10-201-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous version was good, just not optimal. Because the input was an unsigned 64-bit number, compilers needed to generate extra code to deal with HW instructions that only convert 64-bit signed input. And that was useless because a double uniformly distributed from 0 to 1 can only have 53 bits of randomness. The previous implementation did exactly what the Microsoft libstdc++ and libc++ implementations do. In my opinion, those implementations have an imperfect distribution, which is corrected in this commit. In those, all random input bigger than 0x20000000000000 has a different frequency compared to input below that mark. For example, both 0x20000000000000 and 0x20000000000001 produce the same result (4.8828125e-4). What's more, for the libc++ and MSVC implementations, input between 0xfffffffffffff001 and 0xffffffffffffffff results in 1.0 (probability 1 in 2⁵³), even though the Standard is very clear that the result should be strictly less than 1. GCC 7's libstdc++ doesn't have this issue, whereas the versions before would enter an infinite loop. Change-Id: Ib17dde1a1dbb49a7bba8fffd14eced3c375dd2ec Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Clean dynamic function resolving done for XP in QFileInfo testsOrgad Shaneh2017-10-191-39/+15
| | | | | | | | | | Change-Id: I15364b1e8c4f4406fef2be68ca221a8867d0dcfa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into ↵Liang Qi2017-10-172-3/+78
|\ \ | | | | | | | | | refs/staging/5.10
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-162-3/+78
| |\| | | | | | | | | | Change-Id: I3cf73c53cf131d0babfb558c2507bed0e0fc5f08
| | * QUrl: re-fix the setPath("//path") case leading to scheme://pathThiago Macieira2017-10-061-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commits aba336c2b4ad8926dc8a000718bbb7f8a6d5a72d (in Qt 5.2) and aba336c2b4ad8926dc8a000718bbb7f8a6d5a72d (in 5.6) both tried to deal with this problem, with different levels of success. This is the third attempt (and hopefully the charm). Instead of modifying the path that the user provides, go straight ahead and declare it invalid. This is supported by RFC 3986, which declares this expansion impossible: relative-part = "//" authority path-abempty / path-absolute / path-noscheme / path-empty path-abempty = *( "/" segment ) path-absolute = "/" [ segment-nz *( "/" segment ) ] path-noscheme = segment-nz-nc *( "/" segment ) The "path-abempty" and "path-noscheme" cases are the two issues we already handle. This commit adds the third one: path-absolute, which requires that the first segment of the path be of non-zero length. That is, it is now possible again to have http://example.com//path constructed piece-wise, without it producing http://example.com/path. Additionally, it catches the case of http://example.com//path parsed from full URL then followed by setAuthority(""). Change-Id: I69f37f9304f24709a823fffd14e67a5e7212ddcd Reviewed-by: David Faure <david.faure@kdab.com>
| | * Improve performance in QThreadPoolSvenn-Arne Dragly2017-10-041-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When many runnables are executed, this improves the performance by not resizing the queue for each runnable, which was the case in the previous version, because of many calls to QVector::takeFirst(). Also add a test that makes sure tryTake() is safe to call and does not leave the queue in a bad state that tries to use nullptr entries. Change-Id: I608134ecfa9cfc03db4878dcbd6f9c1107e13e90 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | configure: make C++11 <random> a required functionalityThiago Macieira2017-10-161-23/+3
|/ / | | | | | | | | | | | | | | | | Error out if it's missing or broken (Mersenne Twister not present). This ensures that we never have a low-quality random generator in Qt. Change-Id: I0a103569c81b4711a649fffd14ec80649df7087e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix QWinEventNotifier for auto-reset eventsJoerg Bornemann2017-10-151-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Auto-reset events are automatically reset to non-signaled when we get notified about the signaled state. This implies that we cannot check the event state again in activateEventNotifiers. Instead, store the signaled state in a QAtomicInt and test and decrement that. This amends commit 85403d0a. Task-number: QTBUG-63555 Change-Id: I0adee3d2929783f98d91060f9106c8b5266d72fa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Autotest: use _exit() instead of exit() to simulate an unclean exitThiago Macieira2017-10-082-5/+11
| | | | | | | | | | | | | | | | | | | | We're not going to crash to avoid core dumps getting recorded by systemd, filling up filesystems or showing dialog boxes. We just need to exit without running destructors. Now, exit() isn't supposed to run function-scope destructors, so just in case we use _exit(). Change-Id: I0b48fc8e90304e0dacc3fffd14e909ff248ce1a1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Move detection of <future> to a configure testGiuseppe D'Angelo2017-10-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | <future> is needed by QThread::create. Instead of a fragile series of preprocessor tests, move its detection to a configure test. This dramatically simplifies the code, but on the other hand ties the availability of QThread::create() to the system used to compile Qt (rather the one used to compile an application). Change-Id: If1b06363379bf29126cfa68f2a0651cbb78a67f7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Ensure result of all QTest::qWaitFor are verifiedTor Arne Vestbø2017-10-051-2/+2
| | | | | | | | | | | | | | | | | | The qWaitFor functions themselves can not trigger a test failure, as that will not result in the test function exiting early, so every single call to qWaitFor needs to be wrapped in a QVERIFY. Change-Id: Id15a1549f31d06cdbf788e1d84ea431c28636ec8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | qmake: Allow non-bundle apps and libs to have an Info.plistTor Arne Vestbø2017-09-291-1/+1
| | | | | | | | | | Change-Id: I5fe5c8d3214876520b5259d478ac9ef887c61e95 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Clean up OS version checks for Apple platformsJake Petroules2017-09-292-3/+3
| | | | | | | | | | | | | | | | | | | | Convert QSysInfo/QOperatingSystemVersion to __builtin_available where required or possible, or to QOperatingSystemVersion where __builtin_available cannot be used and is not needed (such as negated conditions, which are not supported by that construct). Change-Id: I83c0e7e777605b99ff4d24598bfcccf22126fdda Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Improve qustrlen further by avoiding the alignment prologueThiago Macieira2017-09-261-6/+31
| | | | | | | | | | | | | | | | | | | | | | This avoids looping prior to the main 16-byte loop, by performing one load that may include bytes prior to the start of the string. This is guaranteed not to fault, since str points to a valid character, but it may cause Valgrind to print warnings. Change-Id: I6e9274c1e7444ad48c81fffd14dcae854bba24b2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QRandomGenerator: update API to better nameThiago Macieira2017-09-221-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | "generate" is better than "get", and we already have "generate(it, it)" which uses std::generate(). This changes: - get32() → generate() - get64() → generate64() and QRandomGenerator64::generate() - getReal() → generateDouble() Change-Id: I6e1fe42ae4b742a7b811fffd14e5d7bd69abcdb3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-202-3/+4
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/util/qcompleter.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmdisubwindow.cpp Change-Id: If0e96981af07ce36ac68f2e69211bc2120f93973
| * Remove unnecessary VxWorks ifdefJake Petroules2017-09-181-2/+0
| | | | | | | | | | | | Change-Id: Ie655bdff9a09c6060f66e4346b94ba52443241f4 Reviewed-by: Tuomas Heimonen <tuomas.heimonen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Exclude QSystemSemaphore test with -no-feature-systemsemaphoreJake Petroules2017-09-181-0/+3
| | | | | | | | | | Change-Id: I9db6b68c3d26b27a0203c68c48ab73602eb15095 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
| * Exclude tst_QDir::mkdirOnSymlink on Unix platforms without symlinksJake Petroules2017-09-151-1/+1
| | | | | | | | | | | | | | | | One example is VxWorks. Change-Id: I253df715a9417c1f9cede79b1e1860924e0da8a9 Reviewed-by: Tuomas Heimonen <tuomas.heimonen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QStringView: De-inline the length calculation so we can use SSE2Thiago Macieira2017-09-131-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Performance is more important in this case than the theoretical benefit of constexpr. This commit implements the SSE2 search for 16-bit null and it might be possible to implement the equivalent for AArch64 (investigation required). It also adds a fallback to wcslen() for systems where wchar_t is short (non-x86 Windows or 32-bit x86 build with -no-sse2). We can re-add the constexpr loop once the C++ language has a way of overloading constexpr and non-constexpr. GCC has a non-standard way to do that with __builtin_constant_p, which is also implemented in this commit, but note that the inline function is still not constexpr. Change-Id: I6e9274c1e7444ad48c81fffd14dcaacafda5ebdc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | macOS: Detect use of heap-allocated QMacAutoReleasePoolTor Arne Vestbø2017-09-083-0/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMacAutoReleasePool is backed by an NSAutoreleasePool, which documents that "you should always drain an autorelease pool in the same context (invocation of a method or function, or body of a loop) that it was created". This means allocating QMacAutoReleasePool on the heap is not a supported use-case, but unfortunately we can't detect it on construction time. Instead we detect whether or not the associated NSAutoreleasePool has been drained, and prevent a double-drain of the pool. Change-Id: Ifd7380a06152e9e742d2e199476ed3adab326d9c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-062-3/+12
|\| | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/qopenglwidget/main.cpp src/3rdparty/pcre2/src/pcre2_printint.c src/plugins/platforms/cocoa/qnsview.mm src/widgets/widgets/qcombobox.cpp Change-Id: I37ced9da1e8056f95851568bcc52cd5dc34f56af
| * Fix resolution of relative links on WindowsOrgad Shaneh2017-09-041-3/+9
| | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QFileInfo] Relative symbolic links on Windows are now resolved to their absolute path by symLinkTarget(). Task-number: QTBUG-62802 Change-Id: I5826517130bd389aef994bf3f4b6d99b2a91b409 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| * tst_QMutex: produce less noise with MSVCThiago Macieira2017-09-011-0/+3
| | | | | | | | | | | | | | | | | | | | Since MSVC doesn't have <chrono> (according to QT_HAS_INCLUDE), the QSKIP in the test was printed for every line in the table. Instead, add the skip in the _data() function. Change-Id: I6e9274c1e7444ad48c81fffd14dbcee5e5a322aa Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-311-0/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/examples.pro qmake/library/qmakebuiltins.cpp src/corelib/global/qglobal.cpp Re-apply b525ec2 to qrandom.cpp(code movement in 030782e) src/corelib/global/qnamespace.qdoc src/corelib/global/qrandom.cpp src/gui/kernel/qwindow.cpp Re-apply a3d59c7 to QWindowPrivate::setVisible() (code movement in d7a9e08) src/network/ssl/qsslkey_openssl.cpp src/plugins/platforms/android/androidjniinput.cpp src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/widgets/widgets/qmenu.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp Change-Id: If7ab427804408877a93cbe02079fca58e568bfd3
| * Fix resolution of relative symlinks from relative path on unixOrgad Shaneh2017-08-271-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider the following: /root/target - a file /root/path/link -> ../target /root/path/other/exe - executable Running from /root/path/other. exe is: #include <QDebug> #include <QFileInfo> int main() { qDebug() << QFileInfo("../link").symLinkTarget() return 0; } The link references /root/target, but the current output is /root/path/target. The link doesn't depend on the PWD. It depends on its own directory. Change-Id: I61e95018154a75e0e0d795ee801068e18870a5df Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Introduce QIODevice::skip()Alex Trotsenko2017-08-271-0/+91
| | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QIODevice] Added skip() method to improve performance in read operations. Change-Id: I79068a3e9df108756abe37ba3d431e27e7413621 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QTemporaryFile: Add support for Linux's O_TMPFILEThiago Macieira2017-08-231-5/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That means a file is never created, unless you ask for the name. There's no chance of left-over temporary files being left behind. QSaveFile also benefits from this, since the save file is not present on disk until commit(). Unfortunately, QSaveFile must go through a temporary name because linkat(2) cannot overwrite -- we need rename(2) for that (for now). [ChangeLog][Important Behavior Changes][QTemporaryFile] On Linux, QTemporaryFile will attempt to create unnamed temporary files. If that succeeds, open() will return true but exists() will be false. If you call fileName() or any function that calls it, QTemporaryFile will give the file a name, so most applications will not see a difference. Change-Id: I1eba2b016de74620bfc8fffd14cc843e5b0919d0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Remove timer checks from testQuitLockMorten Johan Sørvig2017-08-221-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test sets up two timers: - a 100ms recurring timer - a series of 10 200ms single-shot timers. After quitLock lets exec() return it then uses a signal spy to check if the 100ms timer fired at least 17/20 of the times it should. However there is no guarantee that the 100ms timer will fire more often than the 200ms timer. If the native timer callbacks happen at 500ms intervals then Qt will fire both timers (once) at that interval. In practice this seems to happen on macOS CI under system load and/or with the test app napping. The primary goal for the test is to verify that exec() returns when it should; we can remove the timer signal spy. Remove testQuitLock from BLACKLIST. Timely timer: 524429311.389913 runLoopTimerCallback 524429311.389979 200ms fire 524429311.389997 100ms fire 524429311.490056 runLoopTimerCallback 524429311.490130 100ms fire 524429311.589752 runLoopTimerCallback 524429311.589929 200ms fire 524429311.589976 100ms fire Delayed timer: 524429428.690887 runLoopTimerCallback 524429428.691002 100ms fire 524429428.691143 200ms fire 524429433.692103 runLoopTimerCallback 524429433.692205 100ms fire 524429433.692331 200ms fire Change-Id: Iff4faaa1de3741cf4e217949d5ed17d4e70c6af2 Task-number: QTBUG-61499 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-151-3/+6
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoamenu.h src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/cocoa/qcocoawindow.mm src/widgets/styles/qstylehelper_p.h Change-Id: I54247c98dd79d2b3826fc062b8b11048c9c7d9bb
| * Autotest: Fix test when running on a non-Unicode-capable localeThiago Macieira2017-08-121-3/+6
| | | | | | | | | | | | | | Like my default FreeBSD environment. Change-Id: I3868166e5efc45538544fffd14d8a7f2dffa6ac9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Autotest: fix blacklisted test about position on non-regular filesThiago Macieira2017-08-082-10/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On BSD systems (tested on macOS and FreeBSD), you *can* lseek(2) or ftell(3) on a pipe and get its current position. But QFile will not get the position when the file is sequential, so we need to return 0. Technically speaking, we ought to do the same for block devices, but if you're redirecting stdin, stdout or stderr in the unit test to or from a block device, you deserve the extra work to add that yourself to the test. Change-Id: I3868166e5efc45538544fffd14d8a74e92963fe7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | QFileInfo: harmonize QFileInfo() and QFileInfo("")Thiago Macieira2017-08-081-48/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a QFileInfo was constructed with an empty path, which could happen with QFileInfo(QFile()) or via QDir, etc., then it would issue system calls to empty paths and could even produce warnings. This commit makes am empty path name be the same as a default-constructed QFileInfo and corrects the use if 0 for ownerId and groupId to match the documentation. [ChangeLog][Important Behavior Changes] QFileInfo on empty strings now behaves like the default-constructed QFileInfo. Notably, path() will now be the empty string too, instead of ".", which means absoluteFilePath() is no longer the current working directory. Change-Id: I8d96dea9955d4c749b99fffd14ce34968b1d9bbf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>