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

Side by Side Diff: runtime/vm/compiler_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/code_generator_test.cc ('k') | runtime/vm/dart_entry_test.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/class_finalizer.h"
6 #include "vm/compiler.h" 7 #include "vm/compiler.h"
7 #include "vm/object.h" 8 #include "vm/object.h"
8 #include "vm/unit_test.h" 9 #include "vm/unit_test.h"
9 10
10 namespace dart { 11 namespace dart {
11 12
12 // Compiler only implemented on IA32 and X64 now. 13 // Compiler only implemented on IA32 and X64 now.
13 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) 14 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
14 15
15 TEST_CASE(CompileScript) { 16 TEST_CASE(CompileScript) {
(...skipping 15 matching lines...) Expand all
31 " static foo() { return 42; }\n" 32 " static foo() { return 42; }\n"
32 " static moo() {\n" 33 " static moo() {\n"
33 " // A.foo();\n" 34 " // A.foo();\n"
34 " }\n" 35 " }\n"
35 "}\n"; 36 "}\n";
36 String& url = String::Handle(String::New("dart-test:CompileFunction")); 37 String& url = String::Handle(String::New("dart-test:CompileFunction"));
37 String& source = String::Handle(String::New(kScriptChars)); 38 String& source = String::Handle(String::New(kScriptChars));
38 Script& script = Script::Handle(Script::New(url, source, RawScript::kSource)); 39 Script& script = Script::Handle(Script::New(url, source, RawScript::kSource));
39 Library& lib = Library::Handle(Library::CoreLibrary()); 40 Library& lib = Library::Handle(Library::CoreLibrary());
40 EXPECT(CompilerTest::TestCompileScript(lib, script)); 41 EXPECT(CompilerTest::TestCompileScript(lib, script));
42 EXPECT(ClassFinalizer::FinalizePendingClasses());
41 Class& cls = Class::Handle( 43 Class& cls = Class::Handle(
42 lib.LookupClass(String::Handle(String::NewSymbol("A")))); 44 lib.LookupClass(String::Handle(String::NewSymbol("A"))));
43 EXPECT(!cls.IsNull()); 45 EXPECT(!cls.IsNull());
44 String& function_foo_name = String::Handle(String::New("foo")); 46 String& function_foo_name = String::Handle(String::New("foo"));
45 Function& function_foo = 47 Function& function_foo =
46 Function::Handle(cls.LookupStaticFunction(function_foo_name)); 48 Function::Handle(cls.LookupStaticFunction(function_foo_name));
47 EXPECT(!function_foo.IsNull()); 49 EXPECT(!function_foo.IsNull());
48 50
49 EXPECT(CompilerTest::TestCompileFunction(function_foo)); 51 EXPECT(CompilerTest::TestCompileFunction(function_foo));
50 EXPECT(function_foo.HasCode()); 52 EXPECT(function_foo.HasCode());
51 53
52 String& function_moo_name = String::Handle(String::New("moo")); 54 String& function_moo_name = String::Handle(String::New("moo"));
53 Function& function_moo = 55 Function& function_moo =
54 Function::Handle(cls.LookupStaticFunction(function_moo_name)); 56 Function::Handle(cls.LookupStaticFunction(function_moo_name));
55 EXPECT(!function_moo.IsNull()); 57 EXPECT(!function_moo.IsNull());
56 58
57 EXPECT(CompilerTest::TestCompileFunction(function_moo)); 59 EXPECT(CompilerTest::TestCompileFunction(function_moo));
58 EXPECT(function_moo.HasCode()); 60 EXPECT(function_moo.HasCode());
59 } 61 }
60 62
61 #endif // TARGET_ARCH_IA32 || TARGET_ARCH_X64 63 #endif // TARGET_ARCH_IA32 || TARGET_ARCH_X64
62 64
63 } // namespace dart 65 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_generator_test.cc ('k') | runtime/vm/dart_entry_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698