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

Added:
   trunk/gert/standalone/bug80540/
   trunk/gert/standalone/bug80540/default.build
   trunk/gert/standalone/bug80540/liba.cs
   trunk/gert/standalone/bug80540/libb.cs
   trunk/gert/standalone/bug80540/test.cs
   trunk/gert/standalone/bug81691/
   trunk/gert/standalone/bug81691/default.build
   trunk/gert/standalone/bug81691/liba.cs
   trunk/gert/standalone/bug81691/libb.cs
   trunk/gert/standalone/bug81691/test.cs
Modified:
   trunk/gert/standalone/known-issues
Log:
Added tests for bug #80540 and #81691.


Added: trunk/gert/standalone/bug80540/default.build
===================================================================
--- trunk/gert/standalone/bug80540/default.build        2007-05-20 14:38:47 UTC 
(rev 77722)
+++ trunk/gert/standalone/bug80540/default.build        2007-05-20 15:01:27 UTC 
(rev 77723)
@@ -0,0 +1,84 @@
+<project name="bug80540" default="rebuild">
+       <target name="mono-1.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,ONLY_1_1,MONO" />
+               <property name="expect.failure" value="true" />
+       </target>
+
+       <target name="mono-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0,MONO" />
+               <property name="expect.failure" value="true" />
+       </target>
+
+       <target name="net-1.1">
+               <property name="csc.defines" value="NET_1_0,NET_1_1,ONLY_1_1" />
+               <property name="expect.failure" value="false" />
+       </target>
+
+       <target name="net-2.0">
+               <property name="csc.defines" 
value="NET_1_0,NET_1_1,NET_2_0,ONLY_2_0" />
+               <property name="expect.failure" value="false" />
+       </target>
+
+       <property name="frameworks" value="mono-1.0,mono-2.0,net-1.1,net-2.0" />
+
+       <target name="clean">
+               <delete>
+                       <fileset>
+                               <include name="liba.dll" />
+                               <include name="libb.dll" />
+                               <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">
+               <csc target="library" define="${csc.defines}" output="liba.dll" 
warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="liba.cs" />
+                       </sources>
+               </csc>
+               <csc target="library" define="${csc.defines}" output="libb.dll" 
warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="libb.cs" />
+                       </sources>
+                       <references>
+                               <include name="liba.dll" />
+                       </references>
+               </csc>
+               <delete file="liba.dll" />
+               <record name="out" action="Start" />
+               <csc target="exe" define="${csc.defines}" output="test.exe" 
warnaserror="true" warninglevel="4" failonerror="${not(expect.failure)}">
+                       <sources>
+                               <include name="test.cs" />
+                       </sources>
+                       <references>
+                               <include name="libb.dll" />
+                       </references>
+               </csc>
+               <record name="out" action="Close" />
+               <if test="${expect.failure}">
+                       <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,'SIGSEGV') != 
-1}">#3</fail>
+               </if>
+       </target>
+
+       <target name="rebuild" depends="clean, build" />
+</project>


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

Added: trunk/gert/standalone/bug80540/liba.cs
===================================================================
--- trunk/gert/standalone/bug80540/liba.cs      2007-05-20 14:38:47 UTC (rev 
77722)
+++ trunk/gert/standalone/bug80540/liba.cs      2007-05-20 15:01:27 UTC (rev 
77723)
@@ -0,0 +1,6 @@
+namespace NS.A
+{
+       public class TestA
+       {
+       }
+}
\ No newline at end of file


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

Added: trunk/gert/standalone/bug80540/libb.cs
===================================================================
--- trunk/gert/standalone/bug80540/libb.cs      2007-05-20 14:38:47 UTC (rev 
77722)
+++ trunk/gert/standalone/bug80540/libb.cs      2007-05-20 15:01:27 UTC (rev 
77723)
@@ -0,0 +1,13 @@
+namespace NS.B
+{
+       public class TestB
+       {
+               private static readonly NS.A.TestA testb = new NS.A.TestA ();
+
+               public TestB ()
+               {
+                       if (testb == null) {
+                       }
+               }
+       }
+}


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

Added: trunk/gert/standalone/bug80540/test.cs
===================================================================
--- trunk/gert/standalone/bug80540/test.cs      2007-05-20 14:38:47 UTC (rev 
77722)
+++ trunk/gert/standalone/bug80540/test.cs      2007-05-20 15:01:27 UTC (rev 
77723)
@@ -0,0 +1,9 @@
+using NS.B;
+
+public class Test
+{
+       static void Main (string [] args)
+       {
+               new TestB ();
+       }
+}


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

Added: trunk/gert/standalone/bug81691/default.build
===================================================================
--- trunk/gert/standalone/bug81691/default.build        2007-05-20 14:38:47 UTC 
(rev 77722)
+++ trunk/gert/standalone/bug81691/default.build        2007-05-20 15:01:27 UTC 
(rev 77723)
@@ -0,0 +1,77 @@
+<project name="bug81691" 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="liba.dll" />
+                               <include name="libb.dll" />
+                               <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="library" define="${csc.defines}" output="liba.dll" 
warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="liba.cs" />
+                       </sources>
+               </csc>
+               <csc target="library" define="${csc.defines}" output="libb.dll" 
warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="libb.cs" />
+                       </sources>
+                       <references>
+                               <include name="liba.dll" />
+                       </references>
+               </csc>
+               <csc target="exe" define="${csc.defines}" output="test.exe" 
warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="test.cs" />
+                       </sources>
+                       <references>
+                               <include name="libb.dll" />
+                       </references>
+               </csc>
+       </target>
+
+       <target name="run" depends="compile">
+               <delete file="liba.dll" />
+               <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/bug81691/default.build
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/gert/standalone/bug81691/liba.cs
===================================================================
--- trunk/gert/standalone/bug81691/liba.cs      2007-05-20 14:38:47 UTC (rev 
77722)
+++ trunk/gert/standalone/bug81691/liba.cs      2007-05-20 15:01:27 UTC (rev 
77723)
@@ -0,0 +1,6 @@
+namespace NS.A
+{
+       public class TestA
+       {
+       }
+}
\ No newline at end of file


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

Added: trunk/gert/standalone/bug81691/libb.cs
===================================================================
--- trunk/gert/standalone/bug81691/libb.cs      2007-05-20 14:38:47 UTC (rev 
77722)
+++ trunk/gert/standalone/bug81691/libb.cs      2007-05-20 15:01:27 UTC (rev 
77723)
@@ -0,0 +1,13 @@
+namespace NS.B
+{
+       public class TestB
+       {
+               private static readonly NS.A.TestA testb = new NS.A.TestA ();
+
+               public TestB ()
+               {
+                       if (testb == null) {
+                       }
+               }
+       }
+}


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

Added: trunk/gert/standalone/bug81691/test.cs
===================================================================
--- trunk/gert/standalone/bug81691/test.cs      2007-05-20 14:38:47 UTC (rev 
77722)
+++ trunk/gert/standalone/bug81691/test.cs      2007-05-20 15:01:27 UTC (rev 
77723)
@@ -0,0 +1,47 @@
+using System;
+using System.IO;
+using System.Reflection;
+
+class Program
+{
+       static int Main ()
+       {
+               string assemblyFile = Path.Combine 
(AppDomain.CurrentDomain.BaseDirectory,
+                       "libb.dll");
+
+               Assembly assembly = Assembly.LoadFile (assemblyFile);
+               Type type = assembly.GetType ("NS.B.TestB");
+               FieldInfo field =type.GetField ("testb", BindingFlags.NonPublic 
| BindingFlags.Static);
+               if (field.Name != "testb")
+                       return 1;
+               if (field.DeclaringType != type)
+                       return 2;
+               if (field.Attributes != (FieldAttributes.Private | 
FieldAttributes.Static | FieldAttributes.InitOnly))
+                       return 3;
+               try {
+                       if (field.FieldType == null)
+                               return 4;
+                       return 5;
+               } catch (FileNotFoundException ex) {
+#if NET_2_0
+                       if (ex.FileName != "liba, Version=0.0.0.0, 
Culture=neutral, PublicKeyToken=null")
+                               return 6;
+#else
+                       if (ex.FileName != "liba")
+                               return 6;
+#endif
+                       if (ex.InnerException != null)
+                               return 7;
+                       if (ex.Message == null)
+                               return 8;
+#if NET_2_0
+                       if (ex.Message.IndexOf ("liba, Version=0.0.0.0, 
Culture=neutral, PublicKeyToken=null") == -1)
+                               return 9;
+#else
+                       if (ex.Message.IndexOf ("liba") == -1)
+                               return 9;
+#endif
+               }
+               return 0;
+       }
+}


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

Modified: trunk/gert/standalone/known-issues
===================================================================
--- trunk/gert/standalone/known-issues  2007-05-20 14:38:47 UTC (rev 77722)
+++ trunk/gert/standalone/known-issues  2007-05-20 15:01:27 UTC (rev 77723)
@@ -11,3 +11,4 @@
 bug81646/**
 bug81662/**
 bug81673/**
+bug81691/**

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

Reply via email to