diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2021-11-21 17:04:21 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2021-11-21 17:09:35 +0900 |
commit | e6ba08c3b21cdb14ee3a97b5d584759a4597b54b (patch) | |
tree | e8b4121323f2f448aeaa15bf3bddb465f36aea8b /debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs | |
parent | f312c235ea5f9971066f3808997d20f89c25f33b (diff) | |
download | extra-dependencies-e6ba08c3b21cdb14ee3a97b5d584759a4597b54b.tar.gz extra-dependencies-e6ba08c3b21cdb14ee3a97b5d584759a4597b54b.zip |
uncrustify-trinity: updated based on upstream version 0.74.0
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs')
120 files changed, 2373 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10000-simple.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10000-simple.cs new file mode 100644 index 00000000..36cedfa2 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10000-simple.cs @@ -0,0 +1,118 @@ +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.74.0/tests/expected/cs/10001-getset.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10001-getset.cs new file mode 100644 index 00000000..756170b6 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10001-getset.cs @@ -0,0 +1,17 @@ +public bool Enabled +{ + get + { + return enabled; + } +} + + +public bool Enabled +{ + get + { + return enabled; + } +} + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10002-simple.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10002-simple.cs new file mode 100644 index 00000000..f8344b26 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10002-simple.cs @@ -0,0 +1,131 @@ +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.74.0/tests/expected/cs/10003-region.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10003-region.cs new file mode 100644 index 00000000..2ada63e7 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10003-region.cs @@ -0,0 +1,18 @@ +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.74.0/tests/expected/cs/10010-var-member.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10010-var-member.cs new file mode 100644 index 00000000..0da0b9f5 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10010-var-member.cs @@ -0,0 +1,23 @@ +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.74.0/tests/expected/cs/10011-strings.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10011-strings.cs new file mode 100644 index 00000000..6794e762 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10011-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.74.0/tests/expected/cs/10012-621_this-spacing.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10012-621_this-spacing.cs new file mode 100644 index 00000000..bd28a5e8 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10012-621_this-spacing.cs @@ -0,0 +1,2 @@ +result = (Foo)this;
+result = (Foo)foo;
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10013-625_where-constraints.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10013-625_where-constraints.cs new file mode 100644 index 00000000..123109b0 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10013-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.74.0/tests/expected/cs/10014-630_bad-new-init-semicolon-removal.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10014-630_bad-new-init-semicolon-removal.cs new file mode 100644 index 00000000..2e6d5a98 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10014-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.74.0/tests/expected/cs/10015-misc-failures.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10015-misc-failures.cs new file mode 100644 index 00000000..e7022083 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10015-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.74.0/tests/expected/cs/10016-new-constraint-paren-space.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10016-new-constraint-paren-space.cs new file mode 100644 index 00000000..a337a447 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10016-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.74.0/tests/expected/cs/10018-delete-space-oc.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10018-delete-space-oc.mm new file mode 100644 index 00000000..59496772 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10018-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.74.0/tests/expected/cs/10019-func-param-wrap-oc.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10019-func-param-wrap-oc.mm new file mode 100644 index 00000000..6e192eec --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10019-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.74.0/tests/expected/cs/10020-region.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10020-region.cs new file mode 100644 index 00000000..b2f57ece --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10020-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.74.0/tests/expected/cs/10021-region.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10021-region.cs new file mode 100644 index 00000000..926e467d --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10021-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.74.0/tests/expected/cs/10022-region.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10022-region.cs new file mode 100644 index 00000000..9628d4fd --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10022-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.74.0/tests/expected/cs/10023-region.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10023-region.cs new file mode 100644 index 00000000..e21c467c --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10023-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.74.0/tests/expected/cs/10027-oneline_property.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10027-oneline_property.cs new file mode 100644 index 00000000..e4470be2 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10027-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.74.0/tests/expected/cs/10028-ifcolalign.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10028-ifcolalign.cs new file mode 100644 index 00000000..13df0440 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10028-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+";
+ }
+ }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10029-when.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10029-when.cs new file mode 100644 index 00000000..4480f618 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10029-when.cs @@ -0,0 +1,21 @@ +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();
+ }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10030-sort_using.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10030-sort_using.cs new file mode 100644 index 00000000..99e802c1 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10030-sort_using.cs @@ -0,0 +1,18 @@ +// should be ddd, eee, fff +using b.ddd; +using b.eee; +using b.fff; + +// should be aaa, ccc +using aaa; +using ccc; +// 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.74.0/tests/expected/cs/10031-bug_i_935.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10031-bug_i_935.cs new file mode 100644 index 00000000..c45eb79d --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10031-bug_i_935.cs @@ -0,0 +1,15 @@ +using Syst; +using System; +using System.Collections.Generic; +using System2; + +using b; +using b.a; +using b.A; +using b.ddd; +using b.ddd.A; +using b.eee; +using b.fff; + +void foo(); + diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10032-sort_using_categ.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10032-sort_using_categ.cs new file mode 100644 index 00000000..ec997fc9 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10032-sort_using_categ.cs @@ -0,0 +1,12 @@ +using System; +using Client.Common; +using LeopotamGroup.Common; +using LeopotamGroup.Serialization; +using UnityEngine; +using UnityEngine.Events; +using UnityEngine.EventSystems; + +using nameSpace; +using Namespace; +using NameSpace; +using NameSpacEveryday; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10033-objc.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10033-objc.mm new file mode 100644 index 00000000..07ede276 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10033-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.74.0/tests/expected/cs/10034-asm.h.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10034-asm.h.mm new file mode 100644 index 00000000..84a5efa8 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10034-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.74.0/tests/expected/cs/10035-definesalign.h.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10035-definesalign.h.mm new file mode 100644 index 00000000..9ad29954 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10035-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.74.0/tests/expected/cs/10036-inttypes.h.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10036-inttypes.h.mm new file mode 100644 index 00000000..4ac13417 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10036-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.74.0/tests/expected/cs/10039-615_nested-usings.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10039-615_nested-usings.cs new file mode 100644 index 00000000..d46108bd --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10039-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.74.0/tests/expected/cs/10040-tcf.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10040-tcf.cs new file mode 100644 index 00000000..009f269e --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10040-tcf.cs @@ -0,0 +1,38 @@ +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.74.0/tests/expected/cs/10041-gs.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10041-gs.cs new file mode 100644 index 00000000..ba9f873e --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10041-gs.cs @@ -0,0 +1,37 @@ +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.74.0/tests/expected/cs/10042-exception-filters.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10042-exception-filters.cs new file mode 100644 index 00000000..d638d9a8 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10042-exception-filters.cs @@ -0,0 +1,41 @@ +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.74.0/tests/expected/cs/10044-ifcomment.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10044-ifcomment.cs new file mode 100644 index 00000000..2c3ab0fc --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10044-ifcomment.cs @@ -0,0 +1,58 @@ +#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.74.0/tests/expected/cs/10045-UNI-1288.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10045-UNI-1288.cs new file mode 100644 index 00000000..03d60f5b --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10045-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.74.0/tests/expected/cs/10046-UNI-1333.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10046-UNI-1333.mm new file mode 100644 index 00000000..de887ad0 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10046-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.74.0/tests/expected/cs/10050-generics.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10050-generics.cs new file mode 100644 index 00000000..74e49ecd --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10050-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.74.0/tests/expected/cs/10051-UNI-1338.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10051-UNI-1338.cs new file mode 100644 index 00000000..3f3d9d06 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10051-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.74.0/tests/expected/cs/10055-UNI-1345.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10055-UNI-1345.cs new file mode 100644 index 00000000..13f61127 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10055-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.
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10060-unsafe.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10060-unsafe.cs new file mode 100644 index 00000000..fdfdd67b --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10060-unsafe.cs @@ -0,0 +1,7 @@ +public class Class1 +{ + public unsafe bool GetValue() + { + return(true); + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10065-UNI-1975.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10065-UNI-1975.cs new file mode 100644 index 00000000..1d2f2659 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10065-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.74.0/tests/expected/cs/10066-UNI-1977.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10066-UNI-1977.cs new file mode 100644 index 00000000..94b929c4 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10066-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.74.0/tests/expected/cs/10067-UNI-1978.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10067-UNI-1978.cs new file mode 100644 index 00000000..5f55cb2f --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10067-UNI-1978.cs @@ -0,0 +1,19 @@ +// `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.74.0/tests/expected/cs/10070-utf16le.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10070-utf16le.cs Binary files differnew file mode 100644 index 00000000..c017f6c3 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10070-utf16le.cs diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10071-utf16be.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10071-utf16be.cs Binary files differnew file mode 100644 index 00000000..d9f54e37 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10071-utf16be.cs diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10072-utf16le_no_bom.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10072-utf16le_no_bom.cs Binary files differnew file mode 100644 index 00000000..c017f6c3 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10072-utf16le_no_bom.cs diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10073-utf16be_no_bom.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10073-utf16be_no_bom.cs Binary files differnew file mode 100644 index 00000000..d9f54e37 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10073-utf16be_no_bom.cs diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10074-UNI-2020.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10074-UNI-2020.cs new file mode 100644 index 00000000..854a3655 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10074-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.74.0/tests/expected/cs/10075-UNI-2021.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10075-UNI-2021.cs new file mode 100644 index 00000000..b0ec0414 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10075-UNI-2021.cs @@ -0,0 +1,17 @@ +// 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;}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10076-UNI-1343.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10076-UNI-1343.cs new file mode 100644 index 00000000..076e338d --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10076-UNI-1343.cs @@ -0,0 +1,19 @@ +// 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()
+ {
+ }
+} // namespace Unity
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10077-UNI-1919.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10077-UNI-1919.cs new file mode 100644 index 00000000..cc8e8420 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10077-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.74.0/tests/expected/cs/10078-UNI-3484.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10078-UNI-3484.cs new file mode 100644 index 00000000..d7e4f26a --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10078-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.74.0/tests/expected/cs/10080-property.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10080-property.cs new file mode 100644 index 00000000..98d3c21c --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10080-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.74.0/tests/expected/cs/10090-string_multi.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10090-string_multi.cs new file mode 100644 index 00000000..7d006dce --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10090-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.74.0/tests/expected/cs/10100-bug_600.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10100-bug_600.cs new file mode 100644 index 00000000..54c24643 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10100-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.74.0/tests/expected/cs/10101-sf607.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10101-sf607.cs new file mode 100644 index 00000000..3207e6c5 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10101-sf607.cs @@ -0,0 +1,6 @@ +int P
+{
+ get
+ {
+ }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10102-pp-ignore.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10102-pp-ignore.mm new file mode 100644 index 00000000..f26232c9 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10102-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.74.0/tests/expected/cs/10103-UNI-2506.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10103-UNI-2506.cs new file mode 100644 index 00000000..8cd07962 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10103-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.74.0/tests/expected/cs/10104-UNI-2505.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10104-UNI-2505.cs new file mode 100644 index 00000000..a17e6a5e --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10104-UNI-2505.cs @@ -0,0 +1,2 @@ +public class Class : Base
+{}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10110-mdarray_space.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10110-mdarray_space.cs new file mode 100644 index 00000000..8c328f5e --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10110-mdarray_space.cs @@ -0,0 +1,2 @@ +int[ , , ] x;
+var y = new int[2, 3];
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10111-mdarray_space.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10111-mdarray_space.cs new file mode 100644 index 00000000..56aa58ce --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10111-mdarray_space.cs @@ -0,0 +1,2 @@ +int[,,] x;
+var y = new int[2, 3];
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10112-mdarray_space.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10112-mdarray_space.cs new file mode 100644 index 00000000..ab877b8e --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10112-mdarray_space.cs @@ -0,0 +1,2 @@ +int[, ,] x;
+var y = new int[2, 3];
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10119-preserveTabs.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10119-preserveTabs.cs new file mode 100644 index 00000000..c9583dcd --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10119-preserveTabs.cs @@ -0,0 +1,3 @@ +/// <summary> +/// Event handler. +/// </summary> diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10120-cmt_backslash_eol.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10120-cmt_backslash_eol.cs new file mode 100644 index 00000000..e56aec25 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10120-cmt_backslash_eol.cs @@ -0,0 +1,4 @@ +foo(); +// test \ +blah(); +bar(); diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10130-sp_between_new_paren.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10130-sp_between_new_paren.cs new file mode 100644 index 00000000..fd706ffa --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10130-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.74.0/tests/expected/cs/10140-remove_semi.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10140-remove_semi.cs new file mode 100644 index 00000000..3ee1926e --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10140-remove_semi.cs @@ -0,0 +1,28 @@ +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.74.0/tests/expected/cs/10150-operator-null-conditional.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10150-operator-null-conditional.cs new file mode 100644 index 00000000..61ac6d74 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10150-operator-null-conditional.cs @@ -0,0 +1,16 @@ +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.74.0/tests/expected/cs/10151-operator_null-coalescing-assignment.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10151-operator_null-coalescing-assignment.cs new file mode 100644 index 00000000..416e6afc --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10151-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.74.0/tests/expected/cs/10160-delegate.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10160-delegate.cs new file mode 100644 index 00000000..6296ad80 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10160-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.74.0/tests/expected/cs/10161-delegate.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10161-delegate.cs new file mode 100644 index 00000000..152fba2b --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10161-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.74.0/tests/expected/cs/10200-logger.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10200-logger.cs new file mode 100644 index 00000000..defede8a --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10200-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/expected/cs/10300-1822.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10300-1822.cs new file mode 100644 index 00000000..92b5fd5b --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10300-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.74.0/tests/expected/cs/10628-sf628.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10628-sf628.cs new file mode 100644 index 00000000..54d3c52c --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/10628-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.74.0/tests/expected/cs/11011-620_getset-brace.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/11011-620_getset-brace.cs new file mode 100644 index 00000000..d4652c5f --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/11011-620_getset-brace.cs @@ -0,0 +1,10 @@ +class C
+{
+ float V
+ {
+ get
+ {
+ return _v;
+ }
+ set { _v = value; } }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/11030-argtypes.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/11030-argtypes.mm new file mode 100644 index 00000000..1afeb694 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/11030-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.74.0/tests/expected/cs/11031-casting.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/11031-casting.mm new file mode 100644 index 00000000..c73d6ef8 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/11031-casting.mm @@ -0,0 +1 @@ +videoViewController.videoGravity = (NSString*)videoGravity; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/11032-newlines.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/11032-newlines.mm new file mode 100644 index 00000000..49a15913 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/11032-newlines.mm @@ -0,0 +1,33 @@ +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.74.0/tests/expected/cs/11072-UNI-2007.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/11072-UNI-2007.cs new file mode 100644 index 00000000..29e53f26 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/11072-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.74.0/tests/expected/cs/11073-UNI-2008.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/11073-UNI-2008.cs new file mode 100644 index 00000000..a4de3475 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/11073-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.74.0/tests/expected/cs/12001-bug_620.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12001-bug_620.cs new file mode 100644 index 00000000..56e9b8bc --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12001-bug_620.cs @@ -0,0 +1,11 @@ +class C
+{
+ float V
+ {
+ get
+ {
+ return _v;
+ }
+ set { _v = value; }
+ }
+}
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12002-nullable_prop.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12002-nullable_prop.cs new file mode 100644 index 00000000..21c4f7b0 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12002-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.74.0/tests/expected/cs/12003-fncall_as_ctor_in_attr.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12003-fncall_as_ctor_in_attr.cs new file mode 100644 index 00000000..3dab10f6 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12003-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.74.0/tests/expected/cs/12004-verbatim_strings.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12004-verbatim_strings.cs new file mode 100644 index 00000000..73fa1bf0 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12004-verbatim_strings.cs @@ -0,0 +1,7 @@ +class Class +{ + public string s1 = "\t\tFoo"; + public string s2 = @" + Foo +"; +}; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12005-bug_1591.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12005-bug_1591.cs new file mode 100644 index 00000000..ac62df9e --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12005-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.74.0/tests/expected/cs/12101-bug_i_679.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12101-bug_i_679.cs new file mode 100644 index 00000000..199ad7e6 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12101-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.74.0/tests/expected/cs/12102-mod_full_brace_nl_block_rem_mlcond.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12102-mod_full_brace_nl_block_rem_mlcond.cs new file mode 100644 index 00000000..e6e0eede --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12102-mod_full_brace_nl_block_rem_mlcond.cs @@ -0,0 +1,65 @@ +// 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; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12103-mod_full_brace_nl_block_rem_mlcond.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12103-mod_full_brace_nl_block_rem_mlcond.cs new file mode 100644 index 00000000..8ecd4051 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12103-mod_full_brace_nl_block_rem_mlcond.cs @@ -0,0 +1,71 @@ +// 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.74.0/tests/expected/cs/12104-bug_1637.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12104-bug_1637.cs new file mode 100644 index 00000000..9ffe19e7 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12104-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.74.0/tests/expected/cs/12105-bug_1650.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12105-bug_1650.cs new file mode 100644 index 00000000..869a9d0f --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12105-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.74.0/tests/expected/cs/12106-UNI-40685.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12106-UNI-40685.cs new file mode 100644 index 00000000..9b70920e --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12106-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.74.0/tests/expected/cs/12107-mod_full_paren_if_bool.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12107-mod_full_paren_if_bool.cs new file mode 100644 index 00000000..6bcd9201 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12107-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.74.0/tests/expected/cs/12108-Issue_2705.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12108-Issue_2705.cs new file mode 100644 index 00000000..08619bb1 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12108-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.74.0/tests/expected/cs/12200-comma.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12200-comma.cs new file mode 100644 index 00000000..34ccfdd8 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12200-comma.cs @@ -0,0 +1 @@ +int[ , , ] x; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12201-comma.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12201-comma.cs new file mode 100644 index 00000000..794410f0 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12201-comma.cs @@ -0,0 +1 @@ +int[ , , ] x; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12202-comma.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12202-comma.cs new file mode 100644 index 00000000..29ab2c3e --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/12202-comma.cs @@ -0,0 +1 @@ +int[,,] x; diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/19000-UNI-58354.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/19000-UNI-58354.cs new file mode 100644 index 00000000..6c77de40 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/19000-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.74.0/tests/expected/cs/20010-UNI-32658.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/20010-UNI-32658.cs new file mode 100644 index 00000000..145da65f --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/20010-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.74.0/tests/expected/cs/20011-bug_1620.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/20011-bug_1620.cs new file mode 100644 index 00000000..3b837292 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/20011-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.74.0/tests/expected/cs/60004-UNI-2684.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60004-UNI-2684.cs new file mode 100644 index 00000000..ff0b31f1 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60004-UNI-2684.cs @@ -0,0 +1,4 @@ +EditorApplication.CallDelayed(() => { + foreach (CollabToolbarWindow window in Resources.FindObjectsOfTypeAll<CollabToolbarWindow>()) + window.Close(); +}, 1f); diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60005-UNI-2685.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60005-UNI-2685.cs new file mode 100644 index 00000000..ec671dd4 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60005-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(); +}); diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60007-UNI-3083.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60007-UNI-3083.cs new file mode 100644 index 00000000..5209dc72 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60007-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.74.0/tests/expected/cs/60008-UNI-17253.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60008-UNI-17253.cs new file mode 100644 index 00000000..9021a372 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60008-UNI-17253.cs @@ -0,0 +1,63 @@ +// 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.74.0/tests/expected/cs/60009-UNI-9917.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60009-UNI-9917.cs new file mode 100644 index 00000000..5e352d10 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60009-UNI-9917.cs @@ -0,0 +1,53 @@ +// 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) {} + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60011-UNI-11095.mm b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60011-UNI-11095.mm new file mode 100644 index 00000000..4f88df51 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60011-UNI-11095.mm @@ -0,0 +1,15 @@ +// 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; } diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60012-UNI-12303.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60012-UNI-12303.cs new file mode 100644 index 00000000..01be8291 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60012-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.74.0/tests/expected/cs/60013-UNI-13955.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60013-UNI-13955.cs new file mode 100644 index 00000000..940aa89b --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60013-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.74.0/tests/expected/cs/60015-UNI-14131.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60015-UNI-14131.cs new file mode 100644 index 00000000..9656bee8 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60015-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.74.0/tests/expected/cs/60016-UNI-11662.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60016-UNI-11662.cs new file mode 100644 index 00000000..9a49fdba --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60016-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.74.0/tests/expected/cs/60018-UNI-18777.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60018-UNI-18777.cs new file mode 100644 index 00000000..198d5be3 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60018-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.74.0/tests/expected/cs/60019-UNI-18780.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60019-UNI-18780.cs new file mode 100644 index 00000000..0eea713e --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60019-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.74.0/tests/expected/cs/60020-UNI-18829.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60020-UNI-18829.cs new file mode 100644 index 00000000..a72ca87b --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60020-UNI-18829.cs @@ -0,0 +1,20 @@ +// 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.74.0/tests/expected/cs/60023-UNI-18437.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60023-UNI-18437.cs new file mode 100644 index 00000000..d8178e73 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60023-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.74.0/tests/expected/cs/60024-UNI-19644.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60024-UNI-19644.cs new file mode 100644 index 00000000..eb0d4c9c --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60024-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.74.0/tests/expected/cs/60026-UNI-19895.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60026-UNI-19895.cs new file mode 100644 index 00000000..1fedd580 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60026-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; + } + } +} diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60033-UNI-21730.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60033-UNI-21730.cs new file mode 100644 index 00000000..6fcb8c16 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60033-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.74.0/tests/expected/cs/60036-UNI-11993.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60036-UNI-11993.cs new file mode 100644 index 00000000..bf703537 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60036-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.74.0/tests/expected/cs/60037-UNI-29933.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60037-UNI-29933.cs new file mode 100644 index 00000000..943cbf35 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60037-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.74.0/tests/expected/cs/60040-UNI-30498_2.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60040-UNI-30498_2.cs new file mode 100644 index 00000000..445a7c97 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60040-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.74.0/tests/expected/cs/60041-squeeze-paren-close-Option.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60041-squeeze-paren-close-Option.cs new file mode 100644 index 00000000..2fc371c3 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60041-squeeze-paren-close-Option.cs @@ -0,0 +1,29 @@ +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)
+ )
+ )
+ )
+ )
+);
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60042-indent-multistring-coulmn1.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60042-indent-multistring-coulmn1.cs new file mode 100644 index 00000000..4f66d541 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60042-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.74.0/tests/expected/cs/60044-UNI-37241.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60044-UNI-37241.cs new file mode 100644 index 00000000..57d4ffeb --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60044-UNI-37241.cs @@ -0,0 +1,5 @@ +public double TotalPurchases { get; set; }
+protected IEnumerable<string> Defines { get; } =
+ TargetPlatformRules.Elements
+ .Append("LINUX")
+ .Append("_RAKNET_LIB");
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60045-add-nl-before-namespace.cs b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60045-add-nl-before-namespace.cs new file mode 100644 index 00000000..d9840704 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.74.0/tests/expected/cs/60045-add-nl-before-namespace.cs @@ -0,0 +1,15 @@ +using System; + +namespace MyNamespace +{ + +namespace MyNamespace2 +{ + +class A +{ +} + +} + +} |