Skip to content
Browse files

2003-12-13 Patrik Torstensson <p@rxc.se>

        * bug-48015.cs: new test for obj.Equals on ContextBound objects
        * Makefile.am: added bug-48015.cs.

svn path=/trunk/mono/; revision=21087
  • Loading branch information...
1 parent a42e3e5 commit 513278edff4bbda7c9a5c1dc9ee84104f748af56 Patrik Torstensson committed
Showing with 55 additions and 1 deletion.
  1. +5 −0 mono/tests/ChangeLog
  2. +2 −1 mono/tests/Makefile.am
  3. +48 −0 mono/tests/bug-48015.cs
View
5 mono/tests/ChangeLog
@@ -1,3 +1,8 @@
+2003-12-13 Patrik Torstensson <p@rxc.se>
+
+ * bug-48015.cs: new test for obj.Equals on ContextBound objects
+ * Makefile.am: added bug-48015.cs.
+
2003-11-21 Lluis Sanchez Gual <lluis@ximian.com>
* context-static.cs: new test for ContextStaticAttribute.
View
3 mono/tests/Makefile.am
@@ -168,7 +168,8 @@ TEST_CS_SRC= \
base-definition.cs \
bug-27420.cs \
bug-47295.cs \
- bug-46781.cs
+ bug-46781.cs \
+ bug-48015.cs
# These only compile with MS CSC
TEST_CSC_SRC= \
View
48 mono/tests/bug-48015.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Collections;
+using System.Runtime.Remoting;
+
+public class Foo : System.ContextBoundObject {
+}
+
+public class Bar : System.ContextBoundObject {
+
+ public void Test(Foo f) {
+ if (RemotingServices.IsTransparentProxy (f))
+ Console.WriteLine ("Bar::Test(Foo) Is TP");
+ else
+ Console.WriteLine ("Bar::Test(Foo) Is NOT a TP (error!)");
+
+ if (!f.Equals (f))
+ Console.WriteLine ("Bar::Test(Foo) f.Equals (b) failed (error!)");
+ else
+ Console.WriteLine ("Bar::Test(Foo) f.Equals (f) ok!");
+ }
+}
+
+public class Driver {
+ public static void Main (string[] args) {
+ Foo f = new Foo();
+ Bar b = new Bar();
+
+ if (!b.Equals (b))
+ Console.WriteLine ("b.Equals (b) failed (error!)");
+ else
+ Console.WriteLine ("b.Equals (b) ok!");
+
+ if (RemotingServices.IsTransparentProxy (b))
+ Console.WriteLine ("b is a TP");
+ else
+ Console.WriteLine ("b is NOT a TP (error!)");
+
+ b.Test(f);
+
+ if (!f.Equals (f))
+ Console.WriteLine ("f.Equals (b) failed (error!)");
+ else
+ Console.WriteLine ("f.Equals (f) ok!");
+
+ Console.WriteLine ("test end.");
+ }
+}
+

0 comments on commit 513278e

Please sign in to comment.
Something went wrong with that request. Please try again.