summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Cocoa: fix crash regression in qt_mac_create_nsimage()Oleg Yadrov2017-01-231-0/+10
| | | | | | | | | | | The regression was introduced in d8857f21ac264. The original change was meant to fix support for SVG icons, but failed to take into account a valid QIcon with no sizes, but which is also unable to create a pixmap for the requested size. Task-number: QTBUG-58344 Change-Id: I7ac1dbfaf6e3dab8581fe4b33c814e2517fcdba8 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* tst_QSocks5SocketEngine: Refactor testsFriedemann Kleint2017-01-231-88/+52
| | | | | | | | | | | Rewrite tcpSocketNonBlockingTest() and downloadBigFile() to use lambdas for the slots. This allows for removing the related member variables and slots of the test class and ensures no leaks of sockets or inconsistent values. Add an error handler printing the error message to the flaky downloadBigFile() test. Change-Id: Ieb64063c41e045a1a50a6d074bef01753ee319ef Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* tst_QPauseAnimation: Use QTRY_COMPARE for checking the stopped stateFriedemann Kleint2017-01-201-39/+25
| | | | | | | | | | | Use QTRY_COMPARE with a timeout to check for the stopped state unless BAD_TIMER_RESOLUTION is defined. This speeds up the test by 1s and prints diagnostic information should an interval be too short (as seems to be the case on macOS, currently). Change-Id: I8f884cd66ad33314124d3130d9f49606e6dfe9f3 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Make shortcuts work for platform menu barsDmitry Shachnev2017-01-191-8/+17
| | | | | | | | | | | | | | | | | | | | | When a platform menu bar is used, the QMenuBar is hidden, so shortcuts for QActions attached only to it do not work. Extend the macOS-specific code to treat such menubars as visible to other platforms, to make the shortcuts work. The exception is made for internal QMenuBar shortcuts, which are forwarded to the platform menu. A follow-up change will add support for this to QDBusPlatformMenu. The updateGeometries() method is called for platform menu bars too to make sure the internal shortcuts are registered even if the global menu is in use. Add two cases to the tst_QMenuBar::activatedCount() test to test both native and non-native menu bars when possible (it now passes with native menu bars too). Change-Id: I2d7128512719ac199cd3f8f7ba28333d04d84ed4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QSslDiffieHellmanParameters: simplify defaultParameters() constructionMikkel Krautz2017-01-181-0/+35
| | | | | | | | | | | | | | | | | | | | | | This commit simplifies defaultParameters() to simply construct an empty QSslDiffieHellmanParameters and assigning the DER-form of the DH parameters to QSslDiffieHellmanParametersPrivate's derData field. This creates a valid QSslDiffieHellmanParameters instance, but skips any potentially expensive verification steps. The previous implementation of defaultParameters() would use the public fromEncoded() method to construct an instance of the default parameters. This triggers a verification of the passed-in data, which can be expensive. To ensure our defaultParameters() QSslDiffieHellmanParameters instance does pass verification, this commit adds an autotest to verify that. Fixes QTBUG-57815. Change-Id: I6b1d9dbbfde526b232c319195ddbad42326be27c Task-number: QTBUG-57815 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix access incorrect index in QListView with batch layoutAleksei Ilin2017-01-171-0/+14
| | | | | | | | | | | The size of flowPositions is larger by one than the number of rows in the model so the last correct row number is flowPositions.count()-2, not flowPositions.count()-1. Change-Id: Idf8bbd155151d553947d5d299dd01ffaff0c95fa Task-number: QTBUG-47694 Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru> Reviewed-by: David Faure <david.faure@kdab.com>
* QHostAddress: add missing docsMarc Mutz2017-01-151-0/+1
| | | | | | | | | | | | | qHash(QHostAddress) was added in Qt 5.0 (at least the version with uint seed = 0). op==(QHostAddress::SpecialAddress, QHostAddress) was there since QHostAddress was added before public history. Since QHostAddress does not have a \since, the I did not supply one for op==, either. Since the equality operator did not have unit-tests, added one. Change-Id: I954a0df02464338f08a12ca58d4cc0ceb013e67a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Plug memleaks in tst_QStackedLayoutMarc Mutz2017-01-141-1/+1
| | | | | | | QLayout::replaceWidget() doesn't delete the affected item, but returns it. Change-Id: Ibda96e4bf2432ad13ed2908c7d37547f46e29a37 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Adapt to the C++ SIC introduced by P0021: noexcept overloadingThiago Macieira2017-01-144-0/+49
| | | | | | | | | | | | | | | | | | | | C++17 adopts P0021R1[1], which makes noexcept be part of the function pointer's type and thus be overloadable. It contains some provisions for allowing a noexcept function pointer to cast implicitly to a non- noexcept function pointer, but that fails in the presence of templates and additional overloads that could match the type in question. Fortunately, the paper proposed a test macro, so we can change our sources now and be compatible with both C++14 and C++17 rules. This first failed with Clang 4.0 trunk. This source incompatibility is not our fault, it's the language's doing. [1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0012r1.html Task-number: QTBUG-58054 Change-Id: I2bc52f3c7a574209b213fffd14988cf0b875be63 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QFont: fix fromString(toString()) when application font has styleNameDavid Faure2017-01-111-0/+14
| | | | | | | | | | The style name needs to be cleared if not present in the string, otherwise the style name from qApp->font() (which propagates to any default-constructed QFont) remains. Change-Id: I9b6522a39a38526cced8a11ed02ae32582026480 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
* tst_qfont: clear style name in test fontDavid Faure2017-01-111-0/+2
| | | | | | | | | The test failed if qApp->font() had a styleName() set, when testing old serialization formats which didn't serialize it. Change-Id: If0236d354be144b3a990e074a22f796fffb1ed18 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
* tst_utf8: remove duplicate nonCharacters() dataMarc Mutz2017-01-101-33/+0
| | | | | | | | | | | The population of data rows was factored into a separate file, qutf8data.cpp, in commit e20c4730. Merge commit 9bd03235 failed to track a conflicting change into the new file, and brought the code back into the tst_utf8.cpp, where it has been duplicating the utf8data data ever since. Change-Id: I4282685b882448f927289468bd7ab340a21ea0b3 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fixed Chinese language selection on iOSJason Erb2017-01-101-1/+38
| | | | | | | | | | | | | | | For language "Traditional Chinese" on iOS with region "US", the logic was formerly to attempt a match on country/language/script (fail), followed by country/language (which would result in script defaulting to "Simplified"). Now, the logic is to try language/script first if script is specified. Failing that, language/country will be attempted. Task-number: QTBUG-39639 Change-Id: I75a774b1e66686e95167ff221458a97a7ea2660d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jason Erb <jason.erb@sparist.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Drop unnecessary dependencies from some testsUlf Hermann2017-01-107-7/+7
| | | | | | | | | The future tests don't need QtConcurrent as QFuture and friends are in QtCore. The printdevice test doesn't use QtNetwork and the lancelot as well as the testlib tests don't use QtXml. Change-Id: I150ac99b36682aa23ad22ba943266eb0f0952838 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Fix compilation without sharedmemoryUlf Hermann2017-01-051-3/+4
| | | | | | | | | | | We have to enable qt_safe_ftok with either sharedmemory or systemsemaphore. In order to make the resulting QT_CONFIG work with the bootstrap library we switch the features off for bootstrapping. Some tests and examples have to be excluded when sharedmemory is not available. Change-Id: I3fc3926d160202b378be2293fba40201a4bf50c5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime::fromString(): improve performance by 33%David Faure2017-01-031-2/+3
| | | | | | | | | | | | | | | | getMaximum() and getMinimum(), called during parsing, create new QDateTime instances, which on Linux end up calling mktime(). Making these static (for the common case of LocalTime spec) improves performance dramatically, when parsing several date/times. tests/benchmarks/corelib/tools/qdatetime/ (after fixing it to actually parse a valid date/time) says: RESULT : tst_QDateTime::fromString(): - 36,742,060 instruction reads per iteration (total: 36,742,060, iterations: 1) + 24,230,060 instruction reads per iteration (total: 24,230,060, iterations: 1) Change-Id: I0c3931285475bf19a5be8cba1486ed07cbf5e134 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Improve reliability of network bearer testsSimon Hausmann2017-01-023-10/+10
| | | | | | | | | | | | | | May of the tests initiate a scan / update of the network configuration and expect the API to deliver exactly one update. This turns out to be a race condition as the update may be emitted multiple times, as QNetworkConfigurationManagerPrivate::updateConfigurations() is called via posted events (queued signal emissions) from the bearer thread, and so after creating the spy we may receive an update from _before_ and end up emitting the signal multiple times. Task-number: QTQAINFRA-1040 Change-Id: I931e2907f0cb86d48b4ab1a8795d75206035ea11 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QHeaderView: fix restoreState() on a model with more columnsDavid Faure2016-12-291-10/+72
| | | | | | | | | | | | | When saving state for a 3-columns headerview and then restoring that state onto a 5-column headerview, the headerview shouldn't suddenly think it has 3 columns. Rather than making restoreState() fail, we adjust for the additional columns, so that we can still apply the customizations from the user to all other columns (hiding, moving, etc.). Change-Id: I3f220aa322ea8b629d2fe345f8cde13e0ea615d6 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* QIPM: Persist model indexes after emitting layoutChange, not beforeStephen Kelly2016-12-211-0/+76
| | | | | | | | | | | | Callers can persist a QModelIndex which was not persisted before in a slot connected to the signal, and such a persisted index must be updated in the course of the layoutChange. Store the indexes to persist after emitting the signal. Task-number: QTBUG-32981 Change-Id: Ibee4c0d84817d72603a03fe5b22fdeefeac0695e Reviewed-by: David Faure <david.faure@kdab.com>
* QSFPM: Remove data manipulation from move handlersStephen Kelly2016-12-211-0/+46
| | | | | | | | | | | | Similar to the fix in the parent commit, incorrect updating of the internal data structures during layout changes can lead to dangling pointers being dereferenced later. Moves are treated as layoutChanges by this proxy by forwarding to the appropriate method. However, data is incorrectly cleared prior to that forwarding. Remove that, and let the layoutChange handling take appropriate action. Change-Id: Iee951e37152328a4e6a5fb8e5385c32a2fe4c0bd Reviewed-by: David Faure <david.faure@kdab.com>
* QSFPM: Fix handling of source model layout changeStephen Kelly2016-12-211-0/+126
| | | | | | | | | | | | | | | | | | | | | | | In sourceLayoutAboutToBeChanged the source model update is ignored if the affected parents are filtered out anyway. The same logic is attempted in the sourceLayoutChanged slot, but there the early-return logic is applied too late - the mapping is cleared before performing the early-return. Because pointers into the mapping are used in the internalPointer of QModelIndexes in this class, persistent indexes used later will segfault when attempting to dereference it. Additionally, if a parent becomes invalid as a result of the layoutChange, it would be filtered out by the condition in the loop, resulting in a different result in the comparison of emptiness of the parents container. Fix that by persisting the parent's container, and performing the test for early-return before clearing the mapping. Task-number: QTBUG-47711 Task-number: QTBUG-32981 Change-Id: If45e8a1c97d39454160f52041bc9ae7e337dce97 Reviewed-by: David Faure <david.faure@kdab.com>
* Merge remote-tracking branch 'origin/5.8.0' into 5.8Liang Qi2016-12-168-28/+117
|\ | | | | | | | | | | | | | | | | Conflicts: doc/global/qt-cpp-defines.qdocconf src/plugins/platforms/android/qandroidplatformopenglcontext.h src/plugins/platforms/android/qandroidplatformtheme.h Change-Id: I13d51cc66f708138ff4d667ceea7d515992e58a4
| * Merge remote-tracking branch 'origin/5.7' into 5.8.0Liang Qi2016-12-085-3/+14
| |\ | | | | | | | | | Change-Id: I576187a9905802c177ae483e6c29d0f55cf7034d
| | * Merge remote-tracking branch 'origin/5.7.1' into 5.7Liang Qi2016-12-075-3/+14
| | |\ | | | | | | | | | | | | Change-Id: Ic2cdbd0c826bd63f545479495fa095ec666ddd5a
| | | * Fix the JPEG EXIF reader to deal with some broken/corrupt filesv5.7.1Thiago Macieira2016-12-015-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We parse the EXIF header in order to get the proper orientation, so let's be a bit more careful in what we accept. This patch adds better handling for reading past the end of the stream, plus it limits the number of IFDs read (to avoid processing too much data) and deals with a pathological case of the EXIF file format: EXIF (due to its TIFF origins) permits the offset to the next IFD to be backwards in the file, which means it could result in a loop or pointing to plain corrupt data. We disallow any backwards pointers, since it seems that's what other decoders do (libexif, for example). Change-Id: Iaeecaffe26af4535b416fffd1489332db92e3888 (cherry picked from 5.6 commit 02150649f95b8f46f826e6e002be3fa0b6d009bc) Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | | * Apple OS: Handle QSetting strings with embedded zero-bytesTor Arne Vestbø2016-10-211-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Saving strings with embedded zero-bytes (\0) as CFStrings would sometimes fail, and only write the part of the string leading up to the first zero-byte, instead of all the way to the final zero-terminator. This bug was revealed by the code-path that falls back to storing e.g. QTime as strings, via the helper method QSettingsPrivate::variantToString(). We now use the same approach as on platforms such as Windows and WinRT, where the string produced by variantToString() is checked for null-bytes, and if so, stored using a binary representation instead of as a string. For our case that means we fall back to CFData when detecting the null-byte. To separate strings from regular byte arrays, new logic has been added to variantToString() that wraps the null-byte strings in @String(). That way we can implement a fast-path when converting back from CFData, that doesn't go via the slow and lossy conversion via UTF8, and the resulting QVariant will be of type QVariant::ByteArray. The reason for using UTF-8 as the binary representation of the string is that in the case of storing a QByteArray("@foo") we need to still be able to convert it back to the same byte array, which doesn't work if the on-disk format is UTF-16. Task-number: QTBUG-56124 Change-Id: Iab2f71cf96cf3225de48dc5e71870d74b6dde1e8 Cherry-picked: 764f5bf48cc87f4c72550b853ab93b815454cd48 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
| * | | QCocoaMenu: Don't rely on tags when we can get the actual NSMenuItemGabriel de Dietrich2016-12-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -[NSMenu itemWithTag:] clearly states that it'll return the first item with that tag. Furthermore, when and item has been synced more than once, it could be that more than one such item exists in the same menu (e.g. lately changing the role of Edit->Copy). Change-Id: I95a4f0a151659ae273ba03a3cab4a720b781fc3a Task-number: QTBUG-57404 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
| * | | QCocoaMenu: Avoid exception when inserting item already in this menuGabriel de Dietrich2016-12-081-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should not happen, but it's clearly not the user's fault. So we should try to carry on as gracefully as possible instead of letting Cocoa abort the application. The patch also factors the repeated calls to QCocoaMenuItem:: nsItem() in QCocoaMenu::insertNative() and improves a warning from QCocoaMenuIten::sync(). Change-Id: Id00135c219aaf40fb565b19a65cab68f6d9863b2 Task-number: QTBUG-57404 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * | | QHostAddress: fix assignment operatorsMarc Mutz2016-12-071-25/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QHostAddress allowed assignment from a QString, but the respective constructor is explicit, and rightfully so. So it does not make sense that the assignment operator is provided, because of the asymmetry caused between QHostAddress addr = funcReturningQString(); // ERROR addr = funcReturningQString(); // OK (until now) By the same token, since SpecialAddress is implicitly convertible to QHostAddress, provide the missing assignment operator from that enum. Add tests, rewriting the _data() function to use the enum instead of an int to pass SpecialAddress values, and to test !=, too. Added setAddress(SpecialAddress), since a) it was missing and b) to share code between the ctor and the assignment operator. Change-Id: Ief64c493be13ada8c6968801d9ed083b267fa902 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | rename QPointerUniqueId -> QPointingDeviceUniqueIdShawn Rutledge2016-12-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several people agreed that the name was confusing and that this one is better. Task-number: QTBUG-54616 Change-Id: I31cf057f4bc818332b0551a27d1711599440207c Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Sune Vuorela <sune@vuorela.dk>
| * | | QPointerUniqueId: make fit for releaseMarc Mutz2016-12-011-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Declare as Q_MOVABLE_TYPE - Prevent QList<QPointerUniqueId> from being instantiated (use QVector instead) - Add equality relational operators - Add qHash() overload - Replace non-default ctor with named ctor. - Add Q_DECL_NOTHROW. - Add Q_DECL_CONSTEXPR. - Rename numeric() -> numericId(). - Update docs. The extension vector for this class calls for additional properties to be added later, but these are not user- settable. It thus suffices to rely on the only data member, a qint64, which can be reinterpreted to an index into an array or hash with actual objects. This allows to make the class a Trivial Type (ie. no overhead over an int) while still supporting later extension. Cf. QSslEllipticCurve as another example of such a class. The extension has to maintain the following invariants, encoded into user code by way of being used in inline functions: - m_numericId == -1 <=> !isValid() This is trivial to support. An extension could not and still cannot reinterpret the qint64 member as a d-pointer, but a d-pointer is only necessary for user-settable properties where updating a central private data structure would cause too much contention. Add a test. Since this type is used in other modules, keep the existing functions, but mark them as deprecated with the expectation that these compat functions be removed before 5.8.0 final. Task-number: QTBUG-54616 Change-Id: Ia3ede0ecaeeef4cd3ffa94a72b1050bd409713a5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | manual tests: Fix build with modularized configure.jsonAlexander Volkov2016-12-141-0/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I7979b147cc53d9f5250ba983da1245152dcbb2ec Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | | | qmake: introduce magic bypassNesting() scopeOswald Buddenhagen2016-12-132-0/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | will be needed by configure. Change-Id: If14e6944fe84767bd67604ecde98076f873749ef Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | | Accept ZWNJ, ZWJ and PUA characters in input widgetsEskil Abrahamsen Blomfeldt2016-12-123-1/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Private Use Area characters are quite valid input characters when used in combination with a custom font. Joiners also serve an important language purpose in semitic writing systems. Note that there is a hack where we disregard any character produced using CTRL or CTRL+SHIFT specifically because of German keyboards. I have chosen to keep the hack in this patch to limit the change (though I have made an exception for ZWJ and ZWNJ since both are produced using Ctrl+Shift on Windows), but it will probably have to be reverted. [ChangeLog][QtWidgets][Input] Accept characters in Private Use Area, as well as zero-width joiners and zero-width non-joiners in input in QLineEdit and QTextEdit. Task-number: QTBUG-42074 Task-number: QTBUG-57003 Change-Id: I73f3b7d587a8670de24e902dc52a51f7721dba5a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | QDir::cd(): Handle UNC server paths correctlyFriedemann Kleint2016-12-121-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a bool *ok out parameter to qt_normalizePathSegments() and return false when ".." are left over for an absolute path, indicating an attempt to change above root. Factor out static helper qt_cleanPath() to be able to pass the return value to QDir::cd() and return on failure from there. Amends change 63f634322b2c0f795bd424be9e51953a10c701de, which did not handle UNC paths. Task-number: QTBUG-53712 Change-Id: I3e63a5dd0259306a0b99145348d815899582f78e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | QDir::cleanPath(): Do not cd above root paths (UNC, WinRT)Friedemann Kleint2016-12-121-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling QDir::cleanPath() on "//server/path/.." resulted in "/". Factor out a function to determine the root path part of an absolute path for later use, and handle some special cases: - Consider server name of "//server/path/.." as part of the prefix. - Check on the root path for WinRT. Task-number: QTBUG-53712 Change-Id: Ibddacf06212b6fc86fa74a5e4078df6cfd5b66f5 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Disable core dumps for selftests that are meant to be crashingTor Arne Vestbø2016-12-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-55155 Change-Id: I26a1461f35f916f3980fcb18cdddf3502e22fc90 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | | UIKit: Improve handling of private system fonts / fallback fontsTor Arne Vestbø2016-12-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 2bc7a40048 taught the CoreText font database to populate the families lazily, and in the process added a guard to ensure that we didn't populate internal fonts (prefixed with a '.'), as these fonts would then show up in font selection dialogs. Commit 909d3f5c7 then added support for private fonts, by making it possible to filter out any private fonts from font selection daialogs. But the guard was not removed, so we were still not populating these fonts. This guard has been removed, and the filtering function has been updated to include the conditions of the guard. Next, commit e5e93345c5 used [UIFont fontNamesForFamilyName:] to verify that each family that we registered with the font database would also have matching fonts when finally populated. This is not the right approach, as [UIFont fontNamesForFamilyName:] does not handle internal fonts. Instead we trust what CTFontDescriptorCreateMatchingFontDescriptors() gives us, but make sure to register the resulting font descriptors with the original/originating font family, instead of the one we pull out of the font descriptor. Finally, as of iOS 10, we can use CTFontManagerCopyAvailableFontFamilyNames instead of [UIFont familyNames], which gives us all of the internal font families like on macOS, instead of just the user-visible families. For earlier iOS versions we manually add '.PhoneFallback', as we know it will be available even if not listed in [UIFont familyNames]. The end result is that we register and populate families like '.PhoneFallback', which is critical to supporting more esoteric writing systems. The check in tst_QFont that styles for a given family is not empty has been removed, as we can't guarantee that on all platforms, which is also documented for QFontDatabase::styles(). Task-number: QTBUG-45746 Task-number: QTBUG-50624 Change-Id: I04674dcb2bb36b4cdf5646d540c35727ff3daaad Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | | | Fix qdrawhelper function toRGB64Allan Sandfeld Jensen2016-12-081-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function was incorrectly handling green and blue color channels causing them to be dropped. This affects drawing non 32-bit images onto 10-bit per color channels formats such as RGB30. Change-Id: I9211e253b1a9da0dada5c418d592a8f531265989 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | | | tst_qsqlquery.cpp: Refactor runIntegralTypesMysqlTest()Friedemann Kleint2016-12-051-16/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change 3370ab9119df09ca14f7d4641c555e60c1b3f478 introduced warnings from MSVC: tst_qsqlquery.cpp(4005): warning C4805: '==': unsafe mix of type 'const bool' and type 'int' in operation tst_qsqlquery.cpp(4059): note: see reference to function template instantiation 'void runIntegralTypesMysqlTest<bool>(QSqlDatabase &,const QString &,const QString &,const bool,const T,const T)' being compiled with [ T=bool ] tst_qsqlquery.cpp(4006): warning C4805: '==': unsafe mix of type 'const bool' and type 'int' in operation tst_qsqlquery.cpp(4006): warning C4804: '/': unsafe use of type 'bool' in operation tst_qsqlquery.cpp(4026): warning C4804: '+=': unsafe use of type 'bool' in operation Extract an overload taking a QVector of values and use that for the bool case instead of looping over min/max to generate a sequence of values for bool. Change-Id: I72583774e788b8df899f22ed1a64278217e664f6 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | | | Fix blending of RGB32 on RGB32 with partial opacityAllan Sandfeld Jensen2016-12-031-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The alpha channel of an RGB32 image was not properly ignored when doing blending with partial opacity. Now the alpha value is properly ignored, which is both more correct and faster. This also makes SSE2 and AVX2 implementations match NEON which was already doing the right thing (though had dead code for doing it wrong). Change-Id: I4613b8d70ed8c2e36ced10baaa7a4a55bd36a940 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | | | Fix tst_QComboBox::getSetCheck()Friedemann Kleint2016-12-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change 2fd3d8ea9e3e1829653942431070a83569bab6eb broke the QCOMPARE() in there, partially revert. Change-Id: I8f572b9d82ad1c6b5448504eda7cc2fa53fa3d3d Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | | Add a test case for removing a submenu from the menubarDmitry Shachnev2016-12-011-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If 5ca9631d3a0717afb066471ed5eb3b3ed9a9c08a is reverted, this test segfaults on Unity most of the times. Task-number: QTBUG-55966 Change-Id: Ice59842e0a1a7930e3cd10c4c7319ef033fe6a58 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | tst_QTextStream: Use casts instead of Q_UINT64_C for negative values cast to ↵Friedemann Kleint2016-11-301-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | quint64 Q_UINT64_C appends a literal, which causes warnings: tst_qtextstream.cpp(2026): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2030): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2031): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2032): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2289): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2309): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2329): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2355): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2381): warning C4146: unary minus operator applied to unsigned type, result still unsigned tst_qtextstream.cpp(2411): warning C4146: unary minus operator applied to unsigned type, result still unsigned Change-Id: I69ac87c224b75aff059477362d8a317c7e766ec2 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* | | | tests/auto/widgets: use QCOMPARE(., nullptr)Marc Mutz2016-11-3030-240/+240
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .. instead of manually casted 0s. QCOMPARE(., nullptr) was added for Qt 5.8. Make use of the new API. In tst_qwidget.cpp, as a drive-by, change qApp->focusWidget() -> QApplication::focusWidget() Change-Id: I1331b8916b026d48e01534d1ed0b3d72f3f3d50c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | | Fix warnings in tests (MinGW/MSCV)Friedemann Kleint2016-11-294-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tst_qtcpsocket.cpp:606:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] tst_qtcpsocket.cpp:670:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] tst_qfile.cpp(2661): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) tst_qarraydata.cpp(760): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?) main.cpp:40:33: warning: ignoring return value of 'char* fgets(char*, int, FILE*)', declared with attribute warn_unused_result [-Wunused-result] Change-Id: I80ccef29b71af6a2c3d45a79aedaeb37f49bba72 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | tst_qchar: Silence deprecation warningFriedemann Kleint2016-11-291-0/+5
| | | | | | | | | | | | | | | | | | | | Change-Id: I248d815862a4172ceae6ba45391cba0a30b8e1ae Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | | Fix bilinear sampling of more than 8x rotated transformsAllan Sandfeld Jensen2016-11-292-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The check for 8x zoom was inverted and checked for 1/8x zoom. Change-Id: I45156db709bab6b702769c2a70d4d2af51b5533a Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | | Fix tst_QString::sprintf()Friedemann Kleint2016-11-291-6/+11
|/ / / | | | | | | | | | | | | | | | | | | | | | Compare to QLatin1String and use reinterpret_cast to fix MSVC warning: tst_qstring.cpp(1271): warning C4312: 'type cast': conversion from 'unsigned int' to 'void *' of greater size Change-Id: I4f26d72f0fad59e09636fe609a2772309a688e5c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Fix some warnings in testsFriedemann Kleint2016-11-286-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ../tst_qfile.cpp: In member function 'void tst_QFile::handle()': ../tst_qfile.cpp:2661:38: warning: ignoring return value of 'ssize_t read(int, void*, size_t)', declared with attribute warn_unused_result [-Wunused-result] tst_qstatictext.cpp:862:58: warning: unused parameter 'textItem' [-Wunused-parameter] ../tst_qtcpsocket.cpp: In member function 'void tst_QTcpSocket::abortiveClose()': ../tst_qtcpsocket.cpp:2254:90: warning: suggest parentheses around assignment used as truth value [-Wparentheses] Test.cpp: In member function 'void My4Socket::read()': Test.cpp:66:20: warning: 'reply' may be used uninitialized in this function [-Wmaybe-uninitialized] ../tst_qlocalsocket.cpp: In lambda function: ../tst_qlocalsocket.cpp:701:51: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ../tst_qtcpserver.cpp: In member function 'void tst_QTcpServer::linkLocal()': ../tst_qtcpserver.cpp:935:92: warning: suggest parentheses around assignment used as truth value [-Wparentheses] ../tst_qtcpserver.cpp:940:92: warning: suggest parentheses around assignment used as truth value [-Wparentheses] Change-Id: Ic315069768bcb63a6b333c28ac65b0b992b0d43f Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>