Browse Source

Tweaked ToString output of methods and properties in debugger tests

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@6220 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
David Srbecký 16 years ago
parent
commit
02962a3424
  1. 24
      src/AddIns/Debugger/Debugger.Core/MetaData/DebugMethodInfo.cs
  2. 51
      src/AddIns/Debugger/Debugger.Core/MetaData/DebugPropertyInfo.cs
  3. 8
      src/AddIns/Debugger/Debugger.Tests/Tests/ControlFlow_MainThreadExit.cs
  4. 294
      src/AddIns/Debugger/Debugger.Tests/Tests/DebugType_Tests.cs
  5. 4
      src/AddIns/Debugger/Debugger.Tests/Tests/ExpressionEvaluator_Tests.cs

24
src/AddIns/Debugger/Debugger.Core/MetaData/DebugMethodInfo.cs

@ -60,10 +60,21 @@ namespace Debugger.MetaData @@ -60,10 +60,21 @@ namespace Debugger.MetaData
get { throw new NotSupportedException(); }
}
/// <summary> Name including the declaring type and parameters </summary>
/// <summary> Name including the declaring type, return type and parameters </summary>
public string FullName {
get {
StringBuilder sb = new StringBuilder();
if (this.IsStatic) {
sb.Append("static ");
}
if (this.ReturnType != null) {
sb.Append(this.ReturnType.Name);
sb.Append(" ");
} else {
sb.Append("void ");
}
sb.Append(this.DeclaringType.FullName);
sb.Append(".");
sb.Append(this.Name);
@ -628,16 +639,7 @@ namespace Debugger.MetaData @@ -628,16 +639,7 @@ namespace Debugger.MetaData
/// <inheritdoc/>
public override string ToString()
{
string txt = string.Empty;
if (this.IsStatic)
txt += "static ";
if (this.ReturnType != null) {
txt += this.ReturnType.FullName + " ";
} else {
txt += "void ";
}
txt += this.FullName;
return txt;
return this.FullName;
}
IntPtr IOverloadable.GetSignarture()

51
src/AddIns/Debugger/Debugger.Core/MetaData/DebugPropertyInfo.cs

@ -65,6 +65,38 @@ namespace Debugger.MetaData @@ -65,6 +65,38 @@ namespace Debugger.MetaData
}
}
/// <summary> Name including the declaring type, return type and parameters </summary>
public string FullName {
get {
StringBuilder sb = new StringBuilder();
if (this.IsStatic) {
sb.Append("static ");
}
sb.Append(this.PropertyType.Name);
sb.Append(" ");
sb.Append(this.DeclaringType.FullName);
sb.Append(".");
sb.Append(this.Name);
if (GetIndexParameters().Length > 0) {
sb.Append("[");
bool first = true;
foreach(DebugParameterInfo p in GetIndexParameters()) {
if (!first)
sb.Append(", ");
first = false;
sb.Append(p.ParameterType.Name);
sb.Append(" ");
sb.Append(p.Name);
}
sb.Append("]");
}
return sb.ToString();
}
}
/// <inheritdoc/>
public override Type ReflectedType {
get { throw new NotSupportedException(); }
@ -210,24 +242,7 @@ namespace Debugger.MetaData @@ -210,24 +242,7 @@ namespace Debugger.MetaData
/// <inheritdoc/>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append(this.PropertyType);
sb.Append(" ");
sb.Append(this.Name);
if (GetIndexParameters().Length > 0) {
sb.Append("[");
bool first = true;
foreach(DebugParameterInfo p in GetIndexParameters()) {
if (!first)
sb.Append(", ");
first = false;
sb.Append(p.ParameterType.Name);
sb.Append(" ");
sb.Append(p.Name);
}
sb.Append("]");
}
return sb.ToString();
return this.FullName;
}
}
}

8
src/AddIns/Debugger/Debugger.Tests/Tests/ControlFlow_MainThreadExit.cs

@ -78,11 +78,11 @@ namespace Debugger.Tests { @@ -78,11 +78,11 @@ namespace Debugger.Tests {
</Item>
<Item>
<Thread
Callstack="{static System.Boolean System.Threading.WaitHandle.InternalWaitOne(SafeHandle waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext), System.Boolean System.Threading.WaitHandle.WaitOne(Int32 millisecondsTimeout, Boolean exitContext), System.Boolean System.Threading.WaitHandle.WaitOne(), static void Debugger.Tests.ControlFlow_MainThreadExit.WaitForALongTime(), static void System.Threading.ThreadHelper.ThreadStart_Context(Object state), static void System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx), static void System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state), void System.Threading.ThreadHelper.ThreadStart()}"
Callstack="{static Boolean System.Threading.WaitHandle.InternalWaitOne(SafeHandle waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext), Boolean System.Threading.WaitHandle.WaitOne(Int32 millisecondsTimeout, Boolean exitContext), Boolean System.Threading.WaitHandle.WaitOne(), static void Debugger.Tests.ControlFlow_MainThreadExit.WaitForALongTime(), static void System.Threading.ThreadHelper.ThreadStart_Context(Object state), static void System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx), static void System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state), void System.Threading.ThreadHelper.ThreadStart()}"
CurrentExceptionType="0"
IsAtSafePoint="True"
IsInValidState="True"
MostRecentStackFrame="static System.Boolean System.Threading.WaitHandle.InternalWaitOne(SafeHandle waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)"
MostRecentStackFrame="static Boolean System.Threading.WaitHandle.InternalWaitOne(SafeHandle waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)"
Name="Worker thread"
Priority="Normal"
RuntimeValue="{System.Threading.Thread}" />
@ -101,11 +101,11 @@ namespace Debugger.Tests { @@ -101,11 +101,11 @@ namespace Debugger.Tests {
</Item>
<Item>
<Thread
Callstack="{static System.Boolean System.Threading.WaitHandle.InternalWaitOne(SafeHandle waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext), System.Boolean System.Threading.WaitHandle.WaitOne(Int32 millisecondsTimeout, Boolean exitContext), System.Boolean System.Threading.WaitHandle.WaitOne(), static void Debugger.Tests.ControlFlow_MainThreadExit.WaitForALongTime(), static void System.Threading.ThreadHelper.ThreadStart_Context(Object state), static void System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx), static void System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state), void System.Threading.ThreadHelper.ThreadStart()}"
Callstack="{static Boolean System.Threading.WaitHandle.InternalWaitOne(SafeHandle waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext), Boolean System.Threading.WaitHandle.WaitOne(Int32 millisecondsTimeout, Boolean exitContext), Boolean System.Threading.WaitHandle.WaitOne(), static void Debugger.Tests.ControlFlow_MainThreadExit.WaitForALongTime(), static void System.Threading.ThreadHelper.ThreadStart_Context(Object state), static void System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx), static void System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state), void System.Threading.ThreadHelper.ThreadStart()}"
CurrentExceptionType="0"
IsAtSafePoint="True"
IsInValidState="True"
MostRecentStackFrame="static System.Boolean System.Threading.WaitHandle.InternalWaitOne(SafeHandle waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)"
MostRecentStackFrame="static Boolean System.Threading.WaitHandle.InternalWaitOne(SafeHandle waitableSafeHandle, Int64 millisecondsTimeout, Boolean hasThreadAffinity, Boolean exitContext)"
Name="Worker thread"
Priority="Normal"
RuntimeValue="{System.Threading.Thread}"

294
src/AddIns/Debugger/Debugger.Tests/Tests/DebugType_Tests.cs

File diff suppressed because one or more lines are too long

4
src/AddIns/Debugger/Debugger.Tests/Tests/ExpressionEvaluator_Tests.cs

@ -441,8 +441,8 @@ namespace Debugger.Tests { @@ -441,8 +441,8 @@ namespace Debugger.Tests {
<Eval> myClass.Foo(1) = "derived Foo - int" </Eval>
<Eval> myClass.Foo("abc") = "derived Foo - string" </Eval>
<Eval> myClass[1] = More then one applicable overload found:
System.String Item[Double d]
System.String Item[Int64 i] </Eval>
String Debugger.Tests.ExpressionEvaluator_Tests+DerivedClass.Item[Double d]
String Debugger.Tests.ExpressionEvaluator_Tests+BaseClass.Item[Int64 i] </Eval>
<Eval> myClass[(long)1] = "base indexer - long" </Eval>
<Eval> myClass[1.0] = "derived indexer - double" </Eval>
<Eval> myClass["abc"] = "derived indexer - string" </Eval>

Loading…
Cancel
Save