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

Unified Diff: dbus/message_unittest.cc

Issue 1839943003: dbus changes: add SetGlobalOutputChannelRemix support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: additional size_t cast modification Created 4 years, 9 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 efe5400553022de3582fdc69b1266f53c1ca1e61..65d49f77010b11fd483f84f2c68ce3c9d5a1563c 100644
--- a/dbus/message_unittest.cc
+++ b/dbus/message_unittest.cc
@@ -248,6 +248,27 @@ TEST(MessageTest, ArrayOfBytes) {
EXPECT_EQ(3, output_bytes[2]);
}
+TEST(MessageTest, ArrayOfDoubles) {
+ scoped_ptr<Response> message(Response::CreateEmpty());
+ MessageWriter writer(message.get());
+ std::vector<double> doubles;
+ doubles.push_back(0.2);
+ doubles.push_back(0.5);
+ doubles.push_back(1);
+ writer.AppendArrayOfDoubles(doubles.data(), doubles.size());
+
+ MessageReader reader(message.get());
+ const double* output_doubles = NULL;
+ size_t length = 0;
+ ASSERT_EQ("ad", reader.GetDataSignature());
+ ASSERT_TRUE(reader.PopArrayOfDoubles(&output_doubles, &length));
+ ASSERT_FALSE(reader.HasMoreData());
+ ASSERT_EQ(3U, length);
+ EXPECT_EQ(0.2, output_doubles[0]);
+ EXPECT_EQ(0.5, output_doubles[1]);
+ EXPECT_EQ(1, output_doubles[2]);
+}
+
TEST(MessageTest, ArrayOfBytes_Empty) {
scoped_ptr<Response> message(Response::CreateEmpty());
MessageWriter writer(message.get());
« 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