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

Unified Diff: dbus/message_unittest.cc

Issue 7686013: Add AppendArrayOfObjectPaths, which was missing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | « dbus/message.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/message_unittest.cc
diff --git a/dbus/message_unittest.cc b/dbus/message_unittest.cc
index e7d913df847e15b55379805c5a2411f007e12bd3..518a7e00255d53f679923c6f9071727e6abdb9b3 100644
--- a/dbus/message_unittest.cc
+++ b/dbus/message_unittest.cc
@@ -175,6 +175,26 @@ TEST(MessageTest, ArrayOfBytes) {
ASSERT_EQ(3, output_bytes[2]);
}
+TEST(MessageTest, ArrayOfObjectPaths) {
+ dbus::Message message;
+ message.reset_raw_message(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL));
+ dbus::MessageWriter writer(&message);
+ std::vector<std::string> object_paths;
+ object_paths.push_back("/object/path/1");
+ object_paths.push_back("/object/path/2");
+ object_paths.push_back("/object/path/3");
+ writer.AppendArrayOfObjectPaths(object_paths);
+
+ dbus::MessageReader reader(&message);
+ std::vector<std::string> output_object_paths;
+ ASSERT_TRUE(reader.PopArrayOfObjectPaths(&output_object_paths));
+ ASSERT_FALSE(reader.HasMoreData());
+ ASSERT_EQ(3U, output_object_paths.size());
+ ASSERT_EQ("/object/path/1", output_object_paths[0]);
+ ASSERT_EQ("/object/path/2", output_object_paths[1]);
+ ASSERT_EQ("/object/path/3", output_object_paths[2]);
+}
+
// Test that an array can be properly written and read. We only have this
// test for array, as repeating this for other container types is too
// redundant.
« no previous file with comments | « dbus/message.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698