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

Unified Diff: runtime/vm/snapshot_test.cc

Issue 2278763002: Handle empty string messages in Dart_PostCObject (Closed)
Patch Set: Created 4 years, 4 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_message.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot_test.cc
diff --git a/runtime/vm/snapshot_test.cc b/runtime/vm/snapshot_test.cc
index 915358a6a1c154f55e8f304bbb219d3d5616b3d6..adc8e1ffd2c297f0c3d21d3262e549200dd6a92b 100644
--- a/runtime/vm/snapshot_test.cc
+++ b/runtime/vm/snapshot_test.cc
@@ -2925,7 +2925,7 @@ UNIT_TEST_CASE(PostCObject) {
" var port = new RawReceivePort();\n"
" var sendPort = port.sendPort;\n"
" port.handler = (message) {\n"
- " if (messageCount < 8) {\n"
+ " if (messageCount < 9) {\n"
" exception = '$exception${message}';\n"
" } else {\n"
" exception = '$exception${message.length}';\n"
@@ -2934,7 +2934,7 @@ UNIT_TEST_CASE(PostCObject) {
" }\n"
" }\n"
" messageCount++;\n"
- " if (messageCount == 9) throw new Exception(exception);\n"
+ " if (messageCount == 10) throw new Exception(exception);\n"
" };\n"
" return sendPort;\n"
"}\n";
@@ -2973,6 +2973,10 @@ UNIT_TEST_CASE(PostCObject) {
object.value.as_string = const_cast<char*>("æøå");
EXPECT(Dart_PostCObject(port_id, &object));
+ object.type = Dart_CObject_kString;
+ object.value.as_string = const_cast<char*>("");
+ EXPECT(Dart_PostCObject(port_id, &object));
+
object.type = Dart_CObject_kDouble;
object.value.as_double = 3.14;
EXPECT(Dart_PostCObject(port_id, &object));
« no previous file with comments | « runtime/vm/dart_api_message.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698