public void Test() { m = new TestVector3(); m2 = TestVector3NoBinding.zero; UnitTest_10039Sub(m); UnitTest_10039Sub2(m2); }
public static void UnitTest_10022() { TestVector3 pos = TestVector3.One; pos.X += 1; pos.Y += 2; if (pos.X > 10) { pos.X = 10; } if (pos.X < -10) { pos.X = -10; } if (pos.Y > 10) { pos.Y = 10; } if (pos.Y < -10) { pos.Y = -10; } var pos2 = tttt(pos); Console.WriteLine("pos.x = " + pos.X); Console.WriteLine("pos2.x = " + pos2.X); if (pos.X == pos2.X) { throw new Exception("Value Type Violation"); } }
public static void UnitTest_10023() { TestVectorStruct a; a = Sub10023(); TestVector3 pos = a.C; pos.X += 123; TestVector3 pos2 = a.B.Vector; pos2.X -= 120; Console.WriteLine("pos.x=" + pos.X); Console.WriteLine("a.C.x=" + a.C.X); if (pos.X == a.C.X) { throw new Exception("Value Type Violation"); } Console.WriteLine("pos2.x=" + pos2.X); Console.WriteLine("a.B.Vector.x=" + a.B.Vector.X); if (pos2.X == a.B.Vector.X) { throw new Exception("Value Type Violation"); } }
public static void Test01() { TestVector3 vec = new TestVector3(100, 1, 0); TestVector3.One.X += vec.X; Console.WriteLine(TestVector3.One.ToString()); }
public static void Test02() { TestVector3 vec = new TestVector3(100, 1, 0); vec += TestVector3.One; Console.WriteLine(vec.ToString()); }
static void UnitTest_10046Sub(TestVector3 a) { a = a + TestVector3.One2; Console.WriteLine(a); if (a.X != 2) { throw new Exception(); } }
public static void UnitTest_10028() { TestVector3 a = TestVector3.One; float b = 1f; TestVector3 c = new TestVector3(); a.Test(out c, out b); }
public static void UnitTest_10042() { TestVector3 pos = GetVector3Func?.Invoke() ?? TestVector3.One2; if (pos.X != 123) { throw new Exception(); } }
void UnitTest_10039Sub(TestVector3 arg) { arg = TestVector3.One2; if (arg.X != 1) { throw new Exception(); } }
public static void UnitTest_10029() { TestVector3 c = new TestVector3(); UnitTest_10029Sub2(out c); Console.WriteLine(c.ToString()); c = new TestVector3(); UnitTest_10029Sub(out c); Console.WriteLine(c.ToString()); }
public static void UnitTest_10035() { TestVector3[] FuncBtnsPos1 = new TestVector3[3] { TestVector3.One, TestVector3.One, TestVector3.One }; foreach (var i in FuncBtnsPos1) { Console.WriteLine(i.ToString()); } }
public static object Test03() { TestVector3[] a = new TestVector3[10000]; for (int i = 0; i < 10000; i++) { a[i] = TestVector3.One; } return(a); }
public static void UnitTest_10028() { TestVector3 a = TestVector3.One; float b = 1f; #if COMPILE_BUG TestVector3 c = new TestVector3(); a.Test(out c, out b); #endif }
public static void UnitTest_10047() { TestVector3[] arr2 = new TestVector3[10]; arr2[0].X = 1243; arr2[0] += TestVector3.One; if (Math.Abs(arr2[0].X - 1244) > 0.001f) { throw new Exception(); } }
public static void UnitTest_10032() { TestVectorClass VTest = new TestVectorClass(); TestVector3 value = VTest.vector; value.Normalize(); VTest.vector.Normalize(); Console.WriteLine("Vector3BindingTest local Vector3 normalized = " + value); Console.WriteLine("Vector3BindingTest Vector3 normalized = " + VTest.vector); }
public static void UnitTest_10033() { TestVector3[] arr2 = new TestVector3[10]; arr2[0].X = 1243; Vector3[] arr3 = new Vector3[10]; arr3[0].x = 3143; Console.WriteLine(arr2[0].X); Console.WriteLine(arr3[0].x); }
public static void Test01() { TestVector3 vec = new TestVector3(100, 1, 0); TestVector3.One.X += vec.X; Console.WriteLine(TestVector3.One.ToString()); if (TestVector3.One.X == 1) { throw new Exception(); } }
public static object Test03() { TestVector3[] a = new TestVector3[10000]; Vector3[] b = new Vector3[100]; Console.WriteLine(b[0]); for (int i = 0; i < 10000; i++) { a[i] = TestVector3.One; } return(a); }
public static void UnitTest_Performance13() { System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); sw.Start(); TestVector3 vec = default; TestVector3 vec2 = TestVector3.One2; for (int i = 0; i < 1000000; i++) { vec += vec2 * 2 + TestVector3.One2; } sw.Stop(); Console.WriteLine(string.Format("res=" + vec + ",time = " + sw.ElapsedMilliseconds + ", cps:{0:0}", (1000000 * 1000 / sw.ElapsedMilliseconds))); }
public static void UnitTest_10037() { TestVector3 rawPos = new TestVector3(1, 2, 3); TestVector3 tmpPos = rawPos; m_curPos2 = rawPos; Console.WriteLine("before raw:" + rawPos + " tmp:" + tmpPos + " cur:" + m_curPos2); ChangePosY2(tmpPos); ChangePosY2(m_curPos2); Console.WriteLine("after raw:" + rawPos + " tmp:" + tmpPos + " cur:" + m_curPos2); if (tmpPos.Y == 0 || m_curPos2.Y == 0) { throw new AccessViolationException(); } }
public static void UnitTest_10040() { TestVector3 dot = new TestVector3(); dot.X = 10; dot.Y = 10; for (int i = 0; i < 50; i++) { dot.X++; } Console.WriteLine("dot.X == " + dot.X); if (dot.X != 60) { throw new AccessViolationException(); } }
public static void UnitTest_10031() { TestVector3 pos = TestVector3.One2; float offsetX = pos.X - 0.1f; float offsetY = pos.Y - 0.1f;//报错行数在这里 if (offsetX > 1) { Console.WriteLine("1"); } else if (offsetX < -1) { Console.WriteLine("2"); } //注释下面的代码就不会出错了 else if (offsetY > 1) { Console.WriteLine("3"); } else if (offsetY < -1) { Console.WriteLine("4"); } }
static TestVector3 tttt(TestVector3 a) { a.X = 12345; return(a); }
static void ChangePosY2(TestVector3 pos) { pos.Y = 0; }
static void UnitTest_10029Sub2(out TestVector3 v3) { v3 = TestVector3.One2;// }
public static void UnitTest_10046() { TestVector3.TestDelegate2 = UnitTest_10046Sub; TestVector3.DoTest2(); }