Commit Graph
103 Commits
Author SHA1 Message Date
Miguel de Icaza c6ab899595 [System] Fix most warnings on the System test suite 2014-09-24 10:43:46 -04:00
Alexander Köplinger 48e112d652 [Cleanup] Removed TARGET_JVM
It was once part of a special Java target profile, but this is no longer used today.
2014-08-08 03:28:34 +02:00
Alexander Köplinger a8b2f07578 [Cleanup] Removed .jvm.cs files that are no longer used
They were once part of a special Java target profile, but this is no longer used today.
2014-08-07 23:01:51 +02:00
Marek Safar 76c34a1574 [System] Disable failing test 2014-08-07 20:01:46 +02:00
Miguel de Icaza 630116d1b6 Merge pull request #1142 from edbprx/master
ConnectCallback needs to call EndConnect
2014-07-09 09:21:37 -04:00
Ed Boren 0c55c45450 ConnectCallback needs to call EndConnect
Socket.ConnectAsync uses BeginConnect, and ends here in
ConnectCallback. It needs to call EndConnect so any error can be
propagated up.

See Xamarin bug: https://bugzilla.xamarin.com/show_bug.cgi?id=21017
2014-07-07 13:25:51 -04:00
Alex Rønne Petersen dff4b38a95 [System] Add more logging to the BeginConnectMultiple test. 2014-07-03 02:46:21 +02:00
Alex Rønne Petersen 26789fb447 [System] Add some debugging code to BeginConnectMultiple test.
The WaitOne () call has a tendency to time out on the Jenkins
VMs. However, reproducing the problem outside of Jenkins has
proven futile.

This makes the WaitOne () call block for as long as needed and
still fails the test if the elapsed time was longer than 30s.
We print the actual elapsed time to the console.

Hopefully this'll help us find out if it's just taking quite a
long time to run or if it's a hang.
2014-07-03 02:20:11 +02:00
Alex Rønne Petersen 3d3da63af5 [System] Up the timeout in the BeginConnectMultiple test to 30s.
Most Linux systems have the net.ipv4.tcp_syn_retries sysctl
set to 5 or 6, so we need at least 30 seconds here.
2014-06-26 20:40:06 +02:00
Damien Diederen 3d21e9cd2f [System.Net] Do not assume IPv6 is enabled in UdpClientTest
Without this, three of the tests fail on Linux kernels without IPv6
support.

This is a minimal fix, copy'n'pasting a conditional which was used in
other tests.  It might be nicer to factor out the SupportsIPv6 to its
own utility function.
2014-06-20 18:45:35 +02:00
Alexis Christoforides 73ba8a9535 [System.Net] Fixed intermittent test failures from undisposed UdpClients 2014-04-10 15:56:48 -04:00
Alexander Köplinger b0032294da [Test] Cleaned up how a bunch of tests were ignored
Previously, many tests just had a return statement when the test shouldn't
be executed (e.g. Unix-only). This made it look like the test was successful
when in fact it wasn't executed at all.
Assert.Ignore() is now used instead to correctly exclude those tests.
2014-02-23 19:44:21 +01:00
Master T 962a30b605 SocketTest: added tests for multicast index handling for MulticastOption class and MulticastInterface socket option
This commit is under the MIT license.
2013-11-27 00:18:46 +01:00
Sebastien Pouliot eeff03c59c Reduce/remove the probability of having test failures wrt UdpClient.Available 2013-09-11 21:00:04 -04:00
Sebastien Pouliot 313cb0f6be Do not assume AddressList[0] has the address the test wants, that's not always the case, and not what UdpClient should be testing 2013-06-20 15:46:55 -04:00
Miguel de Icaza e8be3702fc Merge pull request #585 from mk8/master
Bug 10233 fix proposal for Socket.BeginSendFIle
2013-03-04 08:13:10 -08:00
Torello Querci 8691f6d8d1 Client Socket close added 2013-03-02 08:31:14 +01:00
Marek Safar 7a1ad27ff0 Disable failing socket test 2013-03-01 17:13:24 +01:00
Torello Querci 0624fa42f1 Fix for bug 10233 about Socket.BeginSendFile 2013-03-01 14:30:04 +01:00
Marek Safar f0ad346fb6 Mobile tests update 2013-02-22 21:41:19 +01:00
Martin Baulig 7fd71833d3 Fix UdpClientTest.CloseInReceive() on Mac OS.
On my Mac, somethig is already listening on port 50000; use
a random one instead.
2012-06-30 06:40:54 +02:00
Martin Baulig 0c23aaa36b Improve SocketTests.EndConnect().
Rename to BogusEndConnect() and accept a few more error codes.
2012-06-30 05:45:09 +02:00
Martin Baulig f3b7c4e856 SocketTest.ConnectMultiple() for Mac OS. 2012-06-30 05:45:09 +02:00
Martin Baulig cc224125a4 Enable the multicast socket tests on the Mac. 2012-06-28 20:41:50 +02:00
Martin Baulig b6b41065cb Fix #5504: UdpClient.JoinMulticastGroup().
* configure.in: Check for if_nametoindex().

* socket-io.c (ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal):
  Mac OS doesn't allow interface = 0; use the interface id from the first
  non-loopback interface.

* UdpClientTest.cs: Enable JoinMulticastGroup1_IPv6,
  JoinMulticastGroup2_IPv6 and JoinMulticastGroup3_IPv6 on the Mac.
2012-06-28 19:47:43 +02:00
Martin Baulig d8babad220 Enable all tests on the Mac. 2012-06-27 06:36:12 +02:00
Martin Baulig 504e2341ba Implement Dns.GetHostEntry(string.Empty) on Mac OS.
* configure.in: Add check for getifaddrs().

* socket-io.c: Implement get_local_ips() using getifaddrs()
  if SIOCGIFCONF is not available.

* DnsTest.cs: Add GetHostEmpty_StringEmpty().

* UdpClientTest.cs(): Enable Available(), BeginReceive() and BeginSend()
  on the Mac.
2012-06-27 04:20:04 +02:00
Martin Baulig f4d96d2fff Fix UdpClientTest.UdpClientBroadcastTest().
You must not use Send() with an endpoint after using either the
hostname constructor or calling Connect(); see the MSDN docs.
2012-06-27 02:26:07 +02:00
Martin Baulig cad82120b6 Fix UdpClientTest.Constructor6(): UDP port 0 seems to be invalid. 2012-06-27 02:10:00 +02:00
Martin Baulig 5d6a94128e UdpClientTest.Constructor5 now works on the Mac. 2012-06-26 21:52:45 +02:00
Martin Baulig eb0ef90fc4 Fix async sockets: don't set Count=0 when reusing SocketAsyncEventArgs.
This reverts commit e2e44bf6f4 (from May
2011).

Added SocketAsyncTest.cs to test this.
2012-06-19 01:10:12 +02:00
Vinicius Jarina 7c32f15193 Removed broken tests from System 2012-06-04 09:12:20 -03:00
Gonzalo Paniagua Javier 47cc2b607d [socket] Fixed other BeginConnect overloads
The BeginConnect overload taking an IPAddress[] was not really
	asynchronous.
2011-04-26 11:02:22 -04:00
Sebastien Pouliot 966a4e1990 Fix buffer checks on Socket.[Receive|Send]Async
* System.Net.Sockets/Socket_2_1.cs: Fix, by explicitely throwing an NRE,
the checks in [Receive|Send]Async methods - otherwise an exception would
occur later, on another thread and close the socket (leading to other,
unexpected, exceptions)

* Test/System.Net.Sockets/SocketTest.cs: Add parameter validation test
cases for both ReceiveAsync and SendAsync
2010-09-29 14:33:20 -04:00
Sebastien Pouliot c3b5cb557e 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)
2010-09-23 17:10:05 -04:00
Gonzalo Paniagua Javier 884680ede3 LocalEndPoint works now for non-blocking connects
We didn't keep the endpoint around for non-blocking connects and later,
	when Poll() was called, we didn't have the information. Also 'isbound'
	wasn't being set in a few places and UDP sockets needed to be marked as
	not connected after a call to Connect() with an Any address.

	Removed an old test for Connect(Any) with UDP sockets, since this is
	used to disconnect them now.

	Fixes bug #640749.
2010-09-22 12:39:07 -04:00
Gonzalo Paniagua Javier 3efb4c4a29 new test
svn path=/trunk/mcs/; revision=145809
2009-11-10 05:56:22 +00:00
Sebastien Pouliot 0328ff83e6 In Test/System.Net.Sockets:
2009-09-26  Sebastien Pouliot  <[email protected]>

	* SocketAsyncEventArgsTest.cs: New. Unit tests

In System.Net.Sockets:
2009-09-26  Sebastien Pouliot  <[email protected]>

	* SocketAsyncEventArgs.cs: Fix paramater validations and default 
	values

In .:
2009-09-26  Sebastien Pouliot  <[email protected]>

	* System_test.dll.sources: Add unit tests for SocketAsyncEventArgs


svn path=/trunk/mcs/; revision=142675
2009-09-26 15:27:35 +00:00
Gert Driesen 916aaf1dbb * SocketTest.cs: Added tests for argument checks, and improved tests
for disposed socket.
* Socket.cs: Modified some argument names to match MS. Moved disposed
check before argument checks in Receive. Use SocketError.InvalidArgument
instead of using magic numbers. Added back comments that was 
accidentally removed in my previous commit.
* Socket_2_1.cs: Modified some argument names to match MS.

svn path=/trunk/mcs/; revision=137051
2009-06-28 20:39:25 +00:00
Gert Driesen ba798b342d * System_test.dll.sources: Added IPv6MulticastOptionTest.cs and
MulticastOptionTest.cs.
* Socket.cs: In GetSocketOption, throw SocketException when (byte [])
option value is null. Use SocketError fields instead of using "magic"
number. In SetSocketOption (SocketOptionLevel, SocketOptionName, object)
only accept Linger, AddMembership, DropMembership and verify option
value.
* MulticastOption.cs: Added argument checks. Save interfaceIndex that is
passed to .ctor, and removed MonoTODO. Renamed arguments to match MS.
Reset InterfaceIndex when LocalAddress is modified, and reset
LocalAddress when InterfaceIndex is modified.
* UdpClient.cs: Modified exception to more closely match MS. Fixed
(int, AddressFamily) .ctor to construct IPv6 endpoint when family is
InterNetworkV6. Added null check for multicastAddr to (IPAddress)
JoinMulticastGroup overload. In (int, IPAddress) and (IPAddress,
IPAddress) overloads of JoinMulticastGroup throw SocketException when
client is IPv4. Added null check for multicastAddr to (IPAddress, int),
overload, and moved JoinMulticastGroup call after argument checks.
* IPv6MulticastOption.cs: Renamed argument names to match MS. Added
null check to set_Group. Added range check to set_InterfaceIndex.
* IPv6MulticastOptionTest.cs: Added .ctor and property tests.
* MulticastOptionTest.cs: Added .ctor and property tests.
* SocketTest.cs: Fixed compiler warnings. Improved tests for
closed socket. Added tests fr GetSocketOption, and SetSocketOption
overloads (for Linger, DontLinger, AddMembership and DropMembership).
* UdpClientTest.cs: Added .ctor and JoinMulticastGroup tests.

svn path=/trunk/mcs/; revision=137048
2009-06-28 16:35:54 +00:00
Gonzalo Paniagua Javier 1c7df92ca0 new test
svn path=/trunk/mcs/; revision=137033
2009-06-27 18:03:35 +00:00
Gonzalo Paniagua Javier 72754e7d4d 2009-06-26 Gonzalo Paniagua Javier <[email protected]>
* SocketTest.cs: tests for DontLinger.


svn path=/trunk/mcs/; revision=136982
2009-06-26 16:34:58 +00:00
Robert Jordan 2f26089775 2009-06-26 Robert Jordan <[email protected]>
* *.cs: Upgrade to new NUnit style.


svn path=/trunk/mcs/; revision=136949
2009-06-26 12:20:08 +00:00
Miguel de Icaza a87e065bae Add test for bug 471580
svn path=/trunk/mcs/; revision=125822
2009-02-05 05:58:23 +00:00
Gonzalo Paniagua Javier ca31518c5a 2009-01-26 Gonzalo Paniagua Javier <[email protected]>
* SocketTest.cs:
	(TestSelect1) avoid RST by reading the bytes from the client.

svn path=/trunk/mcs/; revision=124463
2009-01-26 07:00:46 +00:00
Geoff Norton 067bd1817a 2009-01-07 Geoff Norton <[email protected]>
* SocketTest.cs: Disable some tests on the Mac that rely on socket
        options that are unavailable.

svn path=/trunk/mcs/; revision=122625
2009-01-07 07:04:44 +00:00
Gonzalo Paniagua Javier ee9a2c680c 2008-12-03 Gonzalo Paniagua Javier <[email protected]>
* UdpClientTest.cs: test closing a UDP socket while receiving.


svn path=/trunk/mcs/; revision=120603
2008-12-03 15:34:37 +00:00
Gonzalo Paniagua Javier 8a9f05d723 fix the build
svn path=/trunk/mcs/; revision=118736
2008-11-13 17:24:00 +00:00
Gonzalo Paniagua Javier 0b00587d8a 2008-11-12 Gonzalo Paniagua Javier <[email protected]>
* SocketTest.cs: added test case based on the one in bug
	#443346.


svn path=/trunk/mcs/; revision=118697
2008-11-13 03:48:52 +00:00
Dick Porter d99d4af2ff 2008-06-19 Dick Porter <[email protected]>
* Socket.cs: Implement generic Send() and Receive() methods.
	Fixes bug 395168.

2008-06-19  Dick Porter  <[email protected]>

	* SocketTest.cs: Tests for generic Send() and Receive() methods.



svn path=/trunk/mcs/; revision=106198
2008-06-19 11:50:42 +00:00