Resource files are expected to be readable.
Change-Id: Ife2b624e69b58e2fb996bc3e210a6e6c5c6852fe
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
The removed code was already commented out when the test was added to
the Qt repository and does not compile when uncommented as it calls
non-existant overloads of QtConcurrent::FunctionWrapper1::operator().
Change-Id: I5a02efae4b89e2815b077474aa7cd0192dcb2730
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Checks if model has any changes to submit.
Includes new test covering isDirty(index) as well the new
overloaded function.
Task-number: QTBUG-3108
Change-Id: I0ccbda45d5d9f06434cf1e1c037a9efb76d0cc37
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
1. QJsonParseError::MissingObject defined
2. QJsonDocument::fromJson() will result in defined error after parsing
of something like "{ 'key':1 , }" or "[ {'key':1}, ]"
Change-Id: I8e6234a03b8aca4e5ad6180f273f91066b86d7a1
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
No longer base the implementation on a QWidget which is not
necessary when all that is required is a message window listening
to task-tray messages. Export a service function creating a message
window from the Windows native interface and use that.
Task-number: QTBUG-20978
Change-Id: I01d0faeac777df4eee802c51d2bc722fce814080
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Change-Id: Id565fa1eb8fe13c62a93a5afa39a5701ce7b20ea
QPixmap::grabWidget is deprecated, which calls QWidget::grab() at present.
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
GCC complained about undefined behaviour when
deleting subclasses of AbstractTester through
pointers to AbstractTester, and it's doing so
correctly...
Change-Id: Ie641281d8aafe32c5c9784e8aa39672ff0b699c7
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
These unit tests do not depent on QtWidget.
Change-Id: I95526125c563885c0531da7ebfee06bca9a87b1c
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Subclass QAccessibleEvent to give details what changed in the
state change.
Change-Id: I9005d311e85a3c8bfa6e062833fa6a8a7dc6a4a4
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
The test was assuming that "data()" is a special function in autotests,
but that hasn't been the case since early prototypes of testlib.
Change-Id: Ic24cf5dc539b55d12eba0a6ab17173e2ed698f21
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
- Use const_cast to avoid "deprecated conversion from string constant to
'char*'" warning when building argv arrays from string literals.
- Use Q_UNUSED to avoid warnings on unused local variables.
Change-Id: Idd2c8279adc102b6ebc6af7486ba26fe9ed4e7c1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Make the various versions of the failure message align consistently so
that it's a little easier to compare the actual and expected values. Of
course, the value won't align nicely unless the "actual" and "expected"
strings are the same length, but at least this commit makes that
consistent across all versions of the message.
Change-Id: If9ce231df3b5d279a06f6458fdb5da0aa4586068
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Add Q_IS_ENUM() macro to determine if a given type is an
enumeration. Use information from that in QMetaType::registerType()
to store whether custom registered metatypes are enums or not.
This information can then be accessed by calling
QMetaType::typeFlags(int type). This is used by the declarative
code to determine whether a custom type in a variant can be safely
cast to an integer, which is required to allow passing non-local
enums as signal/slot params.
Change-Id: I9733837f56af201fa3017b4a22b761437a3c0de4
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
The function is public, so it should validate input instead of crashing
Change-Id: Id67463b0b61ab74a76c1ede7f052bdbed37822b6
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Antialiasing of fonts was causing two tests that relied on finding
at least a certain number of pixels of certain color to find one or two
too few pixels of that color and thus fail.
Fixed by increasing the amount of text displayed to make sure enough
pixels of correct color would be present.
Also removing the test insignification, as the test will now
pass completely when run under Windows Classic theme, which CI uses.
Task-number: QTBUG-24323
Change-Id: Ic0b614d33e4e4f5df18d53cb72a05db5d8b6b5e7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Both tst_qimagereader.cpp and tst_qimagewriter.cpp do not depend on
QtWidgets.
Change-Id: I7e8b31c23db203c44ccb4cd4e8e747d18c5d7ed7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Although passing a null pointer to pcre16_get_stringnumber for
the compiled pattern should simply make it error out, it's actually
an undocumented behaviour, so let's stay safe and add an explicit
check.
Tests for this codepath are added.
Change-Id: Ifd9c87874f6812ba487104ec1a5bbc83c3b16761
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
PCRE's JIT uses by default 32K on the pcre_exec caller's stack. This
is fine for most situations, but in some cases (esp. patterns with
lot of recursion) more memory is required.
Therefore, if a match execution fails due to exhausting JIT memory,
we let PCRE allocate up to 512KB to be used for the JIT's stack.
The pointer to the allocated memory is put in thread local storage
(so it can be reused from the same thread, if needed, and automatically
goes away when the thread dies).
Change-Id: Ica5fb7d517068befff88ebb198a603a26ec5d8a7
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
they are obsolete (qmake knows the qt build configuration anyway), and
messing with QTDIR is a recipe for disaster.
Change-Id: Ib3594f38ec3192a5f70771f8bc5d8fd435bbbd15
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
The commit 660af10dee seems to have fixed
the test, so removing the insignification from it.
Task-number: QTBUG-24348
Change-Id: I564e90db53d10b54e22342a1cdbef6826929c63a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
When objects or arrays where being used read only, several objects
can share the same d pointer, but will have different pointers into
the binary data. Correctly change the pointer into the binary
data even if the d-pointer is the same.
Change-Id: Ife0ea5ac5daf46586f855dccdf35b51ec696a623
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
The function is public, so it should validate input instead of crashing
Change-Id: Ifd9f1110f8631f942929d85db6a57eee7afffb6a
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
The function was crashing when an unsupported type id was given
as an input argument.
Change-Id: I2b0e3e6d43f6f248dc71532f8e6485efe68e8120
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
The bug has been fix by 7bc576771d .
Task-number: QTBUG-24326
Change-Id: Ifd37e9fe76cb24e49132f22909c95a55a230b1ed
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Ported from QDom to QXmlStreamReader. This enables removal of QtXml
classes from bootstrap.
A new rcc test was added, copying the data from the
QResourceFileEngine test. The new test runs rcc to create binary
resources, dynamically loads them under various locales and checks
that they do contain the expected files.
Change-Id: I15d23dfda45de851a421156951ce2a60af4c1f7f
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: hjk <qthjk@ovi.com>
In Qt 4 index 0 was the widget itself.
With the cleanup of child index this now changed.
The default constructor uses -1 as parameter to signify that
the widget is the cause, not a child.
Change-Id: I329a1cc91bf2d1d1d8534739acbddfe107f40364
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
If the expected output file was missing (e.g. not included in
selftests.qrc), tst_selftests would trigger an assert inside QList by
calling QList::at() on an empty list. Make tst_selftests detect this
error instead and give a meaningful error message.
When loading expected output for the crashes selftest, where there are
several alternative versions of the expected output, the code reused the
"exp" variable when loading the alternative test output files. This
caused the last file loaded to be used unintentionally if none of the
alternative files had the correct number of lines. Use a different
variable so that exp remains empty if none of the alternatives are
valid and a failure can be reported.
Change-Id: I35b2a3d905d069d3ee8dcb1447836eb68d5c8612
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Previously, verbose (-v2) and XPASS test output showed all QCOMPAREs as
"COMPARE()", making it impossible to see what was compared and difficult
to match the output to the source of a test containing many calls to
QCOMPARE.
This commit changes testlib's internal compare_helper API so that string
representations of the compared expressions are always passed to
QTestResult::compare() when available, and can thus be shown in the
verbose and XPASS output. The XPASS output has also been changed to
state explicitly that the comparison succeeded unexpectedly, bringing it
in line with the XPASS output resulting from a call to QVERIFY.
This commit also changes all calls to compare_helper() to call the
eight-argument version of the function, which simplifies much of the
calling code. The now obsolete four-argument version of
compare_helper() has been changed to output a warning that it is
obsolete. It will be removed once other modules have had some time to
catch up.
The improved XPASS and verbose output is demonstrated by the expectfail
and verbose2 selftests.
Change-Id: I8baa46d5dd30e6c43b26f366c34dc5b64aab5f7c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This is unfortunately still "most of them", because of QTBUG-24451
however some of the unit tests are still possible to test stably.
Also skipped test cases which would hang forever due to QTBUG-24451.
Bearer tests are not run, because they pass when test machine has no
wireless LAN, but fail or hang if it does (QTBUG-24503)
Change-Id: Icf99d45707102d2ef9219ed0b5ad521605716219
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Rather than requiring specific hardcoded proxies in the system,
it now checks the proxies returned by the system have the required
capabilities for the request.
Note the test will pass if no proxy is configured (as
QNetworkProxy::NoProxy has all required capabilities)
The test prints the returned proxy lists and elapsed time
diagnostic for manual comparison and debugging.
Change-Id: I621ef4d1d7264a98c3e8bd485c30bc1166fcbdf0
Task-number: QTBUG-19454
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's unstable on all platforms, because the reply can be finished
due to a race with the http thread. It isn't crashing (which the
test was trying to test for), but rather the QVERIFY(!reply->isFinished())
fails, which is an inconclusive verdict.
Change-Id: Ib815a7cedd220544a0c9cb83023e3334df4a0fb3
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
The metatypes are registered in the constructor, don't need to
register them in test cases as well.
Registering in a test case is bad practice, as it could result
in tests failing when run individually due to unknown metatype.
Change-Id: Ic4d65d0f5fe3cdd3ab57cf2512a4906d71205a05
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
The test case that depends on QLocalSocket consistently fails due
to bugs in QLocalSocket windows implementation
Change-Id: Ibfe9eb3590be4f72b52f14cd4fbe5be61f6cf70e
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
The implementation uses QScrollBar, which is no longer
included by <QtGui>.
Change-Id: I2422cfccc427179ca71e9a3195f16bd637925fb3
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
QPointF is in the category of types for which QList
is needlessly inefficient (elements are copy-constructed
onto the heap and held through pointers). Use a vector
instead. This is consistent with the QPainter API.
Change-Id: Id0e910c067a60d12fbc175e7ee7da824834be374
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
- Introduce cursor() accessor to QPlatformScreen.
- Remove screen member of QPlatformCursor (a
cursor can be shared by multiple screens
of a virtual desktop).
- Add QCursor::pos()/ QCursor::setPos() taking
a QScreen-parameter, use primaryScreen() for
old overloads. QCursor::pos() can then query
the platform cursor for the position and return
the position even if the mouse position is outside
the windows owned by the Qt application.
- Fix tests
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Task-number: QTBUG-22457
Task-number: QTBUG-22565
Task-number: QTBUG-20753
Change-Id: Ia69f37343f95772e934eab1cd806bd54cbdbbe51
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
When adding and showing a central widget in a QMainWindow then the
layout does not respect the size policy of the central widget.
This is a side effect of 059be19781a22d2e41f22072152589857d0fabf9
After the layout of QMainWindow is restored or the separator between central
widget and dock widgets is moved by user, dock widgets should keep their
size when the window if resized.
Task-number: QTBUG-15689
Change-Id: Idfccb7b4ae057a99f431c2ed54e3b9fcfb6ef54c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Exporting the counter that controls the optimization of a compiled
pattern lets us to forcibly optimize all patterns. Therefore,
two tests are now run: one with default optimization values
and another one which always optimizes the pattern.
The counter itself was renamed with a qt_ prefix and put
inside the Qt compilation namespace
(thanks to rohanpm for pointing it out).
Change-Id: I56602433d37adc127772b2d0d2cdaf2e49d43c71
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Commit 1e6514a714 changed the mutex from
recursive to non-recursive, which could introduce dead lock if the
animation starts other animation (This is the case in QMainWindow
layouts)
Change-Id: I1b149b78a802748eb24b5700fffeca0b8555f005
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
- Remove QPlatformFontDatabase::defaultFonts() returning
a hash containing widget name ->font and the Windows
implementation.
- Add enumeration and font accessor to QPlatformTheme. The value
returned for the enumeration value overwrites the default font
of the font database.
- Implement for Windows, Mac and KDE.
- Add more Windows palettes.
Task-number: QTBUG-23686
Change-Id: I8a2abdfd216df23daa7c9630c54264cdf61295db
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
These tests were not aware widgets had been split to different lib.
Change-Id: I58bde1304c876319a3cbb50f4d6a66e9f24b2886
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Q_DECLARE_METATYPE macro is much better for a custom type registration
then a handwritten template specialization.
Change-Id: Ia15688d89f708fbff0c1da93e08052d31f3b3fc0
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
When an aggregate function is used for a column in a SQL resultset then
it should ensure that the right data type is reported for that column.
This also concerns expressions when the returned column does not map
directly to a table column.
Test included for this.
Task-number: QTBUG-22038
Change-Id: I07487694c0ed393d46af06e232914fe923356a99
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
headersclean enforces various rules which all Qt headers are supposed to
abide by. It fails compilation if these rules are broken.
These rules should be followed also by modules hosted outside of
qtbase. Split the test up so that it can be easily reused by other
modules.
Change-Id: Icf09cbfde411c926ed87914dc821e6dfc569b0de
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
A case of a custom type creation was not covered before.
Change-Id: Icd2a7d63633f8e40d9d4a8a26e0eb0896fc85ec8
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Some minor fixes: obviously, a valid match always come from a
valid regular expression, but a valid regular expression can create
an invalid match (internal error during matching).
Also, testing an invalid iterator should silence the emitted
warnings.
Change-Id: I585bb99a81e22f108601fd66bf30b56e0229d68b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Calling select refreshes the query data but disrupts view
navigation.
For OnFieldChange and OnRecordChange it makes sense to only
select the row in question. This does not disturb view navigation.
Assume disruption of view navigation is not a problem
for OnManualSubmit because the user or application decides
when submitAll is called.
Task-number: QTBUG-2875
Change-Id: I1e5f68668fb9102f6296d67d543e80daa403f1c4
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
Once an insert has been submitted, the cached record behaves like an
update. For row bookkeeping, we still have to remember that it was
originally inserted and is not in the query rows.
Between submitting a delete and selecting, we remove the values
from the deleted record. This causes a blank row to be displayed.
Read-only flag is set for cells in deleted row.
Reverting between submit and select means going back to the last
submitted values.
When removing rows, it's better to process from highest row numbers
to lowest. This avoids complications with higher rows shifting down
when lower rows are removed.
Change-Id: I8752fa11f7a1b88f2a71b9e03a020ac37e62487f
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
QRegularExpression::captureCount() returns the number of
capturing groups inside the regular expression pattern.
Change-Id: Ib90ce67c67d06ab2966f0c98bd91da21defc156d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Trivial change: compare dpointers first, then the data.
Added test function for operator==.
Change-Id: I33ac64a59db4ccad56c30be17622187e42415f38
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Added QRegularExpression, QRegularExpressionMatch and
QRegularExpressionMatchIterator as PCRE-enabled, regexp classes.
Documentation is included, as well as a first round of autotests.
Task-number: QTBUG-23489
Change-Id: Id47031b80602c913ccd2fd740070e3024ea06abc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
The test was testing the wrong thing, and passing even though
QNetworkRequest::AuthenticationReuseAttribute was not being
respected, until recently when I fixed username/password in URLs
Now the cache is properly bypassed when this attribute is set to
manual, and the autotest is updated to check this.
Change-Id: I87943515562d0b16b03504f0758ba265758d1c22
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
Expiration date is calculated from max-age header when a response is
inserted into the cache. Because the test case is prepopulating the
cache outside of QNAM's control, the expiration date was uninitialised,
causing the test to fail.
This is due to a 2 year old change in QNAM, where max age calculation was
removed from cache retrieval, and more recent changes to QDateTime
where secsTo() returns 0 if one of the arguments is invalid.
Change-Id: Ieecd46123dde4ca0fd0be3ae79e70e1528ec02bc
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
QSslCertificate can be copied around into multiple threads,
without detaching. For example, the https worker threads inside
QNetworkAccessManager.
There are const methods, which lazily initialise members of
the private class without detaching (i.e. caching results of
expensive function calls)
These functions now lock the d pointer using QMutexPool to
avoid concurrency related crashes.
autotest crashes 20% of the time in release builds without
the fix, passes 100 times in a row with the fix.
Task-number: QTBUG-20452
Change-Id: I64a01af8159216f2dd6215a08669890f6c029ca8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
This is due to the search in the suffix tree starting at position
fileName.length() - 1.
Change-Id: I98501c1724c7dde2626351ace8ba19faa0d2e1e1
Reviewed-by: Ivan Komissarov <ABBAPOH@nextmail.ru>
Reviewed-by: Wolf-Michael Bolle <wolf-michael.bolle@nokia.com>
The window should be shown and activated before sending user input.
Task-number: QTBUG-23615
Change-Id: I2fc1738d9dc4ee7f03c81b040eed6389910a9d3c
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
show() on a window is asynchronous. Wait for it to complete before
continuing with the test.
Note the test already contained code for this, but it was inside of
a Q_WS_X11 block, making it dead code in Qt 5.
Change-Id: I06f892eea86278c56b1773a7e968bbe065f86260
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
show() on a window is asynchronous. Wait for it to complete before
continuing with the test.
Change-Id: Icd0daa0c0e8f287171c57708bb2fce0b6cf0906a
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
This event was completely unused.
In addition it leads to crashes on linux when
sending the Destroy accessibility update.
The Destroy event on linux would still query an accessible interface.
That in turn would trigger the event to be sent.
Change-Id: I8915527de067b8b70ba41b1361e3ef5d12866d7d
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
The latest windows run of CI has QSettings test passing, so remove the
CONFIG += insignificant_test from it.
Task-number: QTBUG-24145
Change-Id: I35c0d8d4f72ad49f9f21dcd486ab33a37ab95e15
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
this is a hack from the times when these functions were (ab)used to
inspect proper project files, but the inclusion was done with a clean
project, so that the included files did not have any functions to work
with.
Change-Id: I19925e8ead597ca38df040000c183e368b32c06d
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Changing qHash() for string data affected the order of properties to be set,
causing 'checkable' to be set after 'checked'.
As 'checkable' state affects 'checked' as well (setting it to false), this means
that the test was unreliable, a bug, which was exposed by the qHash change.
Change-Id: I03a8dd7d07609683d99f0b2a40012a147d409c6e
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
The verbose output for QCOMPARE is not very helpful. Make the verbose2
selftest (which reuses the counting selftest) demonstrate this, so that
a future commit can demonstrate improvement.
Change-Id: I6b3bc8f5199e984aa11d0a67b76a8c916be86380
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
QCOMPARE should only be used in a test function because it makes the
test function return if the compare fails. The test wants to compare
without returning on failure because the compare is inside a helper
function called by many test functions, so the test was calling
testlib's internal QTest::compare_helper() functions instead of
QCOMPARE.
This commit makes this code slightly less objectionable by calling the
public QTest::qCompare() instead.
Change-Id: Ida17a641e89f8a297d6a036449f44b33aa266368
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In many situations it would be very nice to have setRange
as a slot. It fits good with the rangeChanged signal -
and in some situations it does make sense to synchronize
scrollbars ranges.
Change-Id: I6bcb41ed6e009e5822b56b621e4e187fe52502a6
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
The auto test may fail incorrectly depending on the width of the
QGraphicsView frame. To ensure more consistent test results, the frame is
disabled.
Change-Id: I8d70fb07e45803230954f776947d525e4cf9050f
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Screens need to be destroyed in reverse order to ensure the primary
screen stays valid when other screens are destroyed.
Task-number: QTBUG-24300
Change-Id: I9d9d710aa67ec045baa8bf292833ffe7d9eea935
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Do not draw on the backingstore DC when drawing
to a pixmap. Access the paintdevice for checking via
the QPaintEngine since QPainter returns the clipdevice,
which is a widget.
Fix warning about accessing handle of 0-window in the
test.
Task-number: QTBUG-24183
Change-Id: Ie91ea6ab9d09528c7ec1d35633f9a0ee667719b1
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is complimentary to the commit which introduced a similar
partial specialization for single template argument types:
6b4f8a68c8
If T and U are available as metatypes, then QHash<T, U> is too.
Change-Id: I09097b954666418b424c8c23577032beb814343a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
These tests don't have their own source code but rather reuse the
counting selftest with additional command-line options.
Note that currently the -v1 switch only changes the plain text output,
and the expected xml output is identical to that of the counting test.
This may change in the future however.
This commit also restores a couple of lists to alphabetical order, where
the findtestdata selftest was not sorted into the list correctly.
Change-Id: Ie38e255f8029157b34162b3864b5fa66e137d74a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Otherwise metacity was crashing when a QWindow was destroyed immediately
after being activated, because metacity was trying to select events
(XSelectInput) for the already destroyed m_netWmUserTimeWindow.
Task-number: QTBUG-24492
Change-Id: Iedbe7bdd6b26110ca8bec6f33525209ae551ffd5
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Remove the -armfpa option the config.tests/unix/doubleformat*
detection. The places where we used QT_ARMFPA and Q_DOUBLE_FORMAT
has been removed as well.
Rationale: ARM FPA with GCC does not work with EABI. Qt currently
does not support compiling without EABI, making ARM FPA an
impossibility. It is unknown whether other compilers provide ARM FPA
support with EABI. Support for ARM FPA can be re-added in the future
should the need arise, but since ARM VFP is available for ARMv5 and up,
we should encourage implementors to instead use soft-floats or VFP.
Change-Id: I3671aba575118ae3e3e6d769759301c8f2f496f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Specialise QTypeInfo<QPair<T1,T2>> based on the properties of
T1 and T2:
- If either T1 or T2 is Q_COMPLEX_TYPE, so is QPair<T1,T2>.
- Otherwise, if either T1 or T2 is Q_MOVABLE_TYPE, so is QPair<T1,T2>.
- Otherwise, QPair<T1,T2> is Q_PRIMITIVE_TYPE.
Change-Id: I8aecbd37e3b7924f77f38967498deabf1a19ca24
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Causes a new test failure in QGraphicsProxyWidget::updateAndDelete,
expand the EXPECT_FAIL to cover that one as well.
Change-Id: If9da757206445d17510c4fac82a559de7b8c0563
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
The OS provides the error string in this case.
This gives more information to the developer seeing a generic
error.
Change-Id: Ia03642982f3513ee5a8a9fa98d918e948f8d97a5
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
The test fails if MAKEFLAGS is set up for jom since the test
always uses nmake. Remove MAKEFLAGS from the process environment.
Change-Id: Idaed3cc964832b83c282a59fc5257572c520b882
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
For SSL, this would require an OpenSSL library to be installed.
Change-Id: I2a320e7faf40ef925c90dbe539f912e4a8fc13fc
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Do this regardless of whether the event subclass
is public API or only used in examples. Examples
are examples, used by others as templates or even
copied verbatim, so they should also follow sound
engineering rules.
Anyway, there's only one in examples/...
Change-Id: I586ff16407a956c9e89288fdd4377eed73f45c0f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
- It was trying to install syslocaleapp sub program as TESTDATA
instead of an application.
Change-Id: I2117d11335bc2fd37a8ccc9a03b0337382f0177f
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
- Changed remove() test to check the file just removed is gone.
Change-Id: I0b6c176e624134402b5547866064f436ce063f16
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
- Added install of app sub program so it works from install directory
Change-Id: Ia83643519752a3cbb59d6da2aed132d683a94bee
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
- subtest not valid if run as root so added a check and skip
Change-Id: Iae993e20f272f9303a75062ef00d22b49df5e84a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Those escape sequences have a special meaning in the XML Schema 1.1
regular expressions, but not in Perl-compatible ones.
An escape sequence that has no special meaning should match the
escaped character itself; this patch fixes QRegExp's behaviour in
that regard (previously, it added a character class matching
nothing).
Change-Id: I983f923baa7c2ec19938b96353f3a205e6c06d58
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Windows unhelpfully writes to only one byte of the output buffer
when getsockopt is called for a boolean option. Therefore we have
to zero initialise the int rather than initialising to -1 as was
done before.
This in general only works for little endian architecture, because
the word would look like 0x01000000 on big endian. So I have added
some compile time asserts in the assumption that windows is always
little endian. This is ok for comparisons with 0/false, but not
comparisons with true or nonzero values.
In the case of IPV6_V6ONLY, it is documented as DWORD (unsigned int)
but on some windows versions it is returned as a boolean triggering
the warning. I removed the warning, as the conversion to int works on
both LE and BE since it is only compared with zero.
Task-number: QTBUG-23488
Change-Id: I3c586d1ada76465fc045a82661f289920c657a4c
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
I originally tried to put Q_DECLARE_TYPEINFOs into
Q_DECLARE_OPERATORS_FOR_FLAGS, to declare not only
the flags type, but also the underlying enum as
primitive, but too many users (arguably correctly)
used Q_DECLARE_OPERATORS_FOR_FLAGS at (non-global)
namespace scope where QTypeInfo would have been
specialised in the wrong namespace.
So specialise QTypeInfo for QFlags<T> only.
Change-Id: I4af6e29aefbd9460a3d2bc6405f03cdf6b1096bc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
It's not faster under _any_ metric than the new algorithm, and it loses a lot of
spread which is a bad thing.
Change-Id: Ic87258f1c887822ffea1cb1517355564fabc3c26
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
We must do this the same way we do all other hash algorithms for fair
comparison, as otherwise, the call to the PLT unfairly penalises
QHash<QString>'s results, as it's in a different shared object.
Change-Id: I69c891f5a97dcccdfcfbdbf32796f86242a42963
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Per the comments on Ie4100a1ca4dbe7bf1cd73de883a9854377ac2f5e, having Q_ASSERT
was not a good idea, and data functions can't really handle
QVERIFY/QCOMPARE/etc, so do this in initTestCase instead.
Change-Id: I19e61dec7fe415bb1fa0f53a2920d99b8c7c8ea7
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Similar to the UUID benchmark, but won't have any non-numerical characters.
Change-Id: I7487c97cab96fd53c180fe12061e7be3ca96e883
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
This attempts to emulate a dictionary usecase of sorts, done in code to avoid
bloating the git repository by adding an actual word list.
Change-Id: I878bc4af8877ba780ee699932f240c0d9c8ff12c
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
For some reason, hiding files via executing "attrib +h filename"
process didn't work realiably, so changed the file hiding to be done
via Windows native API.
Also changed the test to use QTemporaryDir to simplify temporary
directory handling a bit.
Task-number: QTBUG-24291
Change-Id: I4f02b16e2f9105bcf5e6c5bf136f55434a26e2f4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Only test code change, we already have the correct behaviour
Task-number: QTBUG-20001
Change-Id: I2296f405f47f9c8d15796e69f9d1854063e38d6a
Reviewed-by: Richard J. Moore <rich@kde.org>
This made sense only for Symbian where there was a special
CFbsBitmap-based backend present and it was used from the
Symbian-specific VG and GL pixmap implementations.
The generic version is merely a useless wrapper over QImage and is not
in use anywhere in the codebase.
Change-Id: I1dabe22dfb8cbbc35dce8e22703a3aff810fb5f9
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
- Use temporary directories to avoid instabilities
due to remains of previous failed tests and locked
directories.
- Replace SRCDIR by QFINDTESTDATA(), reference only
the freedesktop.org.xml contained in the Qt source
tree by $$QT.corelib.sources.
- Improve some error messages, test suite instructions
for Windows.
Change-Id: Idee8e3767ef0a8299df3bdaaac20334164878db0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
The private git history shows that the test program associated with this
data file was missing from the original commit and was never
subsequently added.
Change-Id: I3401724ac04168158a48eb06436db83d3557711f
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
- Skip the failing windowsDefaultLocale() test.
- Improve the handling of the subprocess, locate
the binary in initTestCase instead of repeatedly searching it.
- Make all applications console/non-app bundles.
Task-number: QTBUG-24543
Change-Id: I79dfaa3320cd5698f02e74a3fe53477d4a79d4fb
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
The libraries were built into wrong directory in Windows. Fixed it so
that the libraries are built into debug and release directories like
the test executable.
Also fixed QMAKE_CLEAN statement, which was using incorrect separator.
Task-number: QTBUG-24151
Change-Id: Iade656af5f83ef2b79c2b9c4177df4a16b2f6821
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
moc is currently generating code to convert from a pointer to member
function of a slot or signal to its index.
The idea was that it could be usefull for slots to have the new syntax
do the same as the old one (connecting signal index to slot index). But
in practice, the new syntax do not use the IndexOfMethod for slots.
Also, it does not work for all the slots (no Q_PRIVATE_SLOT,
no static slots)
So since it is not used, and that it would take room in the binaries to
generate all the code to get the index of slots, we remove it.
If ever we need it, we can still add it later.
Change-Id: Ia417e3e524d7915ca86433ea86c66ac2b299c81a
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Previously the silent logging mode suppressed passes, skips and internal
testlib info messages, but did not suppress debugging output, making it
hard to see the fails in a noisy test. This commit changes silent mode
so that it suppresses all output except test failures and fatal errors,
making silent mode truly useful for seeing just the important test
output.
This commit also adds a selftest to verify the behaviour of silent mode.
Change-Id: I75420aead03682306210746a87e2a3b608b58fc6
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This adds Sha224, Sha256, Sha384, and Sha512 enum values to
QCryptographicHash::Algorithm. The implementation comes from RFC 6234,
http://tools.ietf.org/html/rfc6234, which is added to
src/3rdparty/rfc6234. Only the headers and SHA-2 code is included in
src/3rdparty/rfc6234 (the SHA1, HMAC, and HKDF code is not included).
Change-Id: I85139fd118291f15efc22899a5ddd1cc83810cfb
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
it did the same cleanup() did, and they are always called consecutively
anyway (except at start and end where it does not matter).
Change-Id: I4c82024d19d6c670f1f4037d43147a15680614ae
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
we want to call it even if the test fails
Change-Id: Ie8f3f9d2df5d52990d6b9f9a632e49826278175a
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
this allows us to temporarily set some extra args without (incorrectly)
instantiating a second TestCompiler (and on the way relying on $PATH for
finding qmake).
Change-Id: Icce5bf7314148ddbe705606f77a26e3362b31f67
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Clear away Q_WS_WIN/Q_WS_X11 from QMenu. Using the hint returned by the
QPlatformTheme.
Task-number: QTBUG-24325
Change-Id: Iaa4da26c74273d7cfc1fbec6519c52d09e10f7bb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
tst_qclipboard.cpp still has Q_WS_WIN which must be clear away. After
clean up, auto test will fail under windows: When setMimeData() is
called, dataChanged() signal will be emited twice.
The solution for QTBUG-24184 has partially solved the problem, but it
still there. Make sure emitChanged() only called by QPlatformClipboard
will give our more control for this.
Task-number: QTBUG-24484
Change-Id: I23566c6d3b32828b6865234c311af3635fe9e299
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
- Create subdirectories containing profiles to avoid
problems with -fast.
- Use QFINDTESTDATA to locate binary.
- Make it a console application, no Mac-bundle.
- Add error messages to the test, give it a longer time-out
and ensure sub-process is killed if it hangs.
Change-Id: Ibc177b786c4bc8fdbc068a8c45f4801a41c9f660
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Fixes a crash when invoking various QRegExp methods on an object
*before* doing any match. For instance fixes:
QRegExp re;
re.matchedLength(); // crash
Task-number: QTBUG-23352
Change-Id: I9c239ff790a139c7820ef1aeced89d31320ae6b0
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reusing a template is much better then creating a new one, even if it
should inline the same code.
For some reason replacing T* by void* force gcc to remove a few bytes
per template instantiation too, it is not really significant, but it
alows us to simplify the code.
Benchmarks don't show any regressions.
Change-Id: I4fdf1e4dc311b23021eb5758605602937d05b183
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QVariant::Type is marked as obsolete. It is not possible to get rid of
it completely, in a source compatible way, but at least we can remove it
safely from a method arguments list.
Change-Id: I26b58099bfa6d32f3a583a8ae0047f0bb36bcd0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Allow moc to produce the desired identifiers when used with C++
symbol names that have been redefined, for example by -Dfoo=bar.
Two changes are required: firstly, when encoding a type name, the
components of the name must be checked for substitutions that have been
defined for that token (note that this is not done here by correct
pre-processing, but only by processing the resultant table of
definitions). Secondly, the arguments to the SIGNAL, SLOT and METHOD
macros must be allowed to be substituted during macro expansion rather
than stringized directly.
This is a temporary change to prevent breaking existing projects
that depend on the declarative module. After clients have had an
opportunity to update their code to the use the new interfaces,
it can be removed.
Task-number: QTBUG-23737
Change-Id: I39e6844cebf6ca7984af6028160b8a3797ac44a5
Reviewed-by: Martin Jones <martin.jones@nokia.com>