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

Side by Side Diff: mojo/public/cpp/bindings/tests/string_unittest.cc

Issue 1532993002: Add output formatters for more mojom types. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-9
Patch Set: rebase Created 4 years, 11 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 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
7 #include "mojo/public/cpp/bindings/formatting.h"
5 #include "mojo/public/cpp/bindings/string.h" 8 #include "mojo/public/cpp/bindings/string.h"
6 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
7 10
8 namespace mojo { 11 namespace mojo {
9 namespace test { 12 namespace test {
10 13
11 TEST(StringTest, DefaultIsNull) { 14 TEST(StringTest, DefaultIsNull) {
12 String s; 15 String s;
13 EXPECT_TRUE(s.is_null()); 16 EXPECT_TRUE(s.is_null());
14 } 17 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 String null; 112 String null;
110 String null2; 113 String null2;
111 EXPECT_FALSE(null < null2); 114 EXPECT_FALSE(null < null2);
112 EXPECT_FALSE(null2 < null); 115 EXPECT_FALSE(null2 < null);
113 116
114 String real("real"); 117 String real("real");
115 EXPECT_TRUE(null < real); 118 EXPECT_TRUE(null < real);
116 EXPECT_FALSE(real < null); 119 EXPECT_FALSE(real < null);
117 } 120 }
118 121
122 TEST(StringText, OutputFormatting) {
123 String s("abc");
124 String null;
125
126 std::ostringstream so;
127 so << "s=" << s << ", null=" << null;
128 EXPECT_EQ("s=abc, null=", so.str());
129 }
130
119 } // namespace test 131 } // namespace test
120 } // namespace mojo 132 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698