| 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 "platform/globals.h" | 5 #include "platform/globals.h" | 
| 6 | 6 | 
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" | 
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" | 
| 9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" | 
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" | 
| (...skipping 2669 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2680   EXPECT(!str3.IsOneByteString()); | 2680   EXPECT(!str3.IsOneByteString()); | 
| 2681   str3 = String::New("Steep and Deep!"); | 2681   str3 = String::New("Steep and Deep!"); | 
| 2682   EXPECT(str3.IsString()); | 2682   EXPECT(str3.IsString()); | 
| 2683   EXPECT(str3.IsOneByteString()); | 2683   EXPECT(str3.IsOneByteString()); | 
| 2684   str3 = OneByteString::null(); | 2684   str3 = OneByteString::null(); | 
| 2685   EXPECT(str3.IsString()); | 2685   EXPECT(str3.IsString()); | 
| 2686   EXPECT(!str3.IsOneByteString()); | 2686   EXPECT(!str3.IsOneByteString()); | 
| 2687 } | 2687 } | 
| 2688 | 2688 | 
| 2689 | 2689 | 
| 2690 #if !defined(TARGET_ARCH_DBC) |  | 
| 2691 static RawLibrary* CreateDummyLibrary(const String& library_name) { | 2690 static RawLibrary* CreateDummyLibrary(const String& library_name) { | 
| 2692   return Library::New(library_name); | 2691   return Library::New(library_name); | 
| 2693 } | 2692 } | 
| 2694 | 2693 | 
| 2695 | 2694 | 
| 2696 static RawFunction* CreateFunction(const char* name) { | 2695 static RawFunction* CreateFunction(const char* name) { | 
| 2697   Thread* thread = Thread::Current(); | 2696   Thread* thread = Thread::Current(); | 
| 2698   const String& class_name = String::Handle(Symbols::New(thread, "ownerClass")); | 2697   const String& class_name = String::Handle(Symbols::New(thread, "ownerClass")); | 
| 2699   const String& lib_name = String::Handle(Symbols::New(thread, "ownerLibrary")); | 2698   const String& lib_name = String::Handle(Symbols::New(thread, "ownerLibrary")); | 
| 2700   const Script& script = Script::Handle(); | 2699   const Script& script = Script::Handle(); | 
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2962   EXPECT_EQ(true, iter.MoveNext()); | 2961   EXPECT_EQ(true, iter.MoveNext()); | 
| 2963   EXPECT_EQ(150, iter.TokenPos().value()); | 2962   EXPECT_EQ(150, iter.TokenPos().value()); | 
| 2964 | 2963 | 
| 2965   EXPECT_EQ(3, iter.TryIndex()); | 2964   EXPECT_EQ(3, iter.TryIndex()); | 
| 2966   EXPECT_EQ(static_cast<uword>(800), iter.PcOffset()); | 2965   EXPECT_EQ(static_cast<uword>(800), iter.PcOffset()); | 
| 2967   EXPECT_EQ(150, iter.TokenPos().value()); | 2966   EXPECT_EQ(150, iter.TokenPos().value()); | 
| 2968   EXPECT_EQ(RawPcDescriptors::kOther, iter.Kind()); | 2967   EXPECT_EQ(RawPcDescriptors::kOther, iter.Kind()); | 
| 2969 | 2968 | 
| 2970   EXPECT_EQ(false, iter.MoveNext()); | 2969   EXPECT_EQ(false, iter.MoveNext()); | 
| 2971 } | 2970 } | 
| 2972 #endif  // !defined(TARGET_ARCH_DBC) |  | 
| 2973 | 2971 | 
| 2974 | 2972 | 
| 2975 static RawClass* CreateTestClass(const char* name) { | 2973 static RawClass* CreateTestClass(const char* name) { | 
| 2976   const String& class_name = String::Handle(Symbols::New(Thread::Current(), | 2974   const String& class_name = String::Handle(Symbols::New(Thread::Current(), | 
| 2977                                                          name)); | 2975                                                          name)); | 
| 2978   const Class& cls = Class::Handle( | 2976   const Class& cls = Class::Handle( | 
| 2979       CreateDummyClass(class_name, Script::Handle())); | 2977       CreateDummyClass(class_name, Script::Handle())); | 
| 2980   return cls.raw(); | 2978   return cls.raw(); | 
| 2981 } | 2979 } | 
| 2982 | 2980 | 
| (...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4727   String& test = String::Handle(); | 4725   String& test = String::Handle(); | 
| 4728   String& result = String::Handle(); | 4726   String& result = String::Handle(); | 
| 4729   for (size_t i = 0; i < ARRAY_SIZE(tests); i++) { | 4727   for (size_t i = 0; i < ARRAY_SIZE(tests); i++) { | 
| 4730     test = String::New(tests[i].in); | 4728     test = String::New(tests[i].in); | 
| 4731     result = String::ScrubName(test); | 4729     result = String::ScrubName(test); | 
| 4732     EXPECT_STREQ(tests[i].out, result.ToCString()); | 4730     EXPECT_STREQ(tests[i].out, result.ToCString()); | 
| 4733   } | 4731   } | 
| 4734 } | 4732 } | 
| 4735 | 4733 | 
| 4736 }  // namespace dart | 4734 }  // namespace dart | 
| OLD | NEW | 
|---|