Author: gert
Date: 2008-01-12 09:44:35 -0500 (Sat, 12 Jan 2008)
New Revision: 92742
Added:
trunk/gert/standalone/bug337654/
trunk/gert/standalone/bug337654/default.build
trunk/gert/standalone/bug337654/test.cs
Modified:
trunk/gert/standalone/known-issues
Log:
Added test for bug #337654.
Added: trunk/gert/standalone/bug337654/default.build
===================================================================
--- trunk/gert/standalone/bug337654/default.build 2008-01-12 14:42:25 UTC
(rev 92741)
+++ trunk/gert/standalone/bug337654/default.build 2008-01-12 14:44:35 UTC
(rev 92742)
@@ -0,0 +1,27 @@
+<project name="bug337654" default="rebuild">
+ <include buildfile="../../build/common.build" />
+
+ <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="compile" depends="init">
+ <csc target="exe" output="test.exe" define="${csc.defines}"
warnaserror="true" warninglevel="4">
+ <sources>
+ <include name="test.cs" />
+ </sources>
+ </csc>
+ </target>
+
+ <target name="run-test" depends="compile">
+ <exec program="test.exe" managed="true" output="out" />
+ <fail if="${file::exists('out')}" />
+ </target>
+</project>
Property changes on: trunk/gert/standalone/bug337654/default.build
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/standalone/bug337654/test.cs
===================================================================
--- trunk/gert/standalone/bug337654/test.cs 2008-01-12 14:42:25 UTC (rev
92741)
+++ trunk/gert/standalone/bug337654/test.cs 2008-01-12 14:44:35 UTC (rev
92742)
@@ -0,0 +1,53 @@
+using System;
+using System.Collections;
+using System.Globalization;
+using System.IO;
+using System.Reflection;
+using System.Resources;
+
+class Program
+{
+ [STAThread]
+ static int Main ()
+ {
+ AppDomain.CurrentDomain.AssemblyResolve += new
ResolveEventHandler (CurrentDomain_AssemblyResolve);
+
+ try {
+ Assembly a = Assembly.GetExecutingAssembly ();
+ a.GetSatelliteAssembly (new CultureInfo ("ja-JP"), new
Version ("3.0"));
+ return 1;
+ } catch (FileNotFoundException) {
+ if (_AssemblyResolves.Count != 1)
+ return 2;
+ }
+
+ _AssemblyResolves.Clear ();
+
+ try {
+ ResourceManager rm = new ResourceManager ("foo",
Assembly.GetExecutingAssembly ());
+ rm.GetObject ("bar", new CultureInfo ("fr-FR"));
+
+ return 3;
+ } catch (MissingManifestResourceException) {
+#if NET_2_0
+ if (_AssemblyResolves.Count != 0)
+ return 4;
+#else
+ if (_AssemblyResolves.Count != 2)
+ return 4;
+#endif
+ return 0;
+ }
+ }
+
+ static Assembly CurrentDomain_AssemblyResolve (object sender,
ResolveEventArgs args)
+ {
+ lock (_syncLock) {
+ _AssemblyResolves.Add (args.Name);
+ }
+ return null;
+ }
+
+ static readonly object _syncLock = new object ();
+ static readonly ArrayList _AssemblyResolves = new ArrayList ();
+}
Property changes on: trunk/gert/standalone/bug337654/test.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/gert/standalone/known-issues
===================================================================
--- trunk/gert/standalone/known-issues 2008-01-12 14:42:25 UTC (rev 92741)
+++ trunk/gert/standalone/known-issues 2008-01-12 14:44:35 UTC (rev 92742)
@@ -121,6 +121,7 @@
bug335011/**
bug335329/**
bug336739/**
+bug337654/**
bug338242/**
bug338782/**
bug339538/**
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches