| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "gtest/gtest.h" |
| 10 #include "mojo/public/cpp/system/macros.h" | 11 #include "mojo/public/cpp/system/macros.h" |
| 11 #include "mojo/public/interfaces/bindings/tests/sample_service.mojom.h" | 12 #include "mojo/public/interfaces/bindings/tests/sample_service.mojom.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | |
| 13 | 13 |
| 14 namespace mojo { | 14 namespace mojo { |
| 15 | 15 |
| 16 template <> | 16 template <> |
| 17 struct TypeConverter<int32_t, sample::BarPtr> { | 17 struct TypeConverter<int32_t, sample::BarPtr> { |
| 18 static int32_t Convert(const sample::BarPtr& bar) { | 18 static int32_t Convert(const sample::BarPtr& bar) { |
| 19 return static_cast<int32_t>(bar->alpha) << 16 | | 19 return static_cast<int32_t>(bar->alpha) << 16 | |
| 20 static_cast<int32_t>(bar->beta) << 8 | | 20 static_cast<int32_t>(bar->beta) << 8 | |
| 21 static_cast<int32_t>(bar->gamma); | 21 static_cast<int32_t>(bar->gamma); |
| 22 } | 22 } |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 ASSERT_FALSE(defaults->a22.is_null()); | 363 ASSERT_FALSE(defaults->a22.is_null()); |
| 364 EXPECT_EQ(imported::Shape::RECTANGLE, defaults->a22->shape); | 364 EXPECT_EQ(imported::Shape::RECTANGLE, defaults->a22->shape); |
| 365 EXPECT_EQ(imported::Color::BLACK, defaults->a22->color); | 365 EXPECT_EQ(imported::Color::BLACK, defaults->a22->color); |
| 366 EXPECT_EQ(0xFFFFFFFFFFFFFFFFULL, defaults->a23); | 366 EXPECT_EQ(0xFFFFFFFFFFFFFFFFULL, defaults->a23); |
| 367 EXPECT_EQ(0x123456789, defaults->a24); | 367 EXPECT_EQ(0x123456789, defaults->a24); |
| 368 EXPECT_EQ(-0x123456789, defaults->a25); | 368 EXPECT_EQ(-0x123456789, defaults->a25); |
| 369 } | 369 } |
| 370 | 370 |
| 371 } // namespace | 371 } // namespace |
| 372 } // namespace sample | 372 } // namespace sample |
| OLD | NEW |