| OLD | NEW |
| 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 "vm/assert.h" | 5 #include "vm/assert.h" |
| 6 #include "vm/assembler.h" | 6 #include "vm/assembler.h" |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 const Class& factory_class = Class::Handle(Class::New(class_name, script)); | 161 const Class& factory_class = Class::Handle(Class::New(class_name, script)); |
| 162 const Array& no_fields = Array::Handle(Array::Empty()); | 162 const Array& no_fields = Array::Handle(Array::Empty()); |
| 163 // Finalizes the class. | 163 // Finalizes the class. |
| 164 factory_class.SetFields(no_fields); | 164 factory_class.SetFields(no_fields); |
| 165 | 165 |
| 166 String& interface_name = String::Handle(String::NewSymbol("MyInterface")); | 166 String& interface_name = String::Handle(String::NewSymbol("MyInterface")); |
| 167 const Class& interface = | 167 const Class& interface = |
| 168 Class::Handle(Class::NewInterface(interface_name, script)); | 168 Class::Handle(Class::NewInterface(interface_name, script)); |
| 169 EXPECT(interface.is_interface()); | 169 EXPECT(interface.is_interface()); |
| 170 EXPECT(!factory_class.is_interface()); | 170 EXPECT(!factory_class.is_interface()); |
| 171 EXPECT_EQ(Object::null(), interface.factory_type()); | 171 EXPECT(!interface.HasFactoryClass()); |
| 172 const Type& factory_type = | 172 interface.set_factory_class(factory_class); |
| 173 Type::Handle(Type::NewNonParameterizedType(factory_class)); | 173 EXPECT_EQ(factory_class.raw(), interface.FactoryClass()); |
| 174 interface.set_factory_type(factory_type); | |
| 175 EXPECT_EQ(factory_type.raw(), interface.factory_type()); | |
| 176 } | 174 } |
| 177 | 175 |
| 178 | 176 |
| 179 TEST_CASE(Smi) { | 177 TEST_CASE(Smi) { |
| 180 const Smi& smi = Smi::Handle(Smi::New(5)); | 178 const Smi& smi = Smi::Handle(Smi::New(5)); |
| 181 Object& smi_object = Object::Handle(smi.raw()); | 179 Object& smi_object = Object::Handle(smi.raw()); |
| 182 EXPECT(smi.IsSmi()); | 180 EXPECT(smi.IsSmi()); |
| 183 EXPECT(smi_object.IsSmi()); | 181 EXPECT(smi_object.IsSmi()); |
| 184 EXPECT_EQ(5, smi.Value()); | 182 EXPECT_EQ(5, smi.Value()); |
| 185 const Object& object = Object::Handle(); | 183 const Object& object = Object::Handle(); |
| (...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1949 cls = iterator.GetNextClass(); | 1947 cls = iterator.GetNextClass(); |
| 1950 ASSERT((cls.raw() == ae66.raw()) || (cls.raw() == re44.raw())); | 1948 ASSERT((cls.raw() == ae66.raw()) || (cls.raw() == re44.raw())); |
| 1951 count++; | 1949 count++; |
| 1952 } | 1950 } |
| 1953 ASSERT(count == 2); | 1951 ASSERT(count == 2); |
| 1954 } | 1952 } |
| 1955 | 1953 |
| 1956 #endif // TARGET_ARCH_IA32. | 1954 #endif // TARGET_ARCH_IA32. |
| 1957 | 1955 |
| 1958 } // namespace dart | 1956 } // namespace dart |
| OLD | NEW |