OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "gtest/gtest.h" |
5 #include "mojo/public/interfaces/bindings/tests/test_constants.mojom.h" | 6 #include "mojo/public/interfaces/bindings/tests/test_constants.mojom.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | |
7 | 7 |
8 namespace mojo { | 8 namespace mojo { |
9 namespace test { | 9 namespace test { |
10 | 10 |
11 TEST(ConstantTest, GlobalConstants) { | 11 TEST(ConstantTest, GlobalConstants) { |
12 // Compile-time constants. | 12 // Compile-time constants. |
13 static_assert(kBoolValue == true, ""); | 13 static_assert(kBoolValue == true, ""); |
14 static_assert(kInt8Value == -2, ""); | 14 static_assert(kInt8Value == -2, ""); |
15 static_assert(kUint8Value == 128U, ""); | 15 static_assert(kUint8Value == 128U, ""); |
16 static_assert(kInt16Value == -233, ""); | 16 static_assert(kInt16Value == -233, ""); |
(...skipping 16 matching lines...) Expand all Loading... |
33 | 33 |
34 TEST(ConstantTest, InterfaceConstants) { | 34 TEST(ConstantTest, InterfaceConstants) { |
35 // Compile-time constants. | 35 // Compile-time constants. |
36 static_assert(InterfaceWithConstants::kUint32Value == 20100722, ""); | 36 static_assert(InterfaceWithConstants::kUint32Value == 20100722, ""); |
37 | 37 |
38 EXPECT_DOUBLE_EQ(InterfaceWithConstants::kDoubleValue, 12.34567); | 38 EXPECT_DOUBLE_EQ(InterfaceWithConstants::kDoubleValue, 12.34567); |
39 } | 39 } |
40 | 40 |
41 } // namespace test | 41 } // namespace test |
42 } // namespace mojo | 42 } // namespace mojo |
OLD | NEW |