mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 354727. Removed duplicated refactoring tests.
This commit is contained in:
parent
c1e775df38
commit
07c8578942
2 changed files with 0 additions and 285 deletions
|
@ -615,152 +615,6 @@ void Test::test() {
|
||||||
bool b = invalid();
|
bool b = invalid();
|
||||||
}
|
}
|
||||||
|
|
||||||
//!Extract int constant
|
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
|
||||||
|
|
||||||
//@.config
|
|
||||||
filename=test.cpp
|
|
||||||
methodname=size
|
|
||||||
|
|
||||||
//@test.h
|
|
||||||
class Test {
|
|
||||||
void test();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//=
|
|
||||||
class Test {
|
|
||||||
void test();
|
|
||||||
int size();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//@test.cpp
|
|
||||||
#include "test.h"
|
|
||||||
|
|
||||||
void Test::test() {
|
|
||||||
int i = /*$*/42/*$$*/;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=
|
|
||||||
#include "test.h"
|
|
||||||
|
|
||||||
int Test::size() {
|
|
||||||
return 42;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Test::test() {
|
|
||||||
int i = size();
|
|
||||||
}
|
|
||||||
|
|
||||||
//!Extract char constant
|
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
|
||||||
|
|
||||||
//@.config
|
|
||||||
filename=test.cpp
|
|
||||||
methodname=newline
|
|
||||||
|
|
||||||
//@test.h
|
|
||||||
class Test {
|
|
||||||
void test();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//=
|
|
||||||
class Test {
|
|
||||||
void test();
|
|
||||||
char newline();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//@test.cpp
|
|
||||||
#include "test.h"
|
|
||||||
|
|
||||||
void Test::test() {
|
|
||||||
char nl = /*$*/'\n'/*$$*/;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=
|
|
||||||
#include "test.h"
|
|
||||||
|
|
||||||
char Test::newline() {
|
|
||||||
return '\n';
|
|
||||||
}
|
|
||||||
|
|
||||||
void Test::test() {
|
|
||||||
char nl = newline();
|
|
||||||
}
|
|
||||||
|
|
||||||
//!Extract boolean true constant
|
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
|
||||||
|
|
||||||
//@.config
|
|
||||||
filename=test.cpp
|
|
||||||
methodname=valid
|
|
||||||
|
|
||||||
//@test.h
|
|
||||||
class Test {
|
|
||||||
void test();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//=
|
|
||||||
class Test {
|
|
||||||
void test();
|
|
||||||
bool valid();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//@test.cpp
|
|
||||||
#include "test.h"
|
|
||||||
|
|
||||||
void Test::test() {
|
|
||||||
bool b = /*$*/true/*$$*/;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=
|
|
||||||
#include "test.h"
|
|
||||||
|
|
||||||
bool Test::valid() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Test::test() {
|
|
||||||
bool b = valid();
|
|
||||||
}
|
|
||||||
|
|
||||||
//!Extract boolean false constant
|
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
|
||||||
|
|
||||||
//@.config
|
|
||||||
filename=test.cpp
|
|
||||||
methodname=invalid
|
|
||||||
|
|
||||||
//@test.h
|
|
||||||
class Test {
|
|
||||||
void test();
|
|
||||||
};
|
|
||||||
//=
|
|
||||||
class Test {
|
|
||||||
void test();
|
|
||||||
bool invalid();
|
|
||||||
};
|
|
||||||
//@test.cpp
|
|
||||||
#include "test.h"
|
|
||||||
|
|
||||||
void Test::test() {
|
|
||||||
bool b = /*$*/false/*$$*/;
|
|
||||||
}
|
|
||||||
//=
|
|
||||||
#include "test.h"
|
|
||||||
|
|
||||||
bool Test::invalid() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Test::test() {
|
|
||||||
bool b = invalid();
|
|
||||||
}
|
|
||||||
//!Extract expression with typedef Bug 331985
|
//!Extract expression with typedef Bug 331985
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -837,34 +691,3 @@ int main() {
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
//! Extract macro
|
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
|
||||||
|
|
||||||
//@.config
|
|
||||||
filename=test.cpp
|
|
||||||
methodname=bar
|
|
||||||
|
|
||||||
//@test.cpp
|
|
||||||
#define five 5
|
|
||||||
#define ADD(a, b) a + b
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
int i = five; //comment3
|
|
||||||
i = /*$*/ADD(i, five)/*$$*/;
|
|
||||||
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
//=
|
|
||||||
#define five 5
|
|
||||||
#define ADD(a, b) a + b
|
|
||||||
|
|
||||||
int bar(int& i) {
|
|
||||||
return ADD(i, five);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
int i = five; //comment3
|
|
||||||
i = bar(i);
|
|
||||||
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
|
@ -2207,7 +2207,6 @@ test::string toXML() {
|
||||||
int main() {
|
int main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
#include "testString.h"
|
#include "testString.h"
|
||||||
|
|
||||||
|
@ -2224,111 +2223,6 @@ test::string toXML() {
|
||||||
int main() {
|
int main() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//!Bug 248622: Extract function fails to extract several expressions; Selection at the end
|
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
|
||||||
//@.config
|
|
||||||
filename=Test.cpp
|
|
||||||
methodname=endTag
|
|
||||||
//@testString.h
|
|
||||||
|
|
||||||
namespace test {
|
|
||||||
|
|
||||||
class string {
|
|
||||||
public:
|
|
||||||
friend string operator+(const string& lhs, const string& rhs) {
|
|
||||||
return rhs;
|
|
||||||
}
|
|
||||||
|
|
||||||
string operator+(const string& rhs) { return rhs; }
|
|
||||||
string(char* cp) {}
|
|
||||||
string() {};
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//@Test.cpp
|
|
||||||
#include "testString.h"
|
|
||||||
|
|
||||||
test::string toXML() {
|
|
||||||
test::string name;
|
|
||||||
name = "hello";
|
|
||||||
return "<" + name + ">" + /*$*/"</" + name + ">"/*$$*/;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=
|
|
||||||
#include "testString.h"
|
|
||||||
|
|
||||||
const char endTag(test::string name) {
|
|
||||||
return "</" + name + ">";
|
|
||||||
}
|
|
||||||
|
|
||||||
test::string toXML() {
|
|
||||||
test::string name;
|
|
||||||
name = "hello";
|
|
||||||
return "<" + name + ">" + endTag(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//!Bug 248622: Extract function fails to extract several expressions; Selection in the middle
|
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
|
||||||
//@.config
|
|
||||||
filename=Test.cpp
|
|
||||||
methodname=exp
|
|
||||||
//@testString.h
|
|
||||||
|
|
||||||
namespace test {
|
|
||||||
|
|
||||||
class string {
|
|
||||||
public:
|
|
||||||
friend string operator+(const string& lhs, const string& rhs) {
|
|
||||||
return rhs;
|
|
||||||
}
|
|
||||||
|
|
||||||
string operator+(const string& rhs) { return rhs; }
|
|
||||||
string(char* cp) {}
|
|
||||||
string() {};
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//@Test.cpp
|
|
||||||
#include "testString.h"
|
|
||||||
|
|
||||||
test::string toXML() {
|
|
||||||
test::string name;
|
|
||||||
name = "hello";
|
|
||||||
return "<" + name + /*$*/">" + "</"/*$$*/ + name + ">";
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//=
|
|
||||||
#include "testString.h"
|
|
||||||
|
|
||||||
const char exp() {
|
|
||||||
return ">" + "</";
|
|
||||||
}
|
|
||||||
|
|
||||||
test::string toXML() {
|
|
||||||
test::string name;
|
|
||||||
name = "hello";
|
|
||||||
return "<" + name + exp() + name + ">";
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//!Bug#262000 refactoring "extract function" misinterprets artificial blocks
|
//!Bug#262000 refactoring "extract function" misinterprets artificial blocks
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
@ -2341,7 +2235,6 @@ int main(int argc, char** argv) {
|
||||||
a++;
|
a++;
|
||||||
}/*$$*/
|
}/*$$*/
|
||||||
}
|
}
|
||||||
|
|
||||||
//=
|
//=
|
||||||
void exp() {
|
void exp() {
|
||||||
int a = 0;
|
int a = 0;
|
||||||
|
@ -2353,7 +2246,6 @@ void exp() {
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
exp();
|
exp();
|
||||||
}
|
}
|
||||||
|
|
||||||
//!Bug#264712 Refactor extract function deletes comments in header
|
//!Bug#264712 Refactor extract function deletes comments in header
|
||||||
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
//#org.eclipse.cdt.ui.tests.refactoring.extractfunction.ExtractFunctionRefactoringTest
|
||||||
//@.config
|
//@.config
|
||||||
|
|
Loading…
Add table
Reference in a new issue