diff options
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs')
109 files changed, 2022 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/1822.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/1822.cs new file mode 100644 index 00000000..a4269bd9 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/1822.cs @@ -0,0 +1,2 @@ + foreach (Cat c in * cats) + System.Console.WriteLine(c.Name); diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/615_nested-usings.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/615_nested-usings.cs new file mode 100644 index 00000000..14a31507 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/615_nested-usings.cs @@ -0,0 +1,9 @@ +using (var x = X()) +using (var y = Y()) +{ +} + +using (var x = X()) + using (var y = Y()) + { + } diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/620_getset-brace.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/620_getset-brace.cs new file mode 100644 index 00000000..f6ee6342 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/620_getset-brace.cs @@ -0,0 +1,7 @@ +class C
+{
+ float V {
+ get {
+ return _v; }
+ set { _v = value; } }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/621_this-spacing.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/621_this-spacing.cs new file mode 100644 index 00000000..bd28a5e8 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/621_this-spacing.cs @@ -0,0 +1,2 @@ +result = (Foo)this;
+result = (Foo)foo;
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/625_where-constraints.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/625_where-constraints.cs new file mode 100644 index 00000000..09274ab9 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/625_where-constraints.cs @@ -0,0 +1,36 @@ +interface D { } interface E { }
+
+class C<T1, T2, TX, T3, T4, T5>
+: IDisposable, IEnumerable<T1>
+ where T1 : class,D ,E ,new()
+ where T2 : IDictionary<D, Dictionary< string, float > >
+where TX : struct, IDisposable
+where T3: class
+ where T4: D where T5:E
+{
+ void F<T3, T4, T5, TX, T6>() where T3 : D, new()
+ where T4 : D
+ where T5: D
+ where TX : new()
+ where T6: D
+ {
+ }
+
+ class C2<T1, T2, TX, T3, T4, T5>
+: IDisposable, IEnumerable<T1>
+ where T1 : class,D ,E,new()
+ where T2 : IDictionary<D, Dictionary< string, float > >
+where TX : struct, IDisposable
+ where T3: class
+ where T4: D where T5:E
+ {
+ void F2<T3, T4, T5, TX, T6>()
+ where T3 : D, new()
+ where T4 : D
+ where T5: D
+ where TX : new()
+ where T6: D
+ {
+ }
+ }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/630_bad-new-init-semicolon-removal.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/630_bad-new-init-semicolon-removal.cs new file mode 100644 index 00000000..2e6d5a98 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/630_bad-new-init-semicolon-removal.cs @@ -0,0 +1,7 @@ +var dude = "Dude";
+var dude2 = new { Name = "Dude", Age = 30, };
+var dude3 = new { Name = "Dude", Age = 30, Kids = new { Name = "LittleDude" } };
+var dude4 = new { Name = "Dude", Age = 30, Kids = new[] { "LittleDude" } };
+var dude5 = new { Name = "Dude", Age = 30, Kids = new[] { new { Name = "LittleDude" } } };
+Action y = () => { };
+Func<int, float, bool> z = (a, b) => { var z = new { a, b }; return z == null; };
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/Issue_2705.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/Issue_2705.cs new file mode 100644 index 00000000..9a1b3172 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/Issue_2705.cs @@ -0,0 +1,16 @@ +//example file +public class A +{ +public void A(string a) +{ + if (a == null) + { + return; + } + + fixed(char* ptr = a) + { + a = a + a; + } +} +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-11095.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-11095.mm new file mode 100755 index 00000000..34ed4050 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-11095.mm @@ -0,0 +1,19 @@ +// Create oneliners + +extern "C" NSBundle* UnityGetMetalBundle() { + return _MetalBundle; +} +extern "C" MTLDeviceRef UnityGetMetalDevice() { return _MetalDevice; } +extern "C" MTLCommandQueueRef UnityGetMetalCommandQueue() { return ((UnityDisplaySurfaceMTL*)GetMainDisplaySurface())->commandQueue; } + +extern "C" EAGLContext* UnityGetDataContextEAGL() { + return _GlesContext; +} + +// Keep oneliners + +extern "C" NSBundle* UnityGetMetalBundle() { return _MetalBundle; } +extern "C" MTLDeviceRef UnityGetMetalDevice() { return _MetalDevice; } +extern "C" MTLCommandQueueRef UnityGetMetalCommandQueue() { return ((UnityDisplaySurfaceMTL*)GetMainDisplaySurface())->commandQueue; } + +extern "C" EAGLContext* UnityGetDataContextEAGL() { return _GlesContext; }
\ No newline at end of file diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-11662.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-11662.cs new file mode 100755 index 00000000..9a49fdba --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-11662.cs @@ -0,0 +1,10 @@ +namespace Unity +{ + public class Class + { + // doesn't work because ; gets removed but + public static readonly Class A = new Class() { name = "A", id = 1 }; + // works and ; doesn't get removed + public static readonly Class B = new Class { name = "B", id = 2 }; + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-11993.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-11993.cs new file mode 100644 index 00000000..6bc6529a --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-11993.cs @@ -0,0 +1,12 @@ +namespace Namespace
+{
+ public class Class
+ {
+ #if DEBUG
+ public statc foo()
+ {
+ }
+ #endif
+ }
+}
+
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-12303.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-12303.cs new file mode 100755 index 00000000..01be8291 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-12303.cs @@ -0,0 +1,4 @@ +//This gets a double indentation +devicePositions[device] = rect = new Rect( + Vector2.Lerp(rect.position, target.position, 0.1f), + Vector2.Lerp(rect.size, target.size, 0.1f)); diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1288.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1288.cs new file mode 100644 index 00000000..70554a02 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1288.cs @@ -0,0 +1,77 @@ +public class Class
+{
+ public Foo GetFoo()
+ {
+ return new Foo
+ {
+ enabled = false,
+ };
+ }
+
+ public override Bar GetBar()
+ {
+ return new Bar()
+ {
+ m_Name = TestPropertyName
+ };
+ return new
+ AA();
+ return new AA<Type>
+ {
+
+ };
+ }
+
+ //It appears uncrustify is adding double-indentation no matter what, to the initializer block.
+ // Both of the above examples start out at a different level of indentation, and both get double-indented past original.
+}
+
+// The following code consolidates examples from the topic.
+class ObjInitializers
+{
+ class Cat
+ {
+ // Auto-implemented properties.
+ public int Age { get; set; }
+ public string Name { get; set; }
+ }
+
+ static void Main()
+ {
+ Cat cat = new Cat { Age = 10, Name = "Fluffy" };
+
+ List<Cat> cats = new List<Cat>
+ {
+ new Cat(){ Name = "Sylvester", Age=8 },
+ new Cat(){ Name = "Whiskers", Age=2 },
+ new Cat(){ Name = "Sasha", Age=14 }
+ };
+
+ List<Cat> moreCats = new List<Cat>
+ {
+ new Cat(){ Name = "Furrytail", Age=5 },
+ new Cat(){ Name = "Peaches", Age=4 },
+ null
+ };
+
+ // Display results.
+ System.Console.WriteLine(cat.Name);
+
+ foreach (Cat c in cats)
+ System.Console.WriteLine(c.Name);
+
+ foreach (Cat c in moreCats)
+ if (c != null)
+ System.Console.WriteLine(c.Name);
+ else
+ System.Console.WriteLine("List element has null value.");
+ }
+ // Output:
+ //Fluffy
+ //Sylvester
+ //Whiskers
+ //Sasha
+ //Furrytail
+ //Peaches
+ //List element has null value.
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1333.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1333.mm new file mode 100644 index 00000000..5c91693c --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1333.mm @@ -0,0 +1,15 @@ +// Test if Uncrustify properly handles `@synchronized` keyword for ObjC
+
+// In keywords.cpp there is no @synchronized keyword listed and from what I've seen synchronized is only regarded as a keyword in other languages
+// { "synchronized", CT_QUALIFIER, LANG_D | LANG_JAVA | LANG_ECMA },
+
+- (void)foo
+{
+ @synchronized(self)
+ {
+ if (bar)
+ {
+ bar = false;
+ }
+ }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1338.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1338.cs new file mode 100644 index 00000000..d10b4893 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1338.cs @@ -0,0 +1,30 @@ +// *Single line functions*
+
+public class Class
+{
+ public string foo {get; set;}
+ public string foo { get; set; }
+
+ bool HasBar() {return m_HasBar != 0;}
+ bool HasBar() { return m_HasBar != 0; }
+
+ public Bar prop {get {return m_bar;} set {m_bar = value;}}
+ public Bar prop { get { return m_bar; } set { m_bar = value; } }
+
+// This seems to happen with no spaces on the interior. Opening brace doesn't get one, closing brace does.
+
+// 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..
+
+// *Initializers*
+
+// Not sure if this is what we want..
+
+ public void foo()
+ {
+ sas.Foo("bar", new Dictionary<string, object>(){ { "k1", "v1" }, { "k2", "v2" } });
+ // ... --> ...
+ sas.Foo("bar", new Dictionary<string, object>() { { "k3", "v3" }, { "k4", "v4" } });
+ }
+
+// Second line adds a space before the initializer {. Is that what we want for C#?
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1343.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1343.cs new file mode 100644 index 00000000..852fe640 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1343.cs @@ -0,0 +1,22 @@ +// Need to...
+
+// * Deal with the newline-after-opening and brace arrangement thing (eat_blanks_after_open_brace etc - see note in Uncrustify.Cpp.cfg)
+// * Terminate with //namespace if greater than x lines (like with #ifdef)
+
+namespace Unity
+{
+ public static void foo1()
+ {
+
+ }
+
+ public static void foo2()
+ {
+
+ }
+
+ public static void foo3()
+ {
+
+ }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1345.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1345.cs new file mode 100644 index 00000000..e218e6a2 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1345.cs @@ -0,0 +1,15 @@ +public class Class
+{
+ public void foo()
+ {
+ data.Sort(
+ delegate(InputData lhs, InputData rhs)
+ {
+ return lhs.m_Name.CompareTo(rhs.m_Name);
+ });
+ }
+}
+
+// Want the braces aligning with the delegate keyword.
+
+// Probably also an issue with lambda style delegates.
\ No newline at end of file diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-13955.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-13955.cs new file mode 100755 index 00000000..940aa89b --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-13955.cs @@ -0,0 +1,16 @@ +if (m_Preview.GetExpanded()) +{ + m_EventSearchString = EditorGUI.TextField(searchRect, m_EventSearchString, Styles.toolbarSearchField); + if (GUILayout.Button( + GUIContent.none, + m_EventSearchString == string.Empty ? Styles.toolbarSearchFieldCancelEmpty : Styles.toolbarSearchFieldCancel)) + { + } +} + +// The closing parenthesis is being indented twice. +bool success = GenerateSecondaryUVSet( + &mesh.vertices[0].x, mesh.vertices.size(), + &triUV[0].x, &triList[0], triSrcPoly.size() ? &triSrcPoly[0] : 0, triCount, + &outUV[0].x, param, errorBuffer, bufferSize +); diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-14131.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-14131.cs new file mode 100755 index 00000000..c8c3c918 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-14131.cs @@ -0,0 +1,16 @@ +using System.Collections.Generic; + +class C +{ + public void S() + { + Action localMethod = () => { + SomeClass.OtherMethod(new Dictionary<string, string> + { + {"a", "one"}, + {"b", "two"}, + {"c", "three"} + }); + }; + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-17253.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-17253.cs new file mode 100644 index 00000000..7342d82c --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-17253.cs @@ -0,0 +1,58 @@ +// Extra test cases for # 1257 +switch (sometext) +{ + case "a": + return 0; + case "b": + Console.WrieLine("hello world\n"); + return 0; + case "c": + { + Console.WrieLine("hello world\n"); + return 0; + } + case "d": + Console.WrieLine("hello world\n"); + + if (hello) + return 0; + else + return 1; + + case "e": + Console.WrieLine("hello world\n"); + + if (hello) + { + int a; + int b; + return 0; + } + + case "f": + { + return 0; + } + case "g": + + return 0; + + case "h": + for (i = 0; i < 10 i++) + { + a += i; + return 0; + } + case "i": + + if (hello) + { + int a; + int b; + return 0; + } + + return 1; + default: + return 0; +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-18437.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-18437.cs new file mode 100644 index 00000000..aab6c498 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-18437.cs @@ -0,0 +1,22 @@ +private static Type[] GetAllVisualElementTypes() +{ + return typeof(VisualElement).Assembly.GetTypes() + .Where(t => t != typeof(VisualElement) && + t != typeof(Panel) && + !t.IsAbstract && + !typeof(IMElement).IsAssignableFrom(t) && + !typeof(IMContainer).IsAssignableFrom(t) && + typeof(VisualElement).IsAssignableFrom(t)).ToArray(); +} + +// to this +private static Type[] GetAllVisualElementAssetTypes() +{ + return typeof(VisualElement).Assembly.GetTypes() + .Where(t => t != typeof(VisualElement) && + t != typeof(Panel) && + !t.IsAbstract && + !typeof(IMElement).IsAssignableFrom(t) && + !typeof(IMContainer).IsAssignableFrom(t) && + typeof(VisualElement).IsAssignableFrom(t)).ToArray(); +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-18777.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-18777.cs new file mode 100644 index 00000000..198d5be3 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-18777.cs @@ -0,0 +1,9 @@ +// I want to keeep the function call indented +Thingy + .Select(x => x > 2) + .ToList(); + +// it works with a var +var x = Thingy + .Select(x => x > 2) + .ToList(); diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-18780.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-18780.cs new file mode 100755 index 00000000..0eea713e --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-18780.cs @@ -0,0 +1,7 @@ +// note that this only happens with positive int literals. if i use a float with a decimal, or 'c' or "abc" or whatever, or even `(-5)`, it's ok. +5.Clamp(2, 10).ShouldBe(5); +5.Clamp(-5, 10).ShouldBe(5); +5.Clamp("a", 10).ShouldBe(5); + +"4".Clamp(2, 10).ShouldBe(5); +(-5).Clamp(2, 10).ShouldBe(5); diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-18829.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-18829.cs new file mode 100755 index 00000000..62c9f8fb --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-18829.cs @@ -0,0 +1,22 @@ +// It shouldn't detele the space after the tuple definition +public static (bool updated, Warnings warnings) UpdateIncludesInFile( + string fileToUpdate, string oldIncludeFile, string newIncludeFile) +{ + // ... +} + +// It shouldn't detele the space after the tuple definition +public static (int, string) UpdateIncludesInFile( + string fileToUpdate, string oldIncludeFile, string newIncludeFile) +{ + // ... +} + +// It shouldn't detele the space after the tuple definition and updated, warnings should be tokenized as types +public static (updated, warnings) UpdateIncludesInFile( + string fileToUpdate, string oldIncludeFile, string newIncludeFile) +{ + // ... +} + + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1919.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1919.cs new file mode 100644 index 00000000..956fd0f8 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1919.cs @@ -0,0 +1,17 @@ +// this
+
+Func(
+ "stuff",
+ foo =>
+ {
+ bar();
+ });
+
+// formats to this
+
+Func(
+ "stuff",
+ foo =>
+{
+ bar();
+});
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-19644.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-19644.cs new file mode 100644 index 00000000..da76bfbc --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-19644.cs @@ -0,0 +1,7 @@ +//It deletes the space after { +class Foo +{ + extern internal bool canAccess { [NativeMethod(Name = "CanAccessFromScript")] get; } + + extern public int subMeshCount { get; [NativeMethod(Name = "CanAccessFromScript")] set; } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1975.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1975.cs new file mode 100644 index 00000000..af678a93 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1975.cs @@ -0,0 +1,23 @@ +// typeof(Dictionary<, >)
+
+// is getting changed to
+
+// typeof(Dictionary<, >)
+
+// (space added after comma)
+
+// Definitely not typical for C#. Needs special handling.
+
+public class Class
+{
+ public void foo(Type type)
+ {
+ if (type == typeof(List<>))
+ {
+ }
+ else if (type == typeof(Dictionary<,>))
+ {
+ var bar = typeof(Dictionary<,>).Bar();
+ }
+ }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1977.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1977.cs new file mode 100644 index 00000000..e4b1b375 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1977.cs @@ -0,0 +1,18 @@ +// We specifically avoid our own tab-space in GenericFormat because of the @"" issue.
+// So we must rely on Uncrustify getting it right, and it nearly does - except for the
+// "Layout has changed, bail out now" where it does not replace the tab preceding the comment.
+
+namespace Namespace
+{
+ class Class
+ {
+ public void Foo()
+ {
+ if (bar)
+ {
+ // Layout has changed, bail out now.
+ bar = false;
+ }
+ }
+ }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1978.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1978.cs new file mode 100644 index 00000000..14cbdc7d --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-1978.cs @@ -0,0 +1,17 @@ +// `new[] {` on colors12345636 should have brace on following line
+
+namespace Namepsace
+{
+ internal static class Colors
+ {
+ static Color[] colors12345636 = new[] {
+ new Color(123/123f, 123/123f, 0/123f),
+ new Color(123/123f, 123/123f, 4/123f),
+ new Color(123/123f, 75/123f, 36/123f),
+ new Color(123/123f, 97/123f, 136/123f),
+ new Color(123/123f, 123/123f, 136/123f),
+ new Color( 13/123f, 123/123f, 136/123f),
+ new Color( 0/123f, 123/123f, 136/123f),
+ new Color(123/123f, 123/123f, 1/123f)};
+ }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-19895.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-19895.cs new file mode 100644 index 00000000..a22c6fa8 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-19895.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using UnityEngine; +using UnityEngine.Serialization; +namespace UnityEngine.Experimental.Input +{ + public class ActionMap : ScriptableObject, IControlDomainSource + { + public List<InputControl> BuildControlsList() + { + ControlSetup controlsSetup = new ControlSetup(); + for (int i = 0; i < actions.Count; i++) + { + var action = actions[i]; +// This line is kept with 71 spaces. + SupportedControl supportedControl = (SupportedControl)(typeof(SupportedControl) + .GetMethod("Get") + .MakeGenericMethod(actions[i].controlType) + .Invoke(null, new object[] { actions[i].name })); + action.controlIndex = controlsSetup.AddControl(supportedControl).index; + } + return controlsSetup.controls; + } + } +}
\ No newline at end of file diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2007.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2007.cs new file mode 100644 index 00000000..2e9f163a --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2007.cs @@ -0,0 +1,34 @@ +public class MyGenericClass<T> where T:IComparable { } + +class MyClass<T, U> + where T : class + where U : struct +{ } + +public class MyGenericClass<T> where T : IComparable, new() +{ + // The following line is not possible without new() constraint: + T item = new T(); +} + +interface IMyInterface +{ +} + +class Dictionary<TKey, TVal> + where TKey : IComparable, IEnumerable + where TVal : IMyInterface +{ + public void Add(TKey key, TVal val) + { + } +} + +class List<T> +{ + void Add<U>(List<U> items) where U: T { /*...*/ } + void Add<U>(List<U> items) where U : T { /*...*/ } +} + +extern T GetNodeFromGuid<T>(Guid guid) where T : INode; +extern T GetNodeFromGuid<T>(Guid guid) where T: INode; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2008.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2008.cs new file mode 100644 index 00000000..eeb649dd --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2008.cs @@ -0,0 +1,2 @@ +Utils.Curve attribute = (Utils.Curve)base.attribute;
+Utils.Curve attribute = (Utils.Curve) base.attribute;
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2020.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2020.cs new file mode 100644 index 00000000..37d9ef23 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2020.cs @@ -0,0 +1,45 @@ +// As discussed with unity updating the test case
+
+{
+ var a = @"asdasda";
+
+ var d =
+@"asdasda";
+
+ var d =
+ @"asdasda";
+
+ var b = @"
+line1
+line2";
+
+ var c = Very(Long(Nested(Function(
+@"line1
+line2"))));
+
+var c = Very(Long(Nested(Function(
+ @"line1
+line2"))));
+
+ var c = Function(
+ hey,
+ you,
+@"line1
+line2", fubar,
+ hmm);
+
+var c = Function(
+ hey,
+ you,
+ @"line1
+line2", fubar,
+ hmm);
+
+ var c = Function(
+ hey,
+ you,
+@"line1
+line2",
+ fubar,
+ hmm);
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2021.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2021.cs new file mode 100644 index 00000000..2b08fafe --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2021.cs @@ -0,0 +1,29 @@ +// updating the testcase for 1247
+// concluded that we need to convert all the 4,3,2 liners to one liner based on the option
+int fun ()
+{
+return 0;
+}
+
+int fun() {return 0; }
+
+int fun() {
+return 0;
+}
+
+int fun() {
+return 0; }
+
+int fun()
+{return 0; }
+
+int fun() { return 0;
+}
+
+int fun()
+{
+return 0; }
+
+int fun()
+{ return 0;
+}
\ No newline at end of file diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-21730.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-21730.cs new file mode 100644 index 00000000..6fcb8c16 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-21730.cs @@ -0,0 +1,5 @@ +private void Foo()
+{
+ Action<UnityPlayerBaseStartInfo, GraphicsTestRunConfiguration, Action<string, Bitmap, long>, RenderingBackend, DX11FeatureLevel? , string> playerRunnerImageCallback
+ = (playerStartInfo, description, incomingScreenshotCallback, configuration, dx11Featurelevel, graphicsDriverType) => incomingScreenshotCallback(filename, new Bitmap(1, 1), 42);
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2505.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2505.cs new file mode 100644 index 00000000..a17e6a5e --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2505.cs @@ -0,0 +1,2 @@ +public class Class : Base
+{}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2506.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2506.cs new file mode 100644 index 00000000..7bdbb81a --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2506.cs @@ -0,0 +1,12 @@ +public class Class
+{
+ public int property
+ {
+ get
+ {
+ return !IsModeActive(Mode.None)
+ && !IsModeActive(Mode.Foo)
+ && !IsModeActive(Mode.Bar);
+ }
+ }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2684.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2684.cs new file mode 100644 index 00000000..0c91b081 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2684.cs @@ -0,0 +1,4 @@ +EditorApplication.CallDelayed(() => { + foreach (CollabToolbarWindow window in Resources.FindObjectsOfTypeAll<CollabToolbarWindow>()) + window.Close(); +}, 1f);
\ No newline at end of file diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2685.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2685.cs new file mode 100644 index 00000000..4c11f20b --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-2685.cs @@ -0,0 +1,9 @@ +func(a, b, c, d, + (float a, int b, Foo bar) => + { + test(); + }); +(float a, int b, Foo bar) => + { + test(); + });
\ No newline at end of file diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-29933.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-29933.cs new file mode 100644 index 00000000..ed96bc87 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-29933.cs @@ -0,0 +1,27 @@ +void Foo1()
+{
+ switch (foo)
+ {
+ case 1:
+ _bar = new Bar(x, y,
+ z, a);
+ break;
+ case 2:
+ _bar = new Bar(x, y,
+ z, a);
+ break;
+ case 3:
+ _bar = foo.bar;
+ break;
+ case 4:
+ foo.bar = Bar.BarFunc(x, (x == y)
+ ? foo.x
+ : foo.y);
+ break;
+ case 5:
+ foo.bar = Bar.BarFunc(x, (x == y)
+ ? foo.x
+ : foo.y);
+ break;
+ }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-30498_2.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-30498_2.cs new file mode 100644 index 00000000..ba0d8515 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-30498_2.cs @@ -0,0 +1,39 @@ +class Foo
+{
+ public static IEnumerable<NPath> RuntimeIncludes { get; }
+ = new[]
+ {
+ new NPath("Projects/PrecompiledHeaders")
+ };
+
+ void Foo(string file)
+ {
+ var type = Path.GetFileNameWithoutExtension(file);
+ switch (Path.GetExtension(file))
+ {
+ case ".cs":
+ resource = new Bar(string.Format("test output",
+ type));
+ break;
+ case ".baz":
+ resource = new Baz(type,
+ string.Format(@"test output
+with multiple
+lines
+",
+ type));
+ break;
+ }
+ }
+}
+
+public class Bar
+{
+ private static FooBar Baz { get; }
+ = new FooBar()
+ .WithPath("foo/bar/baz")
+ .WithSource("qux/quux/quuz")
+ .WithPrebuiltReference(FooBar.Baz)
+ .WithBaz("2")
+ .Complete();
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-3083.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-3083.cs new file mode 100644 index 00000000..5209dc72 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-3083.cs @@ -0,0 +1,15 @@ +class ClassWithCtorICall +{ + public ClassWithCtorICall() + { + DoICall(); + } + + //It shouldn't add an extra space before 0x1000 + [MethodImpl((MethodImplOptions)0x1000)] + static extern void DoICall(); + + //It shouldn't add an extra space before 1000 + [MethodImpl((MethodImplOptions)1000)] + static extern void DoICall(); +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-32658.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-32658.cs new file mode 100644 index 00000000..145da65f --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-32658.cs @@ -0,0 +1,36 @@ +//TestCase-001
+internal struct MyStruct<T>
+ where T : struct, IPrepareFrameJob
+{
+}
+
+//TestCase-002
+class MyClass<T, U>
+ where T : class
+ where U : struct
+{
+}
+
+//TestCase-003
+interface IMyInterface
+{
+}
+
+class Dictionary<TKey, TVal>
+ where TKey : IComparable, IEnumerable
+ where TVal : IMyInterface
+{
+ public void Add(TKey key, TVal val) {}
+}
+
+long DeviceCommand<TCommand>(int deviceId, ref TCommand command)
+ where TCommand : struct, IInputDeviceCommandInfo;
+
+public virtual long OnDeviceCommand<TCommand>(ref TCommand command)
+ where TCommand : struct, IInputDeviceCommandInfo;
+
+long DeviceCommand<TCommand>(int deviceId, ref TCommand command)
+ where TCommand : struct, IInputDeviceCommandInfo
+
+public virtual long OnDeviceCommand<TCommand>(ref TCommand command)
+ where TCommand : struct, IInputDeviceCommandInfo
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-3484.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-3484.cs new file mode 100644 index 00000000..1235aa91 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-3484.cs @@ -0,0 +1,57 @@ +// various combos from unity
+
+contents.Append( "#include \"{file.GetBoundPath ()}\"" );
+contents.Append( $"#include \"{file.GetBoundPath ()}\"" );
+contents.Append( $"#include \"{file.GetBoundPath ("abc def")}\"" );
+
+contents.Append(
+ $"#include \"{file.GetBoundPath()}\"");
+
+contents.Append( $@"#include
+""{file.GetBoundPath($@"abc
+ def")}""" );
+
+contents.Append(
+ $@"#include
+""{file.GetBoundPath(@"abc
+ def ghi")}""" );
+
+contents. Append( @"#include
+""{file.GetBoundPath ()}""" );
+
+// fun with nesting
+
+$@"{$"\\\"abc{$@" \""def\"" {"{ghi}"} {jkl} {{mno}}"}\\\""
+}".Dump();
+
+$@"{$@"\""abc{$@" def {"{ghi}"}
+ {jkl} {{mno}}\"""}"
+}".Dump();
+
+// ensure we didn't break @for etc
+
+var @for = @base + @this - $@"{@while}" ;
+
+// from roslyn's InterpolationTests.cs
+
+Console.WriteLine($"{number}");
+
+Console.WriteLine($"{number}{number}");
+Console.WriteLine($"Jenny don\'t change your number { number :###-####} { number :###-####}.");
+Console.WriteLine($"jenny { ((Func<int>)(() => { return number; })).Invoke() :(408) ###-####}");
+Console.WriteLine( $"{hello}, { world }." );
+
+Console.WriteLine( $@"{
+ hello
+ },
+{
+ world }." );
+
+System.Console.Write($"{{ x }}");
+var s = $@"{$@""{1}""}";
+
+Console.WriteLine($"{ await hello }, { await world }!");
+
+Console.WriteLine($"X = { 123 , -(3+4) }.");
+
+var s1 = $"X = { 1 } ";
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-36862.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-36862.cs new file mode 100644 index 00000000..cb3cb448 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-36862.cs @@ -0,0 +1,10 @@ +public unsafe struct QueryKeyNameCommand : IInputDeviceCommandInfo
+{
+ public string ReadKeyName()
+ {
+ fixed(QueryKeyNameCommand* thisPtr = &this)
+ {
+ return StringHelpers.ReadStringFromBuffer(new IntPtr(thisPtr->nameBuffer), kMaxNameLength);
+ }
+ }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-37241.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-37241.cs new file mode 100644 index 00000000..b2097c4f --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-37241.cs @@ -0,0 +1,5 @@ +public double TotalPurchases { get; set; }
+protected IEnumerable<string> Defines { get; } =
+TargetPlatformRules.Elements
+ .Append("LINUX")
+ .Append("_RAKNET_LIB");
\ No newline at end of file diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-40685.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-40685.cs new file mode 100644 index 00000000..a2f37547 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-40685.cs @@ -0,0 +1,29 @@ +namespace Namespace
+{
+ public static class Class
+ {
+ public static void Foo()
+ {
+ Tests = Bar(
+ A,
+ cp =>
+ cp.Foo(new Bar
+ {
+ Identifier = "ID",
+ PathToEmbed = "VAL"
+ })
+ .WithPrebuiltReference(Moq),
+ Core);
+
+ var Test = FooBar(
+ B,
+ cp => cp.WithB(Bar).WithSource("Path/File.ext"),
+ new[] {
+ A,
+ B,
+ C
+ }
+ );
+ }
+ }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-58354.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-58354.cs new file mode 100644 index 00000000..6c77de40 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-58354.cs @@ -0,0 +1,4 @@ +public static class Extensions +{ + public static FluentXboxOneSdk VS2017(this FluentPlatform<XboxOnePlatform> _) => new FluentXboxOneSdk {MsvcVersion = new Version(15, 0)}; +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-9917.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-9917.cs new file mode 100755 index 00000000..5bd9dc64 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/UNI-9917.cs @@ -0,0 +1,45 @@ +// 1. Formatting the first produces the second. + +namespace Unity.IL2CPP.IntegrationTests.ILTests.Tests +{ + public class GlobalsWithBoxOptimizationAndBrTrueOpcodeTest : BoxTestsBase { public GlobalsWithBoxOptimizationAndBrTrueOpcodeTest() : base(OpCodes.Brtrue) { } } + public class GlobalsWithBoxOptimizationAndBrTrueSOpcodeTest : BoxTestsBase { public GlobalsWithBoxOptimizationAndBrTrueSOpcodeTest() : base(OpCodes.Brtrue_S) { } } + public class GlobalsWithBoxOptimizationAndBrFalseOpcodeTest : BoxTestsBase { public GlobalsWithBoxOptimizationAndBrFalseOpcodeTest() : base(OpCodes.Brfalse) { } } + public class GlobalsWithBoxOptimizationAndBrFalseSOpcodeTest : BoxTestsBase { public GlobalsWithBoxOptimizationAndBrFalseSOpcodeTest() : base(OpCodes.Brfalse_S) { } } +} + +// 2. And formatting this produces the third. + +namespace Unity.IL2CPP.IntegrationTests.ILTests.Tests +{ + public class GlobalsWithBoxOptimizationAndBrTrueOpcodeTest : BoxTestsBase { public GlobalsWithBoxOptimizationAndBrTrueOpcodeTest() : base(OpCodes.Brtrue) {} + } + public class GlobalsWithBoxOptimizationAndBrTrueSOpcodeTest : BoxTestsBase { public GlobalsWithBoxOptimizationAndBrTrueSOpcodeTest() : base(OpCodes.Brtrue_S) {} + } + public class GlobalsWithBoxOptimizationAndBrFalseOpcodeTest : BoxTestsBase { public GlobalsWithBoxOptimizationAndBrFalseOpcodeTest() : base(OpCodes.Brfalse) {} + } + public class GlobalsWithBoxOptimizationAndBrFalseSOpcodeTest : BoxTestsBase { public GlobalsWithBoxOptimizationAndBrFalseSOpcodeTest() : base(OpCodes.Brfalse_S) {} + } +} + +// 3. This doesn't changes when formatted. + +namespace Unity.IL2CPP.IntegrationTests.ILTests.Tests +{ + public class GlobalsWithBoxOptimizationAndBrTrueOpcodeTest : BoxTestsBase + { + public GlobalsWithBoxOptimizationAndBrTrueOpcodeTest() : base(OpCodes.Brtrue) { } + } + public class GlobalsWithBoxOptimizationAndBrTrueSOpcodeTest : BoxTestsBase + { + public GlobalsWithBoxOptimizationAndBrTrueSOpcodeTest() : base(OpCodes.Brtrue_S) { } + } + public class GlobalsWithBoxOptimizationAndBrFalseOpcodeTest : BoxTestsBase + { + public GlobalsWithBoxOptimizationAndBrFalseOpcodeTest() : base(OpCodes.Brfalse) { } + } + public class GlobalsWithBoxOptimizationAndBrFalseSOpcodeTest : BoxTestsBase + { + public GlobalsWithBoxOptimizationAndBrFalseSOpcodeTest() : base(OpCodes.Brfalse_S) { } + } +}
\ No newline at end of file diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/add-nl-before-namespace.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/add-nl-before-namespace.cs new file mode 100644 index 00000000..93a2cf04 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/add-nl-before-namespace.cs @@ -0,0 +1,10 @@ +using System; +namespace MyNamespace +{ +namespace MyNamespace2 +{ +class A +{ +} +} +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/argtypes.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/argtypes.mm new file mode 100644 index 00000000..fd2ff142 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/argtypes.mm @@ -0,0 +1,3 @@ +static void WriteArrayToDrag (NSArray* array, NSPasteboard* pboard, NSString* pboardType);
+static OSStatus FindProcess (const FSRef* appRef, ProcessSerialNumber *pPSN, NSString* application, bool permissiveSearching);
+NSString* MakeNSString(const std::string& string);
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/asm.h.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/asm.h.mm new file mode 100644 index 00000000..97c0edd3 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/asm.h.mm @@ -0,0 +1,21 @@ +static inline void atomic_retain(volatile int *p)
+{
+#if defined(_MSC_VER)
+ _InterlockedIncrement ((LONG volatile *) p);
+#else
+ __asm__ (
+ "lock incl %0\n\t"
+ : "+m" (*p)
+ :
+ : "cc", "memory"
+ );
+#endif
+}
+
+static inline void atomic_thread_fence (memory_order_release_t)
+{
+ __asm__ __volatile__
+ (
+ ASM_LWSYNC : : : "memory"
+ );
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_1591.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_1591.cs new file mode 100644 index 00000000..ac62df9e --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_1591.cs @@ -0,0 +1 @@ +byte[] utf8Str = new byte[] { 197, 170, 110, 196, 173, 099, 197, 141, 100, 101, 204, 189 }; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_1620.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_1620.cs new file mode 100644 index 00000000..0c9d4eb9 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_1620.cs @@ -0,0 +1,67 @@ +new WaveformStreamer(s_sweepedClip, 0, s_sweepedClip.length, 1,
+ (streamer, floats, remaining) =>
+ {
+ return false;
+ }
+ );
+
+using System.Collections.Generic;
+
+class C
+{
+ public void S()
+ {
+ Action localMethod = () => {
+ SomeClass.OtherMethod(new Dictionary<string, string>
+{
+ {"a", "one"},
+ {"b", "two"},
+ {"c", "three"}
+ });
+ };
+ m_Mixers.Add(
+ new WeightInfo
+ {
+ parentMixer = parent,
+ mixer = node,
+ port = port,
+ modulate = (type == typeof(AnimationLayerMixerPlayable))
+ }
+ );
+ }
+}
+
+MergeJSFiles(new string[] {
+ GetDecompressor(),
+ Paths.Combine(buildToolsDir, "UnityConfig"),
+ Paths.Combine(args.stagingAreaData, kOutputFileLoaderFileName),
+ }, unityLoader
+);
+
+public void GeneratesCorrectVisualStudioProjectFile()
+{
+ GenerateProjectsAndCompareWithTemplates(
+ runInJam: InJamCreateTestProject,
+ generatedPath: TestRoot.Combine("Solution"),
+ templatesPath: "Tools/Unity.BuildSystem/Unity.BuildSystem.VisualStudio.Tests/Templates",
+ templates: new[] {
+ "TestProjectGeneration_CApplication.sln",
+ "Projects/TestProjectGeneration_CApplication.vcxproj",
+ "Projects/TestProjectGeneration_CApplication.vcxproj.filters"
+ });
+}
+
+public void GeneratesCorrectVisualStudioProjectFile()
+{
+ GenerateProjectsAndCompareWithTemplates(
+ runInJam: InJamCreateTestProject,
+ generatedPath: TestRoot.Combine("Solution"),
+ templatesPath: "Tools/Unity.BuildSystem/Unity.BuildSystem.VisualStudio.Tests/Templates",
+ templates: new[]
+ {
+ "TestProjectGeneration_CApplication.sln",
+ "Projects/TestProjectGeneration_CApplication.vcxproj",
+ "Projects/TestProjectGeneration_CApplication.vcxproj.filters"
+ }
+ );
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_1637.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_1637.cs new file mode 100644 index 00000000..1f46d1bc --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_1637.cs @@ -0,0 +1,2 @@ +//Test Case-001
+inline double GetAudioBitrateForQuality(double f) { return (56000 + 200000 * (f)); }
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_1650.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_1650.cs new file mode 100644 index 00000000..5c52aece --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_1650.cs @@ -0,0 +1,46 @@ +public string Foo =>
+ "bar";
+public string Foo
+ => "bar";
+
+public static T WithAdditionalFlags<T>(this T _this, IEnumerable<string> flags) where T : ObjectFileLinker
+ => _this.WithLinkerSetting(l => l.Flags = l.Flags.Concat(flags));
+
+public static T WithAdditionalFlags<T>(this T _this, IEnumerable<string> flags) where T : ObjectFileLinker =>
+ _this.WithLinkerSetting(l => l.Flags = l.Flags.Concat(flags));
+
+ public static T WithAdditionalFlags<T>(this T _this, IEnumerable<string> flags) where T : ObjectFileLinker
+ => _this.WithLinkerSetting(
+ l => l.Flags =
+ l.Flags.Concat(flags));
+
+public static T WithAdditionalFlags<T>(this T _this, IEnumerable<string> flags) where T : ObjectFileLinker => _this.WithLinkerSetting(
+ l => l.Flags =
+ l.Flags.Concat(flags));
+
+public static T WithAdditionalFlags<T>(this T _this, IEnumerable<string> flags) where T : ObjectFileLinker
+ => _this.WithLinkerSetting(l =>
+ l.Flags = l.Flags.Concat(flags));
+
+public static T WithAdditionalFlags<T>(this T _this, IEnumerable<string> flags) where T : ObjectFileLinker =>
+ _this.WithLinkerSetting(l
+ => l.Flags = l.Flags.Concat(flags));
+
+var islands = EditorCompilationInterface.GetAllMonoIslands().Select(i => new Island
+{
+ MonoIsland = i,
+ Name = Path.GetFileNameWithoutExtension(i._output),
+ References = i._references.ToList()
+}).ToList();
+
+var projectEntries = islands.Select(i => string.Format(
+ DefaultSynchronizationSettings.SolutionProjectEntryTemplate,
+ SolutionGuid(i), _projectName, Path.GetFileName(ProjectFile(i)), ProjectGuid(i._output)
+ ));
+
+
+Func<IEnumerable<IMemberDefinition>, IEnumerable<IMemberDefinition>> filterMembersWithObsoleteAttr = members => members.Where(m =>
+ !m.IsRuntimeSpecialName
+ && !m.IsSpecialName
+ && !blackList.Contains(m.FullName)
+ && CheckCustomAttributes(m));
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_600.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_600.cs new file mode 100644 index 00000000..3d93d861 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_600.cs @@ -0,0 +1,14 @@ +Vector2 ? a; +Vector2 b; + +void G() +{ + int ? x = true ? null : (int ?)2; + var q = x == null ? y : z; + var q2 = x == q ? y : z; + var q3 = x == null ? (y = new Y()) : z; + var q4 = x == q ? (y = new Y()) : z; + + var q5 = x == null ? y = new Y() : z; + var q6 = x == q ? y = new Y() : z; +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_620.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_620.cs new file mode 100644 index 00000000..f6ee6342 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_620.cs @@ -0,0 +1,7 @@ +class C
+{
+ float V {
+ get {
+ return _v; }
+ set { _v = value; } }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_i_679.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_i_679.cs new file mode 100644 index 00000000..199ad7e6 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_i_679.cs @@ -0,0 +1,4 @@ +using (var x = X()) +using (var y = Y()) +{ +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_i_935.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_i_935.cs new file mode 100644 index 00000000..d2c8ec95 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/bug_i_935.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using Syst; +using System2; +using System; + +using b.ddd.A; +using b; +using b.ddd; +using b.fff; +using b.eee; +using b.a; +using b.A; + +void foo(); + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/casting.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/casting.mm new file mode 100644 index 00000000..c8022c7b --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/casting.mm @@ -0,0 +1 @@ +videoViewController.videoGravity = (NSString*)videoGravity;
\ No newline at end of file diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/cmt_backslash_eol.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/cmt_backslash_eol.cs new file mode 100644 index 00000000..e56aec25 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/cmt_backslash_eol.cs @@ -0,0 +1,4 @@ +foo(); +// test \ +blah(); +bar(); diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/definesalign.h.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/definesalign.h.mm new file mode 100644 index 00000000..a249d1aa --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/definesalign.h.mm @@ -0,0 +1,5 @@ + #define SOUNDMANAGERWATCHDOG()\
+ SoundManagerWatchDog watchdog
+
+ #define CompileTimeAssert(expression, message) \
+ enum{ CT_ASSERT_HACK_JOIN(ct_assert_, __LINE__) = sizeof(CompileTimeAssertImpl<(expression)>) }
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/delegate.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/delegate.cs new file mode 100644 index 00000000..3a4b103c --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/delegate.cs @@ -0,0 +1,29 @@ +void foo() +{ +obj.cb += () => { }; + +funcwithverylongname(() => +{ +func(); +}); +} + +Func( + "stuff", + foo => + { + bar(); + }); + +Func( + "stuff", + foo => +{ + bar(); +}); + +data.Sort( + delegate(InputData lhs, InputData rhs) +{ + return lhs.m_Name.CompareTo(rhs.m_Name); +}); diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/delete-space-oc.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/delete-space-oc.mm new file mode 100644 index 00000000..66e24dc8 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/delete-space-oc.mm @@ -0,0 +1,69 @@ +/* EditorApplication */
+
+#include <string>
+
+#ifdef __OBJC__
+#import <Cocoa/Cocoa.h>
+
+class HierarchyState;
+@interface EditorApplication : NSObject
+{
+ IBOutlet id m_MainWindow;
+ IBOutlet id m_PaneController;
+ id m_RenderTimer;
+
+ IBOutlet id m_CutItem;
+ IBOutlet id m_CopyItem;
+ IBOutlet id m_PasteItem;
+
+ IBOutlet id m_DuplicateItem;
+ IBOutlet id m_DeleteItem;
+
+ IBOutlet id m_FrameSelectedItem;
+ IBOutlet id m_FindItem;
+ IBOutlet id m_SelectAllItem;
+}
+
+- (IBAction)SaveAssets:(id)sender;
+- (IBAction)CloseScene:(id)sender;
+- (IBAction)NewProject:(id)sender;
+- (IBAction)OpenProject:(id)sender;
+
+- (IBAction)SaveAsSceneToDisk:(id)sender;
+
+- (IBAction)EnterSerialNumber:(id)sender;
+- (IBAction)ReturnLicense:(id)sender;
+- (IBAction)CompileScene:(id)sender;
+- (IBAction)CompileSceneAutomatic:(id)sender;
+
+- (IBAction)saveDocument:(id)sender;
+
+- (IBAction)LoadSceneFromDisk:(id)sender;
+
+- (void)RemoveDisplayTimer;
+- (void)RegisterUpdateTimer:(int)frequency;
+
+- (void)refreshModifiedFile:(NSAppleEventDescriptor*)event withReplyEvent:(NSAppleEventDescriptor*)replyEvent;
+- (void)closeFile:(NSAppleEventDescriptor*)event withReplyEvent:(NSAppleEventDescriptor*)replyEvent;
+
+- (IBAction)ShowAboutDialog:(id)sender;
+- (IBAction)ShowPreferences:(id)sender;
+- (IBAction)ShowPackageManager:(id)sender;
+
+- (IBAction) delete:(id)sender;
+- (IBAction) copy:(id)action;
+- (IBAction)paste:(id)action;
+- (IBAction)duplicate:(id)action;
+- (IBAction)cut:(id)action;
+- (IBAction)selectAll:(id)action;
+- (IBAction)find:(id)action;
+- (IBAction)frameSelected:(id)action;
+- (IBAction)frameSelectedWithLock:(id)action;
+
+// Assetstore protocol handler and registration
+- (void)registerAssetStoreURLProtocol;
+- (void)getUrl:(NSAppleEventDescriptor*)event withReplyEvent:(NSAppleEventDescriptor*)replyEvent;
+
+@end
+
+#endif
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/exception-filters.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/exception-filters.cs new file mode 100644 index 00000000..1e3abca3 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/exception-filters.cs @@ -0,0 +1,30 @@ +using System; +class Test +{ +void TestExceptionFilter() +{ +var when = new Object(); +try { + int i = 0; +} catch (Exception e) +{ + int j = -1; +} +try { + int i = 0; +} catch +{ + int j = -1; +} +try { + int i = 0; +} catch when (DateTime.Now.DayOfWeek == DayOfWeek.Saturday) +{ + int j = -1; +} +try { + int a = (int)when.foo(); +} catch (Exception e)when (DateTime.Now.DayOfWeek == DayOfWeek.Saturday) +{ + string b = ((int)when.prop).ToString(); +}}} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/fncall_as_ctor_in_attr.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/fncall_as_ctor_in_attr.cs new file mode 100644 index 00000000..cf52b46f --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/fncall_as_ctor_in_attr.cs @@ -0,0 +1,5 @@ +public class ClassName
+{
+ [Namespace.ClassName("Array")]
+ public int[] Array = { 10 };
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/func-param-wrap-oc.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/func-param-wrap-oc.mm new file mode 100644 index 00000000..16f98ce9 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/func-param-wrap-oc.mm @@ -0,0 +1,5 @@ + if(progress <= 0)
+ {
+ [[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(NSMinX(pieRect)+stroke,NSMinY(pieRect)+stroke,
+ NSWidth(pieRect)-2*stroke,NSHeight(pieRect)-2*stroke)] fill];
+ }
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/generics.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/generics.cs new file mode 100644 index 00000000..7bbe04c7 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/generics.cs @@ -0,0 +1,11 @@ + +int foo() +{ +a.b<c, d>(); +a.b<c, e<d>>(); +a.b < c, d > (); +a.b < c, e < d > > (); +a.b < c, e < d > > (); + +return default (T); +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/getset.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/getset.cs new file mode 100644 index 00000000..59aaa5bc --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/getset.cs @@ -0,0 +1,14 @@ +public bool Enabled +{ +get { return enabled; } +} + + +public bool Enabled +{ +get +{ +return enabled; +} +} + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/gs.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/gs.cs new file mode 100644 index 00000000..16adc604 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/gs.cs @@ -0,0 +1,30 @@ +private string s = ""; +public int Amount +{ +get +{ +; +} +set +{ +; +} +} +public EventHandler MyCustomEventHandler +{ +add +{ +; +} +remove +{ +; +} +} +public this[string index] +{ +get; +set; +} +private string s2 = ""; + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/ifcolalign.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/ifcolalign.cs new file mode 100644 index 00000000..d2e40c78 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/ifcolalign.cs @@ -0,0 +1,16 @@ +namespace Unity
+{
+internal class Class
+{
+ public void Foo()
+ {
+ if (data) go = new ClassA();
+ else go = new ClassB();
+
+ if (evt.alt) modifiers += "Alt+";
+ if (evt.command) modifiers += "Cmd+";
+ if (evt.control) modifiers += "Ctrl+";
+ if (evt.shift) modifiers += "Shift+";
+ }
+}
+}
\ No newline at end of file diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/ifcomment.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/ifcomment.cs new file mode 100644 index 00000000..6663a6ca --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/ifcomment.cs @@ -0,0 +1,57 @@ +#define RENDER_POINTS_USING_MESH + +namespace UnityEditor +{ + internal class CurveWrapper + { + private void DoIconAndName (Rect rect, AnimationWindowHierarchyNode node, bool selected, bool focused, float indent) + { + EditorGUIUtility.SetIconSize (new Vector2 (13, 13)); // If not set we see icons scaling down if text is being cropped + } + public void foo() + { + if (this) + { + if (b) + { + // Now draw + for (int i = 0; i < ticks.Length; i++) + { + ticksPos[i] /= axisUiScalars.y; + if (ticksPos[i] < vRangeMin || ticksPos[i] > vRangeMax) + continue; + + Vector2 pos = DrawingToViewTransformPoint(new Vector2(0, ticksPos[i])); + // Important to take floor of positions of GUI stuff to get pixel correct alignment of + // stuff drawn with both GUI and Handles/GL. Otherwise things are off by one pixel half the time. + pos = new Vector2(pos.x, Mathf.Floor(pos.y)); + + float uiValue = ticks[i]; + Rect labelRect; + if (settings.vTickStyle.centerLabel) + labelRect = new Rect(0, pos.y - 8, leftmargin - 4, 16); // text expands to the left starting from where grid starts (leftmargin size must ensure text is visible) + else + labelRect = new Rect(0, pos.y - 13, labelSize, 16); // text expands to the right starting from left side of window + + GUI.Label(labelRect, uiValue.ToString(format) + settings.vTickStyle.unit, ms_Styles.labelTickMarksY); + } + } + } + // Cleanup + GUI.color = tempCol; + + GUI.EndClip(); + } + } +} // namespace + +namespace UnityEditor +{ +internal class TreeView +{ + public System.Action<int[]> selectionChangedCallback { get; set; } // ids + public System.Action<int> itemDoubleClickedCallback { get; set; } // id + public System.Action<int[], bool> dragEndedCallback { get; set; } // dragged ids, if null then drag was not allowed, bool == true if dragging tree view items from own treeview, false if drag was started outside + public System.Action<int> contextClickItemCallback { get; set; } // clicked item id +} +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/indent-multistring-coulmn1.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/indent-multistring-coulmn1.cs new file mode 100644 index 00000000..56bdf473 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/indent-multistring-coulmn1.cs @@ -0,0 +1,16 @@ +//This +var a = hello( + @"world" +); + +//should stay the same. +//But this +var a = hello( + @"world +"); + +//should get formatted to this +var a = hello( +@"world +"); + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/inttypes.h.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/inttypes.h.mm new file mode 100644 index 00000000..6e093789 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/inttypes.h.mm @@ -0,0 +1,3 @@ +static int32_t level_and_name_to_system(SocketOptionLevel level, SocketOptionName name, int32_t *system_level, int32_t *system_name)
+
+WaitStatus SendTo (uint8_t address[ipv6AddressSize], uint32_t scope, uint16_t port, const uint8_t *data, int32_t count, os::SocketFlags flags, int32_t *len);
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/logger.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/logger.cs new file mode 100644 index 00000000..defede8a --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/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.72.0/tests/input/cs/mdarray_space.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/mdarray_space.cs new file mode 100644 index 00000000..e5338c11 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/mdarray_space.cs @@ -0,0 +1,2 @@ +int[,,] x;
+var y = new int[2,3];
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/misc-failures.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/misc-failures.cs new file mode 100644 index 00000000..857c06f9 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/misc-failures.cs @@ -0,0 +1,33 @@ +void Func() +{ + OtherFunc( +@"multi +line"); +} + +variablex = o.Func( + variabley); +variablex = o.Func2(a, b, + variabley); +o.Func( + variabley); +o.Func2(a, b, + variabley); + + + + AnimatorStateMachine rootStateMachine = syncedIndex == -1 + ? animatorController.layers[selectedLayerIndex].stateMachine + : animatorController.layers[syncedIndex].stateMachine; + + + m_ActiveStateMachine = AnimatorControllerTool.tool ? m_Type == TransitionType.eAnyState ? + AnimatorControllerTool.tool.stateMachineGraph.rootStateMachine : + AnimatorControllerTool.tool.stateMachineGraph.activeStateMachine : null; + + public GUIStyle[] inSlots = { + FindStyle("flow shader in 0"), FindStyle("flow shader in 1"), FindStyle("flow shader in 2"), FindStyle("flow shader in 3"), FindStyle("flow shader in 4"), FindStyle("flow shader in 5"), + }; + + + public GUIStyle[] inSlots = { 1, 2, 3 }; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/mod_full_brace_nl_block_rem_mlcond.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/mod_full_brace_nl_block_rem_mlcond.cs new file mode 100644 index 00000000..f8db4f0b --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/mod_full_brace_nl_block_rem_mlcond.cs @@ -0,0 +1,81 @@ +// mod_full_brace_nl_block_rem_mlcond should block brace removal here +if( a == true + && b == false ) +{ + return 1; +} +else if( a == true + && b == false) +{ + return 2; +} +// except here as there are no parenthesis +else +{ + return 3; +} + + +if( a == true; + b == true; + c == true) +{ + return 1; +} + +for( a = true; + a < 9; + a++) +{ + return 1; +} + +while( a == true + && b == true + && c == true) +{ + return 1; +} + +using (Foo bar = + new Foo()) +{ + return 1; +} + + + +// mod_full_brace_nl_block_rem_mlcond should not block brace removal here +if( a == true && b == false ) +{ + return 1; +} +else if( a == true && b == false) +{ + return 2; +} +else +{ + return 3; +} + + +if( a == true; b == true; c == true) +{ + return 1; +} + +for( a = true; a < 9; a++) +{ + return 1; +} + +while( a == true && b == true && c == true) +{ + return 1; +} + +using (Foo bar = new Foo()) +{ + return 1; +}
\ No newline at end of file diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/mod_full_paren_if_bool.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/mod_full_paren_if_bool.cs new file mode 100644 index 00000000..6bcd9201 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/mod_full_paren_if_bool.cs @@ -0,0 +1,5 @@ +List<int> list = new List<int>(); +if (list.All(i0 => i1 > 5 && i2 < 9)) +{ + return; +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/new-constraint-paren-space.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/new-constraint-paren-space.cs new file mode 100644 index 00000000..209f2721 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/new-constraint-paren-space.cs @@ -0,0 +1,5 @@ +// same as 10130-sp_between_new_paren.cs
+T F<T>() where T : new()
+{
+ return new T();
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/newlines.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/newlines.mm new file mode 100644 index 00000000..31a46376 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/newlines.mm @@ -0,0 +1,34 @@ +NSString* GetXcodePath()
+{
+ return [[NSWorkspace sharedWorkspace]absolutePathForAppBundleWithIdentifier:kXCodeBundleId];
+}
+
+
+extern "C" EXPORTDLL void LaunchXCode()
+{
+ NSString* curApp = GetXcodePath();
+ [[NSWorkspace sharedWorkspace] launchApplication:curApp];
+
+ NSArray *selectedApps =
+ [NSRunningApplication runningApplicationsWithBundleIdentifier:kXCodeBundleId];
+
+ for (int i = 0; i < [selectedApps count]; i++)
+ {
+ NSRunningApplication *app = [selectedApps objectAtIndex:i];
+ int count = 0;
+ NSLog(@"Checking %@\n", app);
+ while (![app isFinishedLaunching] && count++ < 300)
+ [[NSRunLoop currentRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 1.0f]];
+ }
+}
+
+
+NSString* MakeNSString (const std::string& string)
+{
+ return MakeNSString(string.c_str());
+}
+NSString* MakeNSString (const char* string)
+{
+ NSString* ret = string ? [NSString stringWithUTF8String:string] : nil;
+ return ret ? ret : @"";
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/nullable_prop.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/nullable_prop.cs new file mode 100644 index 00000000..21c4f7b0 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/nullable_prop.cs @@ -0,0 +1,18 @@ + +namespace Foo +{ + +public class Bar +{ +public int? Val; + +public int? Prop +{ + get + { + return 1; + } +} +} +} + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/objc.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/objc.mm new file mode 100644 index 00000000..7f0e706a --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/objc.mm @@ -0,0 +1,8 @@ +void foo()
+{
+ if(key)
+ ret.key = [NSString stringWithCharacters:&key length:1];
+
+ [gUndoMenu->m_UndoItem setTitle:[NSString stringWithFormat:[NSString stringWithUTF8String:localizedUndo], undoName.c_str()]];
+ [gUndoMenu->m_RedoItem setTitle:[NSString stringWithFormat:[NSString stringWithUTF8String:localizedRedo], redoName.c_str()]];
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/oneline_property.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/oneline_property.cs new file mode 100644 index 00000000..1d7a2c26 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/oneline_property.cs @@ -0,0 +1,9 @@ +public class Class +{ + public float prop { get; set; } + public float prop { get { return m; } } + public float prop { set { m = value; } } + public float prop { get { return m; } set { m = value; } } + internal int prop { get { return m; } } +}; +public class Container { public int prop { get; set; } }; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/operator-null-conditional.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/operator-null-conditional.cs new file mode 100644 index 00000000..530bdd27 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/operator-null-conditional.cs @@ -0,0 +1,13 @@ +public class test +{ +public static void TestOfNullConditionalOperator() +{ +string s="Test"; +if (s?.Length > 0) +{ +s="Test"; +} +if (System.Reflection.Assembly.GetEntryAssembly()?.GetName() != null) +{ +s="Test"; +}}} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/operator_null-coalescing-assignment.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/operator_null-coalescing-assignment.cs new file mode 100644 index 00000000..416e6afc --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/operator_null-coalescing-assignment.cs @@ -0,0 +1,8 @@ +public class Program
+{
+public static void Main()
+{
+ var thing = new int?();
+ thing ??= new int?();
+}
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/pp-ignore.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/pp-ignore.mm new file mode 100644 index 00000000..2673008c --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/pp-ignore.mm @@ -0,0 +1,29 @@ +#define a z \
+ x
+
+#define a(b) z \
+ x
+
+#define ab(b) z \
+ x
+
+#define abc(b) z \
+ x
+
+#define abcd(b) z \
+ x
+
+
+#if FOO
+# define D(a, ...) B(FOO(a, __LINE__, __VA_ARGS__))
+# define C(msg) \
+ PP_WRAP_CODE( \
+ if (!msg) \
+ { \
+ BAR(); \
+ BARBAR(); \
+ BARBARBAR();\
+ })
+#else
+# define C(msg, ...) EMPTY
+#endif
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/preserveTabs.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/preserveTabs.cs new file mode 100644 index 00000000..c9583dcd --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/preserveTabs.cs @@ -0,0 +1,3 @@ +/// <summary> +/// Event handler. +/// </summary> diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/property.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/property.cs new file mode 100644 index 00000000..85e08bae --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/property.cs @@ -0,0 +1,3 @@ +#define X 1 // comment to check tokenizing of URL +#property URL "http://www.google.com" +#define Y 2 // comment diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/region.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/region.cs new file mode 100644 index 00000000..4f8667f2 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/region.cs @@ -0,0 +1,20 @@ +class X : Y { + int foo1; + #region something + int foo2 = 2; + #endregion + int foo() + { + + #region something else + int foo3 = 3; + #region nested + int foo4 = 0; + #endregion + int foo5 = 0; + #endregion + } + +} + + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/remove_semi.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/remove_semi.cs new file mode 100644 index 00000000..2e6d5a98 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/remove_semi.cs @@ -0,0 +1,7 @@ +var dude = "Dude";
+var dude2 = new { Name = "Dude", Age = 30, };
+var dude3 = new { Name = "Dude", Age = 30, Kids = new { Name = "LittleDude" } };
+var dude4 = new { Name = "Dude", Age = 30, Kids = new[] { "LittleDude" } };
+var dude5 = new { Name = "Dude", Age = 30, Kids = new[] { new { Name = "LittleDude" } } };
+Action y = () => { };
+Func<int, float, bool> z = (a, b) => { var z = new { a, b }; return z == null; };
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/sf607.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/sf607.cs new file mode 100644 index 00000000..f0617c19 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/sf607.cs @@ -0,0 +1,4 @@ +int P {
+ get {
+ }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/sf628.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/sf628.cs new file mode 100644 index 00000000..803c9962 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/sf628.cs @@ -0,0 +1,11 @@ +void foo()
+{
+obj.cb += () => { };
+func();
+obj.cb += (p0) => { };
+func();
+obj.cb += (p0, p1) => { };
+func();
+Action a = delegate { };
+func();
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/simple.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/simple.cs new file mode 100644 index 00000000..30acd134 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/simple.cs @@ -0,0 +1,114 @@ +class X : Y { +bool Method (int argument_1, int argument_2) +{ + #region something + int foo = 0; + #endregion + +if (argument_1 == argument_2) +throw new Exception (Locale.GetText ("They are equal!")); + +if (argument_1 < argument_2) { +if (argument_1 * 3 > 4) +return true; +else +return false; +} + +// +// This sample helps keep your sanity while using 8-spaces for tabs +// +VeryLongIdentifierWhichTakesManyArguments ( +Argument1, +Argument2, Argument3, +NestedCallHere ( +MoreNested)); +} + +bool MyProperty { +get { return x; } + +set { x = value; } +} + +void AnotherMethod () +{ + Logger log = new Logger(); + log.foo.bar = 5; + log.narf.sweat = "cat"; + +if ((a + 5) != 4) { +} + +while (blah) { +if (a) +continue; +b++; +} +} +} + +object lockA; +object lockB; + +void Foo () { + lock (lockA) { + lock (lockB) { + } + } +} + +void Bar () { + lock (lockB) { + lock (lockA) { + } + } +} + + +// class library +class Blah { + Hashtable ht; + void Foo (int zzz, Entry blah) { + lock (ht) { + ht.Add (zzz, blah); + } + } + + void Bar () + { + lock (ht) { + foreach (Entry e in ht) + EachBar (e); + } + } + + virtual void EachBar (Entry e) + { + } +} + +// User +class MyBlah { + byte[] box = new byte[6]; + + box[2] = 56; + + void DoStuff () + { + lock (this) { + int i = GetNumber (); + Entry e = GetEntry (); + + Foo (i, e); + } + } + + override void EachBar (Entry e) + { + lock (this) { + DoSomething (e); + } + } +} + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/sort_using.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/sort_using.cs new file mode 100644 index 00000000..881b4d5b --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/sort_using.cs @@ -0,0 +1,18 @@ +// should be ddd, eee, fff +using b.ddd; +using b.fff; +using b.eee; + +// should be aaa, ccc +using ccc; +using aaa; +// should be just bbb +using bbb; + +// should not change these, as it can't handle multi-line imports +using mango.ccc; +using mango.bbb, + mango.aaa; + +void foo(); + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/sort_using_categ.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/sort_using_categ.cs new file mode 100644 index 00000000..173e42bb --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/sort_using_categ.cs @@ -0,0 +1,12 @@ +using Client.Common; +using LeopotamGroup.Common; +using LeopotamGroup.Serialization; +using System; +using UnityEngine.EventSystems; +using UnityEngine.Events; +using UnityEngine; + +using NameSpace; +using NameSpacEveryday; +using nameSpace; +using Namespace; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/sp_between_new_paren.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/sp_between_new_paren.cs new file mode 100644 index 00000000..f5d8381d --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/sp_between_new_paren.cs @@ -0,0 +1,4 @@ +T F<T>() where T : new ()
+{
+ return new T();
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/squeeze-paren-close-Option.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/squeeze-paren-close-Option.cs new file mode 100644 index 00000000..37203f4a --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/squeeze-paren-close-Option.cs @@ -0,0 +1,34 @@ +bool success(GenerateSecondaryUVSet(test(
+ &mesh.vertices[0].x, mesh.vertices.size(),
+ &triUV[0].x, &triList[0], triSrcPoly.size() ? &triSrcPoly[0] : 0, triCount,
+ &outUV[0].x, param, errorBuffer, bufferSize
+ )
+));
+
+int m = aaaaaaaaaaabaaaaaaaaaa(caaaaaaaaaa(
+ eaaaaaaaaaa(gaaaaaaaaaaa(haaaaaaaaaaaaa(
+ iaaaaaaaaaaaaaaaaaaaaaa(kaaaaaaaaaaaaaaaaaaaa)
+ )
+ )
+ )
+ )
+);
+
+int m = aaaaaaaaaaabaaaaaaaaaa(caaaaaaaaaa(
+ eaaaaaaaaaa(gaaaaaaaaaaa(haaaaaaaaaaaaa(
+ iaaaaaaaaaaaaaaaaaaaaaa(kaaaaaaaaaaaaaaaaaaaa)
+ ))
+ ))
+);
+
+int m = aaaaaaaaaaabaaaaaaaaaa(
+ caaaaaaaaaa(
+ eaaaaaaaaaa(
+ gaaaaaaaaaaa(
+ haaaaaaaaaaaaa(
+ iaaaaaaaaaaaaaaaaaaaaaa(kaaaaaaaaaaaaaaaaaaaa)
+ )
+ )
+ )
+ )
+);
\ No newline at end of file diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/string_multi.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/string_multi.cs new file mode 100644 index 00000000..9e715e51 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/string_multi.cs @@ -0,0 +1,13 @@ +public class C +{ + public void F() + { + var x = @" +abc"; + var y = @" +abc" + "def"; + var z = "" + +@" +"; + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/strings.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/strings.cs new file mode 100644 index 00000000..6794e762 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/strings.cs @@ -0,0 +1,8 @@ +void foo() +{ + string s1 = L"C:\\foo\\bar"; + string s2 = S"C:\\foo\\bar"; + string s3 = "This is a \"test\""; + string s4 = "C:\\"; +} + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/tcf.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/tcf.cs new file mode 100644 index 00000000..f3ac3664 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/tcf.cs @@ -0,0 +1,32 @@ +void foo() +{ +try +{ +; +} +catch (Exception e) +{ +; +} +finally { +; +} +bar(); + +try +{ +; +} +catch (Exception e) +{ +; +} +catch (Exception e) +{ +; +} +finally { +; +} +bar(); +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/unsafe.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/unsafe.cs new file mode 100644 index 00000000..5dc90cb4 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/unsafe.cs @@ -0,0 +1,7 @@ +public class Class1 +{ + public unsafe bool GetValue () + { + return true; + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/utf16be.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/utf16be.cs Binary files differnew file mode 100644 index 00000000..13da3090 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/utf16be.cs diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/utf16be_no_bom.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/utf16be_no_bom.cs Binary files differnew file mode 100644 index 00000000..33587b97 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/utf16be_no_bom.cs diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/utf16le.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/utf16le.cs Binary files differnew file mode 100644 index 00000000..3f16b9d0 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/utf16le.cs diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/utf16le_no_bom.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/utf16le_no_bom.cs Binary files differnew file mode 100644 index 00000000..4a7f9ccc --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/utf16le_no_bom.cs diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/var-member.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/var-member.cs new file mode 100644 index 00000000..0f7ffb23 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/var-member.cs @@ -0,0 +1,24 @@ +namespace Foo.Man.Chu +{ + /// <summary> + /// Summary description for MainForm. + /// </summary> + public class MainForm : System.Windows.Forms.Form + { + #region Initialize the private properties + private System.Windows.Forms.MenuItem File; + private System.Windows.Forms.MenuItem Exit; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private Properties Prop; + private About Abt; + public MainForm mainform; + private System.Windows.Forms.MenuItem menuItem1; + private System.Windows.Forms.Timer timer1; + private System.ComponentModel.IContainer components; + protected string strTitle; + #endregion + + } +} + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/verbatim_strings.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/verbatim_strings.cs new file mode 100644 index 00000000..47c3ed4c --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/verbatim_strings.cs @@ -0,0 +1,7 @@ +class Class +{ + public string s1 = " Foo"; + public string s2 = @" + Foo +"; +}; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/when.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/when.cs new file mode 100644 index 00000000..2785b894 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.72.0/tests/input/cs/when.cs @@ -0,0 +1,17 @@ +private static string GenerateHash()
+{
+ try {
+ int i = 0;
+ } catch when (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
+ {
+ int j = -1;
+ }
+ try {
+ int i = 0;
+ } catch (Exception e) when (DateTime.Now.DayOfWeek == DayOfWeek.Saturday)
+ {
+ var when = DateTime.Now;
+ ulong kind = (ulong)(int)when.Kind;
+ return ((kind << 62) | (ulong)when.Ticks).ToString();
+ }
+}
|