OLD | NEW |
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 <algorithm> | 5 #include <algorithm> |
6 #include <ostream> | 6 #include <ostream> |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "mojo/public/cpp/environment/environment.h" | 9 #include "mojo/public/cpp/environment/environment.h" |
10 #include "mojo/public/cpp/system/macros.h" | 10 #include "mojo/public/cpp/system/macros.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 foo->b = true; | 91 foo->b = true; |
92 foo->c = false; | 92 foo->c = false; |
93 foo->bar = bar.Pass(); | 93 foo->bar = bar.Pass(); |
94 foo->extra_bars = extra_bars.Pass(); | 94 foo->extra_bars = extra_bars.Pass(); |
95 foo->data = data.Pass(); | 95 foo->data = data.Pass(); |
96 foo->source = pipe.handle1.Pass(); | 96 foo->source = pipe.handle1.Pass(); |
97 foo->input_streams = input_streams.Pass(); | 97 foo->input_streams = input_streams.Pass(); |
98 foo->output_streams = output_streams.Pass(); | 98 foo->output_streams = output_streams.Pass(); |
99 foo->array_of_array_of_bools = array_of_array_of_bools.Pass(); | 99 foo->array_of_array_of_bools = array_of_array_of_bools.Pass(); |
100 | 100 |
101 return foo.Pass(); | 101 return foo; |
102 } | 102 } |
103 | 103 |
104 // Check that the given |Foo| is identical to the one made by |MakeFoo()|. | 104 // Check that the given |Foo| is identical to the one made by |MakeFoo()|. |
105 void CheckFoo(const Foo& foo) { | 105 void CheckFoo(const Foo& foo) { |
106 const std::string kName("foopy"); | 106 const std::string kName("foopy"); |
107 ASSERT_FALSE(foo.name.is_null()); | 107 ASSERT_FALSE(foo.name.is_null()); |
108 EXPECT_EQ(kName.size(), foo.name.size()); | 108 EXPECT_EQ(kName.size(), foo.name.size()); |
109 for (size_t i = 0; i < std::min(kName.size(), foo.name.size()); i++) { | 109 for (size_t i = 0; i < std::min(kName.size(), foo.name.size()); i++) { |
110 // Test both |operator[]| and |at|. | 110 // Test both |operator[]| and |at|. |
111 EXPECT_EQ(kName[i], foo.name.at(i)) << i; | 111 EXPECT_EQ(kName[i], foo.name.at(i)) << i; |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 ASSERT_FALSE(defaults->a22.is_null()); | 373 ASSERT_FALSE(defaults->a22.is_null()); |
374 EXPECT_EQ(imported::Shape::RECTANGLE, defaults->a22->shape); | 374 EXPECT_EQ(imported::Shape::RECTANGLE, defaults->a22->shape); |
375 EXPECT_EQ(imported::Color::BLACK, defaults->a22->color); | 375 EXPECT_EQ(imported::Color::BLACK, defaults->a22->color); |
376 EXPECT_EQ(0xFFFFFFFFFFFFFFFFULL, defaults->a23); | 376 EXPECT_EQ(0xFFFFFFFFFFFFFFFFULL, defaults->a23); |
377 EXPECT_EQ(0x123456789, defaults->a24); | 377 EXPECT_EQ(0x123456789, defaults->a24); |
378 EXPECT_EQ(-0x123456789, defaults->a25); | 378 EXPECT_EQ(-0x123456789, defaults->a25); |
379 } | 379 } |
380 | 380 |
381 } // namespace | 381 } // namespace |
382 } // namespace sample | 382 } // namespace sample |
OLD | NEW |