diff options
author | Pasi Petäjäjärvi <pasi.petajajarvi@qt.io> | 2021-12-07 11:41:52 +0200 |
---|---|---|
committer | Pasi Petäjäjärvi <pasi.petajajarvi@qt.io> | 2022-02-17 22:00:37 +0200 |
commit | 964c964193e42dacb6e64323809e81761270b591 (patch) | |
tree | 87dd1f6583b0d824e6be2921b659e9c71d0503be /tests/auto/gui | |
parent | f63bd1a80061e6d40fc05daedc2bc187c6fb9a3a (diff) |
Check if platform has enough RAM for hugeQImage test
The hugeQImage test loads, as its name suggests, a huge image.
At 2.5 GiB it's too big for the hard-coded 1 GiB limit on RAM
that the QNX toolchain hard-codes when it's started in QEMU.
Pick-to: 6.2 6.3
Task-number: QTBUG-100929
Change-Id: I8e8caaff7fd1dd0e648ada5df613c793f72bcf5d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/gui')
-rw-r--r-- | tests/auto/gui/image/qimage/tst_qimage.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp index 6f9e0641ac..5abc164e1a 100644 --- a/tests/auto/gui/image/qimage/tst_qimage.cpp +++ b/tests/auto/gui/image/qimage/tst_qimage.cpp @@ -3945,7 +3945,10 @@ void tst_QImage::hugeQImage() #if Q_PROCESSOR_WORDSIZE < 8 QSKIP("Test only makes sense on 64-bit machines"); #else - QImage image(25000, 25000, QImage::Format_RGB32); + std::unique_ptr<char[]> enough(new (std::nothrow) char[qsizetype(25000)*25000*4]); + if (!enough) + QSKIP("Could not allocate enough memory"); + QImage image((uchar*)enough.get(), 25000, 25000, QImage::Format_RGB32); QVERIFY(!image.isNull()); QCOMPARE(image.height(), 25000); |