Browse Source

Added debugger test: PropertyVariableForm

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@885 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
1012efb736
  1. 1
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Debugger.Tests.csproj
  2. 27
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTests.cs
  3. 1
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestProgram.cs
  4. 21
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/PropertyVariableForm.cs

1
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Debugger.Tests.csproj

@ -51,6 +51,7 @@ @@ -51,6 +51,7 @@
<Compile Include="Src\TestPrograms\FunctionVariablesLifetime.cs" />
<Compile Include="Src\TestPrograms\ObjectValue.cs" />
<Compile Include="Src\TestPrograms\PropertyVariable.cs" />
<Compile Include="Src\TestPrograms\PropertyVariableForm.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="Src" />

27
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/DebuggerTests.cs

@ -481,5 +481,32 @@ namespace Debugger.Tests @@ -481,5 +481,32 @@ namespace Debugger.Tests
debugger.Continue();
debugger.WaitForPrecessExit();
}
[Test]
public void PropertyVariableForm()
{
Variable local = null;
StartProgram("PropertyVariableForm");
WaitForPause(PausedReason.Break, null);
foreach(Variable var in debugger.CurrentFunction.LocalVariables) {
local = var;
}
Assert.AreEqual("form", local.Name);
Assert.AreEqual(typeof(Variable), local.GetType());
foreach(Variable var in local.SubVariables) {
if (var is PropertyVariable) {
Assert.AreEqual(typeof(UnavailableValue), var.Value.GetType(), "Variable name: " + var.Name);
debugger.StartEvaluation();
WaitForPause(PausedReason.AllEvalsComplete, null);
Assert.AreEqual(false, var.Value.IsExpired, "Variable name: " + var.Name);
Assert.AreNotEqual(null, var.Value.AsString, "Variable name: " + var.Name);
}
}
debugger.Continue();
debugger.WaitForPrecessExit();
}
}
}

1
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestProgram.cs

@ -30,6 +30,7 @@ namespace Debugger.Tests @@ -30,6 +30,7 @@ namespace Debugger.Tests
case "HelloWorld": Progs.HelloWorld.Main(); break;
case "ObjectValue": Progs.ObjectValue.Main(); break;
case "PropertyVariable": Progs.PropertyVariable.Main(); break;
case "PropertyVariableForm": Progs.PropertyVariableForm.Main(); break;
case "SimpleProgram": Progs.SimpleProgram.Main(); break;
case "Stepping": Progs.Stepping.Main(); break;
case "Symbols": Progs.Symbols.Main(); break;

21
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/PropertyVariableForm.cs

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
// <file>
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
// <license see="prj:///doc/license.txt">GNU General Public License</license>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Windows.Forms;
namespace Debugger.Tests.TestPrograms
{
public class PropertyVariableForm
{
public static void Main()
{
Form form = new Form();
System.Diagnostics.Debugger.Break();
}
}
}
Loading…
Cancel
Save