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

Side by Side Diff: mojo/public/cpp/bindings/tests/string_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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <sstream>
6
5 #include "mojo/public/cpp/bindings/string.h" 7 #include "mojo/public/cpp/bindings/string.h"
6 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
7 9
8 namespace mojo { 10 namespace mojo {
9 namespace test { 11 namespace test {
10 12
11 TEST(StringTest, DefaultIsNull) { 13 TEST(StringTest, DefaultIsNull) {
12 String s; 14 String s;
13 EXPECT_TRUE(s.is_null()); 15 EXPECT_TRUE(s.is_null());
14 } 16 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 String null; 111 String null;
110 String null2; 112 String null2;
111 EXPECT_FALSE(null < null2); 113 EXPECT_FALSE(null < null2);
112 EXPECT_FALSE(null2 < null); 114 EXPECT_FALSE(null2 < null);
113 115
114 String real("real"); 116 String real("real");
115 EXPECT_TRUE(null < real); 117 EXPECT_TRUE(null < real);
116 EXPECT_FALSE(real < null); 118 EXPECT_FALSE(real < null);
117 } 119 }
118 120
121 TEST(StringText, OutputFormatting) {
122 String s("abc");
123 String null;
124
125 std::ostringstream so;
126 so << "s=" << s << ", null=" << null;
127 EXPECT_EQ("s=abc, null=", so.str());
128 }
129
119 } // namespace test 130 } // namespace test
120 } // namespace mojo 131 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/map_unittest.cc ('k') | mojo/public/cpp/bindings/tests/struct_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698