diff options
Diffstat (limited to 'src/plugins/cppeditor/testcases/move-class/complex')
10 files changed, 159 insertions, 0 deletions
diff --git a/src/plugins/cppeditor/testcases/move-class/complex/complex.pro b/src/plugins/cppeditor/testcases/move-class/complex/complex.pro new file mode 100644 index 0000000000..efdac1a69a --- /dev/null +++ b/src/plugins/cppeditor/testcases/move-class/complex/complex.pro @@ -0,0 +1,2 @@ +HEADERS = theheader.h +SOURCES = thesource.cpp main.cpp diff --git a/src/plugins/cppeditor/testcases/move-class/complex/complex.pro_expected b/src/plugins/cppeditor/testcases/move-class/complex/complex.pro_expected new file mode 100644 index 0000000000..9a7a013363 --- /dev/null +++ b/src/plugins/cppeditor/testcases/move-class/complex/complex.pro_expected @@ -0,0 +1,4 @@ +HEADERS = theheader.h \ + theclass.h +SOURCES = thesource.cpp main.cpp \ + theclass.cpp diff --git a/src/plugins/cppeditor/testcases/move-class/complex/main.cpp b/src/plugins/cppeditor/testcases/move-class/complex/main.cpp new file mode 100644 index 0000000000..2934727d74 --- /dev/null +++ b/src/plugins/cppeditor/testcases/move-class/complex/main.cpp @@ -0,0 +1,11 @@ +#include "theheader.h" + +namespace Project { +namespace Internal { +bool TheClass::needsDefinition = true; +} +} + +int main() +{ +} diff --git a/src/plugins/cppeditor/testcases/move-class/complex/main.cpp_expected b/src/plugins/cppeditor/testcases/move-class/complex/main.cpp_expected new file mode 100644 index 0000000000..10bdcd280a --- /dev/null +++ b/src/plugins/cppeditor/testcases/move-class/complex/main.cpp_expected @@ -0,0 +1,11 @@ +#include "theheader.h" + +namespace Project { +namespace Internal { + +} +} + +int main() +{ +} diff --git a/src/plugins/cppeditor/testcases/move-class/complex/theclass.cpp_expected b/src/plugins/cppeditor/testcases/move-class/complex/theclass.cpp_expected new file mode 100644 index 0000000000..5cb8bbb375 --- /dev/null +++ b/src/plugins/cppeditor/testcases/move-class/complex/theclass.cpp_expected @@ -0,0 +1,20 @@ + +#include "theclass.h" + +namespace Project { +namespace Internal { + +bool TheClass::needsDefinition = true; + +class TheClass::Private +{ + void func(); + int m_member = 0; +}; + +void TheClass::defined() {} + +void TheClass::Private::func() {} + +} // namespace Internal +} // namespace Project diff --git a/src/plugins/cppeditor/testcases/move-class/complex/theclass.h_expected b/src/plugins/cppeditor/testcases/move-class/complex/theclass.h_expected new file mode 100644 index 0000000000..c7db776d27 --- /dev/null +++ b/src/plugins/cppeditor/testcases/move-class/complex/theclass.h_expected @@ -0,0 +1,29 @@ +#ifndef PROJECT_INTERNAL_THECLASS_H +#define PROJECT_INTERNAL_THECLASS_H + +namespace Project { +namespace Internal { + +class TheClass +{ +public: + TheClass() = default; + + void defined(); + void undefined(); + + template<typename T> T defaultValue() const; +private: + class Private; + class Undefined; + static inline bool doesNotNeedDefinition = true; + static bool needsDefinition; + int m_value = 0; +}; + +template<typename T> T TheClass::defaultValue() const { return T(); } + +} // namespace Internal +} // namespace Project + +#endif // PROJECT_INTERNAL_THECLASS_H diff --git a/src/plugins/cppeditor/testcases/move-class/complex/theheader.h b/src/plugins/cppeditor/testcases/move-class/complex/theheader.h new file mode 100644 index 0000000000..93f0d47a81 --- /dev/null +++ b/src/plugins/cppeditor/testcases/move-class/complex/theheader.h @@ -0,0 +1,30 @@ +#ifndef THE_HEADER_H +#define THE_HEADER_H + +namespace Project { +namespace Internal { + +class SomeClass {}; +class TheClass +{ +public: + TheClass() = default; + + void defined(); + void undefined(); + + template<typename T> T defaultValue() const; +private: + class Private; + class Undefined; + static inline bool doesNotNeedDefinition = true; + static bool needsDefinition; + int m_value = 0; +}; + +template<typename T> T TheClass::defaultValue() const { return T(); } + +} +} + +#endif diff --git a/src/plugins/cppeditor/testcases/move-class/complex/theheader.h_expected b/src/plugins/cppeditor/testcases/move-class/complex/theheader.h_expected new file mode 100644 index 0000000000..65bf2ec7f4 --- /dev/null +++ b/src/plugins/cppeditor/testcases/move-class/complex/theheader.h_expected @@ -0,0 +1,18 @@ +#ifndef THE_HEADER_H +#define THE_HEADER_H + +#include "theclass.h" + + +namespace Project { +namespace Internal { + +class SomeClass {}; + + + + +} +} + +#endif diff --git a/src/plugins/cppeditor/testcases/move-class/complex/thesource.cpp b/src/plugins/cppeditor/testcases/move-class/complex/thesource.cpp new file mode 100644 index 0000000000..645b6a4b13 --- /dev/null +++ b/src/plugins/cppeditor/testcases/move-class/complex/thesource.cpp @@ -0,0 +1,19 @@ +#include "theheader.h" + +namespace Project { +namespace Internal { + +static void someFunction() {} + +class TheClass::Private +{ + void func(); + int m_member = 0; +}; + +void TheClass::defined() {} + +void TheClass::Private::func() {} + +} +} diff --git a/src/plugins/cppeditor/testcases/move-class/complex/thesource.cpp_expected b/src/plugins/cppeditor/testcases/move-class/complex/thesource.cpp_expected new file mode 100644 index 0000000000..d84f180808 --- /dev/null +++ b/src/plugins/cppeditor/testcases/move-class/complex/thesource.cpp_expected @@ -0,0 +1,15 @@ +#include "theheader.h" + +namespace Project { +namespace Internal { + +static void someFunction() {} + + + + + + + +} +} |