summaryrefslogtreecommitdiffstats
path: root/tests/auto
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 13:34:57 +0000
commitdd4d4fe1ee74cc6dae370a8a9dcced53dc9a3898 (patch)
tree6a5c2382068f36563bdba1b16a4a66a84cfe4fe5 /tests/auto
parenta5dc5fd2eb7b2b1bccf5605a6479cbff327c1e35 (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/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"