Commit Graph

1528 Commits

Author SHA1 Message Date
Jason McDonald
f64f428b81 testlib: make XPASS output slightly less confusing.
Prior to this commit, when an unexpected pass occurred the test output
showed the message "XPASS : tst_foo::function() 'expr' returned FALSE",
where the problem was actually that the expression evaluated to true
when it was expected to be false.

This commit changes the output to make it clear that the expression
evaluated to true unexpectedly.

Task-number: QTBUG-22118
Change-Id: Id22c178073d3b75789675ca37a8ef019029b1f91
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-20 03:27:02 +01:00
Bradley T. Hughes
2e18c16e59 Speed up tst_QWaitCondition
Reduce the thread and iteration counts to make this test execute faster.
This change reduces the runtime to 14 seconds (from 5 minutes, 38
seconds).

Change-Id: Id5ea056cfd33022da5a06809f0598a5cdb02b27b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-20 00:21:00 +01:00
David Faure
b164911b7f Import QMimeType / QMimeDatabase into QtCore.
History of the development before the import:
ssh://codereview.qt-project.org/playground/mimetypes.git

Mimetype definitions come from shared-mime-info where available (UNIX systems),
loaded using a mmap'ed binary cache generated by update-mime-database.
As a fallback if no cache is found, we parse the raw XML files otherwise.

This makes the MIME type support fast and with very low memory usage on UNIX,
and it makes it easy to use on Windows (no dependency on shared-mime-info,
Qt even includes a freedesktop.xml file to use if none are found on the system).

Change-Id: I27b05008216ff936dc463bd80d3893422bfb940e
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-02-18 22:19:43 +01:00
Andrew Christian
908a080006 Added error reporting to QJsonParser
Change-Id: Ib2390c0faf1ed7ada3fc185abce83740ad112929
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-18 18:08:06 +01:00
Friedemann Kleint
e0d9fade03 Fix qclipboard autotest on Windows.
Emit changed signal only if the clipboard is not owned,
in which case QClipboard does it.

Task-number: QTBUG-24184
Change-Id: I27420583a718a5f8cd93b9d361b1e422a75df300
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-18 00:00:21 +01:00
Friedemann Kleint
400c865f29 Windows: Fix QWindow-test.
- Save & Restore style and geometry when switching to
  full screen and back since it is not a real state on
  Windows.
- Obey the positioning policy in setGeometry.

Task-number: QTBUG-24185

Change-Id: I18dea4fd372e0b2e46273a7a27e0c6f4f4bde771
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-17 20:09:58 +01:00
David Faure
7e970eb58c Ensure that Qt public headers compile with strict flags
Those from
http://wiki.qt-project.org/Coding_Conventions#Conventions_for_public_header_files
(unfortunatey -Wold-style-cast cannot be used due to the glibc macro bswap_16)
and many Qt defines that disable casts.

Change-Id: I97ac707a101df9819e8c031fa75a31b30e20247f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-17 16:42:28 +01:00
Shane Kearns
b4a538ea1c Fix handling of urls containing username/password in QNetworkAccessManager
QNetworkAccessManager was ignoring the supplied credentials, although
webkit seems to support these urls at a higher level.

Following the behaviour of browsers:
We use supplied credentials if authentication is required.
We add supplied credentials to the authentication cache.
We emit authenticationRequired signal if the credentials were wrong.
We do not use previously cached credentials for that url

Synchronous http requests fail, if the credentials were wrong.

Task-number: QTBUG-18107
Change-Id: If46e8eab1511ba8a0f4bbe0d4efaabc4df0b8ab4
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-17 15:04:07 +01:00
Miikka Heikkinen
f8e2753323 Make 'nmake check' succeed for widgets tests
Marked a bunch of tests insignificant, and skipped one crashing test
case in QApplication test, as that couldn't be made to pass simply by
marking the test insignificant.

Once the underlying issues are fixed, the tests need to be re-enabled.

Task-number: QTBUG-24203
Change-Id: I9aea4fa207d307793445efdcaead72219fbf6c4f
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-17 14:08:19 +01:00
Miikka Heikkinen
3efb0d50e5 Disable 'check' target generation for network autotests for Windows.
A number of network autotests are unstable in Windows, so don't
generate check target for them as is done for mac.

Once the tests are acceptably stable, this needs to be reverted.

Change-Id: I18262e28ce40eba541aecf3cfb651bff34698ead
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-17 11:48:08 +01:00
Bradley T. Hughes
0a6516e126 Expect failure in tst_QStyleSheetStyle::hoverColors()
This is similar to the focusColors() failures in QTBUG-23686.

Task-number: QTBUG-23686
Change-Id: I1f01a4e41e61a7a664309be34cfa4fe916a92b15
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-17 11:44:29 +01:00
Bradley T. Hughes
ee7c81b9c4 Skip tst_QGuiApplication::focusObject() on Mac OS X
This test fails intermittently, and at random locations.

Task-number: QTBUG-24322
Change-Id: Ied6dd4d1593066debc0fb48c6ca2a17a1f4d51b7
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-17 11:44:29 +01:00
Bradley T. Hughes
ea1ef2a471 Skip all tst_QFontDialog tests on Mac OS X
All of these tests currently hang.

Task-number: QTBUG-24321
Change-Id: I7664b57f6539d4c03008701da66e193019a4440a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-17 11:44:29 +01:00
Bradley T. Hughes
a902387204 Skip hanging tst_QColorDialog test, expect failing test on Mac OS X
tst_QColorDialog::native_activeModalWidget() hangs, so skip this test.
tst_QColorDialog::task247349_alpha() fails, so XFAIL this failure.

Task-number: QTBUG-24320
Change-Id: Ie4d69e07063e9a648ec4fa3337274143a52ea3e3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-17 11:44:29 +01:00
Bradley T. Hughes
33fe2cf23f Skip hanging/failing tst_QApplication tests on Mac OS X
The first block of tst_QApplication::quitOnLastWindowClosed() hangs
on Mac OS X, so skip that block for now.

tst_QApplication::testDeleteLAter() both hangs and fails on Mac OS X,
so skip the test and XFAIL the failure.

Task-number: QTBUG-24318
Task-number: QTBUG-24319
Change-Id: Ice11292d84e63215f1bb9e03f3ef369943d1d887
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-17 11:44:29 +01:00
Bradley T. Hughes
2c3b2b4703 Expect tst_QSettings::ctor(native) failures on Mac OS X
The default constructor for QSettings does not set NoAccess status, even
if the organization domain, organization name, and application name are
empty. Instead of trying to fix QSettings, keep the existing behavior,
and test for it.

Failures from tst_QSettings no longer need to be ignored, so
mac:CONFIG+=insignificant_test has been removed from the .pro file.

Task-number: QTBUG-22745
Change-Id: Ic9f8b6821c483c217e1ef2ece704be2da169e340
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-17 11:44:29 +01:00
Friedemann Kleint
4cf0deef73 Add palette() and further hints to QtGui/QPlatformTheme.
- Move palette() from deprecated QtWidgets/QGuiPlatformPlugin
  to  QtGui/QPlatformTheme, Make it return a const * since
  QPalette does not have isNull().
- Initialize QGuiApplication::palette() and
  QApplication::systemPalette() from it.
- Do not initialize QPalette from QGuiApplication::palette()
  unless app_pal is non-null (default to Qt::black if it is 0).
  This avoids initialization order crashes/recursions in the
  QPA plugin. Streamline initialization function.
- Remove styleName(), systemIconThemeName() and iconSearchPaths()
  from QGuiPlatformPlugin and re-add them as
  QPlatformTheme::themeHint().
- Remove styleHint() from QGuiPlatformPlugin, add it to
  QPlatformTheme::themeHint().
- Add UNIX themes with factory function (Generic,
  KDE, Gnome), taking it from Qt 4.8 code (stripping the
  KDE 3 code).
- Implement Windows palettes.

Task-number: QTBUG-24204

Change-Id: Ie27ec035df4f84c42deaffc4816b2e53ce705462
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-02-17 11:44:29 +01:00
Kurt Korbatits
d0759e348d Changed qnetworkreply unittest to work from install directory
- made subdir test depend on echo
- remove SRCDIR and changed to use TESTDATA and QFINDTESTDATA
- added waitForFinish() to handle slow networks
- removed core module header from echo subprogram and replaced
  with needed header only
- Added ipv6 skip to connectToIPV6Address() if not available
- Added check QT_BUILD_INTERNAL and skip tests if backend
  not available
- Skip permission tests if run as root
- Removed win32 debug and release directory locations so that
  application is in known location relative to test data

Change-Id: I58c3c2fca3cd2fee72fdb81d016bb4fd7fe08ac2
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-17 08:25:10 +01:00
Kurt Korbatits
c08fb806bb Removed rfc3252.txt from networkselftest unittest
- no longer needed after test that used it was removed

Change-Id: I63fc8a9db07f9250507becb9bf6c2aefe0fdc254
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-17 08:23:10 +01:00
Bradley T. Hughes
f0f78eb0a9 Remove usages of QT_ARCH and QT_ARCH_* from qtbase
The architecture is detected at compile time based on the predefined
macros from the compiler. Don't use QT_ARCH in .pro, .pri, or .prf
files.  The PNG_NO_ASSEMBLER_CODE define from libpng.pri is not present
in the current copy of src/3rdparty/libpng, so no change in
functionality is expected.

The conditional for the SUPPORT_JIT define in pcre.pri is moved to
src/3rdparty/pcre/config.h, again so that we can use the compiler's
predefined macros to detect the architecture at compile time.

Replace QT_ARCH_ARM, QT_ARCH_MIPS, and QT_ARCH_SPARC with their
Q_PROCESSOR_* equivalents.

Replace QT_ARCH_INTEGRITY, QT_ARCH_VXWORKS, and QT_ARCH_WINDOWSCE with
their Q_OS_* equivalents.

Note that this commit also effectively disables the SPARC atomic
implementation. An inline implementation for SPARC needs to be added,
or we remove the current code and instead rely on the GCC intrinsic or
C++11 std::atomic support on SPARC.

Note also that this commit does not remove QT_ARCH from configure or
qconfig.h. This will continue to be set until all Qt 5 projects can be
moved away from using QT_ARCH.

Change-Id: I5de747cc4436d21941329974cff3016970f497b8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-17 08:22:43 +01:00
Marc Mutz
b1004b6f83 Compilation fix: missing includes for geteuid()
Change-Id: I054b8c9a398b5e192c2e005a39cba19bb4930966
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-17 05:27:29 +01:00
Miikka Heikkinen
7c081ba942 Fix qlogging test for release configuration
The helper process 'app' wasn't built in release configuration.

Also improved finding the helper executable to utilize
QFINDTESTDATA and print out a proper errors if it could not be
found or started.

Note that adding ".exe" to process name in Windows is unnecessary
as QProcess already does that for you, so removed the ifdeffing.

Task-number: QTBUG-24330
Change-Id: Ibe75e0ecd24181ab623d0a60f17ecaf92052b0dd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-17 05:26:58 +01:00
Friedemann Kleint
3b5f6f7647 QWindow-test: Fix QSignalSpy warning about Qt::ScreenOrientation.
Change-Id: I5954445057c1a597b5062ee8e472d684832812e5
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-17 05:26:55 +01:00
David Faure
1209fccaf7 QMimeData: export URLs as text too
This allows to drop or paste them into lineedits and text widgets
(including such widgets in non-Qt applications)

Implementation note: this is done on-demand rather than in setUrls
so that it's still possible to setText explicitely; the new code
is only a fallback for when no text/plain data is available.

Change-Id: Ie90c43a30bfa64a6047b627e7351d20bf5ec8e03
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-17 05:26:47 +01:00
Eskil Abrahamsen Blomfeldt
cb8445f032 Remove historical +1 from font height calculation
Historically, we've calculated font height as ascent+descent+1.
In Qt 4, a patch was added to work around this by subtracting
1 from the descent of the font engines. We now remove the +1 and
the work arounds.

Change-Id: I7e25d49b97ac892015d3328f32d70eb9a7c2d88f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-17 05:26:44 +01:00
David Faure
b838170ceb QDebug: Add support for %{pid}, %{appname} and %{threadid}
Change-Id: I4add0a374e6524b615c6dc0ecfb010a90075b04f
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-17 05:25:56 +01:00
Bradley T. Hughes
2193df65a3 Fix tst_QFileSystemWatcher failure on Mac OS X
The watchFileAndItsDirectory() test would fail due to atime updates for
the first watched file coming up to 2 seconds after the file was closed.
Observation shows that the atime has a 2 second resolution on Mac OS X
using HFS+, so add an appropriate delay to make sure that the atime
update from the kqueue based file system watcher can dispatch all
updates.

Task-number: QTBUG-22744
Change-Id: Ie79af20d6b4c154021307c8a8f6d336369720337
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-17 05:25:26 +01:00
Jason McDonald
64642a4d97 testlib: Skip test function if init() fails.
Prior to this commit, the following statement in the qtestlib
documentation was untrue: "If init() fails, the following testfunction
will not be executed, the test will proceed to the next testfunction."
If init() called QSKIP, the test function would be skipped, but if
init() reported a failure, the test function would still be executed
(even though doing so could be unsafe).

This commit makes testlib skip a test function if init() reports a
failure and enhances the selftests to cover skips and fails in both
init() and cleanup().

Task-number: QTBUG-20371
Change-Id: Id1cc8464ae0b8c257ae1b74dbe9189a501f5366b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-17 05:24:46 +01:00
Kurt Korbatits
4121f9df29 Changed qsslkey to work from installation directory
- Changed to use TESTDATA and QFINDTESTDATA instead of SRCDIR

Change-Id: I30bf175c2c9044e1f8556260a032467ca0dfc09f
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-17 05:24:43 +01:00
Kurt Korbatits
20f6dc615a Changed qsslcertificate unittest to work from install directory
- Changed to use TESTDATA and QFINDTESTDATA instead of SRCDIR

Change-Id: I1957ef287ba2f337b5e0b2c6245d872eacb6316f
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-17 05:24:40 +01:00
Kurt Korbatits
857775f701 Changed qcryptographichash unittest to work from installation directory
- Changed qcryptographichash to use TESTDATA and QFINDTESTDATA

Change-Id: Ic3a1bdccc9f81605c648dab2a642421d17f7fe80
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-17 05:24:37 +01:00
Kurt Korbatits
32060c2115 Changed json unittest to work from installation directory
- Changed json unittest to use TESTDATA and QFINDTESTDATA

Change-Id: Id29f8257565f409fa184ba465f25bc8454e2b7fb
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-16 04:23:20 +01:00
Jason McDonald
eb64bb89cf Eliminate duplicate data row names in dbus, tools and xml autotests.
Change-Id: Ic734435f57bb4f2160ecb3bc645e642207931a99
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-16 02:00:52 +01:00
Jason McDonald
6dfb1de099 Eliminate duplicate data row names in network autotests
Change-Id: Icbfc24309a182f37268232fc3c299d35d6d6a0ea
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-16 02:00:46 +01:00
Jędrzej Nowacki
214e031d56 Implement new static less API for QMetaType.
Currently QMetaType API contains almost only static methods. This works
nice until someone needs more information or needs to do more operations
on a type. In this case every function call has to do type dispatch.

This API allows to avoid redundant type dispatching, by caching a
type information in a QMetaType instance. It gives significant
performance boost especially for custom types (up to 9x).

Change-Id: I223d066268402e072e41ca1d0a3e7bc160655d7f
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-16 02:00:15 +01:00
Rohan McGovern
7a5bb18dc6 Fixed tst_QFile when redirecting stdin/stdout/stderr to/from files.
openStandardStreamsBufferedStreams would fail if standard streams were
redirected to a file (e.g. ./tst_qfile > testlog.txt).

openStandardStreamsFileDescriptors already has a workaround, so apply it
here too.

Change-Id: Iffe9d7864909e489e77c1114e80c4e3bc70a8722
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-16 01:57:27 +01:00
Stephen Kelly
66603985f2 Fix ref counted window close handling.
Instead of refcounting QWindow visibility, we ask the Application
subclass whether quitting is appropriate.

Task-Id: QTBUG-24120
Change-Id: Idd19cc1a3e5742fddded89c7638aaaa5e47c568d
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-16 01:56:27 +01:00
Jędrzej Nowacki
18965b1384 Add QMetaType::FirstCoreType enum value.
We should not assume that the first type id is 0.

Change-Id: I17ba6ba57e97ebd495904bfd11235fe458f214e5
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-02-16 01:56:05 +01:00
Stephen Kelly
394315d902 Move the removal of the Quit event to QWindow.
Change-Id: If524127ba9dab9ef065aaf4079294295eef8e49b
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-15 20:47:32 +01:00
Miikka Heikkinen
656dff47a6 Fix tst_QFileDialog2 for Windows 7.
There are no rights for typical user or even administrator to write
directly under c:\ root in windows without rights elevation, so
completionOnLevelAfterRoot() test case failed. Changed the test case
to use an existing directory.

Task-number: QTBUG-24289
Change-Id: I6a8dfc9d1d6ae798b3b9049c542b45fdbdbd9a8c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-15 18:03:54 +01:00
Miikka Heikkinen
79e9076274 Remove XFAIL in QGraphicsWidget test for Windows
The XFAILed initStyleOption() case passes on Windows, so do not XFAIL
it there.

Task-number: QTBUG-24297
Change-Id: I9615c408aa7e72b5eb8fe9739903594e45eb5fd7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-15 18:03:01 +01:00
Kent Hansen
ded417b75a Add autotest for QMetaMethod introspection
This autotest checks that meta-methods can be properly inspected
(signature, return type, parameter types, etc.).

Change-Id: I13dc75ec5123280e94ec738dade3f54e427fdbaa
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-15 17:27:04 +01:00
Friedemann Kleint
0f0d8a5a8f Stabilize QFileSystemWatcher test.
- Run each test in a temporary directory, avoid writing test
  files in source/build tree and prevents tests being influenced
  by left-overs from previous runs and locks of the application
  on the current directory.
- Modify test to be able to use absolute paths to the temporary
  directory.
- Skip parts of test removeFileAndUnWatch if a race condition
  occurs.

Task-number: QTBUG-24029
Change-Id: I215cc2e0fe6f92d2ffe597b01cdc9c9a39e3c5b4
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-15 08:59:34 +01:00
Bradley T. Hughes
b9cf3dec90 tst_QVariant passes on Mac OS X
Do not mark with insignificant_test anymore.

Task-number: QTBUG-22747
Change-Id: I4ef6d5d7e1189b03fd1ab812a0839e3709686e1b
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-15 08:59:29 +01:00
Kent Hansen
e121d6d7e8 Test template-based connect() with qmetaobjectbuilder
For template-based connect(), the meta-object is resolved at
compile-time (the virtual metaObject() function isn't called).
But we can make it work by copying the members of the dynamically
constructed meta-object to the statically defined one.

Change-Id: Ia4d3263a89008e36e187c584db6d25d9042f32b3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-15 08:59:29 +01:00
Kent Hansen
58d6c856ec qmetaobjectbuilder: Add support for revisioned methods and properties
moc supports it, so qmetaobjectbuilder should too.

Change-Id: I01475794e928b5a1b659f0dab044933948186971
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-02-15 08:59:29 +01:00
Jason McDonald
1acc490248 Eliminate duplicate data row names in widgets autotests.
Change-Id: I82bab3cc39320014fac6732c7b60233b262cb30d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-15 02:36:47 +01:00
Mark Brand
555aa4439b QSqlTableModel::commitAll(): replace row removal hack
The purpose of the hack was to fool QSqlQueryModel into signaling the
removal of extra rows via rowsRemoved(). The extra rows are the
inserted rows generated by QSqlTableModel.

While it is important to signal the removal of all the rows before
requerying after committing changes, there is a cleaner way. The
table model should remove its rows before the query model removes its
rows.

Iterating backwards avoids having to decrement row numbers above ones
being removed.

Expected test results have been adjusted for these changes.

Change-Id: I0e8aa81f5e7b8fea5922f5ffd1cfb4a932313a10
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-02-15 02:36:21 +01:00
Andrew Stanley-Jones
9809471223 Allow the QLocalServer to listen to a native descriptor
QLocalServer could only listen to sockets it created.
Thi is not always possible as sockets may be passed
by socketpair() or have to be created locally by
other means.  This adds a similar feature to QLocalSocket
where a native descriptor maybe used.

Change-Id: I43b0af179b3b868dd164d4e1fd312ff4546cf9ff
Reviewed-by: Michalina Ziemba <michalina.ziemba@nokia.com>
Reviewed-by: Tapani Mikola <tapani.mikola@nokia.com>
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
2012-02-15 02:36:02 +01:00
Miikka Heikkinen
fc8f92106d Remove fileLineEndingTest from networkselftest.
The fileLineEndingTest case doesn't test network in any way and it is
conceptually wrong, too, as any tests where line endings are an issue
should be handled with .gitattributes rather than forcing user to
check out the repo with unix line endings.

Task-number: QTBUG-24271
Change-Id: I73986993edc227cb68b8f61d51cc1cf458d20989
Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
2012-02-15 02:35:58 +01:00
Shane Kearns
a28c433b29 Abort FTP download, not the whole application
An old coding error meant that the C runtime abort() function was
being called instead of QFtp::abort() when cancelling an FTP download
using QNetworkReply::close()

Task-number: QTBUG-22820
Change-Id: Ib97fda9769b2b55a08c042c66c4444cb6216d2b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-15 02:35:20 +01:00
Miikka Heikkinen
78a6447e31 Windows: Fixed helper process finding in network tests
Helper processes were not found properly on all network tests
when the test was run with "nmake check":

- tst_qtcpsocket
- tst_qtcpserver
- tst_qnetworksession
- tst_qnetworkreply

Task-number: QTBUG-24199
Task-number: QTBUG-24203
Task-number: QTBUG-24226
Task-number: QTBUG-24231
Task-number: QTBUG-24232

Change-Id: Ia4451b5a5e3fe9f81aba3837baf8292411f995d8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
2012-02-15 02:34:38 +01:00
Mark Brand
bfec6b9a7d update comment on test
Fix up for f5e1da12f0.

Change-Id: I3a730ce7e47d71551a46cc105ba2d1fe4e33b65b
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-02-14 12:21:38 +01:00
Jason McDonald
2cb41b3da6 Eliminate duplicate data row names in gui autotests.
Change-Id: I1b39a7d13399ea8d47369203e9617810a34c0097
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-14 06:19:16 +01:00
Jason McDonald
ab9be7cc23 Eliminate duplicate data row names from corelib autotests.
Change-Id: I57a37f19746b76c6c9c3534f5c66c5a5478dae24
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-14 06:19:16 +01:00
Jason McDonald
1cda7678a6 Eliminate duplicate data row names in utf8 autotest.
Change-Id: I30dfd4b93ab1e5430b5bc7fc25fe6aea0e0cc551
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-14 02:48:35 +01:00
Jason McDonald
db0eacaa74 Fix duplicate data row name in tst_QTextCodec::utf8Codec test.
Rename rows using naming convention used elsewhere in this test.

Change-Id: I8e669cedcc2058cf84cee976c8a0a478bc1cea0a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-14 02:48:35 +01:00
Jason McDonald
b904576b37 Use meaningful data row names in tst_QTextCodec::fromUnicode test.
Use the codec name instead of just numbering the rows. This eliminates
some duplicate row names.  Two duplicate rows have also been removed --
for the WINSAMI2 row, the last value in the row is different, making one
copy do a subset of the testing done by the other, so the row that did
less testing was removed.

Change-Id: I859f681a627e8d3839ca8a4ba09d541bec43d9fb
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-14 02:48:35 +01:00
Miikka Heikkinen
e0fd9b5b06 Make "nmake check" pass for network tests in Windows.
Marked two tests insignificant due to failures, these need to be
fixed later and then re-enabled:
- tst_qnetworkreply
- tst_qsslsocket

Task-number: QTBUG-24203
Change-Id: I9647833bf15fe5a340d7ef59e1dcb007a92677dc
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-14 02:48:35 +01:00
João Abecasis
5c637e9171 Add QFileInfo::isNativePath
This function returns true if the file path can be used directly with
native APIs, modulo encoding and path separator conversions. This is
important for applications that interface with other libraries or simply
need to use native APIs together with Qt.

Traditionally, this information was available in QAbstractFileEngine and
forced users to explicitly create an engine or use internal API such as
QFile::fileEngine to access the underlying engine and this piece of
information.

Given its usefulness, exposing the information in a more visible place
is more appropriate. This reduces the need for people to know or care
about implementation details, like file engines...

The existing isLocalFs test was updated and repurposed to use the new
API, instead of relying on file engines and internal implementation
details of QFileInfo.

Change-Id: I65f497bb25741f6f7ea4d2c3b3562c8c4aab8bea
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-14 02:48:35 +01:00
Bradley T. Hughes
3f74aea9bb Fix tst_QSocketNotifier on Mac OS X
Socket notifier behavior is very OS-dependent. QtNetwork uses non-
immediately (it will return -1 w/ errno=EINPROGRESS). We have to wait
with select(2) to indicate that the connection is ready, then call
connect(2) again. When this happens, we need another call to select(2)
to get notification on the listening socket so that we can call
accept(2) to complete the connection.

The mixingWithTimers() failure happens due to the test expecting a
single processEvents() call to be able to completely connect a TCP
socket. But as described above, this may not happen. The test should
QTRY_COMPARE() to give the test a chance to let all this happen.

The posixSockets() test can fail due to the same connect() behavior. The
test already has a comment about the write notifier behavior being very
OS dependent. This caused the first enterLoop() to return too early,
before the read notifier fired (which is what the test is checking for,
that the read notifier fired). Move creation of the write notifier to
where we expect it to fire, just before writing to the posix socket.

In the same test, the read notifier inside QTcpSocket may not fire after
the write notifier on the posix socket. Use the waitForReadyRead()
function to give the socket a chance to read the data written to the
posix socket.

Change-Id: I541e6ee9a39a92ce3acf6b9ffee51079febe43e4
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
2012-02-13 22:16:17 +01:00
Bradley T. Hughes
771a3f29f9 Remove HP PA-RISC atomic implementation.
This architecture is obsolete and discontinued.

Support for PA-RISC can be re-added if needed, but it would be preferred
to use the GCC intrinsic support from qatomic_gcc.h (on Linux/HPPA, for
example).

Change-Id: I952e521a2c8c68840df0d44843b5487d5c20b135
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-13 12:02:11 +01:00
Jason McDonald
9b2971cbb4 testlib: Count passes, fails and skips consistently.
For data-driven tests, testlib previously counted one fail or skip for
each data row that failed or skipped, while it counted only one pass
for a test function where all rows passed and counted no passes for a
test function where some rows passed and some rows failed. A similar
problem also existed for benchmark tests, which could run multiple
iterations of the same test, with each fail and skip being counted but
only a single pass being counted for the entire series of iterations.

This commit makes testlib count one pass, fail or skip for each data
row.  Test functions that are not data-driven count one result for the
test function, as before.  Benchmark tests count one pass, fail or skip
per iteration.

A side-effect of this change is that the test output in plain text, xml
and light xml formats now shows a result for every data row and
benchmark iteration executed, allowing post-processors to correctly
calculate the total number of tests executed.  Previously, individual
rows were not shown in the test output if they passed, making such
calculations impossible.

The only change to the xunitxml output format is to correct a bug where
no test result was recorded for a test function if the last data row
was skipped and all other rows passed -- in which case the overall
result should be a pass.  Note that there is also a pre-existing bug
in the xunit logger, where no result is reported if all rows are
skipped; that bug is unaffected by this commit.

Task-number: QTBUG-21848
Task-number: QTBUG-22124
Change-Id: I7e17177e10d6e89e55b9684c159bd506f21d002b
Reviewed-by: Ed Baak <ed.baak@nokia.com>
2012-02-13 01:46:09 +01:00
Caroline Chao
a6d3983ef6 CodeCoverage: Handle QTest based subtests.
Set QT_TESTCOCOON_ACTIVE environment variable when the coverage is installed
for a test and unset it when the coverage data is saved. Tests that run when
QT_TESTCOCOON_ACTIVE is set are subtests and will not be considered as
stand-alone tests for the coverage.

When a test is run as a subtest its coverage data will not be saved for
itself but for the main test it is merged with. Also its status will not be
reported since only the status of the main test is expected in the test report,
e.g. the test tests/auto/testlib/selftests.

Change-Id: Icfdf99300aae18040e1a3441a8af21f68df4c0db
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-12 23:25:19 +01:00
Stephen Kelly
7a7d82ffd9 Implement QMAKE_SUBSTITUTES.config = verbatim.
Change-Id: Ie0b333fa7fae2283e99e42f9cd7bab4e84991f40
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-02-11 13:30:31 +01:00
David Faure
3791d3b0c2 Add QUrl::toDisplayString(), which is toString() without password.
And fix documentation of toString() which said this was the method to
use for displaying to humans, while this has never been true.

Change-Id: Iff6df92e32b2517e1481d4992d80cae2d58da427
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-11 11:02:01 +01:00
Miikka Heikkinen
38dbb45e79 Make "nmake check" pass for gui tests in Windows.
Marked the following tests insignificant due to failures, these need
to be fixed later and then re-enabled:

  tst_QPixmap
  tst_QClipboard
  tst_QWindow
  tst_QGuiApplication
  tst_QPainter
  tst_QPrinterInfo
  tst_QPrinter
  tst_QOpenGL
  tst_QFontDatabse
  tst_QFontMetrics
  tst_QGlyphRun
  tst_QRawFont

Task-number: QTBUG-24128
Change-Id: I39ade8a693c4580b5cd618624e892cdcac21d78c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-02-10 15:40:22 +01:00
Olivier Goffart
497622cafe Make it possible to put QObject tracked with QWeakPointer inside QSharedPointer
Do that by keeping the QWeakPointer that track QObject independent of
the ones that track QSharedPointer.

QSharedPointer do not touch the sharedRefCount in QObjectPrivate anymore

When converting a QWeakPointer constructed from a QObject to a
QSharedPointer, it will display a warning saying one should not do that.

Task-number: QTBUG-22622
Change-Id: I3595e3e7401702410776c458687ab357ad9366ab
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-10 15:37:10 +01:00
Kai Koehne
dd119e14d0 Fix qlogging autotest for clang
Change-Id: Iac82c4847554534174b5419ec78319c9ac381628
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-10 15:28:22 +01:00
Bradley T. Hughes
8f8e3db6ae Test posted events in tst_QEventDispatcher with various flags
Add QEventLoop::ProcessEventsFlags test data for
tst_QEventDispatcher::sendPostedEvents() to test that posted events are
sent when waiting for events and when not waiting.

Change-Id: I99f9eb121d0b1ded725e19c5233922fc0a6b81e4
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-10 15:22:11 +01:00
Bradley T. Hughes
358c14821b Run tst_QEventDispatcher with the GUI event dispatchers as well
Since some GUI event dispatchers are complete reimplementations and do
not build on the corelib ones, we want to run the same tests with the
other dispatcher.

Since this is a GUI test now, we need to make sure to drain system
events queued during application startup to make sure we can reliably
run the test functions.

Change-Id: I4905db70bc8f8584c4ef1f4d767824040281452c
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-10 15:22:03 +01:00
Bradley T. Hughes
c50f026a22 Add tst_QEventDispatcher to tests/auto/corelib/kernel
This will test the event dispatcher in corelib for proper timer and
posted event handling. The test makes sure all of the necessary virtual
functions are implemented and working as expected.

This test doesn't test socket notifiers or Win32 event notifiers, as
these are already covered in existing tests.

Change-Id: I5540ffc4e6d7f97bcd6c3725d7e74c0ab9c97015
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-10 15:21:55 +01:00
Jan-Arve Saether
ff2886db6a Move all usages of Relation enum values to QAccessible::relations()
Next step is to remove navigate(), but that has to be done in
qtdeclarative first.

Change-Id: I01ea1386c092446be04cc19d0f70adf53f094adc
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-02-10 15:21:46 +01:00
Olivier Goffart
482d96a0c5 Force -fPIE on ELF if Qt is built with reduced relocations
Put in qconfig.h whether qt is compiled with reduced relocations.

When using -Bsymbolic-functions (enabled by default on Qt)
but not -fPIE, the comparison of the function pointers fail
because the addresses are different in Qt, and in the executable.

Hence we now enable -fPIE by default on qmake, and force a compilation
error when it is not enabled and built with reduced relocations.

Done-with: Sune Vuorela <sune@vuorela.dk>
Change-Id: Ib3fdba06fab6e8a93b75b4c6cf16cc973ab335db
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-10 11:42:31 +01:00
Laszlo Agocs
09e2e77be2 Handle TouchCancel in gui and widgets
Change-Id: I31739840348d88ae408ac1aae2399f6328ccdd43
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-10 11:41:04 +01:00
Toby Tomkins
b942106bb6 Remove SVG specific tests and testdata from QIcon.
SVG support is now handled in QtSvg. Previously this test code would
normally be skipped when testing qtbase. This code is only executed
when testing qt5 with QtSvg enabled. This code will be moved to QtSvg.

Task-number: QTBUG-22360

Change-Id: I7372012469f9c0f9b7d3851a0ae696f8f935ba10
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-10 05:37:36 +01:00
Kurt Korbatits
6e3c4de94f Fixed qlibrary unittest to work on mac
- Changed unload_after_implicit_load() to use full path
- Turned off app_bundle

Change-Id: Ibdf3ae0dc833d97eba64298715eb88c70408fff6
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-10 03:02:07 +01:00
Kurt Korbatits
c5618fd880 Fixed qsharedpointer unittest to run from installation directory
- Only run invalidConstructs() tests if not cross compiled

Change-Id: If99fccdf9bca339507ca60c49aa89dc35c535d3d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-10 03:02:07 +01:00
Andrew Stanley-Jones
49b5306155 Add socketOptions flags to QLocalServer
QLocalServer had no way to set socket options
that more complicated servers require. The
first set of options allow setting of access
control on the sockets.

Change-Id: If4268c66462fc2e6cf1e70b1d5f56c76d2c69228
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
2012-02-10 03:02:07 +01:00
Thorbjørn Lund Martsum
73a5bc2aac QHeaderView - minor bug in visualIndexAt
This fixes a minor bug in VisualIndex triggered when calling
resizeSection with size 0 (but not hideSection).

It is mostly cosmetics - however hopefully there will soon
be a minor refactoring and there is really no need to make
strange code to keep a semantic bug.

However it is also doubtful to make a semantic change
while refactoring.

Change-Id: Ide153e421fd7a634062cb74867f4a49da4bf9cd6
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-10 00:27:44 +01:00
Kai Koehne
be98fa32c7 Allow customization of qDebug output at runtime
Check the QT_OUTPUT_PATTERN environment variable in the default
message handler to customize the output of messages. Following
place holders are right now supported:
 %{message}, %{type}, %{file}, %{line}, %{function}

The original cleanupFuncinfo was written by Thiago Macieira.

Change-Id: I6ad25baaa0e6a1c9f886105d2a93ef3310e512a9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: David Faure <faure@kde.org>
2012-02-09 18:11:21 +01:00
Miikka Heikkinen
581f079b04 Make "nmake check" pass for corelib tests in Windows.
- Marked four tests insignificant due to failures, these need to be
  fixed later and then re-enabled:
  - tst_qfilesystemwatcher
  - tst_qsettings
  - tst_qlibrary
  - tst_qsharedpointer
- Skipped one invalid case (tst_QCoreApplication::argc())
- Ifdeffed around vsprintf issue in MSVC (tst_QByteArray::qvsnprintf())

Task-number: QTBUG-24157
Task-number: QTBUG-24146
Task-number: QTBUG-24128
Change-Id: I4db957a65fbf0093f5ae3dc1a04d792492818104
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-02-09 12:52:28 +01:00
Rohan McGovern
5cd73e5088 Fixed tst_qfileinfo::group crash if getgrgid fails
QVERIFY2 and gracefully fail with an error message, rather than
crashing, if getgrgid() fails.

Change-Id: I82a7290f83208486577988cc831d5d3cba20f98e
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-09 10:47:33 +01:00
Andreas Holzammer
ef7fd67845 Replace Q_WS_WINCE against Q_OS_WINCE.
Window system Macros where deprecated so use
Q_OS_WINCE for now. This code will need
some refactoring, but this is the first
step to it.

Change-Id: I5876b80ee45d4b38ac63fc7d51e775dc70bbd485
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-09 10:45:38 +01:00
Rohan McGovern
adfca27ac0 Fixed tst_qobject::property for clang
The test was failing at:

  QCOMPARE(property.userType(), qMetaTypeId<CustomType*>());

The CustomType* metatype was not registered before this part of the
test.

qMetaTypeId<T> will register the metatype for T before returning it if
it is not yet registered, while QMetaProperty::userType() returns 0 if
the metatype is not yet registered.  However, the order of evaluation of
these two expressions in the above statement is technically undefined.

Apparently, gcc evaluates the arguments in order from right to left,
allowing the test to pass, while clang evaluates the arguments in order
from left to right, causing the test to fail.

Change-Id: I5059556e860cec29b57c31e4e26f46cf9e6055da
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-02-09 10:45:38 +01:00
Kurt Korbatits
805d895978 Fixed qstandardpaths unittest to handle being run as root
- testCustomRuntimeDirectory test skips if run as root

Change-Id: Idcc2a1db5d8a96b2ec0248b8b1c392fffc0b2e11
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-09 06:53:10 +01:00
Kurt Korbatits
951c0b7afa Fixed qdir unittest to handle being run as root
- Added checks to see if running as root and skip as needed

Change-Id: I4f94d5bfe511c6dfda315854b7cd1f64efe6e4f4
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-09 06:53:05 +01:00
Kurt Korbatits
7f403f368e Fixed qfile unittest rename() failing as root
When run as root was able to move file to /etc directory but was
expecting a failure.

Change-Id: Ic2ac5506253f2a3395ed56e88a856542bf82ad6d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-09 06:53:00 +01:00
Jason McDonald
1fe0a4cc68 Make selftest.pri more readable/maintainable.
Change-Id: Ic5a74beebb718df4cce5a9b02cdfd6f6d4cec97d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-09 04:07:53 +01:00
Jason McDonald
52744f5053 Improve float selftest
Correct a bug in the test and use unique names for data rows.  The bug
was that the test assumed that QCOMPARE for float values 100001 and
100002 would fail, but it actually succeeds.  QCOMPARE for floats uses
qFuzzyCompare(), which succeeds if the numbers differ by no more than
1/100,000th of the smaller value.  Thus QCOMPARE(100001, 100002) passes,
while QCOMPARE(99998, 99999) fails.

Change-Id: Ia35d3126c2e3ebe91d64daa309048514a365d9fb
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-09 04:07:50 +01:00
Jason McDonald
7b7b58ae09 Remove unused test results from testlib selftests.
Some of the subtests are only run with plain-text output format.  For
those subtests, the other output formats were unused and gradually
becoming out-of-date.

Change-Id: I4c10f7f5bab2d2cc7d2d2ad641fbf5d4df02b798
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-09 04:07:48 +01:00
Jason McDonald
7aa5a89eef Add data tag names to datetime selftest.
Change-Id: I73a0faab06df99521a48f106d93dd7b9a620148d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-09 04:07:45 +01:00
Jason McDonald
95d0b27711 testlib: Add selftests for skip and fail inside cleanupTestCase().
Change-Id: I9bbe774c3259338d452cd1eb1a6f37a85db15921
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-09 04:07:33 +01:00
Rohan McGovern
931f4501a6 Fixed tst_selftests on OSX 10.7
Our OSX 10.7 test machines send a SIGILL rather than a SIGSEGV to a
process which attempts to dereference a null pointer.

Change the "crashes" test to dereference an invalid pointer with a
value slightly greater than 0 so that we get the same crash behavior on
all (unix) platforms.

Change-Id: I700a2c7d654a9468af5e5996010a258695ed2ae5
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-09 03:31:08 +01:00
João Abecasis
0c97840708 Introduce Q_DECLARE_OPAQUE_POINTER
To hide the IsPointerToTypeDerivedFromQObject monstruosity :-)

Documentation for Q_DECLARE_METATYPE and qRegisterMetaType was updated
to mention requirements on registered types and how they can be
circumvented for pointer types with the new macro.

Change-Id: If83b037a8e2f28761eb903525e87008107298801
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-09 00:32:41 +01:00
Stephen Kelly
ae85d7c965 Treat pointers to QObject derived types in QVariant specially.
It is possible to do this for example:

QVariant v = QVariant::fromValue<MyCustomQObject*>();
QObject *object = v.value<QObject*>();

This means that if a QVariant contains a pointer to a QObject
derived type, third parties can extract a QObject* and use its
properties without knowing the concrete type.

This is a source compatible change.

Change-Id: Iee9a9437e99cc2f40d1a4bfea47275482ef7161f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-02-08 14:43:18 +01:00
Mark Brand
7b726900ec QSqlTableModel::setRecord(): emit dataChanged() consistently
Previously, if any fields in the supplied record could not be matched
with a column in the target table, dataChanged() was supressed for all
columns for OnManualSubmit. This is not good because it prevents other
views from noticing the fields that *do* change.

It's simplest and probably more efficient just to emit
dataChanged() once for the whole row. Fewer signals need to be
processed and in typical cases much or all of the row is likely to
be changed anyway.

Change-Id: Ib56bf9a18e51b9cb85771acefcb2bf26e295a54e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-02-08 14:43:18 +01:00
Mark Brand
5953304bc5 QSqlTableModel::setRecord(): do not try to detect value changes
In an apparent attempt to be economical with emitting dataChanged()
and submitting SQL to the databse, setRecord() compares each field
value of the record with the old value, taking action only when
a difference is detected.  Several complaints against this code are:

-The comparision does not work on float type.

-It is really up to the application and database to decide this. The
model should make few assumptions. The application has the option to
omit fields from the record that should be ignored.

-The current behavior seems to assume that the "old" values are the
current state of the database, but the database may have changed since
the model was last refreshed.

-The code compares the value from record(), which probably
corresponds to the EditRole, with the DisplayRole value from data().

Change-Id: I11477c185eb411d442144dc682893d0df12d03d5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-02-08 14:43:18 +01:00
Pasi Matilainen
6dc85408cd QTextEdit cursor position fix when moving left/right with selection
When text has been selected in a QTextEdit and the left or right arrow
key is pressed, the cursor moves one character beyond the start or end
of the selection, when it shouldn't move past the selection. Fixed by
moving the cursor to the right place when a selection is active.

Task-number: QTBUG-22853
Change-Id: I9ea1863436db98627a6fd041ce554cf10be26493
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
(cherry picked from commit 1b031759ddfdab9703dfecac13f1ed318da3dafe)
2012-02-08 12:37:22 +01:00
Harald Fernengel
a2bea730c2 Fix qlocalsocket autotest
Lackey is currently not built due to a qscript dependency. Mark the
test as an expected failure, so we can resume testing QLocalSocket
again. See QTBUG-24142

Change-Id: I2642ed30cf7a2068f30f63801c632fea7dae7691
Reviewed-by: Andrew Stanley-Jones <andrew.stanley-jones@nokia.com>
2012-02-08 09:53:23 +01:00