Author: gert
Date: 2007-11-07 11:10:03 -0500 (Wed, 07 Nov 2007)
New Revision: 89117

Added:
   trunk/gert/standalone/bug323114/
   trunk/gert/standalone/bug323114/client.cs
   trunk/gert/standalone/bug323114/common.cs
   trunk/gert/standalone/bug323114/default.build
   trunk/gert/standalone/bug323114/server.cs
   trunk/gert/standalone/bug323114/test.cs
Modified:
   trunk/gert/standalone/known-issues
Log:
Added test for bug #323114.


Added: trunk/gert/standalone/bug323114/client.cs
===================================================================
--- trunk/gert/standalone/bug323114/client.cs   2007-11-07 16:05:13 UTC (rev 
89116)
+++ trunk/gert/standalone/bug323114/client.cs   2007-11-07 16:10:03 UTC (rev 
89117)
@@ -0,0 +1,37 @@
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Tcp;
+
+public class TestClient
+{
+       static int Main (string [] args)
+       {
+               TcpChannel chan = new TcpChannel ();
+#if NET_2_0
+               ChannelServices.RegisterChannel (chan, false);
+#else
+               ChannelServices.RegisterChannel (chan);
+#endif
+
+               TestService sv = (TestService) RemotingServices.Connect (typeof 
(TestService),
+                                                                        
"tcp://localhost:8089/test");
+
+               TestEnumBI64 arg = TestEnumBI64.AL;
+               TestEnumBI64 result = sv.Echo (arg);
+               if (arg != result) {
+                       ChannelServices.UnregisterChannel (chan);
+                       return 1;
+               }
+               if ((long) arg != (long) result) {
+                       ChannelServices.UnregisterChannel (chan);
+                       return 2;
+               }
+               if (!arg.Equals (result)) {
+                       ChannelServices.UnregisterChannel (chan);
+                       return 3;
+               }
+               ChannelServices.UnregisterChannel (chan);
+               return 0;
+       }
+}


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

Added: trunk/gert/standalone/bug323114/common.cs
===================================================================
--- trunk/gert/standalone/bug323114/common.cs   2007-11-07 16:05:13 UTC (rev 
89116)
+++ trunk/gert/standalone/bug323114/common.cs   2007-11-07 16:10:03 UTC (rev 
89117)
@@ -0,0 +1,11 @@
+using System;
+
+public enum TestEnumBI64 : long
+{
+       AL = Int64.MaxValue, BL = 1000
+}
+
+public interface TestService
+{
+       TestEnumBI64 Echo (TestEnumBI64 arg);
+}


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

Added: trunk/gert/standalone/bug323114/default.build
===================================================================
--- trunk/gert/standalone/bug323114/default.build       2007-11-07 16:05:13 UTC 
(rev 89116)
+++ trunk/gert/standalone/bug323114/default.build       2007-11-07 16:10:03 UTC 
(rev 89117)
@@ -0,0 +1,87 @@
+<project name="bug80425" 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="client.exe" />
+                               <include name="common.dll" />
+                               <include name="server.exe" />
+                               <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="common.dll" warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="common.cs" />
+                       </sources>
+               </csc>
+               <csc target="exe" define="${csc.defines}" output="server.exe" 
warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="server.cs" />
+                       </sources>
+                       <references>
+                               <include name="System.Runtime.Remoting.dll" />
+                               <include name="common.dll" />
+                       </references>
+               </csc>
+               <csc target="exe" define="${csc.defines}" output="client.exe" 
warnaserror="true" warninglevel="4">
+                       <sources>
+                               <include name="client.cs" />
+                       </sources>
+                       <references>
+                               <include name="System.Runtime.Remoting.dll" />
+                               <include name="common.dll" />
+                       </references>
+               </csc>
+               <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="server.exe" managed="true" 
pidproperty="server.pid" spawn="true" />
+               <sleep milliseconds="1000" />
+               <exec program="client.exe" managed="true" />
+               <kill pid="${server.pid}" />
+               <sleep milliseconds="200" />
+               <exec program="test.exe" managed="true" />
+       </target>
+
+       <target name="rebuild" depends="clean, build" />
+</project>


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

Added: trunk/gert/standalone/bug323114/server.cs
===================================================================
--- trunk/gert/standalone/bug323114/server.cs   2007-11-07 16:05:13 UTC (rev 
89116)
+++ trunk/gert/standalone/bug323114/server.cs   2007-11-07 16:10:03 UTC (rev 
89117)
@@ -0,0 +1,34 @@
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Channels.Tcp;
+
+public class TestServiceImpl : MarshalByRefObject, TestService
+{
+       public TestEnumBI64 Echo (TestEnumBI64 arg)
+       {
+               return arg;
+       }
+
+       public override object InitializeLifetimeService ()
+       {
+               return null;
+       }
+}
+
+public class TestServer
+{
+       static void Main (string [] args)
+       {
+               TestServiceImpl impl = new TestServiceImpl ();
+               RemotingServices.Marshal (impl, "test");
+               TcpChannel chan = new TcpChannel (8089);
+#if NET_2_0
+               ChannelServices.RegisterChannel (chan, false);
+#else
+               ChannelServices.RegisterChannel (chan);
+#endif
+               Console.ReadLine ();
+               ChannelServices.UnregisterChannel (chan);
+       }
+}


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

Added: trunk/gert/standalone/bug323114/test.cs
===================================================================
--- trunk/gert/standalone/bug323114/test.cs     2007-11-07 16:05:13 UTC (rev 
89116)
+++ trunk/gert/standalone/bug323114/test.cs     2007-11-07 16:10:03 UTC (rev 
89117)
@@ -0,0 +1,25 @@
+using System;
+
+public enum Enum64 : long
+{
+       A = Int64.MaxValue,
+}
+
+delegate Enum64 EnumDelegate (Enum64 value);
+
+class Test
+{
+       static Enum64 Method (Enum64 value)
+       {
+               return value;
+       }
+
+       static int Main ()
+       {
+               EnumDelegate d = new EnumDelegate (Method);
+               Enum64 r = d.EndInvoke (d.BeginInvoke (Enum64.A, null, null));
+               if (r == Enum64.A)
+                       return 0;
+               return 1;
+       }
+}


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

Modified: trunk/gert/standalone/known-issues
===================================================================
--- trunk/gert/standalone/known-issues  2007-11-07 16:05:13 UTC (rev 89116)
+++ trunk/gert/standalone/known-issues  2007-11-07 16:10:03 UTC (rev 89117)
@@ -79,6 +79,7 @@
 bug315969/**
 bug319456/**
 bug321615/**
+bug323114/**
 bug324002/**
 bug324032/**
 bug320964/**

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

Reply via email to