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

Side by Side Diff: test/mjsunit/tools/codemap.js

Issue 6869007: Cleanup of mjsunit.js code and make assertEquals more strict. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review comments Created 9 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/third_party/regexp-pcre.js ('k') | test/mjsunit/tools/splaytree.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 assertEntry(codeMap, 'code {1}', 0x1700); 150 assertEntry(codeMap, 'code {1}', 0x1700);
151 })(); 151 })();
152 152
153 153
154 (function testStaticEntriesExport() { 154 (function testStaticEntriesExport() {
155 var codeMap = new CodeMap(); 155 var codeMap = new CodeMap();
156 codeMap.addStaticCode(0x1500, newCodeEntry(0x3000, 'lib1')); 156 codeMap.addStaticCode(0x1500, newCodeEntry(0x3000, 'lib1'));
157 codeMap.addStaticCode(0x15500, newCodeEntry(0x5000, 'lib2')); 157 codeMap.addStaticCode(0x15500, newCodeEntry(0x5000, 'lib2'));
158 codeMap.addStaticCode(0x155500, newCodeEntry(0x10000, 'lib3')); 158 codeMap.addStaticCode(0x155500, newCodeEntry(0x10000, 'lib3'));
159 var allStatics = codeMap.getAllStaticEntries(); 159 var allStatics = codeMap.getAllStaticEntries();
160 allStatics = allStatics.map(String);
160 allStatics.sort(); 161 allStatics.sort();
161 assertEquals(['lib1: 3000', 'lib2: 5000', 'lib3: 10000'], allStatics); 162 assertEquals(['lib1: 3000', 'lib2: 5000', 'lib3: 10000'], allStatics);
162 })(); 163 })();
163 164
164 165
165 (function testDynamicEntriesExport() { 166 (function testDynamicEntriesExport() {
166 var codeMap = new CodeMap(); 167 var codeMap = new CodeMap();
167 codeMap.addCode(0x1500, newCodeEntry(0x200, 'code1')); 168 codeMap.addCode(0x1500, newCodeEntry(0x200, 'code1'));
168 codeMap.addCode(0x1700, newCodeEntry(0x100, 'code2')); 169 codeMap.addCode(0x1700, newCodeEntry(0x100, 'code2'));
169 codeMap.addCode(0x1900, newCodeEntry(0x50, 'code3')); 170 codeMap.addCode(0x1900, newCodeEntry(0x50, 'code3'));
170 var allDynamics = codeMap.getAllDynamicEntries(); 171 var allDynamics = codeMap.getAllDynamicEntries();
172 allDynamics = allDynamics.map(String);
171 allDynamics.sort(); 173 allDynamics.sort();
172 assertEquals(['code1: 200', 'code2: 100', 'code3: 50'], allDynamics); 174 assertEquals(['code1: 200', 'code2: 100', 'code3: 50'], allDynamics);
173 codeMap.deleteCode(0x1700); 175 codeMap.deleteCode(0x1700);
174 var allDynamics2 = codeMap.getAllDynamicEntries(); 176 var allDynamics2 = codeMap.getAllDynamicEntries();
177 allDynamics2 = allDynamics2.map(String);
175 allDynamics2.sort(); 178 allDynamics2.sort();
176 assertEquals(['code1: 200', 'code3: 50'], allDynamics2); 179 assertEquals(['code1: 200', 'code3: 50'], allDynamics2);
177 codeMap.deleteCode(0x1500); 180 codeMap.deleteCode(0x1500);
178 var allDynamics3 = codeMap.getAllDynamicEntries(); 181 var allDynamics3 = codeMap.getAllDynamicEntries();
179 assertEquals(['code3: 50'], allDynamics3); 182 assertEquals(['code3: 50'], allDynamics3.map(String));
180 })(); 183 })();
OLDNEW
« no previous file with comments | « test/mjsunit/third_party/regexp-pcre.js ('k') | test/mjsunit/tools/splaytree.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698