Fix bug 4786 test.
authorJon Purdy <evincarofautumn@gmail.com>
Thu, 14 Sep 2017 00:09:19 +0000 (17:09 -0700)
committerJon Purdy <evincarofautumn@gmail.com>
Thu, 14 Sep 2017 05:53:38 +0000 (22:53 -0700)
The fix in #5501 had a scoping error causing `make check` to fail.

mcs/class/Mono.Data.Tds/Test/bug-4786.cs

index ed44567b40d019b14b7198a20c623f98a82449b1..dbb28b32af08f4e9ea0ff21471e1cf8f948c8499 100644 (file)
@@ -45,6 +45,8 @@ namespace MonoTests.Mono.Data.Tds
     public void CheckNullException() 
     {
 
+    TcpListener Listener = null;
+
        //set up dummy sql listener, if there is a real sql server on this
        //machine at that port, in theory this part will fail, but that's ok
        //becuase something will be listening on the port and that's all we
@@ -53,7 +55,7 @@ namespace MonoTests.Mono.Data.Tds
        try{
                IPAddress hostIP =Dns.GetHostEntry("localhost").AddressList[0];
         IPEndPoint ep = new IPEndPoint(hostIP, 1433);
-        TcpListener Listener = new TcpListener (ep);
+        Listener = new TcpListener (ep);
         Listener.Start ();
        } catch (Exception){
                //ignore