Changeset 175729 in webkit
- Timestamp:
- Nov 6, 2014 4:49:36 PM (9 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r175724 r175729 1 2014-11-06 Mark Lam <mark.lam@apple.com> 2 3 Refactor the get-by-pname.js test [follow up]. 4 <https://webkit.org/b/138483> 5 6 Reviewed by Michael Saboff. 7 8 Used named properties to make the test code more readable. 9 10 * js/script-tests/get-by-pname.js: 11 (isTierIteration): 12 (tierName): 13 (testExpr): Deleted. 14 (testExpectedResult): Deleted. 15 1 16 2014-11-06 Mark Lam <mark.lam@apple.com> 2 17 -
trunk/LayoutTests/js/script-tests/get-by-pname.js
r175724 r175729 34 34 35 35 var testCases = [ 36 [ "foo(o)", "11" ],37 [ "foo(p)", "10" ],38 [ "foo(q)", "3467" ],39 [ "foo(r)", "113" ],40 [ "foo(s)", "182" ],36 { test: "foo(o)", result: "11" }, 37 { test: "foo(p)", result: "10" }, 38 { test: "foo(q)", result: "3467" }, 39 { test: "foo(r)", result: "113" }, 40 { test: "foo(s)", result: "182" }, 41 41 42 [ "getByPnameOnConstant(a)", "0" ],43 [ "getByPnameOnVar(a, 100)", "0" ],44 [ "getByPnameOnVar(a, 'abc')", "'0abc'" ],45 [ "getByPnameOnVar(a, o)", "0" ],46 [ "getByPnameOnVar(a, o1)", "4" ],47 [ "getByPnameOnVar(a, a)", "6" ],42 { test: "getByPnameOnConstant(a)", result: "0" }, 43 { test: "getByPnameOnVar(a, 100)", result: "0" }, 44 { test: "getByPnameOnVar(a, 'abc')", result: "'0abc'" }, 45 { test: "getByPnameOnVar(a, o)", result: "0" }, 46 { test: "getByPnameOnVar(a, o1)", result: "4" }, 47 { test: "getByPnameOnVar(a, a)", result: "6" }, 48 48 49 [ "getByPnameOnConstant(o1)", "0" ],50 [ "getByPnameOnVar(o1, 100)", "0" ],51 [ "getByPnameOnVar(o1, 'abc')", "'0bc0'" ],52 [ "getByPnameOnVar(o1, o)", "0" ],53 [ "getByPnameOnVar(o1, o1)", "11" ],54 [ "getByPnameOnVar(o1, a)", "5" ],49 { test: "getByPnameOnConstant(o1)", result: "0" }, 50 { test: "getByPnameOnVar(o1, 100)", result: "0" }, 51 { test: "getByPnameOnVar(o1, 'abc')", result: "'0bc0'" }, 52 { test: "getByPnameOnVar(o1, o)", result: "0" }, 53 { test: "getByPnameOnVar(o1, o1)", result: "11" }, 54 { test: "getByPnameOnVar(o1, a)", result: "5" }, 55 55 56 [ "getByPnameOnConstant(o)", "0" ],57 [ "getByPnameOnVar(o, 100)", "0" ],58 [ "getByPnameOnVar(o, 'abc')", "0" ],59 [ "getByPnameOnVar(o, o)", "11" ],60 [ "getByPnameOnVar(o, o1)", "0" ],61 [ "getByPnameOnVar(o, a)", "0" ],56 { test: "getByPnameOnConstant(o)", result: "0" }, 57 { test: "getByPnameOnVar(o, 100)", result: "0" }, 58 { test: "getByPnameOnVar(o, 'abc')", result: "0" }, 59 { test: "getByPnameOnVar(o, o)", result: "11" }, 60 { test: "getByPnameOnVar(o, o1)", result: "0" }, 61 { test: "getByPnameOnVar(o, a)", result: "0" }, 62 62 63 [ "getByPnameOnConstant(0)", "0" ],64 [ "getByPnameOnVar(0, 100)", "0" ],65 [ "getByPnameOnVar(0, 'abc')", "0" ],66 [ "getByPnameOnVar(0, o)", "0" ],67 [ "getByPnameOnVar(0, o1)", "0" ],68 [ "getByPnameOnVar(0, a)", "0" ],63 { test: "getByPnameOnConstant(0)", result: "0" }, 64 { test: "getByPnameOnVar(0, 100)", result: "0" }, 65 { test: "getByPnameOnVar(0, 'abc')", result: "0" }, 66 { test: "getByPnameOnVar(0, o)", result: "0" }, 67 { test: "getByPnameOnVar(0, o1)", result: "0" }, 68 { test: "getByPnameOnVar(0, a)", result: "0" }, 69 69 70 [ "getByPnameOnConstant('abc')", "0" ],71 [ "getByPnameOnVar('abc', 100)", "0" ],72 [ "getByPnameOnVar('abc', 'abc')", "'0abc'" ],73 [ "getByPnameOnVar('abc', o)", "0" ],74 [ "getByPnameOnVar('abc', o1)", "4" ],75 [ "getByPnameOnVar('abc', a)", "6" ],76 [ "getByPnameOnVar('def', 'abc')", "'0abc'" ],70 { test: "getByPnameOnConstant('abc')", result: "0" }, 71 { test: "getByPnameOnVar('abc', 100)", result: "0" }, 72 { test: "getByPnameOnVar('abc', 'abc')", result: "'0abc'" }, 73 { test: "getByPnameOnVar('abc', o)", result: "0" }, 74 { test: "getByPnameOnVar('abc', o1)", result: "4" }, 75 { test: "getByPnameOnVar('abc', a)", result: "6" }, 76 { test: "getByPnameOnVar('def', 'abc')", result: "'0abc'" }, 77 77 ]; 78 79 function testExpr(index) {80 return testCases[index][0];81 }82 function testExpectedResult(index) {83 return testCases[index][1];84 }85 78 86 79 // The tiers should be sorted from lowest iterations to highest. 87 80 var tiers = [ 88 81 // name, iterations 89 [ "cold", 0 ],90 [ "llint", 10 ],91 [ "baseline", 500 ],92 [ "dfg", 1000 ],93 // [ "ftl", 100000 ],82 { name: "cold", iterations: 0 }, 83 { name: "llint", iterations: 10 }, 84 { name: "baseline", iterations: 500 }, 85 { name: "dfg", iterations: 1000 }, 86 // { name: "ftl", iterations: 100000 }, 94 87 ]; 95 var highestIteration = tiers[tiers.length - 1] [1];88 var highestIteration = tiers[tiers.length - 1].iterations; 96 89 97 90 function isTierIteration(iteration) { 98 91 for (var i = 0; i < tiers.length; i++) { 99 var tierIteration = tiers[i] [1];92 var tierIteration = tiers[i].iterations; 100 93 if (iteration < tierIteration) 101 94 return false; … … 107 100 function tierName(iteration) { 108 101 for (var i = 0; i < tiers.length; i++) { 109 if (iteration == tiers[i] [1])110 return tiers[i] [0];102 if (iteration == tiers[i].iterations) 103 return tiers[i].name; 111 104 } 112 105 } … … 116 109 debug("Test tier: " + tierName(i)); 117 110 for (var j = 0; j < testCases.length; j++) 118 shouldBe(test Expr(j), testExpectedResult(j));111 shouldBe(testCases[j].test, testCases[j].result); 119 112 debug(""); 120 113 } else { 121 114 for (var j = 0; j < testCases.length; j++) 122 eval(test Expr(j));115 eval(testCases[j].test); 123 116 } 124 117 }
Note: See TracChangeset
for help on using the changeset viewer.