From 75714853412e0b1ff1d83f27014ab031909f8408 Mon Sep 17 00:00:00 2001 From: Richard Date: Mon, 1 Jan 2024 20:49:06 -0700 Subject: [PATCH] Update Extract Function test cases Restore test case to Extract Function in C file. Update diffs. --- RefactorTest/CMakeLists.txt | 4 +- RefactorTest/ExtractFunction.cpp | 40 +++++++++++++++---- ...xtractFunction2.cpp => ExtractFunction2.c} | 0 results/diffs/EXF1.txt | 30 +++++++------- results/diffs/EXF10.txt | 36 ++++++++--------- results/diffs/EXF11.txt | 34 ++++++++-------- results/diffs/EXF12.txt | 36 ++++++++--------- results/diffs/EXF13.txt | 36 ++++++++--------- results/diffs/EXF14.txt | 36 ++++++++--------- results/diffs/EXF15.txt | 36 ++++++++--------- results/diffs/EXF16.txt | 36 ++++++++--------- results/diffs/EXF17.txt | 36 ++++++++--------- results/diffs/EXF18.txt | 38 ++++++++++-------- results/diffs/EXF19.txt | 30 +++++++++----- results/diffs/EXF2.txt | 34 ++++++++-------- results/diffs/EXF3.txt | 36 ++++++++--------- results/diffs/EXF4.txt | 36 ++++++++--------- results/diffs/EXF5.txt | 36 ++++++++--------- results/diffs/EXF6.txt | 36 ++++++++--------- results/diffs/EXF7.txt | 36 ++++++++--------- results/diffs/EXF8.txt | 36 ++++++++--------- results/diffs/EXF9.txt | 36 ++++++++--------- 22 files changed, 377 insertions(+), 337 deletions(-) rename RefactorTest/{ExtractFunction2.cpp => ExtractFunction2.c} (100%) diff --git a/RefactorTest/CMakeLists.txt b/RefactorTest/CMakeLists.txt index 054740f..e7b5e82 100644 --- a/RefactorTest/CMakeLists.txt +++ b/RefactorTest/CMakeLists.txt @@ -12,7 +12,7 @@ add_library(refactor-test-cases STATIC CreateMultiVariableDeclaration.cpp ExtractConstant.cpp ExtractFunction.cpp - ExtractFunction2.cpp + ExtractFunction2.c ExtractMethod.cpp ExtractParameter.cpp ExtractVariable.cpp @@ -55,7 +55,7 @@ add_library(refactor-test-cases STATIC ${CMAKE_CURRENT_BINARY_DIR}/include/Config.h ) source_group("Header Files" REGULAR_EXPRESSION ".*\\.h") -source_group("Source Files" REGULAR_EXPRESSION ".*\\.cpp") +source_group("Source Files" REGULAR_EXPRESSION ".*\\.(cpp|c)") source_group("CMake Template Files" REGULAR_EXPRESSION ".*\\.in") if("cxx_std_14" IN_LIST CMAKE_CXX_COMPILE_FEATURES) add_library(refactor-14 OBJECT RenameCpp14.h RenameCpp14.cpp) diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp index e4fa731..02dc2dd 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp @@ -43,8 +43,14 @@ int TestInteger() return x + 3; } -int Function1(int x) { return x; } -int Function2(int x) { return x; } +int Function1(int x) +{ + return x; +} +int Function2(int x) +{ + return x; +} int (*TestFunction(int x))(int) { @@ -80,11 +86,23 @@ Function *TestFunction2(int x) class Foo { public: - int Operation1(int x) { return x; } - int Operation2(int x) { return x * 2; } + int Operation1(int x) + { + return x; + } + int Operation2(int x) + { + return x * 2; + } - int Method1() const { return 1; } - int Method2() const { return 2; } + int Method1() const + { + return 1; + } + int Method2() const + { + return 2; + } }; int (Foo::*TestMember(int x))(int) @@ -149,8 +167,14 @@ PtrConstMemberT TestConstMember2(int x) return member; } -int Function1() { return 1; } -int Function2() { return 2; } +int Function1() +{ + return 1; +} +int Function2() +{ + return 2; +} struct Bar { diff --git a/RefactorTest/ExtractFunction2.cpp b/RefactorTest/ExtractFunction2.c similarity index 100% rename from RefactorTest/ExtractFunction2.cpp rename to RefactorTest/ExtractFunction2.c diff --git a/results/diffs/EXF1.txt b/results/diffs/EXF1.txt index 8592cc4..0998d2f 100644 --- a/results/diffs/EXF1.txt +++ b/results/diffs/EXF1.txt @@ -1,22 +1,22 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..d4a9acc 100644 +index e4fa731..4b3f11a 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -7,10 +7,16 @@ extern void TestExtractFunctionCFile(); +@@ -6,10 +6,16 @@ extern void TestExtractFunctionCFile(); namespace ExtractFunction { -+ void Goink(int& x) -+ { -+ x = 3; -+ } ++void goink(int &x) ++{ ++ x = 3; ++} + - int TestInteger() - { - // #TEST#: EXF1 Extract function on statement -- int x = 3; -+ int x; -+ Goink(x); - REQUIRE_EQUAL(3, x); - // #TEST#: EXF2 Extract function on statement - x *= 3; + int TestInteger() + { + // #TEST#: EXF1 Extract function on statement +- int x = 3; ++ int x; ++ goink(x); + REQUIRE_EQUAL(3, x); + // #TEST#: EXF2 Extract function on statement + x *= 3; diff --git a/results/diffs/EXF10.txt b/results/diffs/EXF10.txt index de50a1f..736a68f 100644 --- a/results/diffs/EXF10.txt +++ b/results/diffs/EXF10.txt @@ -1,25 +1,25 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..ef19526 100644 +index e4fa731..8db307b 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -7,6 +7,11 @@ extern void TestExtractFunctionCFile(); +@@ -6,6 +6,11 @@ extern void TestExtractFunctionCFile(); namespace ExtractFunction { -+ void Goink(int& x) -+ { -+ x &= 3; -+ } ++void goink(int &x) ++{ ++ x &= 3; ++} + - int TestInteger() - { - // #TEST#: EXF1 Extract function on statement -@@ -38,7 +43,7 @@ namespace ExtractFunction - x |= 3; - REQUIRE_EQUAL(11, x); - // #TEST#: EXF10 Extract function on statement -- x &= 3; -+ Goink(x); - REQUIRE_EQUAL(3, x); - // #TEST#: EXF11 Extract function on expression - return x + 3; + int TestInteger() + { + // #TEST#: EXF1 Extract function on statement +@@ -37,7 +42,7 @@ int TestInteger() + x |= 3; + REQUIRE_EQUAL(11, x); + // #TEST#: EXF10 Extract function on statement +- x &= 3; ++ goink(x); + REQUIRE_EQUAL(3, x); + // #TEST#: EXF11 Extract function on expression + return x + 3; diff --git a/results/diffs/EXF11.txt b/results/diffs/EXF11.txt index 81b8207..c7ddb73 100644 --- a/results/diffs/EXF11.txt +++ b/results/diffs/EXF11.txt @@ -1,25 +1,25 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..39a76a7 100644 +index e4fa731..fbe50c3 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -7,6 +7,11 @@ extern void TestExtractFunctionCFile(); +@@ -6,6 +6,11 @@ extern void TestExtractFunctionCFile(); namespace ExtractFunction { -+ int Goink(int x) -+ { -+ return x + 3; -+ } ++int goink(int x) ++{ ++ return x + 3; ++} + - int TestInteger() - { - // #TEST#: EXF1 Extract function on statement -@@ -41,7 +46,7 @@ namespace ExtractFunction - x &= 3; - REQUIRE_EQUAL(3, x); - // #TEST#: EXF11 Extract function on expression -- return x + 3; -+ return Goink(x); - } + int TestInteger() + { + // #TEST#: EXF1 Extract function on statement +@@ -40,7 +45,7 @@ int TestInteger() + x &= 3; + REQUIRE_EQUAL(3, x); + // #TEST#: EXF11 Extract function on expression +- return x + 3; ++ return goink(x); + } - int Function1(int x) { return x; } + int Function1(int x) { return x; } diff --git a/results/diffs/EXF12.txt b/results/diffs/EXF12.txt index 39ee95b..81c4d49 100644 --- a/results/diffs/EXF12.txt +++ b/results/diffs/EXF12.txt @@ -1,24 +1,24 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..7f619ac 100644 +index 02dc2dd..2ec052d 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -47,13 +47,18 @@ namespace ExtractFunction - int Function1(int x) { return x; } - int Function2(int x) { return x; } +@@ -52,13 +52,18 @@ int Function2(int x) + return x; + } -+ void Goink(int(*& function)(int)) -+ { -+ function = Function1; -+ } ++void goink(int (*&function)(int)) ++{ ++ function = Function1; ++} + - int (*TestFunction(int x))(int) + int (*TestFunction(int x))(int) + { + int (*function)(int); + if (x > 0) + { + // #TEST#: EXF12 Extract function on statement +- function = Function1; ++ goink(function); + } + else { - int (*function)(int); - if (x > 0) - { - // #TEST#: EXF12 Extract function on statement -- function = Function1; -+ Goink(function); - } - else - { diff --git a/results/diffs/EXF13.txt b/results/diffs/EXF13.txt index 527bde6..3ea796a 100644 --- a/results/diffs/EXF13.txt +++ b/results/diffs/EXF13.txt @@ -1,25 +1,25 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..7b2fba7 100644 +index 02dc2dd..53a5ecc 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -63,13 +63,19 @@ namespace ExtractFunction - } +@@ -68,13 +68,19 @@ int (*TestFunction(int x))(int) + } - typedef int Function(int); + typedef int Function(int); + -+ void Goink(Function*& function) -+ { -+ function = Function1; -+ } ++void goink(Function *&function) ++{ ++ function = Function1; ++} + - Function *TestFunction2(int x) + Function *TestFunction2(int x) + { + Function *function; + if (x > 0) + { + // #TEST#: EXF13 Extract function on statement +- function = Function1; ++ goink(function); + } + else { - Function *function; - if (x > 0) - { - // #TEST#: EXF13 Extract function on statement -- function = Function1; -+ Goink(function); - } - else - { diff --git a/results/diffs/EXF14.txt b/results/diffs/EXF14.txt index 9292fdb..6011180 100644 --- a/results/diffs/EXF14.txt +++ b/results/diffs/EXF14.txt @@ -1,24 +1,24 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..7c920e2 100644 +index 02dc2dd..8d7fef1 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -88,13 +88,18 @@ namespace ExtractFunction - int Method2() const { return 2; } - }; +@@ -105,13 +105,18 @@ public: + } + }; -+ void Goink(int( Foo::*& member)(int)) -+ { -+ member = &Foo::Operation1; -+ } ++void goink(int (Foo::*&member)(int)) ++{ ++ member = &Foo::Operation1; ++} + - int (Foo::*TestMember(int x))(int) + int (Foo::*TestMember(int x))(int) + { + int (Foo::*member)(int); + if (x > 0) + { + // #TEST#: EXF14 Extract function on statement +- member = &Foo::Operation1; ++ goink(member); + } + else { - int (Foo::*member)(int); - if (x > 0) - { - // #TEST#: EXF14 Extract function on statement -- member = &Foo::Operation1; -+ Goink(member); - } - else - { diff --git a/results/diffs/EXF15.txt b/results/diffs/EXF15.txt index fee8f3a..be63eb3 100644 --- a/results/diffs/EXF15.txt +++ b/results/diffs/EXF15.txt @@ -1,25 +1,25 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..2a5ccd8 100644 +index 02dc2dd..bd99abd 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -104,13 +104,19 @@ namespace ExtractFunction - } +@@ -121,13 +121,19 @@ int (Foo::*TestMember(int x))(int) + } - typedef int (Foo::*PtrMemberT)(int); + typedef int (Foo::*PtrMemberT)(int); + -+ void Goink(PtrMemberT& member) -+ { -+ member = &Foo::Operation1; -+ } ++void goink(PtrMemberT &member) ++{ ++ member = &Foo::Operation1; ++} + - PtrMemberT TestMember2(int x) + PtrMemberT TestMember2(int x) + { + PtrMemberT member; + if (x > 0) + { + // #TEST#: EXF15 Extract function on statement +- member = &Foo::Operation1; ++ goink(member); + } + else { - PtrMemberT member; - if (x > 0) - { - // #TEST#: EXF15 Extract function on statement -- member = &Foo::Operation1; -+ Goink(member); - } - else - { diff --git a/results/diffs/EXF16.txt b/results/diffs/EXF16.txt index 2d3aba9..4f44db3 100644 --- a/results/diffs/EXF16.txt +++ b/results/diffs/EXF16.txt @@ -1,24 +1,24 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..76b22d3 100644 +index 02dc2dd..4ffe4dc 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -119,13 +119,18 @@ namespace ExtractFunction - return member; - } +@@ -136,13 +136,18 @@ PtrMemberT TestMember2(int x) + return member; + } -+ void Goink(int( Foo::*& member)() const) -+ { -+ member = &Foo::Method1; -+ } ++void goink(int (Foo::*&member)() const) ++{ ++ member = &Foo::Method1; ++} + - int (Foo::*TestConstMember(int x))() const + int (Foo::*TestConstMember(int x))() const + { + int (Foo::*member)() const; + if (x > 0) + { + // #TEST#: EXF16 Extract function on statement +- member = &Foo::Method1; ++ goink(member); + } + else { - int (Foo::*member)() const; - if (x > 0) - { - // #TEST#: EXF16 Extract function on statement -- member = &Foo::Method1; -+ Goink(member); - } - else - { diff --git a/results/diffs/EXF17.txt b/results/diffs/EXF17.txt index 7b73849..da99a34 100644 --- a/results/diffs/EXF17.txt +++ b/results/diffs/EXF17.txt @@ -1,25 +1,25 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..c239faa 100644 +index 02dc2dd..48de405 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -135,13 +135,19 @@ namespace ExtractFunction - } +@@ -152,13 +152,19 @@ int (Foo::*TestConstMember(int x))() const + } - typedef int (Foo::*PtrConstMemberT)() const; + typedef int (Foo::*PtrConstMemberT)() const; + -+ void Goink(PtrConstMemberT& member) -+ { -+ member = &Foo::Method1; -+ } ++void goink(PtrConstMemberT &member) ++{ ++ member = &Foo::Method1; ++} + - PtrConstMemberT TestConstMember2(int x) + PtrConstMemberT TestConstMember2(int x) + { + PtrConstMemberT member; + if (x > 0) + { + // #TEST#: EXF17 Extract function on statement +- member = &Foo::Method1; ++ goink(member); + } + else { - PtrConstMemberT member; - if (x > 0) - { - // #TEST#: EXF17 Extract function on statement -- member = &Foo::Method1; -+ Goink(member); - } - else - { diff --git a/results/diffs/EXF18.txt b/results/diffs/EXF18.txt index cce1c04..9a32a71 100644 --- a/results/diffs/EXF18.txt +++ b/results/diffs/EXF18.txt @@ -1,22 +1,26 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..571ffcd 100644 +index 02dc2dd..77b0d87 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -158,10 +158,16 @@ namespace ExtractFunction - int _x; - int _y; +@@ -176,6 +176,11 @@ int Function2() + return 2; + } -+ void Goink(int& x) const -+ { -+ x = Function1() + Function2(); -+ } ++void goink(int &x) ++{ ++ x = Function1() + Function2(); ++} + - void ConstOperation() const - { - // #TEST#: EXF18 Extract Function on next line -- int x = Function1() + Function2(); -+ int x; -+ Goink(x); - int y = x*2; - } - }; + struct Bar + { + int _x; +@@ -184,7 +189,8 @@ struct Bar + void ConstOperation() const + { + // #TEST#: EXF18 Extract Function on next line +- int x = Function1() + Function2(); ++ int x; ++ goink(x); + int y = x * 2; + } + }; diff --git a/results/diffs/EXF19.txt b/results/diffs/EXF19.txt index e8c4187..c7cce1d 100644 --- a/results/diffs/EXF19.txt +++ b/results/diffs/EXF19.txt @@ -1,12 +1,24 @@ -diff --git a/RefactorTest/ExtractFunction2.cpp b/RefactorTest/ExtractFunction2.cpp -index a7401c7..5e76ad5 100644 ---- a/RefactorTest/ExtractFunction2.cpp -+++ b/RefactorTest/ExtractFunction2.cpp -@@ -1,6 +1,11 @@ - #include "stdafx.h" +diff --git a/RefactorTest/CMakeLists.txt b/RefactorTest/CMakeLists.txt +index 043212d..e7b5e82 100644 +--- a/RefactorTest/CMakeLists.txt ++++ b/RefactorTest/CMakeLists.txt +@@ -55,7 +55,7 @@ add_library(refactor-test-cases STATIC + ${CMAKE_CURRENT_BINARY_DIR}/include/Config.h + ) + source_group("Header Files" REGULAR_EXPRESSION ".*\\.h") +-source_group("Source Files" REGULAR_EXPRESSION ".*\\.cpp") ++source_group("Source Files" REGULAR_EXPRESSION ".*\\.(cpp|c)") + source_group("CMake Template Files" REGULAR_EXPRESSION ".*\\.in") + if("cxx_std_14" IN_LIST CMAKE_CXX_COMPILE_FEATURES) + add_library(refactor-14 OBJECT RenameCpp14.h RenameCpp14.cpp) +diff --git a/RefactorTest/ExtractFunction2.c b/RefactorTest/ExtractFunction2.c +index baec870..ee0e805 100644 +--- a/RefactorTest/ExtractFunction2.c ++++ b/RefactorTest/ExtractFunction2.c +@@ -1,5 +1,10 @@ #include -+int Goink(FILE *f) ++int goink(FILE *f) +{ + return getc(f); +} @@ -14,12 +26,12 @@ index a7401c7..5e76ad5 100644 void TestExtractFunctionCFile() { FILE *f = fopen("tmp.tmp", "wb"); -@@ -8,7 +13,7 @@ void TestExtractFunctionCFile() +@@ -7,7 +12,7 @@ void TestExtractFunctionCFile() for (int i = 0; i < 10; i++) { // #TEST#: EXF19 Extract Function on right hand side of assignment. - y += getc(f); -+ y += Goink(f); ++ y += goink(f); } fclose(f); } diff --git a/results/diffs/EXF2.txt b/results/diffs/EXF2.txt index 30004cc..e376ed5 100644 --- a/results/diffs/EXF2.txt +++ b/results/diffs/EXF2.txt @@ -1,24 +1,24 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..cf08c35 100644 +index e4fa731..4cf35a8 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -7,13 +7,18 @@ extern void TestExtractFunctionCFile(); +@@ -6,13 +6,18 @@ extern void TestExtractFunctionCFile(); namespace ExtractFunction { -+ void Goink(int& x) -+ { -+ x *= 3; -+ } ++void goink(int &x) ++{ ++ x *= 3; ++} + - int TestInteger() - { - // #TEST#: EXF1 Extract function on statement - int x = 3; - REQUIRE_EQUAL(3, x); - // #TEST#: EXF2 Extract function on statement -- x *= 3; -+ Goink(x); - REQUIRE_EQUAL(9, x); - // #TEST#: EXF3 Extract function on statement - x /= 3; + int TestInteger() + { + // #TEST#: EXF1 Extract function on statement + int x = 3; + REQUIRE_EQUAL(3, x); + // #TEST#: EXF2 Extract function on statement +- x *= 3; ++ goink(x); + REQUIRE_EQUAL(9, x); + // #TEST#: EXF3 Extract function on statement + x /= 3; diff --git a/results/diffs/EXF3.txt b/results/diffs/EXF3.txt index 4687f3f..4abeb3a 100644 --- a/results/diffs/EXF3.txt +++ b/results/diffs/EXF3.txt @@ -1,25 +1,25 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..bae82a7 100644 +index e4fa731..51caf9d 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -7,6 +7,11 @@ extern void TestExtractFunctionCFile(); +@@ -6,6 +6,11 @@ extern void TestExtractFunctionCFile(); namespace ExtractFunction { -+ void Goink(int& x) -+ { -+ x /= 3; -+ } ++void goink(int &x) ++{ ++ x /= 3; ++} + - int TestInteger() - { - // #TEST#: EXF1 Extract function on statement -@@ -16,7 +21,7 @@ namespace ExtractFunction - x *= 3; - REQUIRE_EQUAL(9, x); - // #TEST#: EXF3 Extract function on statement -- x /= 3; -+ Goink(x); - REQUIRE_EQUAL(3, x); - // #TEST#: EXF4 Extract function on statement - x += 3; + int TestInteger() + { + // #TEST#: EXF1 Extract function on statement +@@ -15,7 +20,7 @@ int TestInteger() + x *= 3; + REQUIRE_EQUAL(9, x); + // #TEST#: EXF3 Extract function on statement +- x /= 3; ++ goink(x); + REQUIRE_EQUAL(3, x); + // #TEST#: EXF4 Extract function on statement + x += 3; diff --git a/results/diffs/EXF4.txt b/results/diffs/EXF4.txt index 21e54b4..dee7d76 100644 --- a/results/diffs/EXF4.txt +++ b/results/diffs/EXF4.txt @@ -1,25 +1,25 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..4002132 100644 +index e4fa731..bfe4b45 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -7,6 +7,11 @@ extern void TestExtractFunctionCFile(); +@@ -6,6 +6,11 @@ extern void TestExtractFunctionCFile(); namespace ExtractFunction { -+ void Goink(int& x) -+ { -+ x += 3; -+ } ++void goink(int &x) ++{ ++ x += 3; ++} + - int TestInteger() - { - // #TEST#: EXF1 Extract function on statement -@@ -19,7 +24,7 @@ namespace ExtractFunction - x /= 3; - REQUIRE_EQUAL(3, x); - // #TEST#: EXF4 Extract function on statement -- x += 3; -+ Goink(x); - REQUIRE_EQUAL(6, x); - // #TEST#: EXF5 Extract function on statement - x -= 3; + int TestInteger() + { + // #TEST#: EXF1 Extract function on statement +@@ -18,7 +23,7 @@ int TestInteger() + x /= 3; + REQUIRE_EQUAL(3, x); + // #TEST#: EXF4 Extract function on statement +- x += 3; ++ goink(x); + REQUIRE_EQUAL(6, x); + // #TEST#: EXF5 Extract function on statement + x -= 3; diff --git a/results/diffs/EXF5.txt b/results/diffs/EXF5.txt index dd3993b..b9149d3 100644 --- a/results/diffs/EXF5.txt +++ b/results/diffs/EXF5.txt @@ -1,25 +1,25 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..f3bd431 100644 +index e4fa731..035ac6a 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -7,6 +7,11 @@ extern void TestExtractFunctionCFile(); +@@ -6,6 +6,11 @@ extern void TestExtractFunctionCFile(); namespace ExtractFunction { -+ void Goink(int& x) -+ { -+ x -= 3; -+ } ++void goink(int &x) ++{ ++ x -= 3; ++} + - int TestInteger() - { - // #TEST#: EXF1 Extract function on statement -@@ -22,7 +27,7 @@ namespace ExtractFunction - x += 3; - REQUIRE_EQUAL(6, x); - // #TEST#: EXF5 Extract function on statement -- x -= 3; -+ Goink(x); - REQUIRE_EQUAL(3, x); - // #TEST#: EXF6 Extract function on statement - x %= 3; + int TestInteger() + { + // #TEST#: EXF1 Extract function on statement +@@ -21,7 +26,7 @@ int TestInteger() + x += 3; + REQUIRE_EQUAL(6, x); + // #TEST#: EXF5 Extract function on statement +- x -= 3; ++ goink(x); + REQUIRE_EQUAL(3, x); + // #TEST#: EXF6 Extract function on statement + x %= 3; diff --git a/results/diffs/EXF6.txt b/results/diffs/EXF6.txt index e8ca71e..b694deb 100644 --- a/results/diffs/EXF6.txt +++ b/results/diffs/EXF6.txt @@ -1,25 +1,25 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..9d65796 100644 +index e4fa731..3e81930 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -7,6 +7,11 @@ extern void TestExtractFunctionCFile(); +@@ -6,6 +6,11 @@ extern void TestExtractFunctionCFile(); namespace ExtractFunction { -+ void Goink(int& x) -+ { -+ x %= 3; -+ } ++void goink(int &x) ++{ ++ x %= 3; ++} + - int TestInteger() - { - // #TEST#: EXF1 Extract function on statement -@@ -25,7 +30,7 @@ namespace ExtractFunction - x -= 3; - REQUIRE_EQUAL(3, x); - // #TEST#: EXF6 Extract function on statement -- x %= 3; -+ Goink(x); - REQUIRE_EQUAL(0, x); - x = 8; - // #TEST#: EXF7 Extract function on statement + int TestInteger() + { + // #TEST#: EXF1 Extract function on statement +@@ -24,7 +29,7 @@ int TestInteger() + x -= 3; + REQUIRE_EQUAL(3, x); + // #TEST#: EXF6 Extract function on statement +- x %= 3; ++ goink(x); + REQUIRE_EQUAL(0, x); + x = 8; + // #TEST#: EXF7 Extract function on statement diff --git a/results/diffs/EXF7.txt b/results/diffs/EXF7.txt index 57ec7be..843a3e0 100644 --- a/results/diffs/EXF7.txt +++ b/results/diffs/EXF7.txt @@ -1,25 +1,25 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..011d7c2 100644 +index e4fa731..10bb939 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -7,6 +7,11 @@ extern void TestExtractFunctionCFile(); +@@ -6,6 +6,11 @@ extern void TestExtractFunctionCFile(); namespace ExtractFunction { -+ void Goink(int& x) -+ { -+ x >>= 3U; -+ } ++void goink(int &x) ++{ ++ x >>= 3U; ++} + - int TestInteger() - { - // #TEST#: EXF1 Extract function on statement -@@ -29,7 +34,7 @@ namespace ExtractFunction - REQUIRE_EQUAL(0, x); - x = 8; - // #TEST#: EXF7 Extract function on statement -- x >>= 3U; -+ Goink(x); - REQUIRE_EQUAL(1, x); - // #TEST#: EXF8 Extract function on statement - x <<= 3U; + int TestInteger() + { + // #TEST#: EXF1 Extract function on statement +@@ -28,7 +33,7 @@ int TestInteger() + REQUIRE_EQUAL(0, x); + x = 8; + // #TEST#: EXF7 Extract function on statement +- x >>= 3U; ++ goink(x); + REQUIRE_EQUAL(1, x); + // #TEST#: EXF8 Extract function on statement + x <<= 3U; diff --git a/results/diffs/EXF8.txt b/results/diffs/EXF8.txt index 836c114..4b7561c 100644 --- a/results/diffs/EXF8.txt +++ b/results/diffs/EXF8.txt @@ -1,25 +1,25 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..b2e1717 100644 +index e4fa731..302c53d 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -7,6 +7,11 @@ extern void TestExtractFunctionCFile(); +@@ -6,6 +6,11 @@ extern void TestExtractFunctionCFile(); namespace ExtractFunction { -+ void Goink(int& x) -+ { -+ x <<= 3U; -+ } ++void goink(int &x) ++{ ++ x <<= 3U; ++} + - int TestInteger() - { - // #TEST#: EXF1 Extract function on statement -@@ -32,7 +37,7 @@ namespace ExtractFunction - x >>= 3U; - REQUIRE_EQUAL(1, x); - // #TEST#: EXF8 Extract function on statement -- x <<= 3U; -+ Goink(x); - REQUIRE_EQUAL(8, x); - // #TEST#: EXF9 Extract function on statement - x |= 3; + int TestInteger() + { + // #TEST#: EXF1 Extract function on statement +@@ -31,7 +36,7 @@ int TestInteger() + x >>= 3U; + REQUIRE_EQUAL(1, x); + // #TEST#: EXF8 Extract function on statement +- x <<= 3U; ++ goink(x); + REQUIRE_EQUAL(8, x); + // #TEST#: EXF9 Extract function on statement + x |= 3; diff --git a/results/diffs/EXF9.txt b/results/diffs/EXF9.txt index 4835510..005e0a0 100644 --- a/results/diffs/EXF9.txt +++ b/results/diffs/EXF9.txt @@ -1,25 +1,25 @@ diff --git a/RefactorTest/ExtractFunction.cpp b/RefactorTest/ExtractFunction.cpp -index d6416f3..76d46ff 100644 +index e4fa731..0219829 100644 --- a/RefactorTest/ExtractFunction.cpp +++ b/RefactorTest/ExtractFunction.cpp -@@ -7,6 +7,11 @@ extern void TestExtractFunctionCFile(); +@@ -6,6 +6,11 @@ extern void TestExtractFunctionCFile(); namespace ExtractFunction { -+ void Goink(int& x) -+ { -+ x |= 3; -+ } ++void goink(int &x) ++{ ++ x |= 3; ++} + - int TestInteger() - { - // #TEST#: EXF1 Extract function on statement -@@ -35,7 +40,7 @@ namespace ExtractFunction - x <<= 3U; - REQUIRE_EQUAL(8, x); - // #TEST#: EXF9 Extract function on statement -- x |= 3; -+ Goink(x); - REQUIRE_EQUAL(11, x); - // #TEST#: EXF10 Extract function on statement - x &= 3; + int TestInteger() + { + // #TEST#: EXF1 Extract function on statement +@@ -34,7 +39,7 @@ int TestInteger() + x <<= 3U; + REQUIRE_EQUAL(8, x); + // #TEST#: EXF9 Extract function on statement +- x |= 3; ++ goink(x); + REQUIRE_EQUAL(11, x); + // #TEST#: EXF10 Extract function on statement + x &= 3;