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

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 1056223002: Fix crash when posting a message to a send port with port id 0. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/object.cc » ('j') | 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 b91fb1223aba96c80055e35d890568d4afa8deb9..306ca8832bf2f2b8f8ac6fa5af6ba687b5337243 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -7141,6 +7141,20 @@ void NewNativePort_send321(Dart_Port dest_port_id,
}
+TEST_CASE(IllegalNewSendPort) {
+ Dart_Handle error = Dart_NewSendPort(ILLEGAL_PORT);
+ EXPECT(Dart_IsError(error));
+ EXPECT(Dart_IsApiError(error));
+}
+
+
+TEST_CASE(IllegalPost) {
+ Dart_Handle message = Dart_True();
+ bool success = Dart_Post(ILLEGAL_PORT, message);
+ EXPECT(!success);
+}
+
+
UNIT_TEST_CASE(NewNativePort) {
// Create a port with a bogus handler.
Dart_Port error_port = Dart_NewNativePort("Foo", NULL, true);
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698