Author: gert
Date: 2007-05-20 11:30:27 -0400 (Sun, 20 May 2007)
New Revision: 77724

Added:
   trunk/gert/standalone/bug59665/
   trunk/gert/standalone/bug59665/default.build
   trunk/gert/standalone/bug59665/test.cs
   trunk/gert/standalone/bug61134/
   trunk/gert/standalone/bug61134/default.build
   trunk/gert/standalone/bug61134/test.cs
   trunk/gert/standalone/bug72166/
   trunk/gert/standalone/bug72166/default.build
   trunk/gert/standalone/bug72166/test.cs
   trunk/gert/standalone/bug74525/
   trunk/gert/standalone/bug74525/default.build
   trunk/gert/standalone/bug74525/test.cs
   trunk/gert/standalone/bug74955/
   trunk/gert/standalone/bug74955/Form1.vb
   trunk/gert/standalone/bug74955/default.build
Modified:
   trunk/gert/standalone/known-issues
Log:
Added some more tests.


Added: trunk/gert/standalone/bug59665/default.build
===================================================================
--- trunk/gert/standalone/bug59665/default.build        2007-05-20 15:01:27 UTC 
(rev 77723)
+++ trunk/gert/standalone/bug59665/default.build        2007-05-20 15:30:27 UTC 
(rev 77724)
@@ -0,0 +1,58 @@
+<project name="bug59665" default="rebuild">
+       <target name="mono-1.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,ONLY_1_1,MONO" />
+       </target>
+
+       <target name="mono-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0,MONO" />
+       </target>
+
+       <target name="net-1.1">
+               <property name="csc.defines" value="NET_1_0,NET_1_1,ONLY_1_1" />
+       </target>
+
+       <target name="net-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0" />
+       </target>
+
+       <property name="frameworks" value="mono-1.0,mono-2.0,net-1.1,net-2.0" />
+       
+       <target name="clean">
+               <delete>
+                       <fileset>
+                               <include name="out" />
+                               <include name="test.exe" />
+                       </fileset>
+               </delete>
+       </target>
+
+       <target name="build">
+               <property name="original.targetframework" 
value="${nant.settings.currentframework}" />
+
+               <foreach property="framework" item="String" in="${frameworks}" 
delim=",">
+                       <if test="${framework::exists(framework)}">
+                               <property name="nant.settings.currentframework" 
value="${framework}" />
+                               <call 
target="${nant.settings.currentframework}" />
+                               <call target="run" />
+                               <call target="clean" />
+                       </if>
+               </foreach>
+
+               <property name="nant.settings.currentframework" 
value="${original.targetframework}" />
+       </target>
+
+       <target name="compile">
+               <csc target="exe" define="${csc.defines}" output="test.exe" 
warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="test.cs" />
+                       </sources>
+               </csc>
+       </target>
+
+       <target name="run" depends="compile">
+               <exec program="test.exe" managed="true" output="out" />
+               <fail if="${file::exists('out')}" />
+       </target>
+
+       <target name="rebuild" depends="clean, build" />
+</project>


Property changes on: trunk/gert/standalone/bug59665/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug59665/test.cs
===================================================================
--- trunk/gert/standalone/bug59665/test.cs      2007-05-20 15:01:27 UTC (rev 
77723)
+++ trunk/gert/standalone/bug59665/test.cs      2007-05-20 15:30:27 UTC (rev 
77724)
@@ -0,0 +1,18 @@
+using System;
+
+class Program
+{
+       static int Main ()
+       {
+               if (typeof (int).GUID != new Guid 
("a310fadd-7c33-377c-9d6b-599b0317d7f2"))
+                       return 1;
+
+               if (typeof (string).GUID != new Guid 
("296afbff-1b0b-3ff5-9d6c-4e7e599f8b57"))
+                       return 2;
+
+               if (typeof (Test).GUID != new Guid 
("2632d937-461e-38f3-9939-c110f0107e4f"))
+                       return 3;
+
+               return 0;
+       }
+}


Property changes on: trunk/gert/standalone/bug59665/test.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug61134/default.build
===================================================================
--- trunk/gert/standalone/bug61134/default.build        2007-05-20 15:01:27 UTC 
(rev 77723)
+++ trunk/gert/standalone/bug61134/default.build        2007-05-20 15:30:27 UTC 
(rev 77724)
@@ -0,0 +1,61 @@
+<project name="bug61134" default="rebuild">
+       <target name="mono-1.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,ONLY_1_1,MONO" />
+       </target>
+
+       <target name="mono-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0,MONO" />
+       </target>
+
+       <target name="net-1.1">
+               <property name="csc.defines" value="NET_1_0,NET_1_1,ONLY_1_1" />
+       </target>
+
+       <target name="net-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0" />
+       </target>
+
+       <property name="frameworks" value="mono-1.0,mono-2.0,net-1.1,net-2.0" />
+
+       <target name="clean">
+               <delete>
+                       <fileset>
+                               <include name="out" />
+                               <include name="test.exe" />
+                       </fileset>
+               </delete>
+       </target>
+
+       <target name="build">
+               <property name="original.targetframework" 
value="${nant.settings.currentframework}" />
+
+               <foreach property="framework" item="String" in="${frameworks}" 
delim=",">
+                       <if test="${framework::exists(framework)}">
+                               <property name="nant.settings.currentframework" 
value="${framework}" />
+                               <call 
target="${nant.settings.currentframework}" />
+                               <call target="run" />
+                               <call target="clean" />
+                       </if>
+               </foreach>
+
+               <property name="nant.settings.currentframework" 
value="${original.targetframework}" />
+       </target>
+
+       <target name="compile">
+               <csc target="exe" define="${csc.defines}" output="test.exe" 
unsafe="true" warnaserror="true" warninglevel="4">
+                       <nowarn>
+                               <warning number="0169" />
+                       </nowarn>
+                       <sources>
+                               <include name="test.cs" />
+                       </sources>
+               </csc>
+       </target>
+
+       <target name="run" depends="compile">
+               <exec program="test.exe" managed="true" output="out" />
+               <fail if="${file::exists('out')}" />
+       </target>
+
+       <target name="rebuild" depends="clean, build" />
+</project>


Property changes on: trunk/gert/standalone/bug61134/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug61134/test.cs
===================================================================
--- trunk/gert/standalone/bug61134/test.cs      2007-05-20 15:01:27 UTC (rev 
77723)
+++ trunk/gert/standalone/bug61134/test.cs      2007-05-20 15:30:27 UTC (rev 
77724)
@@ -0,0 +1,117 @@
+using System;
+using System.Runtime.InteropServices;
+
+class Program
+{
+       static int Main ()
+       {
+               GCHandle h;
+               bool failed;
+
+               h = GCHandle.Alloc (new byte [] { 1, 2, 3, 4, 5 }, 
GCHandleType.Pinned);
+               if (CheckBytes (h, 0, 1))
+                       return 1;
+               if (CheckBytes (h, 4, 5))
+                       return 2;
+               h.Free ();
+               h = GCHandle.Alloc (new String ('\u2222', 6), 
GCHandleType.Pinned);
+               if (CheckBytes (h, 0, 0x22))
+                       return 3;
+               if (CheckBytes (h, 4, 0x22))
+                       return 4;
+               h.Free ();
+               h = GCHandle.Alloc (new TestClass (6, 10), GCHandleType.Pinned);
+               if (CheckBytes (h, 0, 6))
+                       return 5;
+               if (CheckBytes (h, 8, 10))
+                       return 6;
+               h.Free ();
+               // allocate a normal handle, but use AddrOfPinnedObject ()
+               h = GCHandle.Alloc (new TestClass (6, 10), GCHandleType.Normal);
+               failed = false;
+               try {
+                       IntPtr v = h.AddrOfPinnedObject ();
+                       if (v == IntPtr.Zero) {
+                               return 1;
+                       }
+               } catch (InvalidOperationException) {
+                       failed = true;
+               }
+               if (!failed)
+                       return 7;
+               h.Free ();
+
+               failed = false;
+               try {
+                       h = GCHandle.Alloc (new TestClassNoBlit (), 
GCHandleType.Pinned);
+               } catch (ArgumentException) {
+                       failed = true;
+               }
+               if (!failed)
+                       return 8;
+
+               failed = false;
+               try {
+                       h = GCHandle.Alloc (new TestClassNoBlit2 (), 
GCHandleType.Pinned);
+               } catch (ArgumentException) {
+                       failed = true;
+               }
+               if (!failed)
+                       return 9;
+
+               failed = false;
+               try {
+                       h = GCHandle.Alloc (new TestClassAutoLayout (2, 3), 
GCHandleType.Pinned);
+               } catch (ArgumentException) {
+                       failed = true;
+               }
+               if (!failed)
+                       return 10;
+
+               return 0;
+       }
+
+       public unsafe static bool CheckBytes (GCHandle h, int pos, byte val)
+       {
+               IntPtr p = h.AddrOfPinnedObject ();
+               byte* a = (byte*) p.ToPointer ();
+               return a [pos] != val;
+       }
+}
+
+[StructLayout (LayoutKind.Sequential)]
+public class TestClass
+{
+       private byte mByte;
+       public int mInt;
+       private byte mByte2;
+       public TestClass (byte b, int i)
+       {
+               mByte = b;
+               mInt = i;
+               mByte2 = (byte) i;
+       }
+}
+
+[StructLayout (LayoutKind.Sequential)]
+public class TestClassNoBlit
+{
+       bool bval;
+}
+
+[StructLayout (LayoutKind.Sequential)]
+public class TestClassNoBlit2
+{
+       string sval;
+}
+
+public class TestClassAutoLayout
+{
+       private byte mByte;
+       public int mInt;
+       public TestClassAutoLayout (byte b, int i)
+       {
+               mByte = b;
+               mInt = i;
+       }
+}


Property changes on: trunk/gert/standalone/bug61134/test.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug72166/default.build
===================================================================
--- trunk/gert/standalone/bug72166/default.build        2007-05-20 15:01:27 UTC 
(rev 77723)
+++ trunk/gert/standalone/bug72166/default.build        2007-05-20 15:30:27 UTC 
(rev 77724)
@@ -0,0 +1,58 @@
+<project name="bug72166" default="rebuild">
+       <target name="mono-1.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,ONLY_1_1,MONO" />
+       </target>
+
+       <target name="mono-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0,MONO" />
+       </target>
+
+       <target name="net-1.1">
+               <property name="csc.defines" value="NET_1_0,NET_1_1,ONLY_1_1" />
+       </target>
+
+       <target name="net-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0" />
+       </target>
+
+       <property name="frameworks" value="mono-1.0,mono-2.0,net-1.1,net-2.0" />
+
+       <target name="clean">
+               <delete>
+                       <fileset>
+                               <include name="out" />
+                               <include name="test.exe" />
+                       </fileset>
+               </delete>
+       </target>
+
+       <target name="build">
+               <property name="original.targetframework" 
value="${nant.settings.currentframework}" />
+
+               <foreach property="framework" item="String" in="${frameworks}" 
delim=",">
+                       <if test="${framework::exists(framework)}">
+                               <property name="nant.settings.currentframework" 
value="${framework}" />
+                               <call 
target="${nant.settings.currentframework}" />
+                               <call target="run" />
+                               <call target="clean" />
+                       </if>
+               </foreach>
+
+               <property name="nant.settings.currentframework" 
value="${original.targetframework}" />
+       </target>
+
+       <target name="compile">
+               <csc target="exe" define="${csc.defines}" output="test.exe" 
warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="test.cs" />
+                       </sources>
+               </csc>
+       </target>
+
+       <target name="run" depends="compile">
+               <exec program="test.exe" managed="true" output="out" />
+               <fail if="${file::exists('out')}" />
+       </target>
+
+       <target name="rebuild" depends="clean, build" />
+</project>


Property changes on: trunk/gert/standalone/bug72166/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug72166/test.cs
===================================================================
--- trunk/gert/standalone/bug72166/test.cs      2007-05-20 15:01:27 UTC (rev 
77723)
+++ trunk/gert/standalone/bug72166/test.cs      2007-05-20 15:30:27 UTC (rev 
77724)
@@ -0,0 +1,14 @@
+using System;
+using System.Text.RegularExpressions;
+
+class Program
+{
+       static int Main ()
+       {
+               string result = Regex.Replace (@"a", "a", @"\\");
+               if (result == @"\\") {
+                       return 0;
+               }
+               return 1;
+       }
+}


Property changes on: trunk/gert/standalone/bug72166/test.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug74525/default.build
===================================================================
--- trunk/gert/standalone/bug74525/default.build        2007-05-20 15:01:27 UTC 
(rev 77723)
+++ trunk/gert/standalone/bug74525/default.build        2007-05-20 15:30:27 UTC 
(rev 77724)
@@ -0,0 +1,56 @@
+<project name="bug74525" default="rebuild">
+       <target name="mono-1.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,ONLY_1_1,MONO" />
+       </target>
+
+       <target name="mono-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0,MONO" />
+       </target>
+
+       <target name="net-1.1">
+               <property name="csc.defines" value="NET_1_0,NET_1_1,ONLY_1_1" />
+       </target>
+
+       <target name="net-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0" />
+       </target>
+
+       <property name="frameworks" value="mono-1.0,mono-2.0,net-1.1,net-2.0" />
+
+       <target name="clean">
+               <delete>
+                       <fileset>
+                               <include name="test.exe" />
+                       </fileset>
+               </delete>
+       </target>
+
+       <target name="build">
+               <property name="original.targetframework" 
value="${nant.settings.currentframework}" />
+
+               <foreach property="framework" item="String" in="${frameworks}" 
delim=",">
+                       <if test="${framework::exists(framework)}">
+                               <property name="nant.settings.currentframework" 
value="${framework}" />
+                               <call 
target="${nant.settings.currentframework}" />
+                               <call target="run" />
+                               <call target="clean" />
+                       </if>
+               </foreach>
+
+               <property name="nant.settings.currentframework" 
value="${original.targetframework}" />
+       </target>
+
+       <target name="compile">
+               <csc target="exe" define="${csc.defines}" output="test.exe" 
warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="test.cs" />
+                       </sources>
+               </csc>
+       </target>
+
+       <target name="run" depends="compile">
+               <exec program="test.exe" managed="true" />
+       </target>
+
+       <target name="rebuild" depends="clean, build" />
+</project>


Property changes on: trunk/gert/standalone/bug74525/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug74525/test.cs
===================================================================
--- trunk/gert/standalone/bug74525/test.cs      2007-05-20 15:01:27 UTC (rev 
77723)
+++ trunk/gert/standalone/bug74525/test.cs      2007-05-20 15:30:27 UTC (rev 
77724)
@@ -0,0 +1,79 @@
+using System;
+using System.Threading;
+
+namespace MonitorSynchro
+{
+       class MonitorSample
+       {
+               Thread t1;
+               Thread t2;
+               object myLock = new object();
+
+               public void ThreadProc1()
+               {
+                       Console.WriteLine("T1 getting lock...");
+                       lock(myLock)
+                       {
+                               Console.WriteLine("T1 got the lock.");
+                               Console.WriteLine("T1 sleeping for 10 sec...");
+                               Thread.Sleep(10000);
+                               Console.WriteLine("T1 woke up. Pulse and wait 
now...");
+                               Monitor.Pulse(myLock);
+                               Monitor.Wait(myLock);
+                               Console.WriteLine("T1 woke up. Stopping T2 in 
10 sec...");
+                               Thread.Sleep(10000);
+                               Console.WriteLine("T1 stopping T2 now.");
+                               t2.Interrupt();
+                       }
+                       Console.WriteLine("T1 released lock and waiting for 
T2.");
+                       t2.Join();
+                       Console.WriteLine("T1 leaving. Bye!");
+               }
+
+               public void ThreadProc2()
+               {
+                       bool working = true;
+
+                       while(working)
+                       {
+                               try
+                               {
+                                       Console.WriteLine("T2 getting lock...");
+                                       lock(myLock)
+                                       {
+                                               Console.WriteLine("T2 got the 
lock.");
+                                               Console.WriteLine("T2 sleeping 
for 5 sec...");
+                                               Thread.Sleep(5000);
+                                               Console.WriteLine("T2 woke up. 
Pulse and sleep 1 sec now...");
+                                               Monitor.Pulse(myLock);
+                                               Thread.Sleep(1000);
+                                       }
+                                       Console.WriteLine("T2 released lock.");
+                               }
+                               catch(ThreadInterruptedException)
+                               {
+                                       Console.WriteLine("T2 being asked to 
quit.");
+                                       working = false;
+                               }
+                       }
+                       Console.WriteLine("T2 leaving. Bye!");
+               }
+
+               public MonitorSample()
+               {
+                       t1 = new Thread(new ThreadStart(ThreadProc1));
+                       t2 = new Thread(new ThreadStart(ThreadProc2));
+
+                       t1.Start();
+                       t2.Start();
+
+                       t1.Join();
+               }
+
+               static void Main(string[] args)
+               {
+                       new MonitorSample();
+                       return;
+               }
+       }
+}


Property changes on: trunk/gert/standalone/bug74525/test.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug74955/Form1.vb
===================================================================
--- trunk/gert/standalone/bug74955/Form1.vb     2007-05-20 15:01:27 UTC (rev 
77723)
+++ trunk/gert/standalone/bug74955/Form1.vb     2007-05-20 15:30:27 UTC (rev 
77724)
@@ -0,0 +1,39 @@
+Public Class Form1
+    Inherits System.Windows.Forms.Form
+
+#Region " Windows Form Designer generated code "
+
+    Public Sub New()
+        MyBase.New()
+
+        'This call is required by the Windows Form Designer.
+        InitializeComponent()
+
+        'Add any initialization after the InitializeComponent() call
+
+    End Sub
+
+    'Form overrides dispose to clean up the component list.
+    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
+        If disposing Then
+            If Not (components Is Nothing) Then
+                components.Dispose()
+            End If
+        End If
+        MyBase.Dispose(disposing)
+    End Sub
+
+    'Required by the Windows Form Designer
+    Private components As System.ComponentModel.IContainer
+
+    'NOTE: The following procedure is required by the Windows Form Designer
+    'It can be modified using the Windows Form Designer.  
+    'Do not modify it using the code editor.
+    <System.Diagnostics.DebuggerStepThrough()> Private Sub 
InitializeComponent()
+        components = New System.ComponentModel.Container()
+        Me.Text = "Form1"
+    End Sub
+
+#End Region
+
+End Class


Property changes on: trunk/gert/standalone/bug74955/Form1.vb
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug74955/default.build
===================================================================
--- trunk/gert/standalone/bug74955/default.build        2007-05-20 15:01:27 UTC 
(rev 77723)
+++ trunk/gert/standalone/bug74955/default.build        2007-05-20 15:30:27 UTC 
(rev 77724)
@@ -0,0 +1,71 @@
+<project name="bug74955" default="rebuild">
+       <target name="mono-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0,MONO" />
+       </target>
+
+       <target name="net-1.1">
+               <property name="csc.defines" value="NET_1_0,NET_1_1,ONLY_1_1" />
+       </target>
+
+       <target name="net-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0" />
+       </target>
+
+       <property name="frameworks" value="mono-2.0,net-1.1,net-2.0" />
+
+       <target name="clean">
+               <delete>
+                       <fileset>
+                               <include name="Form1.exe" />
+                               <include name="Form1.exe.mdb" />
+                               <include name="out" />
+                       </fileset>
+               </delete>
+       </target>
+
+       <target name="build">
+               <property name="original.targetframework" 
value="${nant.settings.currentframework}" />
+
+               <foreach property="framework" item="String" in="${frameworks}" 
delim=",">
+                       <if test="${framework::exists(framework)}">
+                               <property name="nant.settings.currentframework" 
value="${framework}" />
+                               <call 
target="${nant.settings.currentframework}" />
+                               <call target="compile" />
+                               <call target="clean" />
+                       </if>
+               </foreach>
+
+               <property name="nant.settings.currentframework" 
value="${original.targetframework}" />
+       </target>
+
+       <target name="compile">
+               <vbc target="winexe" output="Form1.exe" main="Form1">
+                       <sources>
+                               <include name="Form1.vb" />
+                       </sources>
+                       <references>
+                               <include name="System.Windows.Forms.dll" />
+                       </references>
+               </vbc>
+               <fail unless="${file::exists('Form1.exe')}">#1</fail>
+
+               <call target="clean" />
+
+               <record name="out" action="Start" />
+               <vbc target="winexe" output="Form1.exe" failonerror="false">
+                       <sources>
+                               <include name="Form1.vb" />
+                       </sources>
+                       <references>
+                               <include name="System.Windows.Forms.dll" />
+                       </references>
+               </vbc>
+               <record name="out" action="Close" />
+               <fail if="${file::exists('Form1.exe')}">#2</fail>
+               <fail unless="${file::exists('out')}">#3</fail>
+               <loadfile file="out" property="out" />
+               <fail unless="${string::index-of(out,'BC30420') != 
-1}">#4</fail>
+       </target>
+
+       <target name="rebuild" depends="clean, build" />
+</project>


Property changes on: trunk/gert/standalone/bug74955/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/gert/standalone/known-issues
===================================================================
--- trunk/gert/standalone/known-issues  2007-05-20 15:01:27 UTC (rev 77723)
+++ trunk/gert/standalone/known-issues  2007-05-20 15:30:27 UTC (rev 77724)
@@ -1,4 +1,7 @@
 bug57612/**
+bug59665/**
+bug61134/**
+bug74955/**
 bug77208/**
 bug78455/**
 bug81563/**

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

Reply via email to