SyncCalls.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. //
  2. // MonoTests.Remoting.SyncCalls.cs
  3. //
  4. // Author: Lluis Sanchez Gual ([email protected])
  5. //
  6. // 2003 (C) Copyright, Ximian, Inc.
  7. //
  8. using System;
  9. using System.Collections;
  10. using NUnit.Framework;
  11. using System.Text;
  12. using System.Runtime.InteropServices;
  13. namespace MonoTests.Remoting
  14. {
  15. public abstract class SyncCallTest : BaseCallTest
  16. {
  17. public override InstanceSurrogate GetInstanceSurrogate () { return new SyncInstanceSurrogate (); }
  18. public override AbstractSurrogate GetAbstractSurrogate () { return new SyncAbstractSurrogate (); }
  19. public override InterfaceSurrogate GetInterfaceSurrogate () { return new SyncInterfaceSurrogate (); }
  20. }
  21. public class SyncInstanceSurrogate : InstanceSurrogate
  22. {
  23. public override int Simple ()
  24. {
  25. return RemoteObject.Simple ();
  26. }
  27. public override string PrimitiveParams (int a, uint b, char c, string d)
  28. {
  29. return RemoteObject.PrimitiveParams (a, b, c, d);
  30. }
  31. public override string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, int filler, ref char c1, out char c2, ref string d1, out string d2)
  32. {
  33. return RemoteObject.PrimitiveParamsInOut (ref a1, out a2, ref b1, out b2, filler, ref c1, out c2, ref d1, out d2);
  34. }
  35. public override Complex ComplexParams (ArrayList a, Complex b, string c)
  36. {
  37. return RemoteObject.ComplexParams (a, b, c);
  38. }
  39. public override Complex ComplexParamsInOut (ref ArrayList a, out Complex b, [In,Out] byte[] bytes, [In,Out] StringBuilder sb, string c)
  40. {
  41. return RemoteObject.ComplexParamsInOut (ref a, out b, bytes, sb, c);
  42. }
  43. public override void ProcessContextData ()
  44. {
  45. RemoteObject.ProcessContextData ();
  46. }
  47. }
  48. public class SyncAbstractSurrogate : AbstractSurrogate
  49. {
  50. public override int Simple ()
  51. {
  52. return RemoteObject.Simple ();
  53. }
  54. public override string PrimitiveParams (int a, uint b, char c, string d)
  55. {
  56. return RemoteObject.PrimitiveParams (a, b, c, d);
  57. }
  58. public override string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, int filler, ref char c1, out char c2, ref string d1, out string d2)
  59. {
  60. return RemoteObject.PrimitiveParamsInOut (ref a1, out a2, ref b1, out b2, filler, ref c1, out c2, ref d1, out d2);
  61. }
  62. public override Complex ComplexParams (ArrayList a, Complex b, string c)
  63. {
  64. return RemoteObject.ComplexParams (a, b, c);
  65. }
  66. public override Complex ComplexParamsInOut (ref ArrayList a, out Complex b, [In,Out] byte[] bytes, [In,Out] StringBuilder sb, string c)
  67. {
  68. return RemoteObject.ComplexParamsInOut (ref a, out b, bytes, sb, c);
  69. }
  70. public override void ProcessContextData ()
  71. {
  72. RemoteObject.ProcessContextData ();
  73. }
  74. }
  75. public class SyncInterfaceSurrogate : InterfaceSurrogate
  76. {
  77. public override int Simple ()
  78. {
  79. return RemoteObject.Simple ();
  80. }
  81. public override string PrimitiveParams (int a, uint b, char c, string d)
  82. {
  83. return RemoteObject.PrimitiveParams (a, b, c, d);
  84. }
  85. public override string PrimitiveParamsInOut (ref int a1, out int a2, ref float b1, out float b2, int filler, ref char c1, out char c2, ref string d1, out string d2)
  86. {
  87. return RemoteObject.PrimitiveParamsInOut (ref a1, out a2, ref b1, out b2, filler, ref c1, out c2, ref d1, out d2);
  88. }
  89. public override Complex ComplexParams (ArrayList a, Complex b, string c)
  90. {
  91. return RemoteObject.ComplexParams (a, b, c);
  92. }
  93. public override Complex ComplexParamsInOut (ref ArrayList a, out Complex b, [In,Out] byte[] bytes, [In,Out] StringBuilder sb, string c)
  94. {
  95. return RemoteObject.ComplexParamsInOut (ref a, out b, bytes, sb, c);
  96. }
  97. public override void ProcessContextData ()
  98. {
  99. RemoteObject.ProcessContextData ();
  100. }
  101. }
  102. }