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

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

Issue 23851038: Add Dart_QualifiedClassName. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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/include/dart_mirrors_api.h ('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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 Dart_Handle instance = Dart_True(); 278 Dart_Handle instance = Dart_True();
279 Dart_Handle cls = Dart_InstanceGetClass(instance); 279 Dart_Handle cls = Dart_InstanceGetClass(instance);
280 EXPECT_VALID(cls); 280 EXPECT_VALID(cls);
281 EXPECT(Dart_IsClass(cls)); 281 EXPECT(Dart_IsClass(cls));
282 Dart_Handle cls_name = Dart_ClassName(cls); 282 Dart_Handle cls_name = Dart_ClassName(cls);
283 EXPECT_VALID(cls_name); 283 EXPECT_VALID(cls_name);
284 const char* cls_name_cstr = ""; 284 const char* cls_name_cstr = "";
285 EXPECT_VALID(Dart_StringToCString(cls_name, &cls_name_cstr)); 285 EXPECT_VALID(Dart_StringToCString(cls_name, &cls_name_cstr));
286 EXPECT_STREQ("bool", cls_name_cstr); 286 EXPECT_STREQ("bool", cls_name_cstr);
287 287
288 Dart_Handle qual_cls_name = Dart_QualifiedClassName(cls);
289 EXPECT_VALID(qual_cls_name);
290 const char* qual_cls_name_cstr = "";
291 EXPECT_VALID(Dart_StringToCString(qual_cls_name, &qual_cls_name_cstr));
292 EXPECT_STREQ("Library:'dart:core' Class: bool", qual_cls_name_cstr);
293
288 // Errors propagate. 294 // Errors propagate.
289 Dart_Handle error = Dart_NewApiError("MyError"); 295 Dart_Handle error = Dart_NewApiError("MyError");
290 Dart_Handle error_cls = Dart_InstanceGetClass(error); 296 Dart_Handle error_cls = Dart_InstanceGetClass(error);
291 EXPECT_ERROR(error_cls, "MyError"); 297 EXPECT_ERROR(error_cls, "MyError");
292 298
293 // Get the handle from a non-instance handle 299 // Get the handle from a non-instance handle
294 ASSERT(Dart_IsClass(cls)); 300 ASSERT(Dart_IsClass(cls));
295 Dart_Handle cls_cls = Dart_InstanceGetClass(cls); 301 Dart_Handle cls_cls = Dart_InstanceGetClass(cls);
296 EXPECT_ERROR(cls_cls, 302 EXPECT_ERROR(cls_cls,
297 "Dart_InstanceGetClass expects argument 'instance' to be of " 303 "Dart_InstanceGetClass expects argument 'instance' to be of "
(...skipping 7019 matching lines...) Expand 10 before | Expand all | Expand 10 after
7317 NewString("main"), 7323 NewString("main"),
7318 0, 7324 0,
7319 NULL); 7325 NULL);
7320 int64_t value = 0; 7326 int64_t value = 0;
7321 result = Dart_IntegerToInt64(result, &value); 7327 result = Dart_IntegerToInt64(result, &value);
7322 EXPECT_VALID(result); 7328 EXPECT_VALID(result);
7323 EXPECT_EQ(8, value); 7329 EXPECT_EQ(8, value);
7324 } 7330 }
7325 7331
7326 } // namespace dart 7332 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/include/dart_mirrors_api.h ('k') | runtime/vm/mirrors_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698