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

Side by Side Diff: tools/clang/rewrite_to_chrome_style/tests/gmock-original.cc

Issue 2655793004: Also handle renaming method names inside ON_CALL macro calls. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « tools/clang/rewrite_to_chrome_style/tests/gmock-expected.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "gmock/gmock.h" 5 #include "gmock/gmock.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 namespace simple_test { 9 namespace simple_test {
10 10
11 class Interface { 11 class Interface {
12 public: 12 public:
13 virtual void myMethod(int my_param) {} 13 virtual void myMethod(int my_param) {}
14 }; 14 };
15 15
16 class MockedInterface : public Interface { 16 class MockedInterface : public Interface {
17 public: 17 public:
18 MOCK_METHOD1(myMethod, void(int)); 18 MOCK_METHOD1(myMethod, void(int));
19 }; 19 };
20 20
21 void test() { 21 void test() {
22 MockedInterface mockedInterface; 22 MockedInterface mockedInterface;
23 EXPECT_CALL(mockedInterface, myMethod(1)); 23 EXPECT_CALL(mockedInterface, myMethod(1));
24 EXPECT_CALL( 24 EXPECT_CALL(
25 mockedInterface, // A comment to prevent reformatting into single line. 25 mockedInterface, // A comment to prevent reformatting into single line.
26 myMethod(1)); 26 myMethod(1));
27 mockedInterface.myMethod(123); 27 mockedInterface.myMethod(123);
28
29 int arg;
30 ON_CALL(mockedInterface, myMethod(1))
31 .WillByDefault(testing::SaveArg<0>(&arg));
28 } 32 }
29 33
30 } // namespace simple_test 34 } // namespace simple_test
31 35
32 namespace no_base_method_to_override { 36 namespace no_base_method_to_override {
33 37
34 class MockDestructible { 38 class MockDestructible {
35 public: 39 public:
36 MOCK_METHOD0(destruct, void()); 40 MOCK_METHOD0(destruct, void());
37 }; 41 };
38 42
39 void Test() { 43 void Test() {
40 MockDestructible destructible; 44 MockDestructible destructible;
41 EXPECT_CALL(destructible, destruct()); 45 EXPECT_CALL(destructible, destruct());
42 } 46 }
43 47
44 } // namespace no_base_method_to_override 48 } // namespace no_base_method_to_override
45 49
46 } // namespace blink 50 } // namespace blink
OLDNEW
« no previous file with comments | « tools/clang/rewrite_to_chrome_style/tests/gmock-expected.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698