summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorabcd <amos.choy@nokia.com>2012-07-11 12:03:02 +1000
committerQt by Nokia <qt-info@nokia.com>2012-07-24 05:01:46 +0200
commit98668fa2d81fcc191edd6deef0a2c8581768db92 (patch)
treee50c5d055bcb418c19b967acf48602e625342d16
parentf749179d7681216a7e51cae27ca61b0010737818 (diff)
downloadqtlocation-98668fa2d81fcc191edd6deef0a2c8581768db92.tar.gz
compareObj params to follow convention of (actual, expected) results
As opposed to (expected, actual) results. Change-Id: I040e85d9362a5c296ac8d3afba99dc9f39d1b6b2 Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
-rw-r--r--tests/auto/declarative_core/utils.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/auto/declarative_core/utils.js b/tests/auto/declarative_core/utils.js
index 3c062f1d..0a659ab2 100644
--- a/tests/auto/declarative_core/utils.js
+++ b/tests/auto/declarative_core/utils.js
@@ -81,10 +81,10 @@ function testObjectProperties(testCase, testObject, data) {
}
function compareObj(testCase, obj1, obj2) {
- for (var propertyName in obj1) {
+ for (var propertyName in obj2) {
if (obj1[propertyName] !== undefined) {
- if (propertyName === "dateTime" && isNaN(obj1["dateTime"].getTime()))
- testCase.verify(isNaN(obj2["dateTime"].getTime()));
+ if (propertyName === "dateTime" && isNaN(obj2["dateTime"].getTime()))
+ testCase.verify(isNaN(obj1["dateTime"].getTime()));
else
testCase.compare(obj1[propertyName], obj2[propertyName])
}
@@ -116,7 +116,7 @@ function testConsecutiveFetch(testCase, model, place, expectedValues)
testCase.compare(totalCount, 5);
testCase.compare(visDataModel.items.count, 1);
- compareObj(testCase, expectedValues[0], visDataModel.items.get(0).model);
+ compareObj(testCase, visDataModel.items.get(0).model, expectedValues[0]);
//set a non-default batch size and fetch the next batch
model.batchSize = 2;
@@ -125,8 +125,8 @@ function testConsecutiveFetch(testCase, model, place, expectedValues)
testCase.compare(signalSpy.count, 0);
testCase.compare(model.totalCount, totalCount);
- compareObj(testCase, expectedValues[1], visDataModel.items.get(1).model);
- compareObj(testCase, expectedValues[2], visDataModel.items.get(2).model);
+ compareObj(testCase, visDataModel.items.get(1).model, expectedValues[1]);
+ compareObj(testCase, visDataModel.items.get(2).model, expectedValues[2]);
//set a batch size greater than the number of remaining items and fetch that batch
model.batchSize = 10;
@@ -135,8 +135,8 @@ function testConsecutiveFetch(testCase, model, place, expectedValues)
testCase.compare(signalSpy.count, 0);
testCase.compare(model.totalCount, totalCount);
- compareObj(testCase, expectedValues[3], visDataModel.items.get(3).model);
- compareObj(testCase, expectedValues[4], visDataModel.items.get(4).model);
+ compareObj(testCase, visDataModel.items.get(3).model, expectedValues[3]);
+ compareObj(testCase, visDataModel.items.get(4).model, expectedValues[4]);
visDataModel.destroy();
signalSpy.destroy();