コード例 #1
0
ファイル: TestLog.cs プロジェクト: zhonli/odata.net
        private static void             DisableAsserts()
        {
            try
            {
                //Turn on assert dialog boxes.
                if (_asserthandler == null)
                {
                    //Disable the assert pop-up dialogs
                    foreach (TraceListener listener in Debug.Listeners)
                    {
                        if (listener is DefaultTraceListener)
                        {
                            //Disable assert dialogs popups
                            ((DefaultTraceListener)listener).AssertUiEnabled = false;
                        }
                    }

                    //Add our own handler
                    //  Note: We can't simply set DefaultTeaceListener.AssertUiEnabled = false, since that
                    //  actually disables the assertions, and we no longer see them.  We need to count them
                    //  as errors and continue in Ltm
                    _asserthandler = new TestLogAssertHandler();
                    Debug.Listeners.Add(_asserthandler);
                }
            }
            catch (Exception e)
            {
                //If disabling the asserts fails, simply log it and move on.
                //No reason to hold up the test or block error logging for that, and don't count it as an error
                TestLog.WriteLine("Unable to disable asserts:" + TestLog.NewLine + e);
            }
        }
コード例 #2
0
ファイル: TestLog.cs プロジェクト: AlineGuan/odata.net
		static internal	void			Dispose()
		{
		    //Reset the info.  
		    _internal			= null;
            if(_asserthandler != null)
                Debug.Listeners.Remove(_asserthandler);
		    _asserthandler      = null;
		}
コード例 #3
0
ファイル: TestLog.cs プロジェクト: zhonli/odata.net
 static internal void                    Dispose()
 {
     //Reset the info.
     _internal = null;
     if (_asserthandler != null)
     {
         Debug.Listeners.Remove(_asserthandler);
     }
     _asserthandler = null;
 }
コード例 #4
0
ファイル: testlog.cs プロジェクト: shandan1/CollectionRef
 internal static void Dispose()
 {
     //Reset the info.
     s_pinternal      = null;
     s_passerthandler = null;
 }
コード例 #5
0
ファイル: testlog.cs プロジェクト: chcosta/corefx
 internal static void Dispose()
 {
     //Reset the info.  
     s_pinternal = null;
     s_passerthandler = null;
 }
コード例 #6
0
ファイル: TestLog.cs プロジェクト: AlineGuan/odata.net
        private static void             DisableAsserts()
        {
            try
            {
                //Turn on assert dialog boxes.
                if(_asserthandler == null)
                {
                    //Disable the assert pop-up dialogs
                    foreach(TraceListener listener in Debug.Listeners)
                    {
                        if(listener is DefaultTraceListener)
                        {
                            //Disable assert dialogs popups
                            ((DefaultTraceListener)listener).AssertUiEnabled = false;
                        }
                    }

                    //Add our own handler
                    //  Note: We can't simply set DefaultTeaceListener.AssertUiEnabled = false, since that 
                    //  actually disables the assertions, and we no longer see them.  We need to count them 
                    //  as errors and continue in Ltm
                    _asserthandler = new TestLogAssertHandler();
                    Debug.Listeners.Add(_asserthandler);
                }
            }
            catch (Exception e)
            {
                //If disabling the asserts fails, simply log it and move on.
                //No reason to hold up the test or block error logging for that, and don't count it as an error
                TestLog.WriteLine("Unable to disable asserts:" + TestLog.NewLine + e);
            }
        }