Exemplo n.º 1
0
 public void Test()
 {
     m  = new TestVector3();
     m2 = TestVector3NoBinding.zero;
     UnitTest_10039Sub(m);
     UnitTest_10039Sub2(m2);
 }
Exemplo n.º 2
0
            void UnitTest_10039Sub2(TestVector3NoBinding arg)
            {
                arg = TestVector3NoBinding.one;

                if (arg.x != 1)
                {
                    throw new Exception();
                }
            }
Exemplo n.º 3
0
        public static void UnitTest_10038()
        {
            TestVector3NoBinding rawPos = TestVector3NoBinding.zero;

            rawPos.y = 1122333;

            Console.WriteLine(rawPos.y);
            if (rawPos.y != 1122333)
            {
                throw new AccessViolationException();
            }
        }
Exemplo n.º 4
0
        public static void UnitTest_Performance14()
        {
            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();
            TestVector3NoBinding vec  = default;
            TestVector3NoBinding vec2 = TestVector3NoBinding.one;

            for (int i = 0; i < 1000000; i++)
            {
                vec += vec2 * 2 + TestVector3NoBinding.one;
            }
            sw.Stop();
            Console.WriteLine(string.Format("res=" + vec + ",time = " + sw.ElapsedMilliseconds + ", cps:{0:0}", (1000000 * 1000 / sw.ElapsedMilliseconds)));
        }
Exemplo n.º 5
0
        public static void UnitTest_10036()
        {
            TestVector3NoBinding rawPos = new TestVector3NoBinding(1, 2, 3);
            TestVector3NoBinding tmpPos = rawPos;

            m_curPos = rawPos;
            Console.WriteLine("before raw:" + rawPos + " tmp:" + tmpPos + " cur:" + m_curPos);
            ChangePosY(tmpPos);
            ChangePosY(m_curPos);
            Console.WriteLine("after raw:" + rawPos + " tmp:" + tmpPos + " cur:" + m_curPos);
            if (tmpPos.y == 0 || m_curPos.y == 0)
            {
                throw new AccessViolationException();
            }
        }
Exemplo n.º 6
0
        public static void UnitTest_10041()
        {
            TestVector3NoBinding dot = new TestVector3NoBinding();

            dot.x = 10;
            dot.x = 10;

            for (int i = 0; i < 50; i++)
            {
                dot.x++;
            }

            Console.WriteLine("dot.X == " + dot.x);
            if (dot.x != 60)
            {
                throw new AccessViolationException();
            }
        }
Exemplo n.º 7
0
 static void ChangePosY(TestVector3NoBinding pos)
 {
     pos.y = 0;
 }