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

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

Issue 8380020: Refactor the dart api a bit: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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/snapshot_test.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 <stdio.h> 5 #include <stdio.h>
6 6
7 #include "vm/unit_test.h" 7 #include "vm/unit_test.h"
8 8
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 test->RunTest(); 45 test->RunTest();
46 test = test->next_; 46 test = test->next_;
47 } 47 }
48 } 48 }
49 49
50 50
51 Dart_Handle TestCase::LoadTestScript(const char* script, 51 Dart_Handle TestCase::LoadTestScript(const char* script,
52 Dart_NativeEntryResolver resolver) { 52 Dart_NativeEntryResolver resolver) {
53 Dart_Handle url = Dart_NewString(TestCase::url()); 53 Dart_Handle url = Dart_NewString(TestCase::url());
54 Dart_Handle source = Dart_NewString(script); 54 Dart_Handle source = Dart_NewString(script);
55 Dart_Result result = Dart_LoadScript(url, source, NULL); 55 Dart_Handle lib = Dart_LoadScript(url, source, NULL);
56 assert(Dart_IsValidResult(result)); 56 ASSERT(Dart_IsValid(lib));
57 Dart_Handle lib = Dart_GetResult(result); 57 Dart_Handle result = Dart_SetNativeResolver(lib, resolver);
58 result = Dart_SetNativeResolver(lib, resolver); 58 ASSERT(Dart_IsValid(result));
59 assert(Dart_IsValidResult(result));
60 return lib; 59 return lib;
61 } 60 }
62 61
63 62
64 Dart_Handle TestCase::lib() { 63 Dart_Handle TestCase::lib() {
65 Dart_Handle url = Dart_NewString(TestCase::url()); 64 Dart_Handle url = Dart_NewString(TestCase::url());
66 Dart_Result result = Dart_LookupLibrary(url); 65 Dart_Handle lib = Dart_LookupLibrary(url);
67 assert(Dart_IsValidResult(result)); 66 ASSERT(Dart_IsValid(lib));
68 Dart_Handle lib = Dart_GetResult(result); 67 ASSERT(Dart_IsLibrary(lib));
69 assert(Dart_IsLibrary(lib));
70 return lib; 68 return lib;
71 } 69 }
72 70
73 71
74 uword AssemblerTest::Assemble() { 72 uword AssemblerTest::Assemble() {
75 const Code& code = Code::Handle(Code::FinalizeCode(name_, assembler_)); 73 const Code& code = Code::Handle(Code::FinalizeCode(name_, assembler_));
76 if (FLAG_disassemble) { 74 if (FLAG_disassemble) {
77 OS::Print("Code for test '%s' {\n", name_); 75 OS::Print("Code for test '%s' {\n", name_);
78 const Instructions& instructions = 76 const Instructions& instructions =
79 Instructions::Handle(code.instructions()); 77 Instructions::Handle(code.instructions());
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 Compiler::CompileFunction(function); 175 Compiler::CompileFunction(function);
178 retval = true; 176 retval = true;
179 } else { 177 } else {
180 retval = false; 178 retval = false;
181 } 179 }
182 isolate->set_long_jump_base(base); 180 isolate->set_long_jump_base(base);
183 return retval; 181 return retval;
184 } 182 }
185 183
186 } // namespace dart 184 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/snapshot_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698