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

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 16968006: Add Dart_Allocate to the C++ API (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Allow Type objects as well Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« runtime/vm/dart_api_impl.cc ('K') | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl_test.cc
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index 67b2f8a4167c8731fe15330258e0f4b967e95ef9..73d9b197c2b686566c5d314d25aac466f93c9410 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -3919,6 +3919,15 @@ TEST_CASE(New) {
EXPECT_VALID(Dart_IntegerToInt64(foo, &int_value));
EXPECT_EQ(7, int_value);
+ // Allocate without a constructor.
+ result = Dart_Allocate(cls);
siva 2013/06/19 15:36:24 I think you may run into conflicts with my CL. I h
+ EXPECT_VALID(result);
+ instanceof = false;
+ EXPECT_VALID(Dart_ObjectIsType(result, cls, &instanceof));
+ EXPECT(instanceof);
+ foo = Dart_GetField(result, NewString("foo"));
+ EXPECT(Dart_IsNull(foo));
+
// Invoke the unnamed constructor with an empty string.
result = Dart_New(cls, NewString(""), 0, NULL);
EXPECT_VALID(result);
« runtime/vm/dart_api_impl.cc ('K') | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698