From a89033743316c3f0a5b81e2634bf16958ec84f03 Mon Sep 17 00:00:00 2001 From: Sami Nurmenniemi Date: Wed, 5 Apr 2017 17:35:09 +0300 Subject: Fix tst_toolsupport on 32-bit arm platform On 32-bit arm platform, qint64 gets aligned differently than on 32-bit x86. First difference between the platforms on QFilePrivate member offset happens in QFileDevicePrivate::cachedSize: - On 32-bit x86 it's offset is 148 (4-aligned) - On 32-bit arm it's offset is 152 (8-aligned) and offsets of all the remaining members are +4 compared to x86 - On 64-bit architectures the offsets are the same Change-Id: If110da27ea08504e78b167c0a21599420eaa9630 Reviewed-by: Thiago Macieira --- tests/auto/other/toolsupport/tst_toolsupport.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/auto/other/toolsupport/tst_toolsupport.cpp b/tests/auto/other/toolsupport/tst_toolsupport.cpp index f93c8f825b..a78bdc34f1 100644 --- a/tests/auto/other/toolsupport/tst_toolsupport.cpp +++ b/tests/auto/other/toolsupport/tst_toolsupport.cpp @@ -124,7 +124,13 @@ void tst_toolsupport::offsets_data() { QTestData &data = QTest::newRow("QFilePrivate::fileName") << pmm_to_offsetof(&QFilePrivate::fileName); +#ifdef Q_PROCESSOR_X86 + // x86 32-bit has weird alignment rules. Refer to QtPrivate::AlignOf in + // qglobal.h for more details. data << 168 << 248; +#else + data << 172 << 248; +#endif } #endif -- cgit v1.2.3