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

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

Issue 17582016: Convert implementation in mirrors.cc to use Dart_GetType instead of Dart_GetClass. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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/lib/mirrors.cc ('k') | runtime/vm/mirrors_api_impl.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 "bin/builtin.h" 5 #include "bin/builtin.h"
6 #include "include/dart_api.h" 6 #include "include/dart_api.h"
7 #include "include/dart_mirrors_api.h" 7 #include "include/dart_mirrors_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/json.h" 10 #include "platform/json.h"
(...skipping 2797 matching lines...) Expand 10 before | Expand all | Expand 10 after
2808 EXPECT_VALID(Dart_ClassGetInterfaceCount(intf0, &len)); 2808 EXPECT_VALID(Dart_ClassGetInterfaceCount(intf0, &len));
2809 EXPECT_EQ(0, len); 2809 EXPECT_EQ(0, len);
2810 2810
2811 len = -1; 2811 len = -1;
2812 EXPECT_VALID(Dart_ClassGetInterfaceCount(intf1, &len)); 2812 EXPECT_VALID(Dart_ClassGetInterfaceCount(intf1, &len));
2813 EXPECT_EQ(1, len); 2813 EXPECT_EQ(1, len);
2814 CHECK_CLASS(Dart_ClassGetInterfaceAt(intf1, 0), "MyInterface0"); 2814 CHECK_CLASS(Dart_ClassGetInterfaceAt(intf1, 0), "MyInterface0");
2815 2815
2816 // Error cases. 2816 // Error cases.
2817 EXPECT_ERROR(Dart_ClassGetInterfaceCount(Dart_True(), &len), 2817 EXPECT_ERROR(Dart_ClassGetInterfaceCount(Dart_True(), &len),
2818 "Dart_ClassGetInterfaceCount expects argument 'clazz' to be of " 2818 "Dart_ClassGetInterfaceCount expects argument 'object' to be of "
2819 "type Class."); 2819 "type Class/Type.");
2820 EXPECT_ERROR(Dart_ClassGetInterfaceCount(Dart_NewApiError("MyError"), &len), 2820 EXPECT_ERROR(Dart_ClassGetInterfaceCount(Dart_NewApiError("MyError"), &len),
2821 "MyError"); 2821 "MyError");
2822 } 2822 }
2823 2823
2824 2824
2825 TEST_CASE(TypeGetNonParamtericTypes) { 2825 TEST_CASE(TypeGetNonParamtericTypes) {
2826 const char* kScriptChars = 2826 const char* kScriptChars =
2827 "class MyClass0 {\n" 2827 "class MyClass0 {\n"
2828 "}\n" 2828 "}\n"
2829 "\n" 2829 "\n"
(...skipping 5312 matching lines...) Expand 10 before | Expand all | Expand 10 after
8142 NewString("main"), 8142 NewString("main"),
8143 0, 8143 0,
8144 NULL); 8144 NULL);
8145 int64_t value = 0; 8145 int64_t value = 0;
8146 result = Dart_IntegerToInt64(result, &value); 8146 result = Dart_IntegerToInt64(result, &value);
8147 EXPECT_VALID(result); 8147 EXPECT_VALID(result);
8148 EXPECT_EQ(8, value); 8148 EXPECT_EQ(8, value);
8149 } 8149 }
8150 8150
8151 } // namespace dart 8151 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/lib/mirrors.cc ('k') | runtime/vm/mirrors_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698