summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTapani Mikola <tapani.mikola@nokia.com>2012-05-26 00:06:53 +0300
committerQt by Nokia <qt-info@nokia.com>2012-05-25 23:57:01 +0200
commit67139d055cb759e0c6e712b107a99999d3380fba (patch)
tree03f02ad4cfa8e1c7833fb548b25ac978631efa2d /tests
parent61b1d78172c2f205e871f912a414d97105445fab (diff)
Make a testcase run faster
Change-Id: I4f224d8fd8990f91b383fc691f7e814a92eea1c2 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/jsondbcachinglistmodel/testjsondbcachinglistmodel.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/auto/jsondbcachinglistmodel/testjsondbcachinglistmodel.cpp b/tests/auto/jsondbcachinglistmodel/testjsondbcachinglistmodel.cpp
index d7c9d12c..30c95756 100644
--- a/tests/auto/jsondbcachinglistmodel/testjsondbcachinglistmodel.cpp
+++ b/tests/auto/jsondbcachinglistmodel/testjsondbcachinglistmodel.cpp
@@ -1529,19 +1529,20 @@ void TestJsonDbCachingListModel::roleNames()
void TestJsonDbCachingListModel::getItemNotInCache()
{
resetWaitFlags();
+
+ createIndex("number", "number");
+
QVariantMap item;
for (int i=0; i < 3000; i++) {
item.insert("_type", __FUNCTION__);
- item.insert("number", i);
+ item.insert("number", i%300);
int id = create(item, "com.nokia.shared.1");
waitForResponse1(id);
}
- createIndex("number", "number");
-
QAbstractListModel *listModel = createModel();
if (!listModel) return;
- listModel->setProperty("cacheSize", 50);
+ listModel->setProperty("cacheSize", 150);
listModel->setProperty("sortOrder", "[/number]");
QStringList roleNames = (QStringList() << "_type" << "_uuid" << "number");
listModel->setProperty("roleNames", roleNames);
@@ -1559,13 +1560,13 @@ void TestJsonDbCachingListModel::getItemNotInCache()
QVariant number = getIndex(listModel, 2967, 2);
- QCOMPARE(number.toInt(), 2967);
+ QCOMPARE(number.toInt(), 296);
number = getIndex(listModel, 100, 2);
- QCOMPARE(number.toInt(), 100);
+ QCOMPARE(number.toInt(), 10);
number = getIndex(listModel, 1701, 2);
- QCOMPARE(number.toInt(), 1701);
+ QCOMPARE(number.toInt(), 170);
number = getIndex(listModel, 20, 2);
- QCOMPARE(number.toInt(), 20);
+ QCOMPARE(number.toInt(), 2);
deleteModel(listModel);
}