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

Side by Side Diff: runtime/vm/unit_test.cc

Issue 1341473002: Fix a variety of service protocol bugs. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 | « runtime/vm/unit_test.h ('k') | 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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/unit_test.h" 5 #include "vm/unit_test.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "bin/builtin.h" 9 #include "bin/builtin.h"
10 #include "bin/dartutils.h" 10 #include "bin/dartutils.h"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 bool CompilerTest::TestCompileFunction(const Function& function) { 275 bool CompilerTest::TestCompileFunction(const Function& function) {
276 Thread* thread = Thread::Current(); 276 Thread* thread = Thread::Current();
277 ASSERT(thread != NULL); 277 ASSERT(thread != NULL);
278 ASSERT(ClassFinalizer::AllClassesFinalized()); 278 ASSERT(ClassFinalizer::AllClassesFinalized());
279 const Error& error = Error::Handle(Compiler::CompileFunction(thread, 279 const Error& error = Error::Handle(Compiler::CompileFunction(thread,
280 function)); 280 function));
281 return error.IsNull(); 281 return error.IsNull();
282 } 282 }
283 283
284 284
285 void ElideJSONSubstring(const char* prefix, const char* in, char* out) {
286 const char* pos = strstr(in, prefix);
287 while (pos != NULL) {
288 // Copy up to pos into the output buffer.
289 while (in < pos) {
290 *out++ = *in++;
291 }
292
293 // Skip to the close quote.
294 in += strcspn(in, "\"");
295 pos = strstr(in, prefix);
296 }
297 // Copy the remainder of in to out.
298 while (*in != '\0') {
299 *out++ = *in++;
300 }
301 *out = '\0';
302 }
303
304
285 } // namespace dart 305 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/unit_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698