Author: martin
Date: 2006-04-05 11:30:32 -0400 (Wed, 05 Apr 2006)
New Revision: 59080

Added:
   trunk/debugger/test/testsuite/TestEnum.cs
Removed:
   trunk/debugger/test/mono-debugger.tests/TestEnum.exp
Modified:
   trunk/debugger/test/testsuite/NUnit.cs
Log:
One more test is migrated ....

Deleted: trunk/debugger/test/mono-debugger.tests/TestEnum.exp
===================================================================
--- trunk/debugger/test/mono-debugger.tests/TestEnum.exp        2006-04-05 
15:27:53 UTC (rev 59079)
+++ trunk/debugger/test/mono-debugger.tests/TestEnum.exp        2006-04-05 
15:30:32 UTC (rev 59080)
@@ -1,34 +0,0 @@
-#!/usr/bin/expect -f
-#
-
-source $srcdir/mdb.exp
-
-set line_main 50
-set line_main_2 54
-
-set file $srcdir/TestEnum.cs
-
-mdb_start "TestEnum.exe"
-mdb_expect_frame 0 "X.Main()" $file $line_main
-mdb_send "break $line_main_2"
-set bpt_main_2 [mdb_expect_breakpoint]
-mdb_send "continue"
-mdb_expect_hit_breakpoint 0 "X.Main()" $bpt_main_2 $file $line_main_2
-
-mdb_send_and_expect "p /x irish_pub_thursday" "(Pub) \{ Music = 0x0, Drinks = 
0x301f \}"
-mdb_send_and_expect "p irish_pub_thursday.Music" "(Music) Irish"
-mdb_send_and_expect "p irish_pub_thursday.Drinks" "(Drinks) Tequila | Coffee | 
NonAlcoholic | Whine | Water | Beer | Rum | Alcoholic | Juice | Vodka | All | 
Tea"
-
-mdb_send_and_expect "p /x lunch_break" "(Pub) \{ Music = 0x2, Drinks = 0x1005 
\}"
-mdb_send_and_expect "p lunch_break" "(Pub) \{ Music = RockPop, Drinks = Coffee 
| Water \}"
-mdb_send_and_expect "p /x dinner" "(Pub) \{ Music = 0x1, Drinks = 0x100a \}"
-mdb_send_and_expect "p dinner" "(Pub) \{ Music = Country, Drinks = Juice | Tea 
\}"
-
-mdb_send "continue"
-mdb_expect_line "Pub"
-mdb_expect_line "Pub"
-mdb_expect_line "Pub"
-mdb_expect_line "Target exited."
-mdb_expect_prompt
-mdb_send "quit"
-

Modified: trunk/debugger/test/testsuite/NUnit.cs
===================================================================
--- trunk/debugger/test/testsuite/NUnit.cs      2006-04-05 15:27:53 UTC (rev 
59079)
+++ trunk/debugger/test/testsuite/NUnit.cs      2006-04-05 15:30:32 UTC (rev 
59080)
@@ -335,12 +335,18 @@
 
                public void AssertPrint (Thread thread, string expression, 
string exp_result)
                {
+                       AssertPrint (thread, DisplayFormat.Object, expression, 
exp_result);
+               }
+
+               public void AssertPrint (Thread thread, DisplayFormat format,
+                                        string expression, string exp_result)
+               {
                        string text = null;
                        try {
                                ScriptingContext context = GetContext (thread);
 
                                object obj = EvaluateExpression (context, 
expression);
-                               text = context.FormatObject (obj, 
DisplayFormat.Object);
+                               text = context.FormatObject (obj, format);
                        } catch (AssertionException) {
                                throw;
                        } catch (Exception ex) {

Added: trunk/debugger/test/testsuite/TestEnum.cs
===================================================================
--- trunk/debugger/test/testsuite/TestEnum.cs   2006-04-05 15:27:53 UTC (rev 
59079)
+++ trunk/debugger/test/testsuite/TestEnum.cs   2006-04-05 15:30:32 UTC (rev 
59080)
@@ -0,0 +1,52 @@
+using System;
+using NUnit.Framework;
+
+using Mono.Debugger;
+using Mono.Debugger.Languages;
+using Mono.Debugger.Frontend;
+
+namespace Mono.Debugger.Tests
+{
+       [TestFixture]
+       public class TestEnum : TestSuite
+       {
+               public TestEnum ()
+                       : base ("../test/src/TestEnum.exe")
+               { }
+
+               [Test]
+               public void Main ()
+               {
+                       Process process = Interpreter.Start ();
+                       Assert.IsTrue (process.IsManaged);
+                       Assert.IsTrue (process.MainThread.IsStopped);
+                       Thread thread = process.MainThread;
+
+                       const int line_main = 50;
+                       const int line_main_2 = 54;
+
+                       AssertStopped (thread, "X.Main()", line_main);
+
+                       int bpt_main_2 = AssertBreakpoint (line_main_2.ToString 
());
+                       Execute ("continue");
+                       AssertHitBreakpoint (thread, bpt_main_2, "X.Main()", 
line_main_2);
+
+                       AssertPrint (thread, DisplayFormat.HexaDecimal, 
"irish_pub_thursday",
+                                    "(Pub) { Music = 0x0, Drinks = 0x301f }");
+                       AssertPrint (thread, "irish_pub_thursday.Music", 
"(Music) Irish");
+                       AssertPrint (thread, "irish_pub_thursday.Drinks",
+                                    "(Drinks) Tequila | Coffee | NonAlcoholic 
| Whine | " +
+                                    "Water | Beer | Rum | Alcoholic | Juice | 
Vodka | All | Tea");
+                       AssertPrint (thread, DisplayFormat.HexaDecimal, 
"lunch_break",
+                                    "(Pub) { Music = 0x2, Drinks = 0x1005 }");
+                       AssertPrint (thread, "lunch_break",
+                                    "(Pub) { Music = RockPop, Drinks = Coffee 
| Water }");
+                       AssertPrint (thread, DisplayFormat.HexaDecimal, 
"dinner",
+                                    "(Pub) { Music = 0x1, Drinks = 0x100a }");
+                       AssertPrint (thread, "dinner",
+                                    "(Pub) { Music = Country, Drinks = Juice | 
Tea }");
+
+                       Execute ("kill");
+               }
+       }
+}

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to