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

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

Issue 209093002: Make all objects print at least their type in PrintToJSONStream. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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 | « runtime/vm/object.cc ('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/assembler.h" 5 #include "vm/assembler.h"
6 #include "vm/bigint_operations.h" 6 #include "vm/bigint_operations.h"
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/debugger.h" 10 #include "vm/debugger.h"
(...skipping 4059 matching lines...) Expand 10 before | Expand all | Expand 10 after
4070 } 4070 }
4071 Object& handle = Object::Handle(obj); 4071 Object& handle = Object::Handle(obj);
4072 // Skip some common simple objects to run in reasonable time. 4072 // Skip some common simple objects to run in reasonable time.
4073 if (handle.IsString() || 4073 if (handle.IsString() ||
4074 handle.IsArray() || 4074 handle.IsArray() ||
4075 handle.IsLiteralToken()) { 4075 handle.IsLiteralToken()) {
4076 return; 4076 return;
4077 } 4077 }
4078 JSONStream js; 4078 JSONStream js;
4079 handle.PrintToJSONStream(&js, false); 4079 handle.PrintToJSONStream(&js, false);
4080 // TODO(koda): When all objects include a "type" field, expect that here. 4080 EXPECT_SUBSTRING("\"type\":", js.ToCString());
4081 } 4081 }
4082 }; 4082 };
4083 4083
4084 4084
4085 TEST_CASE(PrintToJSONStream) { 4085 TEST_CASE(PrintToJSONStream) {
4086 Heap* heap = Isolate::Current()->heap(); 4086 Heap* heap = Isolate::Current()->heap();
4087 heap->CollectAllGarbage(); 4087 heap->CollectAllGarbage();
4088 JSONTypeVerifier verifier; 4088 JSONTypeVerifier verifier;
4089 heap->IterateObjects(&verifier); 4089 heap->IterateObjects(&verifier);
4090 } 4090 }
4091 4091
4092 } // namespace dart 4092 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698