summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-03-03 11:38:26 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-03-03 14:19:57 +0000
commit2f208b8c4f46f0bfe08a93f0e23aeb2caa80e6b2 (patch)
treeddfb4161a28032f88f44dda94e48ee3753147616 /tests
parent86ea6a0d892c7e549e63ffa174d66438d696b9e4 (diff)
QSurfaceDataProxy: Fix crashes adding the first row of data
Adding one row causes an assert ASSERT failure in QList::at: "index out of range", file include/QtCore/qlist.h, line 373 since there is no first row to check the column count against. Check for empty as well. Task-number: PYSIDE-1438 Change-Id: I225b87b764545b7a430472dc5a4b2e476a26a7ff Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> (cherry picked from commit 106bef0493758ddaeadd3b4d744227cb7feadb70) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/cpptest/q3dsurface-proxy/tst_proxy.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/cpptest/q3dsurface-proxy/tst_proxy.cpp b/tests/auto/cpptest/q3dsurface-proxy/tst_proxy.cpp
index cda6bcce..1516e67d 100644
--- a/tests/auto/cpptest/q3dsurface-proxy/tst_proxy.cpp
+++ b/tests/auto/cpptest/q3dsurface-proxy/tst_proxy.cpp
@@ -47,6 +47,7 @@ private slots:
void initialProperties();
void initializeProperties();
+ void initialRow();
private:
QSurfaceDataProxy *m_proxy;
@@ -105,5 +106,14 @@ void tst_proxy::initializeProperties()
QCOMPARE(m_proxy->rowCount(), 2);
}
+void tst_proxy::initialRow()
+{
+ QSurfaceDataProxy proxy;
+ QSurfaceDataRow row{QSurfaceDataItem{QVector3D{0, 0, 0}},
+ QSurfaceDataItem{QVector3D{1, 1, 1}}};
+ proxy.addRow(new QSurfaceDataRow(row));
+ proxy.addRow(new QSurfaceDataRow(row));
+}
+
QTEST_MAIN(tst_proxy)
#include "tst_proxy.moc"