summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestcase.cpp
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@collabora.com>2012-01-20 01:55:51 +0200
committerQt by Nokia <qt-info@nokia.com>2012-01-23 06:49:12 +0100
commitfdedb49b76b8f9ad69611fbfea6b8371ae1ec3a1 (patch)
tree7521c06b368a6110ca1cbd9369df0d104dc97483 /src/testlib/qtestcase.cpp
parent7827c1861f425886773fc6b4906bb0b6efbfa95c (diff)
Blow up earlier when adding test rows without columns.
Previously, the assertation triggered was rather unhelpful: QFATAL : tst_QHash::qhash_qt4() ASSERT: "d->dataCount < d->parent->elementCount()" in file qtestdata.cpp, line 88" We now try a bit harder to be user-friendly. Change-Id: I2e3a5ae27914d44fc1dc89af2a084e3d798fe221 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r--src/testlib/qtestcase.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 666a0e880f..0c2fe2dbd8 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -2286,6 +2286,7 @@ QTestData &QTest::newRow(const char *dataTag)
QTEST_ASSERT_X(dataTag, "QTest::newRow()", "Data tag can not be null");
QTestTable *tbl = QTestTable::currentTestTable();
QTEST_ASSERT_X(tbl, "QTest::newRow()", "Cannot add testdata outside of a _data slot.");
+ QTEST_ASSERT_X(tbl->elementCount(), "QTest::newRow()", "Must add columns before attempting to add rows.");
return *tbl->newData(dataTag);
}