Author: gert
Date: 2007-12-03 14:21:28 -0500 (Mon, 03 Dec 2007)
New Revision: 90582

Added:
   trunk/gert/standalone/bug325084/
   trunk/gert/standalone/bug325084/default.build
   trunk/gert/standalone/bug325084/test.cs
   trunk/gert/standalone/bug345467/
   trunk/gert/standalone/bug345467/default.build
   trunk/gert/standalone/bug345467/test1.cs
   trunk/gert/standalone/bug345467/test2.cs
Modified:
   trunk/gert/standalone/bug344163/default.build
Log:
Added tests for bug #325084 and #345467.


Added: trunk/gert/standalone/bug325084/default.build
===================================================================
--- trunk/gert/standalone/bug325084/default.build       2007-12-03 19:09:56 UTC 
(rev 90581)
+++ trunk/gert/standalone/bug325084/default.build       2007-12-03 19:21:28 UTC 
(rev 90582)
@@ -0,0 +1,60 @@
+<project name="bug325084" 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="compile" />
+                               <call target="clean" />
+                       </if>
+               </foreach>
+
+               <property name="nant.settings.currentframework" 
value="${original.targetframework}" />
+       </target>
+
+       <target name="compile">
+               <record name="out" action="Start" />
+               <csc target="exe" define="${csc.defines}" output="test.exe" 
warnaserror="true" warninglevel="4" failonerror="false">
+                       <sources>
+                               <include name="test.cs" />
+                       </sources>
+               </csc>
+               <record name="out" action="Close" />
+               <fail if="${file::exists('test.exe')}">#1</fail>
+               <fail unless="${file::exists('out')}">#2</fail>
+               <loadfile file="out" property="out" />
+               <fail if="${string::index-of(out,'error CS0103') == 
-1}">#3</fail>
+               <fail if="${string::index-of(out,'Exception') != -1 }">#4</fail>
+       </target>
+
+       <target name="rebuild" depends="clean, build" />
+</project>


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

Added: trunk/gert/standalone/bug325084/test.cs
===================================================================
--- trunk/gert/standalone/bug325084/test.cs     2007-12-03 19:09:56 UTC (rev 
90581)
+++ trunk/gert/standalone/bug325084/test.cs     2007-12-03 19:21:28 UTC (rev 
90582)
@@ -0,0 +1,52 @@
+using System;
+using System.Collections;
+
+class Program
+{
+       static void Main ()
+       {
+               string filename = "ee";
+               if (filename != "ee") {
+                       try {
+                               stream = "bb";
+                       } finally {
+                       }
+               }
+       }
+}
+
+public class class1
+{
+       public void function ()
+       {
+       }
+}
+
+public class class2
+{
+       public void function ()
+       {
+       }
+}
+
+public class Test
+{
+       ArrayList list1;
+       ArrayList list2;
+
+       public void TestFunction ()
+       {
+               list1 = new ArrayList ();
+               list2 = new ArrayList ();
+
+               int i = 0;
+               if (i == 0) {
+                       foreach (class1 c1 in list1) {
+                               c1.function ();
+                       }
+                       foreach (class2 c2 in list2) {
+                               c1.function ();
+                       }
+               }
+       }
+}


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

Modified: trunk/gert/standalone/bug344163/default.build
===================================================================
--- trunk/gert/standalone/bug344163/default.build       2007-12-03 19:09:56 UTC 
(rev 90581)
+++ trunk/gert/standalone/bug344163/default.build       2007-12-03 19:21:28 UTC 
(rev 90582)
@@ -1,4 +1,4 @@
-<project name="bug334163" default="rebuild">
+<project name="bug344163" 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>

Added: trunk/gert/standalone/bug345467/default.build
===================================================================
--- trunk/gert/standalone/bug345467/default.build       2007-12-03 19:09:56 UTC 
(rev 90581)
+++ trunk/gert/standalone/bug345467/default.build       2007-12-03 19:21:28 UTC 
(rev 90582)
@@ -0,0 +1,57 @@
+<project name="bug345467" 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-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0" />
+       </target>
+
+       <target name="init">
+               <if test="${not 
target::exists(nant.settings.currentframework)}">
+                       <fail>Framework '${nant.settings.currentframework}' is 
not supported.</fail>
+               </if>
+               <call target="${nant.settings.currentframework}" />
+       </target>
+       
+       <property name="frameworks" value="mono-2.0,net-2.0" />
+
+       <target name="clean">
+               <delete>
+                       <fileset>
+                               <include name="out" />
+                               <include name="test1.dll" />
+                               <include name="test2.dll" />
+                       </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="compile" />
+                               <call target="clean" />
+                       </if>
+               </foreach>
+
+               <property name="nant.settings.currentframework" 
value="${original.targetframework}" />
+       </target>
+
+       <target name="compile" depends="init">
+               <csc target="library" define="${csc.defines}" 
output="test1.dll" warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="test1.cs" />
+                       </sources>
+               </csc>
+               <csc target="library" define="${csc.defines}" 
output="test2.dll" warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="test2.cs" />
+                       </sources>
+               </csc>
+       </target>
+
+       <target name="rebuild" depends="clean, build" />
+</project>


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

Added: trunk/gert/standalone/bug345467/test1.cs
===================================================================
--- trunk/gert/standalone/bug345467/test1.cs    2007-12-03 19:09:56 UTC (rev 
90581)
+++ trunk/gert/standalone/bug345467/test1.cs    2007-12-03 19:21:28 UTC (rev 
90582)
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+
+internal delegate void EmptyDelegate ();
+
+class BaseObject
+{
+       static void Closure (EmptyDelegate x)
+       {
+       }
+
+       static List<T> Query<T> (out int? count) where T : BaseObject
+       {
+               count = 0;
+               List<T> results = new List<T> ();
+               Closure (delegate { results.Add (MakeSomething<T> ()); });
+               return results;
+       }
+
+       static T MakeSomething<T> () where T : BaseObject
+       {
+               return null;
+       }
+}


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

Added: trunk/gert/standalone/bug345467/test2.cs
===================================================================
--- trunk/gert/standalone/bug345467/test2.cs    2007-12-03 19:09:56 UTC (rev 
90581)
+++ trunk/gert/standalone/bug345467/test2.cs    2007-12-03 19:21:28 UTC (rev 
90582)
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+
+internal delegate void EmptyDelegate ();
+
+class BaseObject
+{
+       static void Closure (EmptyDelegate x)
+       {
+       }
+
+       static List<T> Query<T> () where T : BaseObject
+       {
+               List<T> results = new List<T> ();
+               Closure (delegate { results.Add (MakeSomething<T> ()); });
+               return results;
+       }
+
+       static T MakeSomething<T> () where T : BaseObject
+       {
+               return null;
+       }
+}


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

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

Reply via email to