Only accept lower-case "true" and "false", as documented.
The old check didn't match either the documentation, nor the QSettings/
QVariant behavior (where, for a boolean value, any lower-cased content
that not empty, "0" or "false" is considered true).
Change-Id: I317d29c16a27f862001b9dff02e8298df8acf5a6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Patch 9a08483d76 introduced a regression,
tst_qmetatype test was not meant to be removed.
Change-Id: I5456ffbbd9d9f8e461f828c6183e46dabf67952b
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This patch aims to provide an updated test that follows changes started
in 10.7: new rule is that only root can access SystemScope settings. It
also disables the sync() workaround code path which is at least not
executed during the tst_QSettings execution and returns wrong value to
the test.
From Apple's documentation:
"Note that modification of some preferences domains (those not
belonging to the “Current User”) requires root privileges (or Admin
privileges prior to OS X v10.6)—see Authorization Services Programming
Guide for information on how to gain suitable privileges"
https://developer.apple.com/library/mac/documentation/CoreFoundation/Reference/CFPreferencesUtils/Reference/reference.html
[ChangeLog][QtCore][QSettings] QSettings now returns the correct value
for isWritable() when using SystemScope settings.
Task-number: QTBUG-9824
Task-number: QTBUG-21062
Task-number: QTBUG-22745
Change-Id: Ib6a1490ec596b99d189ec4de9a0f28ecfd684172
Reviewed-by: Liang Qi <liang.qi@digia.com>
- Record the last event ID with every callback. This event ID is passed
to FSEventStreamCreate when restarting the stream, so the watcher will
receive all events that occurred since invalidating the previous stream.
- Never start with kFSEventStreamEventIdSinceNow, because this will
generate a (bogus) soft-assert in FSEventStreamFlushSync in CarbonCore
when no event occurred since stream creation. The last globally
generated event ID is used instead to simulate the "now".
- Do not dispose and recreate the stream in the callback, but use a
queued signal-slot connection to schedule this on thread that owns the
watcher.
Change-Id: I02f5a845d9e27f9853ed97925ab9c7a5bc0dede1
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Introduce function checking whether the system settings in
native format can be written to. If not, default to user scope or
skip the respective tests instead of failing.
Task-number: QTBUG-37822
Change-Id: I330aff9b79bb22254216f022af807e010bc8e8ba
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
This test takes more than 5000ms to finish some times, so waiting
for 10000ms should be enough to make it more stable on all
platforms.
../tst_qprocess.cpp:1072 :: [gui app]
QTestLib: This test case check ("proc.waitedForFinished") failed because the requested timeout (5000 ms) was too short, 6150 ms would have been sufficient this time.
Change-Id: I266ad0e65bf3c84e73b7ca6543dc15335dad4c99
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Extending this to stock QNX as well since it is not
BlackBerry 10 specific.
- tst_QNumeric::floatDistance()
- tst_QNumeric::floatDistance_double()
- tst_QtJson::testNumbers_2()
- tst_QtJson::toJsonLargeNumericValues()
- tst_QtJson::parseNumbers()
Task-number: QTBUG-37066
Change-Id: If0e5d4fbefac5e8a0efed8ef8b1b7655ff6e7766
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Constructing a QCollator is somewhat expensive, and made
localeAwareCompare really slow. As QCollator (at least with
the ICU implementation) is not thread safe, use one collator
per thread. This speeds up collation of a long list of strings
by a factor of 250 for the test case in the bug below.
Task-number: QTBUG-36149
Change-Id: I645cdc3546347d1dcc7a03b7563b628c7f756944
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
The flag is not orthogonal to the rest, and e.g. checking with
flags & Invalid
will fail. Rather make it explicit by comparing with 0.
Change-Id: I428d5e71f5ecd05f61d543aaa78532548ef93d5a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Print a warning when an invalid logging rule is parsed.
Change-Id: I3bf9a6df4053d36b3803652b2faa86168d5222bc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
The macro should stringify value of the given token not the token
itself.
Task-number: QTBUG-37547
Change-Id: I90f4fa613bd13d5a581828ab13f620b40dfd3593
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
testcase.prf cannot be loaded from pro file for various reasons,
see qtbase commit history for details.
Moved runtime testdata logic from pro file to testdata.prf, and
thus made is reusable in other test cases as well.
Change-Id: I500d08dc4951e4eda862071e4ddd3e0f6de8c3d2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
The tasks might not have run yet at the time of the QCOMPARE, so we need
to acquire on the semaphore in order to ensure that this is the case,
just like in the previous testcase.
Change-Id: I1da72bb07c2f53760b3bf912fc26aaf10ed18d48
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
NormalizationTest.txt does not exist in the project root, but under 'data'
directory. TESTDATA is converted to INSTALLS rules in testcase.prf.
INSTALLS rules generated in testcase.prf does not set 'no_check_exist'
CONFIG variable. Thus qmake will not install NormalizationTest.txt since
it cannot find it from defined location.
Even TESTDATA has been incorrectly defined, NormalizationTest.txt
has been found in majority of the platforms thanks to QFINDTESTDATA
flexibility. However it causes problems on sand-boxed platforms such
as WinRT.
Fixed by defining the relative path to NormalizationTest.txt in TESTDATA
so that qmake can find the file when processing INSTALLS variable.
Change-Id: Id9a28db2a00b17d2c0136e6ff32f421b21137898
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
Based on file system implementation for WinRT, the UNC paths are not
supported on WinRT, so lets disable corresponding tests as well.
Change-Id: Ib45ae618f39d5da39a822160096599b30204cf71
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
QMessageAuthenticationCode autotest does not have data folder for
TESTDATA. It seems that pro file is copy/pasted from another one which
actually have data. Removed the unnecessary statement since it caused
problems for https://codereview.qt-project.org/77981.
Change-Id: Ide753e5692bd2f469217760173a9b60f2f646770
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
Check also for rules set in an environment variable QT_LOGGING_RULES.
This makes it even more convenient to set rules e.g. for just one run of an
application, without having to create a logging configuration file. It
is also more in place with the current way we enable/disable debugging
of parts of Qt via environment variables.
Change-Id: I4d05976f2b6c12bca472552ffa22345475cd01de
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Tomasz Olszak <olszak.tomasz@gmail.com>
Use QStringRef to speed up the parsing of the left side of logging rules.
Change-Id: Idd4d75496e3865d092f2802c45928a414c14c615
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Do not accept rules with wildcards in the middle.
Change-Id: If6fa71629c46bc4127aa8bd475643bc0e8a9f57c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The documentation says that the left side of a logging rule has the syntax
<category>[.<type>]
with optional wildcard '*' as the first or the last character (or at
both positions.
However, so far we didn't allow
qt.*.debug
But what we did allow is implicit dropping of trailing '.', e.g.
qt.* matched also 'qt'
Fix these by splitting up the '.type' in advance, and then do string
matching only on the 'real' category names.
Change-Id: Iab50ad0fc673464e870f5ab8dfb3245d829b3107
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use the QTextStream stream operator for formatting 64 bit numbers,
just like we do for other numbers, too. This ensures all numbers in
a QDebug stream e.g. respect the hex and showbase modifiers.
The original reason for formatting qin64, quint64 with QString::number
is unclear (pre-dates the original qt4 git import). Maybe QTextStream
did lack proper support for 64 bit numbers back then.
Task-number: QTBUG-36841
Change-Id: I049516c2a8394c9c1a708f86c3d950418a20a957
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This reverts commits f12b0f9a38
("QByteArrayList: optimize op+"),
f96f2fe367 ("Enable QByteArrayList
tests"), and 4f23f0530a ("new
QByteArrayList class").
This class is coming back in Qt 5.4.
[ChangeLog][CHANGELOG FIX] Remove the line about QByteArrayList being
added.
Change-Id: I890ab2b34a9b3e575512eb306d0f241143a867cf
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
This patch adds the Objective-C NSData/CDataRef converters to
QByteArray
This will replace the current converters offered in QMacExtras
[ChangeLog][QtCore][Objective-C] Added NSData/CDataRef converters for
QByteArray
Change-Id: I7a0f14bee4271798db345f3c5efd26ac671a3ea4
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The test instantiates enormous amounts of templates in one compilation
unit. All clang versions, that I tested, suffers from performance issues
while compiling the test, the cost depends on the version. The most
affected are shipped by Apple.
Task-number: QTBUG-37237
Change-Id: I0959c1a4a6faee448ae1dae5c1e70ee06cefbd9c
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
We do not need to check all possible basic type combinations in
the autoregistration test.
Change-Id: Ibfb97a93d9d1862e669d843988976690bbc83c74
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Redundant and unused variadic macro arguments were removed. For macros
with known count of arguments, named arguments are preferred.
Common code was moved out from macros so it is not generated over and
over.
Change-Id: Ib5106555d0d3c6cadfbdbdbd614831240b6d762f
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
- QVariant can store (U)Int, (U)LongLong, Float and Double numbers.
Previously, QJsonValue::fromVariant() converted Floats into Strings
while converting the others to Doubles.
- Add unit tests for QJsonValue::fromVariant()
[ChangeLog][QtCore][JSON] QJsonValue::fromVariant() will now convert
single-precision Floats into Doubles instead of Strings
Change-Id: I457adbe29c37ada611d1c6d711c42866d63d4024
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
And takes a very long time to build if it doesn't run out of memory.
Task-number: QTBUG-37237
Change-Id: I8c7fae4d2d99ad59c6d6306da2df554a05955446
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
In the original change - cfb44c6528 - when
querying for the path of a file that did not contain a slash after the
drive indicator it would get the current path and return that as the path
that the file resided on.
However this meant that it would take the current path at that time which
may not be the actual path that was expected. So it was decided that
it should revert back to the original behavior which was to just return
the drive letter followed by the colon which would thus indicate still
that it represented whatever the current path was on that drive.
Change-Id: Ic57ae9227882a66e9a4c4d6537d7f2cae829165a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
MSVC 2008 is confused by TypeInStruct being a template, resulting in
\tst_qatomicinteger.cpp(189) : error C2027: use of undefined type 'QStaticAssertFailure<Test>'
with
[
Test=false
]
for int (and thus for all unsupported types). This appears to be a real
Heisenbug-nature compiler bug as it can also be fixed by adding
qDebug() << Q_ALIGNOF(TypeInStruct<T>)
before the static assert.
Task-number: QTBUG-37195
Change-Id: Ib2b60f3c1ffeb0b8bdeb1fb0c659655ce4ab10d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This causes frequent compiler errors on Windows CE.
tests\auto\corelib\global\qtendian\tst_qtendian.cpp(140) : fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'd:\orcas\compiler\utc\src\P2\main.c[0xCCCCCCCC:0xCCCCCCCC]', line 243)
Task-number: QTBUG-37194
Change-Id: I2adbc1e3b1896fbe86780aa26a15e918333a09f2
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
by default QT contains both core and gui already
Change-Id: I6f5b551104e40a024468e7cb62e302134e9472ec
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
These tests seem to fail because denormalized numbers are not
supported on QNX yet, so marking them as expected failures.
- floatDistance(denormal)
- floatDistance_double(denormal)
Task-number: QTBUG-37094
Change-Id: I79dbc78da6e9bef8466264fd2cab4af0ee8b868f
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
These tests seem to fail because denormalized numbers are not
supported on QNX yet, so marking them as expected failures.
- testNumbers_2()
- toJsonLargeNumericValues()
- parseNumbers()
Task-number: QTBUG-37066
Change-Id: Ifec95b936fb70253395dee4d1ca18e85870486a3
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
This is more consistent with e.g. qt.conf, where section names also
start with an upper case character.
Change-Id: I9ddaf72baeb9334d081807412512242d5d46cbbf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Unit-test this by making the QList, QVector, QHash and QMap unit tests
be duplicated under strict-iterator mode. There's no test for
QLinkedList.
The tst_Collections test does not compile under strict-iterator
mode. It generated over 15000 errors when I tried.
The strict iterators required a small change: the difference_type
typedef needs to match the operators that get distances
(operator-(iterator)) and move the iterator around (+, -, +=, -=, etc.).
Task-number: QTBUG-29608
Change-Id: I834873934c51d0f139a994cd395818da4ec997e2
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Add a new QMarginsF class to complement QMargins in the style of
QSize/QSizeF and QRect/QRectF.
[ChangeLog][QtCore] Added class QMarginsF to support handling margins
with floating-point values.
Change-Id: Iaaa95ec85f5d126d9d864fc4b607241a8c8a8f3a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
So far we did bind the definition of Q_COMPILER_VARIADIC_MACROS to
C++11 (so gcc, clang will not define it in default gnu++98 standard).
However, variadic macros are a feature of the gcc preprocessor since
version 2.97, and are enabled in the default configurations on gcc, clang,
icc.
This might cause warnings and errors though if one enables additional
warnings in gcc, clang (e.g. by -pedantic). Anyhow, as a precedent
qglobal.h already relies on 'long long' ... The warning can be disabled
by adding '-Wno-variadic-macros'.
[ChangeLog][Compiler Specific Changes] Variadic macros are now enabled
more liberally for gcc, clang, icc. If you have warnings (because you e.g.
compile with -pedantic), disable them by -Wno-variadic-macros.
Change-Id: Ie979b85809508ad70cab75e6981f20496429f463
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This partially reverts 5764f5e6ea and
fixes the problem differently.
After this commit, "file:///foo" is still equal to "file:/foo", but
"foo:///foo" becomes different from "foo:/foo", as it should be.
Task-number: QTBUG-36151
Change-Id: Ia38638b0f30a7dcf110aa89aa427254c007fc107
Reviewed-by: David Faure <david.faure@kdab.com>
This is extremely useful, since the most common action after a failed
compare-and-swap is to loop around, trying again with the current
value as found in memory.
Code currently written as:
do {
Type value = atomic.load();
...
} while (!atomic.testAndSetRelaxed(value, desired));
Becomes:
Type value = atomic.load();
do {
...
} while (!atomic.testAndSetRelaxed(value, desired, value));
In most CPU architectures, the value that was found in memory is known
to the compare-and-swap code, so this is more efficient than the
previous code. In architectures where the value is not known, the new
code is no worse than before.
The implementation sometimes modified an existing function, sometimes
it added a new one, depending on whether more registers were needed in
the assembly (like ARMv6-7), the code became more complex (ARMv5), the
optimizer failed (C++11), or it was just plain equivalent (MIPS).
Change-Id: I7d6d200ea9746ec8978a0c1e1969dbc3580b9285
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This implementation is based on GCC's implementation of std::hash<FP>, but only
to the extent of checking for zero before hashing the bits. The bit hasher is
the Qt one; I didn't even look what GCC uses.
The check against 0.0 is mandated by the requirement to have
\forall x,y: x == y => qHash(x) == qHash(y)
which would be violated for x = 0.0 and y = -0.0 if we only hashed the bits.
Implemented out-of-line to avoid potential FP-comparison warnings, as well
as to be able to use the file-static hash() functions, which gets inlined
unlike qHashBits(), which cannot be.
[ChangeLog][QtCore][QHash/QSet] Allowed to use float, double and long double
as QHash/QSet keys.
Change-Id: I38cec4afb860f17e9f8be7b67544e58b330f8fff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
This test can assume that the QObject::signalsBlocked property works as
advertized, so just check signalsBlocked() in repsonse to QSignalBlocker
manipulations.
Change-Id: I99e4ef9c4ed05c3840233d92a587636d2d78f59a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Change 85e57653 caused a compile error for code that does
Q_DECLARE_LOGGING_CATEGORY(cat);
//..
qCDebug(cat()) << // ...
error: C3848: expression having type 'const QLoggingCategory' would lose
some const-volatile qualifiers in order to call 'QLoggingCategory
&QLoggingCategory::operator ()(void)'
This is a regression from Qt 5.2. Fix the error by adding a const version
of operator()().
Change-Id: I2fb04f2e155962adee0f98089fc5a159000bef56
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Added basic functionality to socket for WinRT. Even though not
all auto tests pass yet, this patch can be seen as a foundation
for upcoming work in this area. Reading from and writing to TCP
socket works and one can listen for tcp connections.
Change-Id: Id4c25ba1c7187ed92b6368c785c4f62837faded7
Reviewed-by: Andrew Knight <andrew.knight@digia.com>