Explorar o código

Add test case to show a different behavior (from Windows) wrt Socket buffers

* Test/System.Net.Sockets/SocketTest.cs: Add test case where buffers can
be set to 0 under Windows (but has a 256 bytes minimum on Linux)
Sebastien Pouliot %!s(int64=15) %!d(string=hai) anos
pai
achega
c3b5cb557e
Modificáronse 1 ficheiros con 15 adicións e 0 borrados
  1. 15 0
      mcs/class/System/Test/System.Net.Sockets/SocketTest.cs

+ 15 - 0
mcs/class/System/Test/System.Net.Sockets/SocketTest.cs

@@ -890,6 +890,21 @@ namespace MonoTests.System.Net.Sockets
 			sock.Close ();
 		}
 
+		[Test]
+		[Category("NotWorking")] // We cannot totally remove buffers (minimum is set to 256
+		public void BuffersCheck_None ()
+		{
+			using (Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) {
+				int original = s.ReceiveBufferSize;
+				s.ReceiveBufferSize = 0;
+				Assert.AreEqual (0, s.ReceiveBufferSize, "ReceiveBufferSize " + original.ToString ());
+
+				original = s.SendBufferSize;
+				s.SendBufferSize = 0;
+				Assert.AreEqual (0, s.SendBufferSize, "SendBufferSize " + original.ToString ());
+			}
+		}
+
 		[Test]
 		[ExpectedException (typeof(ObjectDisposedException))]
 		public void ReceiveBufferSizeClosed ()