[Network][Non-ACR][Add Dispose call in foreach] 31/198131/4
authorCheoleun Moon <chleun.moon@samsung.com>
Mon, 21 Jan 2019 08:10:34 +0000 (17:10 +0900)
committerCheoleun Moon <chleun.moon@samsung.com>
Mon, 21 Jan 2019 23:32:57 +0000 (08:32 +0900)
Change-Id: Ib380227ac67b4fb6bff14af2c7d84fafc0155a10
Signed-off-by: Cheoleun Moon <chleun.moon@samsung.com>
tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionProfile.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionProfileManager.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSConnectionProfileStateEventArgs.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSProfileStateEventArgs.cs
tct-suite-vs/Tizen.Network.Tests/testcase/TSWiFiManager.cs

index 2fdebc74ad5e374a10e53aea266e82daa6e8827e..aa8caa09a2b84033031c4ffde23ae92ccca9a73c 100755 (executable)
@@ -421,7 +421,7 @@ namespace Tizen.Network.Connection.Tests
 
                 bool found = false;
                 var IPList = ConnectionManager.GetAllIPv6Addresses(ConnectionType.WiFi);
-                foreach(IPAddress item in IPList)
+                foreach (IPAddress item in IPList)
                 {
                     Log.Info(Globals.LogTag, "IPv6 Address: " + item.ToString());
                     if (item.ToString().Equals(preIP))
@@ -591,6 +591,7 @@ namespace Tizen.Network.Connection.Tests
                         _connectionProfile = i;
                         break;
                     }
+                    i.Dispose();
                 }
 
                 Assert.IsNotNull(_connectionProfile, "No Profile Found");
index dcac0a72222294806cbb253439f91627315279bb..f4e52922ca476c70be7e36b42c2a347c32df9f0b 100755 (executable)
@@ -263,6 +263,7 @@ namespace Tizen.Network.Tests
                 {
                     //Console.WriteLine("Profilexx:" + p.Name);
                     _numTask++;
+                    p.Dispose();
                 }
                 Assert.Greater(_numTask, 0, "GetProfileListAsync is fail");
             }
@@ -308,6 +309,7 @@ namespace Tizen.Network.Tests
                 {
                     if (p.Type == ConnectionProfileType.WiFi)
                         _numTask++;
+                    p.Dispose();
                 }
                 Assert.AreEqual(1, _numTask);
             }
@@ -354,6 +356,7 @@ namespace Tizen.Network.Tests
                 {
                     if (p.Type == ConnectionProfileType.WiFi)
                         _numTask++;
+                    p.Dispose();
                 }
                 Assert.AreEqual(0, _numTask);
                 // POSTCONDITION
@@ -565,6 +568,7 @@ namespace Tizen.Network.Tests
                         ConnectionProfileManager.RemoveProfile(item);
                         Log.Info(Globals.LogTag, "RemoveProfile is completed");
                     }
+                    item.Dispose();
                 }
                 Log.Info(Globals.LogTag, "Profile is removed");
                 Assert.IsTrue(mFlag, "Add profile is not success");
@@ -579,6 +583,7 @@ namespace Tizen.Network.Tests
                         mConnectionProfile = item;
                         break;
                     }
+                    item.Dispose();
                 }
                 Assert.IsNull(mConnectionProfile, "RemoveProfile is fail");
                 // POSTCONDITION
@@ -795,6 +800,7 @@ namespace Tizen.Network.Tests
                         _profile = i;
                         break;
                     }
+                    i.Dispose();
                 }
                 await ConnectionProfileManager.DisconnectProfileAsync(_profile);
                 await Task.Delay(1500);
@@ -854,6 +860,7 @@ namespace Tizen.Network.Tests
                         mConnectionProfile = item;
                         break;
                     }
+                    item.Dispose();
                 }
                 Assert.IsNotNull(mConnectionProfile, "Add profile is not success");
                 /**POST CONDITION
@@ -867,6 +874,7 @@ namespace Tizen.Network.Tests
                     {
                         ConnectionProfileManager.RemoveProfile(item);
                     }
+                    item.Dispose();
                 }
             }
             catch (NotSupportedException)
index 34377b2845e47da4678149bf86ab7c865bc0049a..b773e2ff6296e6553a96b6d34aecb6fb4790af28 100755 (executable)
@@ -68,6 +68,7 @@ namespace Tizen.Network.Connection.Tests
                         _connectionProfile = i;
                         break;
                     }
+                    i.Dispose();
                 }
 
                 Assert.IsNotNull(_connectionProfile, "No Profile Found");
index 9a26c32af8ce73e5174177e789e7e317d872d2a9..b3af315ada5be36efe8513aa0d97a4618e1794a9 100755 (executable)
@@ -63,7 +63,7 @@ namespace Tizen.Network.Connection.Tests
                  */
                 await setUp();
                 Assert.IsFalse(_flag, "Flag should be fail before check");
-                
+
                 var list = await ConnectionProfileManager.GetProfileListAsync(ProfileListType.Connected);
                 foreach (var item in list)
                 {
@@ -72,6 +72,7 @@ namespace Tizen.Network.Connection.Tests
                         _connectionProfile = item;
                         break;
                     }
+                    item.Dispose();
                 }
 
                 /*
index dd71d6d0a150d96bf05c8e56d3537bdfc4a940e9..feac07778795993d80c75aff6634704ffb3ab83b 100755 (executable)
@@ -258,7 +258,10 @@ namespace Tizen.Network.WiFi.Tests
                 await WiFiManager.ScanAsync();
                 var listApp = WiFiManager.GetFoundAPs();
                 foreach (var item in listApp)
+                {
                     count++;
+                    item.Dispose();
+                }
                 Assert.Greater(count, 0, "GetFoundAps is fail");
 
                 Log.Info(Globals.LogTag, "Successfully done");
@@ -300,7 +303,10 @@ namespace Tizen.Network.WiFi.Tests
                 var listApp = WiFiManager.GetFoundSpecificAPs();
                 await Task.Delay(1500);
                 foreach (var item in listApp)
+                {
                     count++;
+                    item.Dispose();
+                }
                 Assert.Greater(count, 0, "GetFoundSpecificAps is fail");
 
                 Log.Info(Globals.LogTag, "Successfully done");
@@ -341,7 +347,10 @@ namespace Tizen.Network.WiFi.Tests
                 var count = 0;
                 var listConfig = WiFiManager.GetWiFiConfigurations();
                 foreach (var item in listConfig)
+                {
                     count++;
+                    item.Dispose();
+                }
                 Assert.Greater(count, 0, "GetWiFiConfigurations is fail");
 
                 Log.Info(Globals.LogTag, "Successfully done");
@@ -398,6 +407,7 @@ namespace Tizen.Network.WiFi.Tests
                         _WiFiConfiguration = _itemWiFiAp;
                         break;
                     }
+                    _itemWiFiAp.Dispose();
                 }
                 Assert.IsNotNull(_WiFiConfiguration, "No WiFi Configuration");
                 Assert.AreEqual(_wiFiConfiguration.ProxyAddress, _WiFiConfiguration.ProxyAddress, "GetWiFiConfigurations is fail");
@@ -690,7 +700,10 @@ namespace Tizen.Network.WiFi.Tests
                 await WiFiManager.ScanAsync();
                 var listAp = WiFiManager.GetFoundAPs();
                 foreach (var item in listAp)
+                {
                     count++;
+                    item.Dispose();
+                }
                 Assert.Greater(count, 0, "ScanAsync can't scan WiFiAp");
 
                 Log.Info(Globals.LogTag, "Successfully done");
@@ -732,7 +745,10 @@ namespace Tizen.Network.WiFi.Tests
                 await WiFiManager.ScanSpecificAPAsync(networkParameter.wnPRIVATE1);
                 var listAp = WiFiManager.GetFoundSpecificAPs();
                 foreach (var item in listAp)
+                {
                     count++;
+                    item.Dispose();
+                }
                 Assert.Greater(count, 0, "ScanSpecificApAsync can't scan WiFi private");
 
                 Log.Info(Globals.LogTag, "Successfully done");
@@ -776,7 +792,10 @@ namespace Tizen.Network.WiFi.Tests
                 await WiFiManager.ScanSpecificAPAsync(networkParameter.wnHIDDEN);
                 var listAp = WiFiManager.GetFoundSpecificAPs();
                 foreach (var item in listAp)
+                {
                     count++;
+                    item.Dispose();
+                }
                 Assert.Greater(count, 0, "ScanSpecificApAsync can't scan WiFi HIDDEN");
 
                 Log.Info(Globals.LogTag, "Successfully done");