private void OnEnable() { SCManagerProfiler.DoStartTestCase("EventTestCall"); for (int i = 0; i < iTestCount; i++) { _EventTestCall(); } SCManagerProfiler.DoFinishTestCase("EventTestCall"); SCManagerProfiler.DoStartTestCase("CallBack"); for (int i = 0; i < iTestCount; i++) { _CallBack(); } SCManagerProfiler.DoFinishTestCase("CallBack"); SCManagerProfiler.DoStartTestCase("SendMessage"); for (int i = 0; i < iTestCount; i++) { SendMessage("TestCall"); } SCManagerProfiler.DoFinishTestCase("SendMessage"); SCManagerProfiler.DoPrintResult(false); }
public void Working_Test() { SCManagerProfiler.DoStartTestCase(nameof(Working_Test)); CList_Enter_Stay_Exit <int> list = new CList_Enter_Stay_Exit <int>(); int[] arrEmpty = new int[] { }; int[] arrValue = new int[] { 0, 1, 3, 5 }; list.AddEnter(arrValue); Assert.AreEqual(list.p_list_Enter.ToArray(), arrValue); Assert.AreEqual(list.p_list_Stay.ToArray(), arrValue); Assert.AreEqual(list.p_list_Exit.ToArray(), arrEmpty); arrValue = new int[] { 0 }; int[] arrExit = new int[] { 1, 3, 5 }; list.AddEnter(arrValue); Assert.AreEqual(list.p_list_Enter.ToArray(), arrEmpty); Assert.AreEqual(list.p_list_Stay.ToArray(), arrValue); Assert.AreEqual(list.p_list_Exit.ToArray(), arrExit); SCManagerProfiler.DoFinishTestCase(nameof(Working_Test)); SCManagerProfiler.DoPrintResult(true); }
private void TestCase_Operator_2() { Debug.Log("Start TestCase_Operator_2"); SCManagerProfiler.DoStartTestCase("Test"); for (int i = 0; i < 1000; i++) { HugeNumber sHugeNum1 = new HugeNumber(1, HugeNumber.EUnit.None); HugeNumber sHugeNum2 = sHugeNum1 * 100000000; HugeNumber sHugeNum3 = new HugeNumber(1, HugeNumber.EUnit.G); sHugeNum3 += sHugeNum2; sHugeNum3 -= sHugeNum2; } SCManagerProfiler.DoFinishTestCase("Test"); SCManagerProfiler.DoPrintResult(false); }
private void OnEnable() { MemberInfo pMemberInfo = null; #region Initialize MemberInfo[] arrMembers = GetType().GetFields(BindingFlags.NonPublic | BindingFlags.Instance); for (int i = 0; i < arrMembers.Length; i++) { if (arrMembers[i].Name.Equals(nameof(GetComponent_Attribute))) { pMemberInfo = arrMembers[i]; break; } } GameObject pObjectChild = new GameObject("Child"); pObjectChild.transform.parent = transform; #endregion Initialize string strTestCase = ETestCase.GetComponent_DefulatProperty.ToString(); for (int i = 0; i < iTestCase; i++) { SCManagerProfiler.DoStartTestCase(strTestCase); GetComponent_Property = null; GetComponent_Property = transform; GetComponent_Property.GetType(); SCManagerProfiler.DoFinishTestCase(strTestCase); } strTestCase = ETestCase.GetComponet_Function.ToString(); for (int i = 0; i < iTestCase; i++) { SCManagerProfiler.DoStartTestCase(strTestCase); GetComponent_Function = null; GetComponent_Function = GetComponent <Transform>(); GetComponent_Function.GetType(); SCManagerProfiler.DoFinishTestCase(strTestCase); } strTestCase = ETestCase.GetComponetsInChildren_Function.ToString(); for (int i = 0; i < iTestCase; i++) { SCManagerProfiler.DoStartTestCase(strTestCase); GetComponentsChildren_Children_Function = null; GetComponentsChildren_Children_Function = GetComponentsInChildren <Transform>(); GetComponentsChildren_Children_Function[0].GetType(); SCManagerProfiler.DoFinishTestCase(strTestCase); } strTestCase = ETestCase.GetComponet_Attribute_Individual.ToString(); for (int i = 0; i < iTestCase; i++) { SCManagerProfiler.DoStartTestCase(strTestCase); GetComponent_Attribute = null; SCManagerGetComponent.DoUpdateGetComponentAttribute(this, this, pMemberInfo); GetComponent_Attribute.GetType(); SCManagerProfiler.DoFinishTestCase(strTestCase); } strTestCase = ETestCase.GetComponet_Attribute_All.ToString(); for (int i = 0; i < iTestCase; i++) { SCManagerProfiler.DoStartTestCase(strTestCase); GetComponentsChildren_Children_Attribute = null; SCManagerGetComponent.DoUpdateGetComponentAttribute(this); GetComponentsChildren_Children_Attribute[0].GetType(); SCManagerProfiler.DoFinishTestCase(strTestCase); } SCManagerProfiler.DoPrintResult_PrintLog_IsError(true); }
private void Update() { if (Input.GetKeyDown(KeyCode.Alpha1)) { print("Test Setter Start"); SCManagerProfiler.DoStartTestCase("mapInt_Setter"); for (int i = 0; i < iTestCount; i++) { _mapInt[0] = i; } SCManagerProfiler.DoFinishTestCase("mapInt_Setter"); SCManagerProfiler.DoStartTestCase("mapEnumNormal_Setter"); for (int i = 0; i < iTestCount; i++) { _mapEnumNormal[ETestEnum.Test] = i; } SCManagerProfiler.DoFinishTestCase("mapEnumNormal_Setter"); SCManagerProfiler.DoStartTestCase("mapEnumComparer_Setter"); for (int i = 0; i < iTestCount; i++) { _mapEnumComparer[ETestEnum.Test] = i; } SCManagerProfiler.DoFinishTestCase("mapEnumComparer_Setter"); SCManagerProfiler.DoStartTestCase("mapEnumCustom_Setter"); for (int i = 0; i < iTestCount; i++) { _mapEnumCustom[ETestEnum.Test] = i; } SCManagerProfiler.DoFinishTestCase("mapEnumCustom_Setter"); SCManagerProfiler.DoPrintResult(false); } if (Input.GetKeyDown(KeyCode.Alpha2)) { print("Test Getter Start"); int iTestNum = 0; SCManagerProfiler.DoStartTestCase("mapInt_Getter"); for (int i = 0; i < iTestCount; i++) { iTestNum = _mapInt[0]; } SCManagerProfiler.DoFinishTestCase("mapInt_Getter"); SCManagerProfiler.DoStartTestCase("mapEnumNormal_Getter"); for (int i = 0; i < iTestCount; i++) { iTestNum = _mapEnumNormal[ETestEnum.Test]; } SCManagerProfiler.DoFinishTestCase("mapEnumNormal_Getter"); SCManagerProfiler.DoStartTestCase("mapEnumComparer_Getter"); for (int i = 0; i < iTestCount; i++) { iTestNum = _mapEnumComparer[ETestEnum.Test]; } SCManagerProfiler.DoFinishTestCase("mapEnumComparer_Getter"); SCManagerProfiler.DoStartTestCase("mapEnumCustom_Getter"); for (int i = 0; i < iTestCount; i++) { iTestNum = _mapEnumCustom[ETestEnum.Test]; } SCManagerProfiler.DoFinishTestCase("mapEnumCustom_Getter"); SCManagerProfiler.DoPrintResult(false); } }