Author: gert
Date: 2007-12-09 12:41:19 -0500 (Sun, 09 Dec 2007)
New Revision: 91006
Added:
trunk/gert/standalone/bug347174/
trunk/gert/standalone/bug347174/Lang.cs
trunk/gert/standalone/bug347174/Locale.cs
trunk/gert/standalone/bug347174/NonLocale.cs
trunk/gert/standalone/bug347174/NonSigned.cs
trunk/gert/standalone/bug347174/default.build
trunk/gert/standalone/bug347174/test.cs
trunk/gert/standalone/bug347174/test.snk
Log:
Added test for bug #347174.
Added: trunk/gert/standalone/bug347174/Lang.cs
===================================================================
--- trunk/gert/standalone/bug347174/Lang.cs 2007-12-09 16:06:43 UTC (rev
91005)
+++ trunk/gert/standalone/bug347174/Lang.cs 2007-12-09 17:41:19 UTC (rev
91006)
@@ -0,0 +1,15 @@
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyVersion ("1.0.0.0")]
+[assembly: AssemblyCulture ("en")]
+
+#if ONLY_1_1 && !MONO
+[assembly: AssemblyKeyFile ("test.snk")]
+#endif
+
+public class Lang
+{
+}
Property changes on: trunk/gert/standalone/bug347174/Lang.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/standalone/bug347174/Locale.cs
===================================================================
--- trunk/gert/standalone/bug347174/Locale.cs 2007-12-09 16:06:43 UTC (rev
91005)
+++ trunk/gert/standalone/bug347174/Locale.cs 2007-12-09 17:41:19 UTC (rev
91006)
@@ -0,0 +1,15 @@
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyVersion ("1.0.0.0")]
+[assembly: AssemblyCulture ("nl")]
+
+#if ONLY_1_1 && !MONO
+[assembly: AssemblyKeyFile ("test.snk")]
+#endif
+
+public class Locale
+{
+}
Property changes on: trunk/gert/standalone/bug347174/Locale.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/standalone/bug347174/NonLocale.cs
===================================================================
--- trunk/gert/standalone/bug347174/NonLocale.cs 2007-12-09 16:06:43 UTC
(rev 91005)
+++ trunk/gert/standalone/bug347174/NonLocale.cs 2007-12-09 17:41:19 UTC
(rev 91006)
@@ -0,0 +1,14 @@
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyVersion ("1.0.0.0")]
+
+#if ONLY_1_1 && !MONO
+[assembly: AssemblyKeyFile ("test.snk")]
+#endif
+
+public class NonLocale
+{
+}
Property changes on: trunk/gert/standalone/bug347174/NonLocale.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/standalone/bug347174/NonSigned.cs
===================================================================
--- trunk/gert/standalone/bug347174/NonSigned.cs 2007-12-09 16:06:43 UTC
(rev 91005)
+++ trunk/gert/standalone/bug347174/NonSigned.cs 2007-12-09 17:41:19 UTC
(rev 91006)
@@ -0,0 +1,3 @@
+public class NonSigned
+{
+}
Property changes on: trunk/gert/standalone/bug347174/NonSigned.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/standalone/bug347174/default.build
===================================================================
--- trunk/gert/standalone/bug347174/default.build 2007-12-09 16:06:43 UTC
(rev 91005)
+++ trunk/gert/standalone/bug347174/default.build 2007-12-09 17:41:19 UTC
(rev 91006)
@@ -0,0 +1,61 @@
+ <project name="bug347174" 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="nl/**" />
+ <include name="Lang.dll" />
+ <include name="Locale.dll" />
+ <include name="NonLocale.dll" />
+ <include name="NonSigned.dll" />
+ <include name="out" />
+ <include name="test.exe" />
+ </fileset>
+ </delete>
+ </target>
+
+ <target name="compile" depends="init">
+ <mkdir dir="nl" />
+ <csc target="library" define="${csc.defines}"
keyfile="test.snk" output="Lang.dll" warnaserror="true" warninglevel="4">
+ <sources>
+ <include name="Lang.cs" />
+ </sources>
+ </csc>
+ <csc target="library" define="${csc.defines}"
keyfile="test.snk" output="nl/Locale.dll" warnaserror="true" warninglevel="4">
+ <sources>
+ <include name="Locale.cs" />
+ </sources>
+ </csc>
+ <csc target="library" define="${csc.defines}"
keyfile="test.snk" output="NonLocale.dll" warnaserror="true" warninglevel="4">
+ <sources>
+ <include name="NonLocale.cs" />
+ </sources>
+ </csc>
+ <csc target="library" define="${csc.defines}"
output="NonSigned.dll" warnaserror="true" warninglevel="4">
+ <sources>
+ <include name="NonSigned.cs" />
+ </sources>
+ </csc>
+ <csc target="exe" define="${csc.defines}" keyfile="test.snk"
output="test.exe" warnaserror="true" warninglevel="4">
+ <nowarn>
+ <warning number="1607" />
+ </nowarn>
+ <sources>
+ <include name="../../build/common/Assert.cs" />
+ <include name="test.cs" />
+ </sources>
+ <references>
+ <include name="nl/Locale.dll" />
+ <include name="NonLocale.dll" />
+ </references>
+ </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/bug347174/default.build
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/standalone/bug347174/test.cs
===================================================================
--- trunk/gert/standalone/bug347174/test.cs 2007-12-09 16:06:43 UTC (rev
91005)
+++ trunk/gert/standalone/bug347174/test.cs 2007-12-09 17:41:19 UTC (rev
91006)
@@ -0,0 +1,113 @@
+using System;
+using System.Globalization;
+using System.IO;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyVersion ("1.0.0.0")]
+#if ONLY_1_1 && !MONO
+[assembly: AssemblyKeyFile ("test.snk")]
+#endif
+
+class Program
+{
+ static void Main ()
+ {
+ Assembly a;
+ CultureInfo culture;
+
+ string dir = AppDomain.CurrentDomain.BaseDirectory;
+
+ a = Assembly.LoadFrom (Path.Combine (dir, "Lang.dll"));
+ culture = a.GetName ().CultureInfo;
+
+ Assert.IsTrue (culture.IsNeutralCulture, "#A1");
+ Assert.IsFalse (culture.IsReadOnly, "#A2");
+ Assert.AreEqual (9, culture.LCID, "#A3");
+ Assert.AreEqual ("en", culture.Name, "#A4");
+ Assert.IsTrue (culture.UseUserOverride, "#A5");
+
+ a = Assembly.GetExecutingAssembly ();
+ culture = a.GetName ().CultureInfo;
+
+ Assert.IsFalse (culture.IsNeutralCulture, "#B1");
+#if NET_2_0
+ Assert.IsFalse (culture.IsReadOnly, "#B2");
+#else
+ Assert.IsTrue (culture.IsReadOnly, "#B2");
+#endif
+ Assert.AreEqual (127, culture.LCID, "#B3");
+ Assert.AreEqual (string.Empty, culture.Name, "#B4");
+ Assert.IsFalse (culture.UseUserOverride, "#B5");
+
+ a = typeof (int).Assembly;
+ culture = a.GetName ().CultureInfo;
+
+ Assert.IsFalse (culture.IsNeutralCulture, "#C1");
+#if NET_2_0
+ Assert.IsFalse (culture.IsReadOnly, "#C2");
+#else
+ Assert.IsTrue (culture.IsReadOnly, "#C2");
+#endif
+ Assert.AreEqual (127, culture.LCID, "#C3");
+ Assert.AreEqual (string.Empty, culture.Name, "#C4");
+ Assert.IsFalse (culture.UseUserOverride, "#C5");
+
+ AssemblyName [] refs = Assembly.GetExecutingAssembly
().GetReferencedAssemblies ();
+ foreach (AssemblyName aname in refs) {
+ culture = aname.CultureInfo;
+ Assert.IsFalse (culture.IsReadOnly, "#D1:" +
aname.Name);
+ if (aname.Name == "Locale") {
+ Assert.IsTrue (culture.UseUserOverride, "#D2:"
+ aname.Name);
+ Assert.IsTrue (culture.IsNeutralCulture, "#D3");
+ Assert.AreEqual (19, culture.LCID, "#D4");
+ Assert.AreEqual ("nl", culture.Name, "#D5");
+ } else {
+#if NET_2_0
+ Assert.IsFalse (culture.UseUserOverride, "#D2:"
+ aname.Name);
+#else
+ Assert.IsTrue (culture.UseUserOverride, "#D2:"
+ aname.Name);
+#endif
+ Assert.IsFalse (culture.IsNeutralCulture,
"#D3");
+ Assert.AreEqual (127, culture.LCID, "#D4");
+ Assert.AreEqual (string.Empty, culture.Name,
"#D5");
+ }
+ }
+
+ a = typeof (NonLocale).Assembly;
+ culture = a.GetName ().CultureInfo;
+
+ Assert.IsFalse (culture.IsNeutralCulture, "#E1");
+#if NET_2_0
+ Assert.IsFalse (culture.IsReadOnly, "#E2");
+#else
+ Assert.IsTrue (culture.IsReadOnly, "#E2");
+#endif
+ Assert.AreEqual (127, culture.LCID, "#E3");
+ Assert.AreEqual (string.Empty, culture.Name, "#E4");
+ Assert.IsFalse (culture.UseUserOverride, "#E5");
+
+ a = Assembly.LoadFrom (Path.Combine (dir, "NonSigned.dll"));
+ culture = a.GetName ().CultureInfo;
+
+ Assert.IsFalse (culture.IsNeutralCulture, "#F1");
+#if NET_2_0
+ Assert.IsFalse (culture.IsReadOnly, "#F2");
+#else
+ Assert.IsTrue (culture.IsReadOnly, "#F2");
+#endif
+ Assert.AreEqual (127, culture.LCID, "#F3");
+ Assert.AreEqual (string.Empty, culture.Name, "#F4");
+ Assert.IsFalse (culture.UseUserOverride, "#F5");
+
+ a = typeof (Locale).Assembly;
+ culture = a.GetName ().CultureInfo;
+
+ Assert.IsTrue (culture.IsNeutralCulture, "#G1");
+ Assert.IsFalse (culture.IsReadOnly, "#G2");
+ Assert.AreEqual (19, culture.LCID, "#G3");
+ Assert.AreEqual ("nl", culture.Name, "#G4");
+ Assert.IsTrue (culture.UseUserOverride, "#G5");
+ }
+}
Property changes on: trunk/gert/standalone/bug347174/test.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/gert/standalone/bug347174/test.snk
===================================================================
(Binary files differ)
Property changes on: trunk/gert/standalone/bug347174/test.snk
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches