diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2009-06-26 20:34:58 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2009-06-26 20:34:58 +0400 |
commit | 72754e7d4d56151a844a56baa683006a5404013a (patch) | |
tree | 37ae920ca8fc26b59dd35023b413718faee55b2a /mcs/class/System/Test | |
parent | 433d127533731878d55d7e3d37320263894353e8 (diff) |
2009-06-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
* SocketTest.cs: tests for DontLinger.
svn path=/trunk/mcs/; revision=136982
Diffstat (limited to 'mcs/class/System/Test')
-rw-r--r-- | mcs/class/System/Test/System.Net.Sockets/ChangeLog | 4 | ||||
-rw-r--r-- | mcs/class/System/Test/System.Net.Sockets/SocketTest.cs | 20 |
2 files changed, 23 insertions, 1 deletions
diff --git a/mcs/class/System/Test/System.Net.Sockets/ChangeLog b/mcs/class/System/Test/System.Net.Sockets/ChangeLog index f07b59f14f2..a28487aecef 100644 --- a/mcs/class/System/Test/System.Net.Sockets/ChangeLog +++ b/mcs/class/System/Test/System.Net.Sockets/ChangeLog @@ -1,3 +1,7 @@ +2009-06-26 Gonzalo Paniagua Javier <gonzalo@novell.com> + + * SocketTest.cs: tests for DontLinger. + 2009-06-26 Robert Jordan <robertj@gmx.net> * *.cs: Upgrade to new NUnit style. diff --git a/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs b/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs index 4fb22a6d486..20ca9ce0f14 100644 --- a/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs +++ b/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs @@ -55,7 +55,7 @@ namespace MonoTests.System.Net.Sockets } [Test] - [Ignore ("Bug #75158")] + [Ignore ("Bug #75158")] // Looks like MS fails after the .ctor, when you try to use the socket public void IncompatibleAddress () { IPEndPoint epIPv6 = new IPEndPoint (IPAddress.IPv6Any, @@ -2749,6 +2749,24 @@ namespace MonoTests.System.Net.Sockets } } #endif + [Test] + public void LingerOptions () + { + using (Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) { + s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.DontLinger, false); + s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.DontLinger, 0); + s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.DontLinger, new LingerOption (true, 1000)); + } + } + + [Test] + [ExpectedException (typeof (SocketException))] + public void NullLingerOption () + { + using (Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) { + s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.DontLinger, null); + } + } } } |