Add dummy test column for data driven test in qmltest
authorCharles Yin <charles.yin@nokia.com>
Wed, 25 Jan 2012 03:48:46 +0000 (13:48 +1000)
committerQt by Nokia <qt-info@nokia.com>
Wed, 25 Jan 2012 05:33:51 +0000 (06:33 +0100)
Normally, data driven test with QTest requires add columns before
adding new data rows, otherwise QTest might results into warning
or error. However, qmltest does the data driven test in its own way
so no columns info needed. So add a dummy column here to make QTest happy.

Task-number:QTBUG-23845
Change-Id: I1bfed663fa7b58d71e0cf898db6bd8ae61dae46b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
src/qmltest/quicktestresult.cpp

index a1fd7ba..102aa78 100644 (file)
@@ -343,6 +343,9 @@ void QuickTestResult::initTestTable()
     Q_D(QuickTestResult);
     delete d->table;
     d->table = new QTestTable;
+    //qmltest does not really need the column for data driven test
+    //add this to avoid warnings.
+    d->table->addColumn(qMetaTypeId<QString>(), "qmltest_dummy_data_column");
 }
 
 void QuickTestResult::clearTestTable()