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

Unified Diff: vm/dart_api_impl_test.cc

Issue 8875001: Add test to expose bug in initialization of objects with native fields in the inline allocation s... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 9 years 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
« no previous file with comments | « tests/vm/vm.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/dart_api_impl_test.cc
===================================================================
--- vm/dart_api_impl_test.cc (revision 2205)
+++ vm/dart_api_impl_test.cc (working copy)
@@ -1222,6 +1222,9 @@
// Access and set various instance fields of the object.
Dart_Handle result = Dart_GetInstanceField(retobj, Dart_NewString("fld3"));
EXPECT(Dart_IsError(result));
+ result = Dart_GetInstanceField(retobj, Dart_NewString("fld0"));
+ EXPECT_VALID(result);
+ EXPECT(Dart_IsNull(result));
result = Dart_GetInstanceField(retobj, Dart_NewString("fld1"));
EXPECT_VALID(result);
int64_t value = 0;
@@ -1262,6 +1265,9 @@
result = Dart_GetNativeInstanceField(retobj, kNativeFld2, &field_value);
EXPECT_VALID(result);
EXPECT_EQ(0, field_value);
+ result = Dart_GetNativeInstanceField(retobj, kNativeFld3, &field_value);
+ EXPECT_VALID(result);
+ EXPECT_EQ(0, field_value);
result = Dart_SetNativeInstanceField(retobj, kNativeFld4, 40);
EXPECT(Dart_IsError(result));
result = Dart_SetNativeInstanceField(retobj, kNativeFld0, 4);
@@ -1293,6 +1299,7 @@
const char* kScriptChars =
"class NativeFields extends NativeFieldsWrapper {\n"
" NativeFields(int i, int j) : fld1 = i, fld2 = j {}\n"
+ " int fld0;\n"
" int fld1;\n"
" final int fld2;\n"
" static int fld3;\n"
@@ -1341,6 +1348,7 @@
"#import('dart:nativewrappers');"
"class NativeFields extends NativeFieldWrapperClass4 {\n"
" NativeFields(int i, int j) : fld1 = i, fld2 = j {}\n"
+ " int fld0;\n"
" int fld1;\n"
" final int fld2;\n"
" static int fld3;\n"
« no previous file with comments | « tests/vm/vm.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698