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 <thiago.macieira@intel.com>
This commit is contained in:
Sami Nurmenniemi 2017-04-05 17:35:09 +03:00
parent 59d4cbca0b
commit a890337433

View File

@ -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