-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EXF20 was actually an Extract Method test, not Extract Function
- Loading branch information
1 parent
d41cef7
commit 46173d5
Showing
22 changed files
with
376 additions
and
376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
diff --git a/RefactorTest/ExtractMethod.cpp b/RefactorTest/ExtractMethod.cpp | ||
index bf17201..5785815 100644 | ||
index c5bd1b8..d073f59 100644 | ||
--- a/RefactorTest/ExtractMethod.cpp | ||
+++ b/RefactorTest/ExtractMethod.cpp | ||
@@ -15,10 +15,15 @@ namespace ExtractMethodNamespace | ||
int _x; | ||
int _y; | ||
@@ -14,10 +14,15 @@ struct Bar | ||
int _x; | ||
int _y; | ||
|
||
+ void Goink() | ||
+ { | ||
+ _x = 3; | ||
+ } | ||
+ void goink() | ||
+ { | ||
+ _x = 3; | ||
+ } | ||
+ | ||
void Method1() | ||
{ | ||
// #TEST#: EM1 Extract Method on next line | ||
- _x = 3; | ||
+ Goink(); | ||
_y = 4; | ||
} | ||
void Method1() | ||
{ | ||
// #TEST#: EM1 Extract Method on next line, void goink() | ||
- _x = 3; | ||
+ goink(); | ||
_y = 4; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
diff --git a/RefactorTest/ExtractMethod.cpp b/RefactorTest/ExtractMethod.cpp | ||
index bf17201..c5b8316 100644 | ||
index 03d4f8d..968c93d 100644 | ||
--- a/RefactorTest/ExtractMethod.cpp | ||
+++ b/RefactorTest/ExtractMethod.cpp | ||
@@ -166,12 +166,18 @@ namespace ExtractMethodNamespace | ||
} | ||
@@ -163,12 +163,18 @@ public: | ||
} | ||
|
||
typedef void (Foo::*MethodPtr)(int); | ||
typedef void (Foo::*MethodPtr)(int); | ||
+ | ||
+ void Goink() | ||
+ { | ||
+ member = &Foo::Operation1; | ||
+ } | ||
+ void goink() | ||
+ { | ||
+ member = &Foo::Operation1; | ||
+ } | ||
+ | ||
MethodPtr Method4(int x) | ||
MethodPtr Method4(int x) | ||
{ | ||
if (x < 0) | ||
{ | ||
// #TEST#: EM10 Extract Method on next line, void goink() | ||
- member = &Foo::Operation1; | ||
+ goink(); | ||
} | ||
else | ||
{ | ||
if (x < 0) | ||
{ | ||
// #TEST#: EM10 Extract Method on next line | ||
- member = &Foo::Operation1; | ||
+ Goink(); | ||
} | ||
else | ||
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
diff --git a/RefactorTest/ExtractMethod.cpp b/RefactorTest/ExtractMethod.cpp | ||
index bf17201..a9e9525 100644 | ||
index 03d4f8d..48a6ec8 100644 | ||
--- a/RefactorTest/ExtractMethod.cpp | ||
+++ b/RefactorTest/ExtractMethod.cpp | ||
@@ -181,12 +181,18 @@ namespace ExtractMethodNamespace | ||
} | ||
@@ -178,12 +178,18 @@ public: | ||
} | ||
|
||
void (Foo::*cmember)(int) const; | ||
void (Foo::*cmember)(int) const; | ||
+ | ||
+ void Goink() | ||
+ { | ||
+ cmember = &Foo::Const1; | ||
+ } | ||
+ void goink() | ||
+ { | ||
+ cmember = &Foo::Const1; | ||
+ } | ||
+ | ||
void (Foo::*Method5(int x))(int) const | ||
void (Foo::*Method5(int x))(int) const | ||
{ | ||
if (x < 0) | ||
{ | ||
// #TEST#: EM11 Extract Method on next line, void goink() | ||
- cmember = &Foo::Const1; | ||
+ goink(); | ||
} | ||
else | ||
{ | ||
if (x < 0) | ||
{ | ||
// #TEST#: EM11 Extract Method on next line | ||
- cmember = &Foo::Const1; | ||
+ Goink(); | ||
} | ||
else | ||
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
diff --git a/RefactorTest/ExtractMethod.cpp b/RefactorTest/ExtractMethod.cpp | ||
index bf17201..54a4a6a 100644 | ||
index 03d4f8d..b50399e 100644 | ||
--- a/RefactorTest/ExtractMethod.cpp | ||
+++ b/RefactorTest/ExtractMethod.cpp | ||
@@ -196,13 +196,19 @@ namespace ExtractMethodNamespace | ||
} | ||
@@ -193,13 +193,19 @@ public: | ||
} | ||
|
||
typedef void (Foo::*ConstMethodPtr)(int) const; | ||
typedef void (Foo::*ConstMethodPtr)(int) const; | ||
+ | ||
+ void Goink(ConstMethodPtr& member) | ||
+ { | ||
+ member = &Foo::Const1; | ||
+ } | ||
+ void goink(ConstMethodPtr &member) | ||
+ { | ||
+ member = &Foo::Const1; | ||
+ } | ||
+ | ||
ConstMethodPtr Method6(int x) | ||
ConstMethodPtr Method6(int x) | ||
{ | ||
ConstMethodPtr member; | ||
if (x < 0) | ||
{ | ||
// #TEST#: EM12 Extract Method on next line, void goink(ConstMethodPtr &member) | ||
- member = &Foo::Const1; | ||
+ goink(member); | ||
} | ||
else | ||
{ | ||
ConstMethodPtr member; | ||
if (x < 0) | ||
{ | ||
// #TEST#: EM12 Extract Method on next line | ||
- member = &Foo::Const1; | ||
+ Goink(member); | ||
} | ||
else | ||
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
diff --git a/RefactorTest/ExtractMethod.cpp b/RefactorTest/ExtractMethod.cpp | ||
index bf17201..7dbd017 100644 | ||
index 03d4f8d..ca613d4 100644 | ||
--- a/RefactorTest/ExtractMethod.cpp | ||
+++ b/RefactorTest/ExtractMethod.cpp | ||
@@ -230,10 +230,15 @@ namespace ExtractMethodNamespace | ||
float f; | ||
double d; | ||
@@ -227,10 +227,15 @@ union Frob | ||
float f; | ||
double d; | ||
|
||
+ void Goink() | ||
+ { | ||
+ i = 3; | ||
+ } | ||
+ void goink() | ||
+ { | ||
+ i = 3; | ||
+ } | ||
+ | ||
void Method1() | ||
{ | ||
// #TEST#: EM13 Extract Method on next line | ||
- i = 3; | ||
+ Goink(); | ||
} | ||
void Method1() | ||
{ | ||
// #TEST#: EM13 Extract Method on next line, void goink() | ||
- i = 3; | ||
+ goink(); | ||
} | ||
|
||
int (*fn)(); | ||
int (*fn)(); |
Oops, something went wrong.