diff options
author | Lorenz Haas <lykurg@gmail.com> | 2013-06-07 16:44:08 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@digia.com> | 2013-06-12 16:32:14 +0200 |
commit | 8f4c4b41f6dc93dd7afb1a349484a08588604056 (patch) | |
tree | 0ff26b6ee18d5347256deede50f6f0209a4d250e /src/plugins/cppeditor | |
parent | c51195d9bb459d16ea0acfaa40b891189a964645 (diff) | |
download | qt-creator-8f4c4b41f6dc93dd7afb1a349484a08588604056.tar.gz |
CppTools: Fix nextToSurroundingDefinitions
Now it is checked if the adjacent declaration is also defined and one
can define the destination file.
Change-Id: Ifff59c49fc2ab3e2f36f41df42ae4b7d7ff8dd35
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Diffstat (limited to 'src/plugins/cppeditor')
-rw-r--r-- | src/plugins/cppeditor/cppquickfix_test.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index c67dce2680..e93bf76267 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -1791,21 +1791,31 @@ void CppEditorPlugin::test_quickfix_MoveFuncDefOutside_MemberFuncOutside() { QByteArray original = "class Foo {\n" - " inline int numbe@r() const\n" - " {\n" - " return 5;\n" - " }\n" - "};"; + " void f1();\n" + " inline int f2@() const\n" + " {\n" + " return 1;\n" + " }\n" + " void f3();\n" + " void f4();\n" + "};\n" + "\n" + "void Foo::f4() {}\n"; QByteArray expected = "class Foo {\n" - " inline int number() const;\n" + " void f1();\n" + " inline int f2@() const;\n" + " void f3();\n" + " void f4();\n" "};\n" "\n" - "int Foo::number() const\n" + "int Foo::f2() const\n" "{\n" - " return 5;\n" - "}" - "\n\n"; + " return 1;\n" + "}\n" + "\n" + "\n" + "void Foo::f4() {}\n\n"; MoveFuncDefOutside factory; TestCase data(original, expected); |