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

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

Issue 10034019: Add missing calls to class finalizer in various tests. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « runtime/vm/compiler_test.cc ('k') | runtime/vm/object.cc » ('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/assert.h" 5 #include "platform/assert.h"
6 #include "vm/assembler.h" 6 #include "vm/assembler.h"
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/compiler.h" 8 #include "vm/compiler.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
11 #include "vm/resolver.h" 11 #include "vm/resolver.h"
12 #include "vm/unit_test.h" 12 #include "vm/unit_test.h"
13 13
14 namespace dart { 14 namespace dart {
15 15
16 // Only ia32 and x64 can run execution tests. 16 // Only ia32 and x64 can run execution tests.
17 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) 17 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
18 18
19 TEST_CASE(DartEntry) { 19 TEST_CASE(DartEntry) {
20 const char* kScriptChars = 20 const char* kScriptChars =
21 "class A {\n" 21 "class A {\n"
22 " static foo() { return 42; }\n" 22 " static foo() { return 42; }\n"
23 "}\n"; 23 "}\n";
24 String& url = String::Handle(String::New("dart-test:DartEntry")); 24 String& url = String::Handle(String::New("dart-test:DartEntry"));
25 String& source = String::Handle(String::New(kScriptChars)); 25 String& source = String::Handle(String::New(kScriptChars));
26 Script& script = Script::Handle(Script::New(url, source, RawScript::kScript)); 26 Script& script = Script::Handle(Script::New(url, source, RawScript::kScript));
27 Library& lib = Library::Handle(Library::CoreLibrary()); 27 Library& lib = Library::Handle(Library::CoreLibrary());
28 EXPECT_EQ(true, CompilerTest::TestCompileScript(lib, script)); 28 EXPECT_EQ(true, CompilerTest::TestCompileScript(lib, script));
29 EXPECT(ClassFinalizer::FinalizePendingClasses());
29 Class& cls = Class::Handle( 30 Class& cls = Class::Handle(
30 lib.LookupClass(String::Handle(String::NewSymbol("A")))); 31 lib.LookupClass(String::Handle(String::NewSymbol("A"))));
31 EXPECT(!cls.IsNull()); 32 EXPECT(!cls.IsNull());
32 String& name = String::Handle(String::New("foo")); 33 String& name = String::Handle(String::New("foo"));
33 Function& function = Function::Handle(cls.LookupStaticFunction(name)); 34 Function& function = Function::Handle(cls.LookupStaticFunction(name));
34 EXPECT(!function.IsNull()); 35 EXPECT(!function.IsNull());
35 36
36 EXPECT(CompilerTest::TestCompileFunction(function)); 37 EXPECT(CompilerTest::TestCompileFunction(function));
37 EXPECT(function.HasCode()); 38 EXPECT(function.HasCode());
38 GrowableArray<const Object*> arguments; 39 GrowableArray<const Object*> arguments;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 instance, function, arguments, kNoArgumentNames)); 111 instance, function, arguments, kNoArgumentNames));
111 EXPECT(retval.IsError()); 112 EXPECT(retval.IsError());
112 Error& error = Error::Handle(); 113 Error& error = Error::Handle();
113 error ^= retval.raw(); 114 error ^= retval.raw();
114 EXPECT_SUBSTRING("++++", error.ToErrorCString()); 115 EXPECT_SUBSTRING("++++", error.ToErrorCString());
115 } 116 }
116 117
117 #endif // TARGET_ARCH_IA32 || TARGET_ARCH_X64. 118 #endif // TARGET_ARCH_IA32 || TARGET_ARCH_X64.
118 119
119 } // namespace dart 120 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/compiler_test.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698