summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-03-03 11:38:26 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-03-03 13:37:55 +0100
commit106bef0493758ddaeadd3b4d744227cb7feadb70 (patch)
treee8d6b63c8ba3327c7c5c1c5b215e3894d0bcdc5c /tests/auto
parentf7e965c6c9e1850480e59fc5153a0f3dae688212 (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. Pick-to: 5.15 6.1 Task-number: PYSIDE-1438 Change-Id: I225b87b764545b7a430472dc5a4b2e476a26a7ff Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'tests/auto')
-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 7c793910..16025964 100644
--- a/tests/auto/cpptest/q3dsurface-proxy/tst_proxy.cpp
+++ b/tests/auto/cpptest/q3dsurface-proxy/tst_proxy.cpp
@@ -45,6 +45,7 @@ private slots:
void initialProperties();
void initializeProperties();
+ void initialRow();
private:
QSurfaceDataProxy *m_proxy;
@@ -103,5 +104,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"