qt5base-lts/tests
Marc Mutz 7d4bf142d7 QUuid: add fromString(QStringView/QLatin1String)
As for the formatting code, de-duplicate the parsing code by only
parsing char*s, converting QChars to Latin-1 first in a small buffer.

The QUuid(const char*) ctor performed no length checking, relying
instead on the checks performed within _q_uuidFromHex(), which
includes an implicit check for premature end (because NUL is not
a valid token for the parser).

The (QString) and (QByteArray) ctors did perform length checking.
To the extent possible, this is removed, since it is handled by
_q_uuidFromHex(). Failure cases need not be optimized. Only the
QLatin1String overload needs to do some checking, because views in
general are not NUL-terminated. The QStringView overload can just
append a NUL when it converts to Latin-1.

The only check I added to _q_uuidFromHex() is that for src ==
nullptr. It would otherwise be duplicated in several callers.

While touching the internal functions, port to passing and returning
by value.

Saves 1.6KiB in text size on optimized GCC 6.1 Linux AMD64 builds,
even though we added new API.

Port some users to the new functions. Expand fromString() test.

[ChangeLog][QtCore][QUuid] Added fromString(QStringView/QLatin1String).

Change-Id: I519339419129550c86e0ea80514865cd6a768f5d
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-20 17:02:44 +00:00
..
auto QUuid: add fromString(QStringView/QLatin1String) 2017-04-20 17:02:44 +00:00
baselineserver Merge remote-tracking branch 'origin/5.8' into 5.9 2017-03-13 15:55:44 +01:00
benchmarks tests: Unify license to GPL-EXCEPT 2017-04-03 07:18:46 +00:00
global tst_bic: Add linux-gcc-ia32 bic data for QtXml 2013-01-16 08:25:28 +01:00
manual Merge remote-tracking branch 'origin/5.9' into dev 2017-04-07 10:24:33 +02:00
shared Fix largefile tests on ARM and QEMU targets 2017-03-28 06:55:32 +00:00
README Doc: Fix references to Qt Test 2013-01-30 01:35:06 +01:00
tests.pro Build examples and tests only if their requirements are met 2017-03-22 15:55:55 +00:00

This directory contains autotests and benchmarks based on Qt Test. In order
to run the autotests reliably, you need to configure a desktop to match the
test environment that these tests are written for.

Linux X11:

   * The user must be logged in to an active desktop; you can't run the
     autotests without a valid DISPLAY that allows X11 connections.

   * The tests are run against a KDE3 or KDE4 desktop.

   * Window manager uses "click to focus", and not "focus follows mouse". Many
     tests move the mouse cursor around and expect this to not affect focus
     and activation.

   * Disable "click to activate", i.e., when a window is opened, the window
     manager should automatically activate it (give it input focus) and not
     wait for the user to click the window.