DebuggerTests.cs
Upload User: gzlwc0706
Upload Date: 2008-08-11
Package Size: 13675k
Code Size: 21k
Category:

matlab

Development Platform:

C#

  1. // <file>
  2. //     <copyright see="prj:///doc/copyright.txt"/>
  3. //     <license see="prj:///doc/license.txt"/>
  4. //     <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
  5. //     <version>$Revision: 1833 $</version>
  6. // </file>
  7. using Debugger;
  8. using Microsoft.CSharp;
  9. using NUnit.Framework;
  10. using System;
  11. using System.CodeDom.Compiler;
  12. using System.Collections;
  13. using System.Collections.Generic;
  14. using System.IO;
  15. using System.Reflection;
  16. using System.Resources;
  17. using System.Threading;
  18. namespace Debugger.Tests
  19. {
  20. /// <summary>
  21. /// This class contains methods that test the debugger
  22. /// </summary>
  23. [TestFixture]
  24. public class DebuggerTests
  25. {
  26. // NDebugger debugger;
  27. // string log;
  28. // string lastLogMessage;
  29. // string assemblyFilename;
  30. // string assemblyDir;
  31. // string symbolsFilename;
  32. //
  33. // public DebuggerTests()
  34. // {
  35. // assemblyFilename = Assembly.GetExecutingAssembly().Location;
  36. // assemblyDir = Path.GetDirectoryName(assemblyFilename);
  37. // symbolsFilename = Path.Combine(assemblyDir, Path.GetFileNameWithoutExtension(assemblyFilename) + ".pdb");
  38. //
  39. // debugger = new NDebugger();
  40. // debugger.MTA2STA.CallMethod = CallMethod.Manual;
  41. // debugger.LogMessage += delegate(object sender, MessageEventArgs e) {
  42. // log += e.Message;
  43. // lastLogMessage = e.Message;
  44. // };
  45. // }
  46. //
  47. // [TearDown]
  48. // public void TearDown()
  49. // {
  50. // debugger.Terminate();
  51. // }
  52. //
  53. // void StartProgram(string programName)
  54. // {
  55. // StartProgram(assemblyFilename, programName);
  56. // }
  57. //
  58. // void StartProgram(string exeFilename, string programName)
  59. // {
  60. // log = "";
  61. // lastLogMessage = null;
  62. // debugger.Terminate();
  63. // debugger.Start(exeFilename, Path.GetDirectoryName(exeFilename), programName);
  64. // }
  65. //
  66. // void WaitForPause(PausedReason expectedReason)
  67. // {
  68. // debugger.WaitForPause();
  69. // Assert.AreEqual(true, debugger.IsPaused);
  70. // Assert.AreEqual(expectedReason, debugger.PausedReason);
  71. // }
  72. //
  73. // void WaitForPause(PausedReason expectedReason, string expectedLastLogMessage)
  74. // {
  75. // WaitForPause(expectedReason);
  76. // if (expectedLastLogMessage != null) expectedLastLogMessage += "rn";
  77. // Assert.AreEqual(expectedLastLogMessage, lastLogMessage);
  78. // }
  79. //
  80. //
  81. // [Test]
  82. // public void SimpleProgram()
  83. // {
  84. // StartProgram("SimpleProgram");
  85. // debugger.WaitForPrecessExit();
  86. // }
  87. //
  88. // [Test]
  89. // public void HelloWorld()
  90. // {
  91. // StartProgram("HelloWorld");
  92. // debugger.WaitForPrecessExit();
  93. // Assert.AreEqual("Hello world!rn", log);
  94. // }
  95. //
  96. // [Test]
  97. // public void Break()
  98. // {
  99. // StartProgram("Break");
  100. // WaitForPause(PausedReason.Break, null);
  101. //
  102. // debugger.Continue();
  103. // debugger.WaitForPrecessExit();
  104. // }
  105. //
  106. // [Test]
  107. // public void Symbols()
  108. // {
  109. // Assert.AreEqual("debugger.tests.exe", Path.GetFileName(assemblyFilename).ToLower());
  110. // Assert.IsTrue(File.Exists(symbolsFilename), "Symbols file not found (.pdb)");
  111. //
  112. // StartProgram("Symbols");
  113. // WaitForPause(PausedReason.Break, null);
  114. // Assert.AreEqual(true, debugger.GetModule(Path.GetFileName(assemblyFilename)).SymbolsLoaded, "Module symbols not loaded");
  115. //
  116. // debugger.Continue();
  117. // debugger.WaitForPrecessExit();
  118. // }
  119. //
  120. // [Test]
  121. // public void Breakpoint()
  122. // {
  123. // Breakpoint b = debugger.AddBreakpoint(@"D:corsavySharpDevelopsrcAddInsMiscDebuggerDebugger.TestsProjectSrcTestProgramsBreakpoint.cs", 18);
  124. //
  125. // StartProgram("Breakpoint");
  126. // WaitForPause(PausedReason.Break, null);
  127. // Assert.AreEqual(true, b.Enabled);
  128. // Assert.AreEqual(true, b.HadBeenSet, "Breakpoint is not set");
  129. // Assert.AreEqual(18, b.SourcecodeSegment.StartLine);
  130. //
  131. // debugger.Continue();
  132. // WaitForPause(PausedReason.Breakpoint, "Mark 1");
  133. //
  134. // debugger.Continue();
  135. // WaitForPause(PausedReason.Break, "Mark 2");
  136. //
  137. // debugger.Continue();
  138. // debugger.WaitForPrecessExit();
  139. // Assert.AreEqual("Mark 1rnMark 2rn", log);
  140. // }
  141. //
  142. // [Test]
  143. // public void FileRelease()
  144. // {
  145. // Assert.IsTrue(File.Exists(assemblyFilename), "Assembly file not found");
  146. // Assert.IsTrue(File.Exists(symbolsFilename), "Symbols file not found (.pdb)");
  147. //
  148. // string tempPath = Path.Combine(Path.GetTempPath(), Path.Combine("DebeggerTest", new Random().Next().ToString()));
  149. // Directory.CreateDirectory(tempPath);
  150. //
  151. // string newAssemblyFilename = Path.Combine(tempPath, Path.GetFileName(assemblyFilename));
  152. // string newSymbolsFilename = Path.Combine(tempPath, Path.GetFileName(symbolsFilename));
  153. //
  154. // File.Copy(assemblyFilename, newAssemblyFilename);
  155. // File.Copy(symbolsFilename, newSymbolsFilename);
  156. //
  157. // Assert.IsTrue(File.Exists(newAssemblyFilename), "Assembly file copying failed");
  158. // Assert.IsTrue(File.Exists(newSymbolsFilename), "Symbols file copying failed");
  159. //
  160. // StartProgram(newAssemblyFilename, "FileRelease");
  161. // debugger.WaitForPrecessExit();
  162. //
  163. // try {
  164. // File.Delete(newAssemblyFilename);
  165. // } catch (System.Exception e) {
  166. // Assert.Fail("Assembly file not releasedn" + e.ToString());
  167. // }
  168. //
  169. // try {
  170. // File.Delete(newSymbolsFilename);
  171. // } catch (System.Exception e) {
  172. // Assert.Fail("Symbols file not releasedn" + e.ToString());
  173. // }
  174. // }
  175. //
  176. // [Test]
  177. // public void DebuggeeKilled()
  178. // {
  179. // StartProgram("DebuggeeKilled");
  180. // WaitForPause(PausedReason.Break);
  181. // Assert.AreNotEqual(null, lastLogMessage);
  182. // System.Diagnostics.Process p = System.Diagnostics.Process.GetProcessById(int.Parse(lastLogMessage));
  183. // p.Kill();
  184. // debugger.WaitForPrecessExit();
  185. // }
  186. //
  187. // [Test]
  188. // public void Stepping()
  189. // {
  190. // StartProgram("Stepping");
  191. // WaitForPause(PausedReason.Break, null);
  192. //
  193. // debugger.StepOver(); // Debugger.Break
  194. // WaitForPause(PausedReason.StepComplete, null);
  195. //
  196. // debugger.StepOver(); // Debug.WriteLine 1
  197. // WaitForPause(PausedReason.StepComplete, "1");
  198. //
  199. // debugger.StepInto(); // Method Sub
  200. // WaitForPause(PausedReason.StepComplete, "1");
  201. //
  202. // debugger.StepInto(); // '{'
  203. // WaitForPause(PausedReason.StepComplete, "1");
  204. //
  205. // debugger.StepInto(); // Debug.WriteLine 2
  206. // WaitForPause(PausedReason.StepComplete, "2");
  207. //
  208. // debugger.StepOut(); // Method Sub
  209. // WaitForPause(PausedReason.StepComplete, "4");
  210. //
  211. // debugger.StepOver(); // Method Sub
  212. // WaitForPause(PausedReason.StepComplete, "4");
  213. //
  214. // debugger.StepOver(); // Method Sub2
  215. // WaitForPause(PausedReason.StepComplete, "5");
  216. //
  217. // debugger.Continue();
  218. // debugger.WaitForPrecessExit();
  219. // }
  220. //
  221. // [Test]
  222. // public void Callstack()
  223. // {
  224. // List<Function> callstack;
  225. //
  226. // StartProgram("Callstack");
  227. // WaitForPause(PausedReason.Break, null);
  228. // callstack = new List<Function>(debugger.SelectedThread.Callstack);
  229. // Assert.AreEqual("Sub2", callstack[0].Name);
  230. // Assert.AreEqual("Sub1", callstack[1].Name);
  231. // Assert.AreEqual("Main", callstack[2].Name);
  232. //
  233. // debugger.StepOut();
  234. // WaitForPause(PausedReason.StepComplete, null);
  235. // callstack = new List<Function>(debugger.SelectedThread.Callstack);
  236. // Assert.AreEqual("Sub1", callstack[0].Name);
  237. // Assert.AreEqual("Main", callstack[1].Name);
  238. //
  239. // debugger.StepOut();
  240. // WaitForPause(PausedReason.StepComplete, null);
  241. // callstack = new List<Function>(debugger.SelectedThread.Callstack);
  242. // Assert.AreEqual("Main", callstack[0].Name);
  243. //
  244. // debugger.Continue();
  245. // debugger.WaitForPrecessExit();
  246. // }
  247. //
  248. // [Test]
  249. // public void FunctionArgumentVariables()
  250. // {
  251. // List<Variable> args;
  252. //
  253. // StartProgram("FunctionArgumentVariables");
  254. // WaitForPause(PausedReason.Break, null);
  255. //
  256. // for(int i = 0; i < 2; i++) {
  257. // debugger.Continue();
  258. // WaitForPause(PausedReason.Break, null);
  259. // args = new List<Variable>(debugger.SelectedFunction.ArgumentVariables);
  260. // // names
  261. // Assert.AreEqual("i", args[0].Name);
  262. // Assert.AreEqual("s", args[1].Name);
  263. // Assert.AreEqual("args", args[2].Name);
  264. // // types
  265. // Assert.AreEqual(typeof(PrimitiveValue), args[0].Value.GetType());
  266. // Assert.AreEqual(typeof(PrimitiveValue), args[1].Value.GetType());
  267. // Assert.AreEqual(typeof(ArrayValue),     args[2].Value.GetType());
  268. // // values
  269. // Assert.AreEqual("0", args[0].Value.AsString);
  270. // Assert.AreEqual("S", args[1].Value.AsString);
  271. // Assert.AreEqual(0 ,((ArrayValue)args[2].Value).Lenght);
  272. //
  273. // debugger.Continue();
  274. // WaitForPause(PausedReason.Break, null);
  275. // args = new List<Variable>(debugger.SelectedFunction.ArgumentVariables);
  276. // // types
  277. // Assert.AreEqual(typeof(PrimitiveValue), args[0].Value.GetType());
  278. // Assert.AreEqual(typeof(PrimitiveValue), args[1].Value.GetType());
  279. // Assert.AreEqual(typeof(ArrayValue),     args[2].Value.GetType());
  280. // // values
  281. // Assert.AreEqual("1", args[0].Value.AsString);
  282. // Assert.AreEqual("S", args[1].Value.AsString);
  283. // Assert.AreEqual(1 ,((ArrayValue)args[2].Value).Lenght);
  284. //
  285. // debugger.Continue();
  286. // WaitForPause(PausedReason.Break, null);
  287. // args = new List<Variable>(debugger.SelectedFunction.ArgumentVariables);
  288. // // types
  289. // Assert.AreEqual(typeof(PrimitiveValue), args[0].Value.GetType());
  290. // Assert.AreEqual(typeof(NullValue), args[1].Value.GetType());
  291. // Assert.AreEqual(typeof(ArrayValue),     args[2].Value.GetType());
  292. // // values
  293. // Assert.AreEqual("2", args[0].Value.AsString);
  294. // Assert.IsNotNull(args[1].Value.AsString);
  295. // Assert.AreEqual(2 ,((ArrayValue)args[2].Value).Lenght);
  296. // }
  297. //
  298. // debugger.Continue();
  299. // debugger.WaitForPrecessExit();
  300. // }
  301. //
  302. // [Test]
  303. // public void FunctionLocalVariables()
  304. // {
  305. // List<Variable> args;
  306. //
  307. // StartProgram("FunctionLocalVariables");
  308. // WaitForPause(PausedReason.Break, null);
  309. // args = new List<Variable>(debugger.SelectedFunction.LocalVariables);
  310. // // names
  311. // Assert.AreEqual("i", args[0].Name);
  312. // Assert.AreEqual("s", args[1].Name);
  313. // Assert.AreEqual("args", args[2].Name);
  314. // Assert.AreEqual("n", args[3].Name);
  315. // Assert.AreEqual("o", args[4].Name);
  316. // // types
  317. // Assert.AreEqual(typeof(PrimitiveValue), args[0].Value.GetType());
  318. // Assert.AreEqual(typeof(PrimitiveValue), args[1].Value.GetType());
  319. // Assert.AreEqual(typeof(ArrayValue),     args[2].Value.GetType());
  320. // Assert.AreEqual(typeof(NullValue),     args[3].Value.GetType());
  321. // Assert.AreEqual(typeof(ObjectValue),     args[4].Value.GetType());
  322. // // values
  323. // Assert.AreEqual("0", args[0].Value.AsString);
  324. // Assert.AreEqual("S", args[1].Value.AsString);
  325. // Assert.AreEqual(1 ,((ArrayValue)args[2].Value).Lenght);
  326. // Assert.IsNotNull(args[3].Value.AsString);
  327. // Assert.AreEqual("{System.Object}", args[4].Value.AsString);
  328. //
  329. // debugger.Continue();
  330. // debugger.WaitForPrecessExit();
  331. // }
  332. //
  333. // [Test]
  334. // public void FunctionLifetime()
  335. // {
  336. // Function function;
  337. //
  338. // StartProgram("FunctionLifetime");
  339. // WaitForPause(PausedReason.Break, null);
  340. // function = debugger.SelectedFunction;
  341. // Assert.IsNotNull(function);
  342. // Assert.AreEqual("Function", function.Name);
  343. // Assert.AreEqual(false, function.HasExpired);
  344. // Assert.AreEqual("1", function.GetArgumentVariable(0).Value.AsString);
  345. //
  346. // debugger.Continue(); // Go to the SubFunction
  347. // WaitForPause(PausedReason.Break, null);
  348. // Assert.AreEqual("SubFunction", debugger.SelectedFunction.Name);
  349. // Assert.AreEqual(false, function.HasExpired);
  350. // Assert.AreEqual("1", function.GetArgumentVariable(0).Value.AsString);
  351. //
  352. // debugger.Continue(); // Go back to Function
  353. // WaitForPause(PausedReason.Break, null);
  354. // Assert.AreEqual("Function", debugger.SelectedFunction.Name);
  355. // Assert.AreEqual(false, function.HasExpired);
  356. // Assert.AreEqual("1", function.GetArgumentVariable(0).Value.AsString);
  357. //
  358. // debugger.Continue(); // Setp out of function
  359. // WaitForPause(PausedReason.Break, null);
  360. // Assert.AreEqual("Main", debugger.SelectedFunction.Name);
  361. // Assert.AreEqual(true, function.HasExpired);
  362. //
  363. // debugger.Continue();
  364. // debugger.WaitForPrecessExit();
  365. // }
  366. //
  367. // [Test]
  368. // public void FunctionVariablesLifetime()
  369. // {
  370. // Function function = null;
  371. // Variable argument = null;
  372. // Variable local    = null;
  373. // Variable localInSubFunction = null;
  374. // Variable @class   = null;
  375. //
  376. // StartProgram("FunctionVariablesLifetime"); // 1 - Enter program
  377. // WaitForPause(PausedReason.Break, null);
  378. // function = debugger.SelectedFunction;
  379. // Assert.IsNotNull(function);
  380. // Assert.AreEqual("Function", function.Name);
  381. // argument = function.GetArgumentVariable(0);
  382. // foreach(Variable var in function.LocalVariables) {
  383. // local = var;
  384. // }
  385. // foreach(Variable var in function.ContaingClassVariables) {
  386. // @class = var;
  387. // }
  388. // Assert.IsNotNull(argument);
  389. // Assert.IsNotNull(local);
  390. // Assert.IsNotNull(@class);
  391. // Assert.AreEqual("argument", argument.Name);
  392. // Assert.AreEqual("local", local.Name);
  393. // Assert.AreEqual("class", @class.Name);
  394. // Assert.AreEqual("1", argument.Value.AsString);
  395. // Assert.AreEqual("2", local.Value.AsString);
  396. // Assert.AreEqual("3", @class.Value.AsString);
  397. //
  398. // debugger.Continue(); // 2 - Go to the SubFunction
  399. // WaitForPause(PausedReason.Break, null);
  400. // Assert.AreEqual("1", argument.Value.AsString);
  401. // Assert.AreEqual("2", local.Value.AsString);
  402. // Assert.AreEqual("3", @class.Value.AsString);
  403. // // Check localInSubFunction variable
  404. // localInSubFunction = debugger.LocalVariables["localInSubFunction"];
  405. // Assert.AreEqual("4", localInSubFunction.Value.AsString);
  406. //
  407. // debugger.Continue(); // 3 - Go back to Function
  408. // WaitForPause(PausedReason.Break, null);
  409. // Assert.AreEqual("1", argument.Value.AsString);
  410. // Assert.AreEqual("2", local.Value.AsString);
  411. // Assert.AreEqual("3", @class.Value.AsString);
  412. // // localInSubFunction should be dead now
  413. // Assert.AreEqual(typeof(UnavailableValue), localInSubFunction.Value.GetType());
  414. //
  415. // debugger.Continue(); // 4 - Go to the SubFunction
  416. // WaitForPause(PausedReason.Break, null);
  417. // Assert.AreEqual("1", argument.Value.AsString);
  418. // Assert.AreEqual("2", local.Value.AsString);
  419. // Assert.AreEqual("3", @class.Value.AsString);
  420. // // localInSubFunction should be still dead...
  421. // Assert.AreEqual(typeof(UnavailableValue), localInSubFunction.Value.GetType());
  422. // // ... , but we should able to get new one
  423. // localInSubFunction = debugger.LocalVariables["localInSubFunction"];
  424. // Assert.AreEqual("4", localInSubFunction.Value.AsString);
  425. //
  426. // debugger.Continue(); // 5 - Setp out of both functions
  427. // WaitForPause(PausedReason.Break, null);
  428. // Assert.AreEqual(typeof(UnavailableValue), argument.Value.GetType());
  429. // Assert.AreEqual(typeof(UnavailableValue), local.Value.GetType());
  430. // Assert.AreEqual(typeof(UnavailableValue), @class.Value.GetType());
  431. //
  432. // debugger.Continue();
  433. // debugger.WaitForPrecessExit();
  434. // }
  435. //
  436. // [Test]
  437. // public void ArrayValue()
  438. // {
  439. // Variable local = null;
  440. // List<Variable> subVars = new List<Variable>();
  441. //
  442. // StartProgram("ArrayValue");
  443. // WaitForPause(PausedReason.Break, null);
  444. // foreach(Variable var in debugger.SelectedFunction.LocalVariables) {
  445. // local = var; break;
  446. // }
  447. // Assert.AreEqual("array", local.Name);
  448. // Assert.AreEqual(true, local.Value.MayHaveSubVariables);
  449. // Assert.AreEqual(typeof(ArrayValue), local.Value.GetType());
  450. // Assert.AreEqual("{System.Int32[5]}", local.Value.AsString);
  451. // foreach(Variable var in local.Value.SubVariables) {
  452. // subVars.Add(var);
  453. // }
  454. // for(int i = 0; i < 5; i++) {
  455. // Assert.AreEqual("[" + i.ToString() + "]", subVars[i].Name);
  456. // Assert.AreEqual(i.ToString(), subVars[i].Value.AsString);
  457. // }
  458. //
  459. // debugger.Continue();
  460. // debugger.WaitForPrecessExit();
  461. // }
  462. //
  463. // [Test]
  464. // public void ObjectValue()
  465. // {
  466. // Variable local = null;
  467. // Variable baseClass;
  468. // List<Variable> subVars = new List<Variable>();
  469. //
  470. // StartProgram("ObjectValue");
  471. // WaitForPause(PausedReason.Break, null);
  472. // foreach(Variable var in debugger.SelectedFunction.LocalVariables) {
  473. // local = var;
  474. // }
  475. // Assert.AreEqual("val", local.Name);
  476. // Assert.AreEqual(true, local.Value.MayHaveSubVariables);
  477. // Assert.AreEqual(typeof(ObjectValue), local.Value.GetType());
  478. // Assert.AreEqual("{Debugger.Tests.TestPrograms.ObjectValue}", local.Value.AsString);
  479. // foreach(Variable var in local.Value.SubVariables) {
  480. // subVars.Add(var);
  481. // }
  482. // Assert.AreEqual("privateField", subVars[1].Name);
  483. // Assert.AreEqual("publicFiled", subVars[2].Name);
  484. // Assert.AreEqual("PublicProperty", subVars[3].Name);
  485. // Assert.AreEqual(typeof(Variable), subVars[1].GetType());
  486. // Assert.AreEqual(typeof(Variable), subVars[2].GetType());
  487. // Assert.AreEqual(typeof(Variable), subVars[3].GetType());
  488. // Assert.AreEqual(false, ((Variable)subVars[1]).IsPublic);
  489. // Assert.AreEqual(true, ((Variable)subVars[2]).IsPublic);
  490. // Assert.AreEqual(true, ((Variable)subVars[3]).IsPublic);
  491. // baseClass = subVars[0];
  492. // Assert.AreEqual(typeof(ObjectValue), baseClass.Value.GetType());
  493. // Assert.AreEqual("{Debugger.Tests.TestPrograms.BaseClass}", baseClass.Value.AsString);
  494. //
  495. // debugger.Continue();
  496. // WaitForPause(PausedReason.Break, null);
  497. // Assert.AreEqual(typeof(ObjectValue), baseClass.Value.GetType());
  498. // Assert.AreEqual("{Debugger.Tests.TestPrograms.BaseClass}", baseClass.Value.AsString);
  499. //
  500. // debugger.Continue();
  501. // debugger.WaitForPrecessExit();
  502. // }
  503. //
  504. // [Test]
  505. // public void PropertyVariable()
  506. // {
  507. // Variable local = null;
  508. // List<Variable> subVars = new List<Variable>();
  509. //
  510. // StartProgram("PropertyVariable");
  511. // WaitForPause(PausedReason.Break, null);
  512. // foreach(Variable var in debugger.SelectedFunction.LocalVariables) {
  513. // local = var;
  514. // }
  515. // foreach(Variable var in local.Value.SubVariables) {
  516. // subVars.Add(var);
  517. // }
  518. // Assert.AreEqual("PrivateProperty", subVars[1].Name);
  519. // Assert.AreEqual("PublicProperty", subVars[2].Name);
  520. // Assert.AreEqual("ExceptionProperty", subVars[3].Name);
  521. // Assert.AreEqual("StaticProperty", subVars[4].Name);
  522. //
  523. // Assert.AreEqual(typeof(UnavailableValue), subVars[1].Value.GetType());
  524. // debugger.StartEvaluation();
  525. // WaitForPause(PausedReason.EvalComplete, null);
  526. // Assert.AreEqual("private", subVars[1].Value.AsString);
  527. //
  528. // Assert.AreEqual(typeof(UnavailableValue), subVars[2].Value.GetType());
  529. // debugger.StartEvaluation();
  530. // WaitForPause(PausedReason.EvalComplete, null);
  531. // Assert.AreEqual("public", subVars[2].Value.AsString);
  532. //
  533. // Assert.AreEqual(typeof(UnavailableValue), subVars[3].Value.GetType());
  534. // debugger.StartEvaluation();
  535. // WaitForPause(PausedReason.EvalComplete, null);
  536. // Assert.AreEqual(typeof(UnavailableValue), subVars[3].Value.GetType());
  537. //
  538. // Assert.AreEqual(typeof(UnavailableValue), subVars[4].Value.GetType());
  539. // debugger.StartEvaluation();
  540. // WaitForPause(PausedReason.EvalComplete, null);
  541. // Assert.AreEqual("static", subVars[4].Value.AsString);
  542. //
  543. // debugger.Continue();
  544. // WaitForPause(PausedReason.Break, null);
  545. //
  546. // debugger.Continue();
  547. // debugger.WaitForPrecessExit();
  548. // }
  549. //
  550. // [Test]
  551. // public void PropertyVariableForm()
  552. // {
  553. // Variable local = null;
  554. //
  555. // StartProgram("PropertyVariableForm");
  556. // WaitForPause(PausedReason.Break, null);
  557. // foreach(Variable var in debugger.SelectedFunction.LocalVariables) {
  558. // local = var;
  559. // }
  560. // Assert.AreEqual("form", local.Name);
  561. // Assert.AreEqual(typeof(Variable), local.GetType());
  562. //
  563. // foreach(Variable var in local.Value.SubVariables) {
  564. // Assert.AreEqual(typeof(UnavailableValue), var.Value.GetType(), "Variable name: " + var.Name);
  565. // debugger.StartEvaluation();
  566. // WaitForPause(PausedReason.EvalComplete, null);
  567. // Assert.AreNotEqual(null, var.Value.AsString, "Variable name: " + var.Name);
  568. // }
  569. //
  570. // debugger.Continue();
  571. // WaitForPause(PausedReason.Break, null);
  572. //
  573. // foreach(Variable var in local.Value.SubVariables) {
  574. // Assert.AreEqual(typeof(UnavailableValue), var.Value.GetType(), "Variable name: " + var.Name);
  575. // }
  576. // debugger.StartEvaluation();
  577. // WaitForPause(PausedReason.EvalComplete, null);
  578. //
  579. // debugger.Continue();
  580. // debugger.WaitForPrecessExit();
  581. // }
  582. //
  583. // [Test]
  584. // public void SetIP()
  585. // {
  586. // StartProgram("SetIP");
  587. // WaitForPause(PausedReason.Break, "1");
  588. //
  589. // Assert.IsNotNull(debugger.SelectedFunction.CanSetIP("SetIP.cs", 16, 0));
  590. // Assert.IsNull(debugger.SelectedFunction.CanSetIP("SetIP.cs", 100, 0));
  591. // debugger.SelectedFunction.SetIP("SetIP.cs", 16, 0);
  592. // debugger.Continue();
  593. // WaitForPause(PausedReason.Break, "1");
  594. // Assert.AreEqual("1rn1rn", log);
  595. //
  596. // debugger.Continue();
  597. // debugger.WaitForPrecessExit();
  598. // }
  599. }
  600. }