示例#1
0
        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
		static internal	void			Dispose()
		{
		    //Reset the info.  
		    _internal			= null;
            if(_asserthandler != null)
                Debug.Listeners.Remove(_asserthandler);
		    _asserthandler      = null;
		}
示例#3
0
 static internal void                    Dispose()
 {
     //Reset the info.
     _internal = null;
     if (_asserthandler != null)
     {
         Debug.Listeners.Remove(_asserthandler);
     }
     _asserthandler = null;
 }
示例#4
0
 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
        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);
            }
        }