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

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

Issue 2654553003: Handle renaming of mocked methods that are not virtual. (Closed)
Patch Set: Created 3 years, 11 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 {
10
9 class Interface { 11 class Interface {
10 public: 12 public:
11 virtual void myMethod(int my_param) {} 13 virtual void myMethod(int my_param) {}
12 }; 14 };
13 15
14 class MockedInterface : public Interface { 16 class MockedInterface : public Interface {
15 public: 17 public:
16 MOCK_METHOD1(myMethod, void(int)); 18 MOCK_METHOD1(myMethod, void(int));
17 }; 19 };
18 20
19 void test() { 21 void test() {
20 MockedInterface mockedInterface; 22 MockedInterface mockedInterface;
21 EXPECT_CALL(mockedInterface, myMethod(1)); 23 EXPECT_CALL(mockedInterface, myMethod(1));
22 EXPECT_CALL( 24 EXPECT_CALL(
23 mockedInterface, // A comment to prevent reformatting into single line. 25 mockedInterface, // A comment to prevent reformatting into single line.
24 myMethod(1)); 26 myMethod(1));
25 mockedInterface.myMethod(123); 27 mockedInterface.myMethod(123);
26 } 28 }
27 29
30 } // namespace simple_test
31
32 namespace no_base_method_to_override {
33
34 class MockDestructible {
35 public:
36 MOCK_METHOD0(destruct, void());
37 };
38
39 void Test() {
40 MockDestructible destructible;
41 EXPECT_CALL(destructible, destruct());
42 }
43
44 } // namespace no_base_method_to_override
45
28 } // namespace blink 46 } // 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