OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // This test is a simple sanity check to make sure gmock is able to build/link | 5 // This test is a simple sanity check to make sure gmock is able to build/link |
6 // correctly. It just instantiates a mock object and runs through a couple of | 6 // correctly. It just instantiates a mock object and runs through a couple of |
7 // the basic mock features. | 7 // the basic mock features. |
8 | 8 |
9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gtest/googlemock/include/gmock/gmock.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/googletest/include/gtest/gtest.h" |
11 | 11 |
12 // Gmock matchers and actions that we use below. | 12 // Gmock matchers and actions that we use below. |
13 using testing::AnyOf; | 13 using testing::AnyOf; |
14 using testing::Eq; | 14 using testing::Eq; |
15 using testing::Return; | 15 using testing::Return; |
16 using testing::SetArgumentPointee; | 16 using testing::SetArgumentPointee; |
17 using testing::WithArg; | 17 using testing::WithArg; |
18 using testing::_; | 18 using testing::_; |
19 | 19 |
20 namespace { | 20 namespace { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 EXPECT_CALL(mock, ReturnSecond(_, AnyOf(Eq(4), Eq(5)))) | 128 EXPECT_CALL(mock, ReturnSecond(_, AnyOf(Eq(4), Eq(5)))) |
129 .WillRepeatedly(WithArg<1>(ReturnVal())); | 129 .WillRepeatedly(WithArg<1>(ReturnVal())); |
130 EXPECT_EQ(4, mock.ReturnSecond(-1, 4)); | 130 EXPECT_EQ(4, mock.ReturnSecond(-1, 4)); |
131 EXPECT_EQ(5, mock.ReturnSecond(0, 5)); | 131 EXPECT_EQ(5, mock.ReturnSecond(0, 5)); |
132 EXPECT_EQ(4, mock.ReturnSecond(0xdeadbeef, 4)); | 132 EXPECT_EQ(4, mock.ReturnSecond(0xdeadbeef, 4)); |
133 EXPECT_EQ(4, mock.ReturnSecond(112358, 4)); | 133 EXPECT_EQ(4, mock.ReturnSecond(112358, 4)); |
134 EXPECT_EQ(5, mock.ReturnSecond(1337, 5)); | 134 EXPECT_EQ(5, mock.ReturnSecond(1337, 5)); |
135 } | 135 } |
136 | 136 |
137 } // namespace | 137 } // namespace |
OLD | NEW |