summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Long live QFlatMap!Joerg Bornemann2020-01-023-0/+458
| | | | | | | | | | Add a light-weight associative container, API-wise very similar to QMap, that's based on two sorted continuous containers (QVector by default). The class is internal for now. Change-Id: Ife12576c4abb39a3ea2acb0a1ba0faca91b3a4c5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QBitArray: Add method to get int valueFederico Guerinoni2019-12-201-0/+93
| | | | | | | | | | | | It is useful to use an array of bit as an integer value. I add also a prarameter to set endianness when converting value to UInt32. [ChangeLog][QtCore][QBitArray] Added toUInt32() to return the bit array's value as a uint32_t. Change-Id: I9d8c7a33f11e7ce94cb67aa9a50b11fa42d56168 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Convert QString to use QArrayDataPointerLars Knoll2019-12-161-7/+8
| | | | | | | | | | | | We're now using the same infrastructure for QVector, QString and QByteArray. This should also make it easier to remove the shared null in a follow-up change. Change-Id: I3aae9cf7912845cfca8e8150e9e82aa3673e3756 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-119-31/+141
|\ | | | | | | | | | | | | Conflicts: tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp Change-Id: I6b82507bf9a80a374c40393e72f4843f1557de89
| * Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Liang Qi2019-12-108-31/+96
| |\
| | * Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2019-12-108-31/+96
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/network/kernel/qnetworkinterface/BLACKLIST Change-Id: I1e8866c63b54bcd95fc2a044276ee15b7f60e79a
| | | * Don't wrap feature detection macros with QT_HAS_FOO() variantsTor Arne Vestbø2019-12-107-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using wrappers for these macros is problematic when for example passing the -frewrite-includes flag to preprocess sources before shipping off to distcc or Icecream. It will also start producing warnings when compilers implement http://eel.is/c++draft/cpp.cond#7.sentence-2. See for example https://reviews.llvm.org/D49091 Both https://clang.llvm.org/docs/LanguageExtensions.html and the SD-6 document at https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations recommend defining '__has_foo(x) 0' as a fallback for compilers without the macros, so that's what we go for. Change-Id: I0298cd3b4a6ff6618821e34642a5ddd6728be767 Reviewed-by: Alex Richardson <arichardson.kde@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Allow lower-case for the T and Z in ISO 8601 date formatEdward Welbourne2019-12-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cite RFC 3339 as basis for allowing a space in place of the T, too. The RFC mentions that ISO 8601 accepts t and z for T and Z, so test for them case-insensitively. Add a test for this. Change-Id: Iba700c8d74d485df154d27300aab7b1958e1ccef Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Fix handling of trailing space at the end of an ISO date-timeEdward Welbourne2019-12-061-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If milliseconds were followed by a space, the space was included in the count of "digits" read as the fractional part; since we read (up to) four digits (so that we round correctly if extras are given), a harmless apce could cause scaling down by too large a power of ten. Since QString::toInt() ignores leading space, we were also allowing interior space at the start of the milliseconds, which we should not, so catch that at the same time. Added tests, including one for the rounding that's the reason for reading the extra digit, when present. Fixes: QTBUG-80445 Change-Id: I606b29a94818a101f45c8b59a0f5d1f78893d78f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | | * Fix crash when a date-time has an invalid time-zoneEdward Welbourne2019-12-061-14/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDateTime is a friend of QTimeZone, so can access its internals; but it must check the zone is valid before doing so. Expanded tst_QDateTime::invalid() and made it data-driven to catch the failure cases. Commented on a test-case that caught a mistake in my first attempt at this, and on QDateTimeParser's surprising reliance on a quirk of QDateTime::toMSecsSinceEpoch()'s behavior. Fixes: QTBUG-80146 Change-Id: I24856e19ff9bf402152d17d71f83be84e366faad Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
| | | * QCborValue: fix replacing of elements with byte data with ones withoutThiago Macieira2019-12-051-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We forgot to reset the flags when replacing the element, so we ended up with an integer with HasByteData after: testMap[0] = QStringLiteral("value"); testMap[0] = 42; Fixes: QTBUG-80342 Change-Id: Ia2aa807ffa8a4c798425fffd15dabfa066ea84b0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | | QCocoaEventDispatcher: make 'interrupt' workTimur Pocheptsov2019-12-101-0/+45
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | even if we are currently inside processEvents (apparently called manually and not from QEventLoop::exec()). A carefully crafted application (see, for example, the linked QTBUG or even updated auto-test) can trigger itself into failing to exit the current (potentially nested) event loop. We can harden our Cocoa event dispatcher to detect such condition and properly propagate 'interrupt' to where it'll do its job, indeed, interrupting the real event loop (aka [NSApp run]). This mainly means we have to undo what bool blocker would erroneously do. Also, long live (as people love to say these days) to another tricky (somewhat) auto-test (surely, it's not flaky!). Fixes: QTBUG-79477 Change-Id: I794f0cda23e24d36be67f2bb63d52b74be057c31 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-093-34/+240
|\| | | | | | | | | | | Change-Id: Ia24cc8b86def0d9d9c17d6775cc519e491b860b1
| * | QMetaType: add more static-less APIOlivier Goffart2019-12-071-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In prevision to Qt6 which is going to discourrage the use of the integer id, add some missing API to the staticless QMetaType API: - Add a way to construct a QMetaType from a type without calling qMetaTypeId: QMetaType::fromType<T>() - Add equality operators - Add a QMetaType::name() function - Add a default constructor (by adding a default parameter to the existing ctor) Change-Id: I95487c1c31bdf0d773717daa9d5452cbced30673 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | QByteArray: add a strict mode to fromBase64Giuseppe D'Angelo2019-12-051-34/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QByteArray::fromBase64 was liberal in its input, simply skipping over invalid characters. As a side-effect of this, it had no error reporting, meaning it could not be used to convert fromBase64 _and_ validate the input in one go. Add more option flags to make fromBase64 strictly validate its input. Since we want to know whether it has succeeded or not, and the existing fromBase64 overloads do not allow for that, introduce a new function that returns an optional-like datatype. While at it: base64 decoding can be done in-place; add an rvalue overload to enable this use case. [ChangeLog][QtCore][QByteArray] Added the new fromBase64Encoding function. [ChangeLog][QtCore][QByteArray] Added new flags to make fromBase64 / fromBase64Encoding strictly validate their input, instead of skipping over invalid characters. Change-Id: I99cd5f2230f3d62970b28b4cb102913301da6ccd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Add QHash::insert(const QHash &other)Lars Knoll2019-12-051-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As opposed to unite(), this inserts one hash into the other without duplicating elements. Change-Id: Ifc786c48f5dc3ab18c29782e73eac3c1a3ef8981 Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Use QString::DataPointer instead of QStringPrivateLars Knoll2019-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Preparations to move QString over to use QArrayDataPointer instead of it's own private struct. Change-Id: I7796a595393394083f6a85863e3c710ebbdea149 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Use QArrayDataPointer to implement QByteArrayLars Knoll2019-12-081-3/+3
| | | | | | | | | | | | | | | Change-Id: I2ee28023c2dea9fc3160400112c59a47566a4868 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Use the QByteArray::DataPointer typedef instead of QByteArrayDataLars Knoll2019-12-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | The goal here is to move things over to QArrayDataPointer. This prepares for it. Change-Id: I32f54a47594274799600c618f7341c200ceaa306 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Get rid of QCharRef and QByteRefLars Knoll2019-12-083-26/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already detach immediately since change c2d2757bccc68e1b981df059786c2e76f2969530. That basically removes the main purpose of having QChar/ByteRef, and we can just as well get rid of those classes for Qt 6. Change-Id: I8dc566a1948ddc29c0cb8a77ec7310654a7219a4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Use <type_traits> to properly have QVector<T>::parameter_typeThiago Macieira2019-12-081-23/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That allows us to pass by value for all fundamental and pointer types. This requires some magic to remove methods taking a T&& to avoid ambiguous overloads for QVector<int/qsizetype>. Remove them for all cases where parameter_type is T, as copying or moving will do exactly the same thing for those types. Change-Id: I8133fecd3ac29bb8f6ae57376e680bc3d616afbf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Enlarge QVariant's private to fit the new QString and QByteArrayThiago Macieira2019-12-081-2/+1
| | | | | | | | | | | | | | | Change-Id: I8baecd0a4db13200b34cdd7c8aebc2a1cc0a0c75 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Final removal of the size and offset members from QArrayDataThiago Macieira2019-12-081-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | Those members are not required anymore and now part of the object itself. Change-Id: If9eb5355ca8f2cf9528f6f63ca4e172acc9f9aed Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Inline the size and data pointers in QByteArrayThiago Macieira2019-12-081-45/+14
| | | | | | | | | | | | | | | Change-Id: I82feeb2c9bd2900f421fc0c8d78698b1e83db043 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Change representation of string data in the meta objectLars Knoll2019-12-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't store our string data as QByteArrayLiterals anymore, but revert back to simply storing them as an array of char* and offsets into that array. This is required to be able to inline size and begin into QByteArray itself. Once that change is done, we can then avoid creating copies of the string data again. Change-Id: I362a54581caefdb1b3da4a7ab922d37e2e63dc02 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Inline the size and data pointer members in QStringThiago Macieira2019-12-081-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'd have preferred to use QArrayDataPointer<ushort> for QString, but that option wasn't the best one. QArrayDataPointer try to do some operations using QArrayDataOps and that would expand to unnecessary code. What's more, the existing code expected to be able to modify and access the d pointer. Instead, this commit introduces QStringPrivate (named differently from QStringData to catch potential users), which contains the three members. This POD class is also used in QJsonValue to store the "inlined" QString. QHashedString in qtdeclarative will need a similar solution. Change-Id: I33f072158e6e2cd031d4d2ffc81f4a8dbaf4e616 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Inline the size and begin pointer in QVectorThiago Macieira2019-12-081-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add QGenericArray to simplify operations. This class can be shared by other tool classes. If there is nothing else to share it, we can move the code onto qvector.h. The one candidate is QList. All tests pass and valgrind is good. Change-Id: Ieaa80709caf5f50520aa97312ab726396f5475eb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Remove bad test in QVectorThiago Macieira2019-12-081-83/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test hardcodes the allocation behaviour instead of testing what it should be testing. Unfortunately, it can't test the actual problem directly since the problem was "it crashed when using vectors with 1 billion elements". Change-Id: Iec6a26ae490b8fdd4a7db1269e3bae85fc77ee52 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Start moving QArrayData's size and data pointer to the main classThiago Macieira2019-12-082-126/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This requires that the allocation functions return two pointers: the d pointer and the pointer to the actual data. Ported QArrayDataPointer & SimpleVector to the inlined size & data. For now, the size and offset members are not yet removed from QArrayData, to let QVector, QByteArray and QString compile unmodified. Change-Id: I8489300976723d75b8fd5831427b1e2bba486196 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Stop using the reference counter to store data stateThiago Macieira2019-12-081-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of using the reference count to store whether the data is sharable and whether the header is immutable, move the settings to the flags member. This allows us to save one comparison per deref() or needsDetach(). It also allows for the possibility of mutable data pointed to by a static header. Change-Id: Ie678a2ff2bb9bce73497cb6138b431c465b0f3bb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Add reference-count manipulation functions to QArrayData and hide refThiago Macieira2019-12-084-44/+41
| | | | | | | | | | | | | | | | | | | | | | | | The next change will stop using some values in the reference counter as settings from the data. Change-Id: I94df1fe643896373fac2f000fff55bc7708fc807 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Introduce the Mutable flag and move QArrayDataPointer::needsDetachThiago Macieira2019-12-082-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Mutable flag now contains the information on whether the data this QArrayData points to is mutable. This decouples the mutability / immutability setting from the allocation and from the type of data, opening the way for mutable raw or foreign data. There are still plenty of places in the source code that check the size of the allocation when it actually wants d->isMutable(). Fixing this will require reviewing all the code, so is left for later. The needsDetach() function is moved to QArrayData and de-constified. It returns true when a reallocation is necessary if the data is to be modified. Change-Id: I17e2bc5a3f6ef1f3eba8a205acd9852b95524f57 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Introduce flags to indicate the QArrayData typeThiago Macieira2019-12-071-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These flags allow us to determine what type of data QArrayData is carrying. There are currently only two supported types: - raw data type: constructed via fromRawData or static data - allocated data type: regular data done via heap allocation The QArrayData object is usually allocated on the heap, unless its own reference count is -1 (indicating static const QArrayData). Such object should have a type of RawDataType, since we can't call free(). Add GrowsBackward for completeness as well as the StaticDataFlags default for static data. Change-Id: Icc915a468a2acf2eae91a94e82451f852d382c92 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Introduce QArrayData::allocatedCapacity() and use it instead of d->allocThiago Macieira2019-12-072-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In almost all cases, use d->allocatedCapacity() or d->constAllocatedCapacity() instead of d->alloc, since they do the same thing (right now). In the future, the functions will be changed. There is a separate const version because most const code should not need to know the allocation size -- only mutating code should need to know that There are a few cases where d->alloc was replaced with a better alternative, like d->size. The one case that remains in the code will be replaced by a different test when it's available. Change-Id: I48135469db4caf150f82df93fff42d2309b23719 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Replace QArrayData::capacityReserved with a full flags fieldThiago Macieira2019-12-072-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of stealing one bit from the alloc field, let's use a full 32-bit for the flags. The first flag to be in the field is the CapacityReserved (even though the allocate() function will store some others there, not relevant for now). This is done in preparation for the need for more flags necessary anyway. Change-Id: I4c997d14743495e0d4558a6fb0a6042eb3d4975d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Rename QArrayData::AllocateOptions enum and update some flagsThiago Macieira2019-12-072-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename to QArrayData::ArrayOptions in preparation for these flags being in the array itself, instead of used just for allocating new ones. For that reason, rename QArrayData::Default to DefaultAllocationFlags. And introduce QArray::DefaultRawFlags to mean the flags needed for creating a raw (static) QArrayData. Also rename QArrayData::Grow to GrowsForward, so we may add GrowsBackward in the future. Change-Id: I536d9b34124f775d53cf810f62d6b0eaada8daef Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Fix qChecksum testLars Knoll2019-12-071-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test passed mostly by accident so far, as the created QByteArray was shorter than what the test assumed. Change-Id: I06858801d83a504eadc73ec2be281c88f8ffad5d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Use Q_NAMESPACE for the Qt namespace, and remove the old moc hack to support itOlivier Goffart2019-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since I can't #include qobjectdefs from qnamespace because of circular dependency, move the Qt macro in the qtmetamacros.h header. Deprecate QObject::staticQtMetaObject since now one can just use Qt::staticMetaObject Change-Id: I11982aa17c2afa2067486b113f8052672f3695eb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-051-0/+20
|\| | | | | | | | | | | Change-Id: I9d63a4c4b229a831b5369f6ec74ac97ba6d6556a
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-12-041-0/+20
| |\| | | | | | | | | | Change-Id: Ia70e81943ef097941339f9ef9ace28592a2eb740
| | * Fix serializing QUuid with QDataStream with Qt 4 stream versionsJoni Poikelin2019-12-031-0/+20
| | | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-76103 Change-Id: Iac92c33539940f5f67d014db5240c6dc14bfb772 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Remove QVariant::operator< and related operatorOlivier Goffart2019-12-042-468/+1
| | | | | | | | | | | | | | | | | | | | | The operator does not have a total order Change-Id: Ifd263c3495aca08c8ccceb9949596c308a76a6c1 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-12-045-56/+202
|\| | | | | | | | | | | Change-Id: I4134c0c6b6c9911950f58b3b5c86e789d28a185b
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Ulf Hermann2019-12-035-56/+202
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/serialization/qcborvalue.cpp Change-Id: I675a3029955c96e81a33ed9d98b72b55b6784b52
| | * Work around macOS's inconsistency in naming of India's time-zoneEdward Welbourne2019-11-281-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | macOS fails to create a zone for the name its own systemTimeZone claims to have (see new comment). So make sure we do consistently recognize the name systemTimeZoneId() returns, using systemTimeZone from which we got its name. Add minimal testing of system time-zone. Fixes: QTBUG-80173 Change-Id: I42f21efbd7c439158fee954d555414bb180e7f8f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | * Be consistent in the RFC2822Date invalid character testsEdward Welbourne2019-11-273-41/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ones we reject used a zero offset while the one that does parse (though it shouldn't - revised comment) has a one hour offset. Made them all use that offset and added a partner test that has no invalid characters, so ensure the success of the invalid character tests isn't due to falsely rejecting the valid date/time text to which the invalid characters are added. Task-number: QTBUG-80038 Change-Id: I6e3dd79b981af6803e60877229c56599cfd719cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Permit leading space at start of RFC 2822 Date formatEdward Welbourne2019-11-273-0/+32
| | | | | | | | | | | | | | | | | | | | | Relevant RFCs explicitly permit such space. Change-Id: I8eb444e96287368cbbf973c77513b43d1d36f972 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Make Qt::RFC2822Date's doc match up with its implementationEdward Welbourne2019-11-273-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The qdatetime implementation's rfcDateImpl() uses regexes which did not match its comments; nor did either the regexes or the comments match what was documented. A review of relevant RFCs suggests we should revise this in future, probably at Qt 6. The documentation also only addressed the formats recognized when parsing a date-time, without indicating how they are serialised or how dates and times are handled separately. Added a note to the tests for the read-only formats, to remind the reader that the RFCs merely recommend recognising these - be permissive in what you expect and strict in what you deliver. Change-Id: I0f0bec752e7a50bde98cceceb7e0d11be15c6a6f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * QCborValue: Extend the constructor to also create extended typesThiago Macieira2019-11-231-12/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already did that when parsing from CBOR binary data, so the code was already present. [ChangeLog][QtCore][QCborValue] The constructor taking a CBOR tag and a value to be tagged now attempts to convert to a QCborValue extended type. For example, if the tag is 0 (UnixTime_t) and the payload is a number, the resulting object will become tag 1 (DateTime) and the payload will be the the ISO-8601 date/time string. Fixes: QTBUG-79196 Change-Id: I6edce5101800424a8093fffd15cdf650fb2fc45c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * Fix QCborValue::toCbor with non-ASCII URLsThiago Macieira2019-11-231-0/+3
| | | | | | | | | | | | | | | | | | | | | Found while fixing QTBUG-79196. Change-Id: Ia2aa807ffa8a4c798425fffd15d841657def99af Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>