File: testcase_array_iteration.patch

package info (click to toggle)
qtdeclarative-opensource-src 5.11.3-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 173,780 kB
  • sloc: cpp: 433,810; xml: 9,073; ansic: 2,596; python: 2,023; sh: 81; makefile: 47; php: 27
file content (32 lines) | stat: -rw-r--r-- 1,442 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Description: fix arrays iteration to work around QTBUG-61579
Author: Dmitry Shachnev <mitya57@ubuntu.com>
Bug: https://bugreports.qt.io/browse/QTBUG-61579
Forwarded: no
Last-Update: 2017-06-22

--- a/src/imports/testlib/TestCase.qml
+++ b/src/imports/testlib/TestCase.qml
@@ -1817,7 +1817,7 @@ Item {
             testList.sort()
         }
         var checkNames = (functionsToRun.length > 0)
-        for (var index in testList) {
+        for (var index = 0; index < testList.length; ++index) {
             var prop = testList[index]
             var datafunc = prop + "_data"
             var isBenchmark = (prop.indexOf("benchmark_") == 0)
@@ -1837,11 +1837,11 @@ Item {
                     var table = qtest_testCaseResult
                     var haveData = false
                     qtest_results.initTestTable()
-                    for (var index in table) {
+                    for (var rowIndex in table) {
                         haveData = true
-                        var row = table[index]
+                        var row = table[parseInt(rowIndex)]
                         if (!row.tag)
-                            row.tag = "row " + index    // Must have something
+                            row.tag = "row " + rowIndex    // Must have something
                         qtest_results.dataTag = row.tag
                         if (isBenchmark)
                             qtest_runBenchmarkFunction(prop, row)