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

Unified Diff: vm/dart_api_impl_test.cc

Issue 10829153: The null tests that I added for Dart_NewString{8,16,32} were too restrictive. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « 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: vm/dart_api_impl_test.cc
===================================================================
--- vm/dart_api_impl_test.cc (revision 10203)
+++ vm/dart_api_impl_test.cc (working copy)
@@ -6517,6 +6517,30 @@
}
+TEST_CASE(NewString_Null) {
+ Dart_Handle str = Dart_NewString8(NULL, 0);
+ EXPECT_VALID(str);
+ EXPECT(Dart_IsString(str));
+ intptr_t len = -1;
+ EXPECT_VALID(Dart_StringLength(str, &len));
+ EXPECT_EQ(0, len);
+
+ str = Dart_NewString16(NULL, 0);
+ EXPECT_VALID(str);
+ EXPECT(Dart_IsString(str));
+ len = -1;
+ EXPECT_VALID(Dart_StringLength(str, &len));
+ EXPECT_EQ(0, len);
+
+ str = Dart_NewString32(NULL, 0);
+ EXPECT_VALID(str);
+ EXPECT(Dart_IsString(str));
+ len = -1;
+ EXPECT_VALID(Dart_StringLength(str, &len));
+ EXPECT_EQ(0, len);
+}
+
+
#endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
} // namespace dart
« no previous file with comments | « vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698