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

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

Issue 850473002: MallocGrowableArray (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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/platform/assert.h ('k') | runtime/vm/growable_array.h » ('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 (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 "platform/globals.h" 5 #include "platform/globals.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 RawScript::kScriptTag)); 56 RawScript::kScriptTag));
57 Library& lib = Library::Handle(Library::CoreLibrary()); 57 Library& lib = Library::Handle(Library::CoreLibrary());
58 EXPECT_EQ(true, CompilerTest::TestCompileScript(lib, script)); 58 EXPECT_EQ(true, CompilerTest::TestCompileScript(lib, script));
59 EXPECT(ClassFinalizer::ProcessPendingClasses()); 59 EXPECT(ClassFinalizer::ProcessPendingClasses());
60 Class& cls = Class::Handle( 60 Class& cls = Class::Handle(
61 lib.LookupClass(String::Handle(Symbols::New("A")))); 61 lib.LookupClass(String::Handle(Symbols::New("A"))));
62 EXPECT(!cls.IsNull()); // No ambiguity error expected. 62 EXPECT(!cls.IsNull()); // No ambiguity error expected.
63 String& name = String::Handle(String::New("foo")); 63 String& name = String::Handle(String::New("foo"));
64 Function& function = Function::Handle(cls.LookupStaticFunction(name)); 64 Function& function = Function::Handle(cls.LookupStaticFunction(name));
65 EXPECT(!function.IsNull()); 65 EXPECT(!function.IsNull());
66 GrowableArray<const Object*> arguments;
67 const Object& retval = Object::Handle( 66 const Object& retval = Object::Handle(
68 DartEntry::InvokeFunction(function, Object::empty_array())); 67 DartEntry::InvokeFunction(function, Object::empty_array()));
69 EXPECT(retval.IsError()); 68 EXPECT(retval.IsError());
70 EXPECT_SUBSTRING("++++", Error::Cast(retval).ToErrorCString()); 69 EXPECT_SUBSTRING("++++", Error::Cast(retval).ToErrorCString());
71 } 70 }
72 71
73 72
74 TEST_CASE(InvokeDynamic_CompileError) { 73 TEST_CASE(InvokeDynamic_CompileError) {
75 const char* kScriptChars = 74 const char* kScriptChars =
76 "class A {\n" 75 "class A {\n"
(...skipping 29 matching lines...) Expand all
106 EXPECT(!function.IsNull()); 105 EXPECT(!function.IsNull());
107 const Array& args = Array::Handle(Array::New(1)); 106 const Array& args = Array::Handle(Array::New(1));
108 args.SetAt(0, instance); 107 args.SetAt(0, instance);
109 const Object& retval = Object::Handle(DartEntry::InvokeFunction(function, 108 const Object& retval = Object::Handle(DartEntry::InvokeFunction(function,
110 args)); 109 args));
111 EXPECT(retval.IsError()); 110 EXPECT(retval.IsError());
112 EXPECT_SUBSTRING("++++", Error::Cast(retval).ToErrorCString()); 111 EXPECT_SUBSTRING("++++", Error::Cast(retval).ToErrorCString());
113 } 112 }
114 113
115 } // namespace dart 114 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/platform/assert.h ('k') | runtime/vm/growable_array.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698