Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Side by Side Diff: test/mjsunit/string-indexof.js

Issue 7138: Reduced time of string-indexof.js to avoid timeout on ARM simulator in debug mode. (Closed)
Patch Set: Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 + "dicta sunt, explicabo. nemo enim ipsam voluptatem, quia voluptas" 113 + "dicta sunt, explicabo. nemo enim ipsam voluptatem, quia voluptas"
114 + "sit, aspernatur aut odit aut fugit, sed quia consequuntur magni" 114 + "sit, aspernatur aut odit aut fugit, sed quia consequuntur magni"
115 + " dolores eos, qui ratione voluptatem sequi nesciunt, neque porro" 115 + " dolores eos, qui ratione voluptatem sequi nesciunt, neque porro"
116 + " quisquam est, qui dolorem ipsum, quia dolor sit, amet, " 116 + " quisquam est, qui dolorem ipsum, quia dolor sit, amet, "
117 + "consectetur, adipisci velit, sed quia non numquam eius modi" 117 + "consectetur, adipisci velit, sed quia non numquam eius modi"
118 + " tempora incidunt, ut labore et dolore magnam aliquam quaerat " 118 + " tempora incidunt, ut labore et dolore magnam aliquam quaerat "
119 + "voluptatem. ut enim ad minima veniam, quis nostrum exercitationem " 119 + "voluptatem. ut enim ad minima veniam, quis nostrum exercitationem "
120 + "ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi " 120 + "ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi "
121 + "consequatur? quis autem vel eum iure reprehenderit, qui in ea " 121 + "consequatur? quis autem vel eum iure reprehenderit, qui in ea "
122 + "voluptate velit esse, quam nihil molestiae consequatur, vel illum, " 122 + "voluptate velit esse, quam nihil molestiae consequatur, vel illum, "
123 + "qui dolorem eum fugiat, quo voluptas nulla pariatur?\n" 123 + "qui dolorem eum fugiat, quo voluptas nulla pariatur?\n";
124 + "At vero eos et accusamus et iusto odio dignissimos ducimus, qui "
125 + "blanditiis praesentium voluptatum deleniti atque corrupti, quos "
126 + "dolores et quas molestias excepturi sint, obcaecati cupiditate "
127 + "non provident, similique sunt in culpa, qui officia deserunt "
128 + "mollitia animi, id est laborum et dolorum fuga. et harum quidem "
129 + "rerum facilis est et expedita distinctio. nam libero tempore, "
130 + "cum soluta nobis est eligendi optio, cumque nihil impedit, quo "
131 + "minus id, quod maxime placeat, facere possimus, omnis voluptas "
132 + "assumenda est, omnis dolor repellendus. temporibus autem "
133 + "quibusdam et aut officiis debitis aut rerum necessitatibus "
134 + "saepe eveniet, ut et voluptates repudiandae sint et molestiae "
135 + "non recusandae. itaque earum rerum hic tenetur a sapiente "
136 + "delectus, ut aut reiciendis voluptatibus maiores alias consequatur "
137 + "aut perferendis doloribus asperiores repellat.";
138 124
139 assertEquals(893, lipsum.indexOf("lorem ipsum, quia dolor sit, amet"), 125 assertEquals(893, lipsum.indexOf("lorem ipsum, quia dolor sit, amet"),
140 "Lipsum"); 126 "Lipsum");
141 // test a lot of substrings of differing length and start-position. 127 // test a lot of substrings of differing length and start-position.
142 for(var i = 255; i < lipsum.length; i += 3) { 128 for(var i = 0; i < lipsum.length; i += 3) {
143 for(var len = 661; i + len < lipsum.length; len += 4) { 129 for(var len = 1; i + len < lipsum.length; len += 7) {
144 var substring = lipsum.substring(i, i + len); 130 var substring = lipsum.substring(i, i + len);
145 var index = -1; 131 var index = -1;
146 do { 132 do {
147 index = lipsum.indexOf(substring, index + 1); 133 index = lipsum.indexOf(substring, index + 1);
148 assertTrue(index != -1, 134 assertTrue(index != -1,
149 "Lipsum substring " + i + ".." + (i + len-1) + " not found"); 135 "Lipsum substring " + i + ".." + (i + len-1) + " not found");
150 assertEquals(lipsum.substring(index, index + len), substring, 136 assertEquals(lipsum.substring(index, index + len), substring,
151 "Wrong lipsum substring found: " + i + ".." + (i + len - 1) + "/" + 137 "Wrong lipsum substring found: " + i + ".." + (i + len - 1) + "/" +
152 index + ".." + (index + len - 1)); 138 index + ".." + (index + len - 1));
153 } while (index >= 0 && index < i); 139 } while (index >= 0 && index < i);
154 assertEquals(i, index, "Lipsum match at " + i + ".." + (i + len - 1)); 140 assertEquals(i, index, "Lipsum match at " + i + ".." + (i + len - 1));
155 } 141 }
156 } 142 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698