tst_QUuid: make big-endian runs not fail

As far as I can tell, QUuid is working correctly on big endian
platforms. But it stores the integers in such a weird fashion (I wish to
fix that for Qt 7) that this test is non-obvious.

I don't have a big-endian machine to test this with. Anyone interested
is welcome to submit patches.

Fixes: QTBUG-134634
Pick-to: 6.8 6.9
Change-Id: I2415be976d1d880d1525fffdf525dcf4f21aaa70
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
Thiago Macieira 2025-03-12 12:54:38 -07:00
parent 6a465729be
commit aa87214864

View File

@ -295,6 +295,10 @@ void tst_QUuid::id128()
void tst_QUuid::uint128()
{
#ifdef QT_SUPPORTS_INT128
if (QSysInfo::ByteOrder == QSysInfo::BigEndian)
QSKIP("Not implemented for big endian. Feel free to submit fixes.");
// {fc69b59e-cc34-4436-a43c-ee95d128b8c5}
constexpr quint128 u = Q_UINT128_C(0xfc69b59e'cc344436'a43cee95'd128b8c5); // This is LE
constexpr quint128 be = qToBigEndian(u);
constexpr QUuid uuid = QUuid::fromUInt128(be);