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

Unified Diff: mojo/public/cpp/bindings/tests/array_unittest.cc

Issue 1519673002: Add helpers for logging mojom objects. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase Created 5 years 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 | « mojo/public/cpp/bindings/struct_ptr.h ('k') | mojo/public/cpp/bindings/tests/map_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/tests/array_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/array_unittest.cc b/mojo/public/cpp/bindings/tests/array_unittest.cc
index 38917809ecb45db3c9faa7b28975bdd12d242436..4447e11b0a73f3bdc70d0665738206840944469c 100644
--- a/mojo/public/cpp/bindings/tests/array_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/array_unittest.cc
@@ -828,6 +828,30 @@ TEST_F(ArrayTest, Serialization_ArrayOfStructPtr) {
}
}
+TEST_F(ArrayTest, OutputFormatting) {
+ Array<int32_t> null_array;
+ Array<int32_t> empty_array;
+ empty_array.resize(0);
+ Array<int32_t> one_element_array;
+ one_element_array.push_back(123);
+ Array<int32_t> three_element_array;
+ three_element_array.push_back(4);
+ three_element_array.push_back(5);
+ three_element_array.push_back(6);
+
+ std::ostringstream so;
+ so << "null_array=" << null_array << ", empty_array=" << empty_array
+ << ", one_element_array=" << one_element_array
+ << ", three_element_array=" << three_element_array;
+
+ EXPECT_EQ(
+ "null_array=null, "
+ "empty_array=[], "
+ "one_element_array=[123], "
+ "three_element_array=[4, 5, 6]",
+ so.str());
+}
+
} // namespace
} // namespace test
} // namespace mojo
« no previous file with comments | « mojo/public/cpp/bindings/struct_ptr.h ('k') | mojo/public/cpp/bindings/tests/map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698