diff options
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input')
11 files changed, 215 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/I-3310.c b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/I-3310.c new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/I-3310.c diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/I-842.cpp b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/I-842.cpp new file mode 100644 index 00000000..7f7bcaf3 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/I-842.cpp @@ -0,0 +1,9 @@ +namespace Namespace +{ + // class Class { + public void foo() + { + + } + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/backup.h-save b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/backup.h-save new file mode 100644 index 00000000..9a66578c --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/backup.h-save @@ -0,0 +1,4 @@ +int main() +{ + a=b+c; +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/class_enum_struct_union.cpp b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/class_enum_struct_union.cpp new file mode 100644 index 00000000..6a72c823 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/class_enum_struct_union.cpp @@ -0,0 +1,134 @@ + /** + * the enum (and variable declarations thereof) could be of + * the following forms: + * + * "enum type [: integral_type] { ... } [x, ...]" + * "enum type [: integral_type]" + * "enum class type [: integral_type] { ... } [x, ...]" + * "enum class type [: integral_type]" + * "enum [: integral_type] { ... } x, ..." + */ + + /** + * the class/struct (and variable declarations thereof) could be of + * the following forms: + * + * template<...> class/struct[<...>] [macros/attributes ...] type [: bases ...] { } + * template<...> class/struct[<...>] [macros/attributes ...] type + * class/struct[ [macros/attributes ...] type [: bases ...] { } [x, ...] + * class/struct [macros/attributes ...] type [x, ...] + * class/struct [macros/attributes ...] [: bases] { } x, ... + */ + +#define ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment))) + +#if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__)) +#define API_EXPORT __attribute__ ((visibility("default"))) +#elif defined _WIN32 +#define API_EXPORT __declspec(dllexport) +#else +#define API_EXPORT +#endif + +namespace outer_namespace +{ + +namespace inner_namespace +{ + +class Base1 { }; + +template<typename> class Base2 { }; + +} + +} + +// template<...> class/struct[<...>] [macros/attributes ...] type : bases ... { } +template<typename, typename ...> +class API_EXPORT __attribute__((__deprecated__)) ALIGNAS(4) c1 +: public outer_namespace::inner_namespace::Base1, + public outer_namespace::inner_namespace::Base2<outer_namespace::inner_namespace::Base1> +{ + +}; + +// template<...> class/struct[<...>] [macros/attributes ...] type { } +template<typename, typename ...> +class API_EXPORT c2 +{ +public: + + template<typename T> + struct inner_class + { + static inner_class<T> *m_inner_class; + }; +}; + +template<> template<> struct API_EXPORT c2<int>::inner_class<int> *c2<int>::inner_class<int>::m_inner_class = nullptr; + +// template<...> class/struct[<...>] [macros/attributes ...] type +template<typename, typename ...> +class API_EXPORT c2; + +// class/struct [macros/attributes ...] type : bases ... { } x, ... +class API_EXPORT __attribute__((__deprecated__)) ALIGNAS(4) c3 +: public outer_namespace::inner_namespace::Base2<int>, + public c2<int>::inner_class<int> +{ +public: + c3(int x = 0, int y = 0, int z = 0) : m_x(x), m_y(y), m_z(z) { } + + int m_x; + int m_y; + int m_z; +} c31, *c32 = nullptr, *c33[] = { nullptr, nullptr }, c34{ 0, 1, 2}, * const c35(nullptr), c16(0, 1, 2); + +// class/struct [macros/attributes ...] type x, ... +class __attribute__((__deprecated__)) API_EXPORT ALIGNAS(4) c3 c41, *c42 = c32 ? c32 : nullptr, *c43[] = { nullptr, nullptr }, c44{ 0, 1, 2}, * const c45(nullptr), c46(0, 1, 2); + +// class/struct [macros/attributes ...] type : bases ... { } x, ... +class ALIGNAS(4) API_EXPORT __attribute__((__deprecated__)) +: public outer_namespace::inner_namespace::Base1 +{ +public: + int m_x; + int m_y; + int m_z; +} c51, *c52 = nullptr, *c53[] = { nullptr, nullptr }; + + +// enum type : integral_type { ... } x, ... +enum e1 : long long { a1, b1, d1 } e11, e12, e13; + +// enum type : integral_type { ... } +enum e2 : unsigned int { a2, b2, d2 }; + +// enum type : integral_type +enum e3 : short; + +// enum type x, ... +enum e3 e31, e32; + +// enum class type : integral_type { ... } x, ... +enum class e4 : long long { a4, b4, d4 } e41, e42, e43, e44; + +// enum class type : integral_type { ... } +enum class e5 : unsigned int { a5, b5, d5 }; + +// enum class type : integral_type +enum class e6 : short; + +// enum class type +enum class e7; + +// enum : integral_type { ... } x, ... +enum : long long { a8, b8, c8 } e81, e82; + +// enum { ... } x, ... +enum { a9, b9, c9 } e91, e92; + +union API_EXPORT u1 { int x; long y; } u11, *u12 = nullptr, *u13{0}; + +union API_EXPORT u1 u21; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/logger.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/logger.cs new file mode 100644 index 00000000..defede8a --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/logger.cs @@ -0,0 +1,4 @@ +// Turning on sp_inside_braces=add fixes it, but also changes a lot of initializer code we don't want to touch (like x = {1}). May need special support, or perhaps there's a bug..
+// long comment line(s), such as here, might be too long to produce a correct LOG-file such as
+// with the use of option -L A
+// in such a case, the output of the log will be cut.
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/replace.list b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/replace.list new file mode 100644 index 00000000..009e6f33 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/replace.list @@ -0,0 +1,2 @@ +input/I-3310.c +input/backup.h diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/testSrc.cpp b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/testSrc.cpp new file mode 100644 index 00000000..1a22f6d9 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/testSrc.cpp @@ -0,0 +1,16 @@ +struct TelegramIndex +{ +TelegramIndex(const char* pN, unsigned long nI) : +pTelName(pN), +nTelIndex(n) +{ +} + +~TelegramIndex() +{ +} + +const char* const pTelName; +unsigned long nTelIndex; +}; + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/testSrcP.cpp b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/testSrcP.cpp new file mode 100644 index 00000000..85e36674 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/testSrcP.cpp @@ -0,0 +1,19 @@ +#define x s23_foo += \ +s8_foo * s16_bar; + +struct TelegramIndex +{ +TelegramIndex(const char* pN, unsigned long nI) : +pTelName(pN), +nTelIndex(n) +{ +} + +~TelegramIndex() +{ +} + +const char* const pTelName; +unsigned long nTelIndex; +}; + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/tracking_space.cpp b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/tracking_space.cpp new file mode 100644 index 00000000..5b0b8aa1 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/tracking_space.cpp @@ -0,0 +1,11 @@ +{ + a = b + 111-55; +} +template<typename...A, int...B> +struct foo1:foo1<A..., (sizeof...(A)+B)...> +{ + foo1() { + int x = sizeof...(A); + bool b = x > 1; + } +}; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/truncate.cpp b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/truncate.cpp new file mode 100644 index 00000000..7ef9530d --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/truncate.cpp @@ -0,0 +1,4 @@ +// 1 6789A123456789B123456789c123456789d123456789 123456789 123456789 123 +// 2 6789A123456789B123456789c123456789 +// 3 6789A123456789B123456789c12345678 +// 4 6789A123456789B123456789c1234567 diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/unmatched_close_pp.cpp b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/unmatched_close_pp.cpp new file mode 100644 index 00000000..b79d12fd --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/cli/input/unmatched_close_pp.cpp @@ -0,0 +1,12 @@ +#ifndef _Include_H +#define _Include_H +namespace Namespace +{ + // class Class { + public void foo() + { + + } + } +} +#endif |