on xenial help sign in
Card test: Limit the precision we ask for doubles to be equal
04a414eAlbert Astals Cid
tests/qmltests/Dash/tst_Card.qml+3−5
@@ -307,8 +307,8 @@ Rectangle {
307 { tag: "Medium", width: units.gu(18), fill: Image.PreserveAspectCrop, index: 0 },
307 { tag: "Medium", width: units.gu(18), fill: Image.PreserveAspectCrop, index: 0 },
308 { tag: "Small", width: units.gu(12), index: 1 },
308 { tag: "Small", width: units.gu(12), index: 1 },
309 { tag: "Large", width: units.gu(38), index: 2 },
309 { tag: "Large", width: units.gu(38), index: 2 },
310− { tag: "Wide", height: units.gu(19), size: "large", index: 3 },
310+ { tag: "Wide", height: function() { return units.gu(19) }, size: "large", index: 3 },
311− { tag: "Tall", height: units.gu(38) / 0.7, size: "large", width: units.gu(38), index: 4 },
311+ { tag: "Tall", height: function() { return units.gu(38) / 0.7 }, size: "large", width: units.gu(38), index: 4 },
312 { tag: "VerticalWidth", width: function() { return headerRow.width + units.gu(1) }, index: 0 },
312 { tag: "VerticalWidth", width: function() { return headerRow.width + units.gu(1) }, index: 0 },
313 { tag: "HorizontalHeight", height: function() { return headerRow.height + units.gu(1) * 2 }, index: 5 },
313 { tag: "HorizontalHeight", height: function() { return headerRow.height + units.gu(1) * 2 }, index: 5 },
314 { tag: "HorizontalWidth", width: function() { return headerRow.x - units.gu(1) }, index: 5 },
314 { tag: "HorizontalWidth", width: function() { return headerRow.x - units.gu(1) }, index: 5 },
@@ -337,9 +337,7 @@ Rectangle {
337 }
337 }
338
338
339 if (data.hasOwnProperty("height")) {
339 if (data.hasOwnProperty("height")) {
340− if (typeof data.height === "function") {
341− tryCompareFunction(function() { return art.height === data.height() }, true);
340+ tryCompareFunction(function() { return art.height.toFixed(2) === data.height().toFixed(2) }, true);
342− } else tryCompare(art, "height", data.height);
343 }
341 }
344
342
345 if (data.hasOwnProperty("fill")) {
343 if (data.hasOwnProperty("fill")) {