| OLD | NEW |
| 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/unit_test.h" | 5 #include "vm/unit_test.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "bin/builtin.h" | 9 #include "bin/builtin.h" |
| 10 #include "bin/dartutils.h" | 10 #include "bin/dartutils.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 | 42 |
| 43 void TestCaseBase::RunAll() { | 43 void TestCaseBase::RunAll() { |
| 44 TestCaseBase* test = first_; | 44 TestCaseBase* test = first_; |
| 45 while (test != NULL) { | 45 while (test != NULL) { |
| 46 test->RunTest(); | 46 test->RunTest(); |
| 47 test = test->next_; | 47 test = test->next_; |
| 48 } | 48 } |
| 49 } | 49 } |
| 50 | 50 |
| 51 // TODO(zra): Remove when tests that need these functions are ready to enable. | |
| 52 #if !defined(TARGET_ARCH_ARM64) | |
| 53 | 51 |
| 54 static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, | 52 static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, |
| 55 Dart_Handle library, | 53 Dart_Handle library, |
| 56 Dart_Handle url) { | 54 Dart_Handle url) { |
| 57 if (!Dart_IsLibrary(library)) { | 55 if (!Dart_IsLibrary(library)) { |
| 58 return Dart_NewApiError("not a library"); | 56 return Dart_NewApiError("not a library"); |
| 59 } | 57 } |
| 60 if (!Dart_IsString(url)) { | 58 if (!Dart_IsString(url)) { |
| 61 return Dart_NewApiError("url is not a string"); | 59 return Dart_NewApiError("url is not a string"); |
| 62 } | 60 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 135 |
| 138 Dart_Handle TestCase::library_handler(Dart_LibraryTag tag, | 136 Dart_Handle TestCase::library_handler(Dart_LibraryTag tag, |
| 139 Dart_Handle library, | 137 Dart_Handle library, |
| 140 Dart_Handle url) { | 138 Dart_Handle url) { |
| 141 if (tag == Dart_kCanonicalizeUrl) { | 139 if (tag == Dart_kCanonicalizeUrl) { |
| 142 return url; | 140 return url; |
| 143 } | 141 } |
| 144 return Api::Success(); | 142 return Api::Success(); |
| 145 } | 143 } |
| 146 | 144 |
| 147 #endif | |
| 148 | 145 |
| 149 void AssemblerTest::Assemble() { | 146 void AssemblerTest::Assemble() { |
| 150 const String& function_name = String::ZoneHandle(Symbols::New(name_)); | 147 const String& function_name = String::ZoneHandle(Symbols::New(name_)); |
| 151 const Class& cls = Class::ZoneHandle( | 148 const Class& cls = Class::ZoneHandle( |
| 152 Class::New(function_name, Script::Handle(), Scanner::kNoSourcePos)); | 149 Class::New(function_name, Script::Handle(), Scanner::kNoSourcePos)); |
| 153 const Library& lib = Library::ZoneHandle(Library::New(function_name)); | 150 const Library& lib = Library::ZoneHandle(Library::New(function_name)); |
| 154 cls.set_library(lib); | 151 cls.set_library(lib); |
| 155 Function& function = Function::ZoneHandle( | 152 Function& function = Function::ZoneHandle( |
| 156 Function::New(function_name, RawFunction::kRegularFunction, | 153 Function::New(function_name, RawFunction::kRegularFunction, |
| 157 true, false, false, false, false, cls, 0)); | 154 true, false, false, false, false, cls, 0)); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 bool CompilerTest::TestCompileFunction(const Function& function) { | 232 bool CompilerTest::TestCompileFunction(const Function& function) { |
| 236 Isolate* isolate = Isolate::Current(); | 233 Isolate* isolate = Isolate::Current(); |
| 237 ASSERT(isolate != NULL); | 234 ASSERT(isolate != NULL); |
| 238 ASSERT(ClassFinalizer::AllClassesFinalized()); | 235 ASSERT(ClassFinalizer::AllClassesFinalized()); |
| 239 const Error& error = Error::Handle(Compiler::CompileFunction(function)); | 236 const Error& error = Error::Handle(Compiler::CompileFunction(function)); |
| 240 return error.IsNull(); | 237 return error.IsNull(); |
| 241 } | 238 } |
| 242 | 239 |
| 243 | 240 |
| 244 } // namespace dart | 241 } // namespace dart |
| OLD | NEW |