[Bluetooth][Manual][Non-ACR] Modify String comparision function 41/252241/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 26 Jan 2021 04:28:15 +0000 (13:28 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 26 Jan 2021 04:33:14 +0000 (13:33 +0900)
UUID strings are case-sensitive. Because of this if we use
Equals function, the comparision statement returns false for
the same UUID. So this patchset modifies the comparision
function to Compare.

Change-Id: Ic3a77843436ca389c954aa11b12f3e9e97a7e525
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/BluetoothSetup.cs
tct-suite-vs/Tizen.Bluetooth.Manual.Tests/testcase/TSBluetoothCombine4_Device.cs

index f27fc09..8c52ece 100644 (file)
@@ -336,7 +336,9 @@ namespace BluetoothNetworkUtils
                     {
                         foreach (string s in item.ServiceUuidList)
                         {
-                            if (s.Equals(HspHsUuid) || s.Equals(HfpHsUuid) || s.Equals(A2dpSnkUuid))
+                            if (string.Compare(s, HspHsUuid, true) == 0 ||
+                                 string.Compare(s, HfpHsUuid, true) == 0 ||
+                                   string.Compare(s, A2dpSnkUuid, true) == 0)
                             {
                                 audioDevice = item;
                                 break;
@@ -357,7 +359,8 @@ namespace BluetoothNetworkUtils
             {
                 foreach (string s in audioDevice.ServiceUuidList)
                 {
-                    if (s.Equals(HspHsUuid) || s.Equals(HfpHsUuid))
+                    if (string.Compare(s, HspHsUuid, true) == 0 ||
+                         string.Compare(s, HfpHsUuid, true) == 0)
                     {
                         IsProfileSupported = true;
                         break;
@@ -368,7 +371,7 @@ namespace BluetoothNetworkUtils
             {
                 foreach (string s in audioDevice.ServiceUuidList)
                 {
-                    if (s.Equals(A2dpSnkUuid))
+                    if (string.Compare(s, A2dpSnkUuid, true) == 0)
                     {
                         IsProfileSupported = true;
                         break;
@@ -379,7 +382,7 @@ namespace BluetoothNetworkUtils
             {
                 foreach (string s in audioDevice.ServiceUuidList)
                 {
-                    if (s.Equals(A2dpSrcUuid))
+                    if (string.Compare(s, A2dpSrcUuid, true) == 0)
                     {
                         IsProfileSupported = true;
                         break;
@@ -390,7 +393,8 @@ namespace BluetoothNetworkUtils
             {
                 foreach (string s in audioDevice.ServiceUuidList)
                 {
-                    if (s.Equals(HspAgUuid) || s.Equals(HfpAgUuid))
+                    if (string.Compare(s, HspAgUuid, true) == 0 ||
+                         string.Compare(s, HfpAgUuid, true) == 0)
                     {
                         IsProfileSupported = true;
                         break;
@@ -421,7 +425,7 @@ namespace BluetoothNetworkUtils
                     {
                         foreach (string s in item.ServiceUuidList)
                         {
-                            if (s.Equals(A2dpSnkUuid))
+                            if (string.Compare(s, A2dpSnkUuid, true) == 0)
                             {
                                 avrcpDevice = item;
                                 break;
@@ -458,7 +462,7 @@ namespace BluetoothNetworkUtils
                     {
                         foreach (string s in item.ServiceUuidList)
                         {
-                            if (s.Equals(A2dpSrcUuid))
+                            if (string.Compare(s, A2dpSrcUuid, true) == 0)
                             {
                                 avrcpTargetDevice = item;
                                 break;
@@ -539,7 +543,9 @@ namespace BluetoothNetworkUtils
                     {
                         foreach (string s in item.ServiceUuidList)
                         {
-                            if (s.Equals(HspHsUuid) || s.Equals(HfpHsUuid) || s.Equals(A2dpSnkUuid))
+                            if (string.Compare(s, HspHsUuid, true) == 0 ||
+                                 string.Compare(s, HfpHsUuid, true) == 0 ||
+                                  string.Compare(s, A2dpSnkUuid, true) == 0)
                             {
                                 audioDevice = item;
                                 break;
index 2ce34b9..d802a1c 100644 (file)
@@ -498,19 +498,21 @@ namespace Tizen.Network.Bluetooth.Tests
                     {
                         foreach (string s in item.ServiceUuidList)
                         {
-                            if (audioDevice == null && (s.Equals(HspHsUuid) || s.Equals(HfpHsUuid)))
+                            if (audioDevice == null &&
+                                (string.Compare(s, HspHsUuid, true) == 0 ||
+                                  string.Compare(s, HfpHsUuid, true) == 0))
                             {
                                 audioDevice = item;
                                 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Found audio Device");
                                 break;
                             }
-                            if (avrcpDevice == null && s.Equals(A2dpSnkUuid))
+                            if (avrcpDevice == null && string.Compare(s, A2dpSnkUuid, true) == 0)
                             {
                                 avrcpDevice = item;
                                 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Found AVRCP Device");
                                 break;
                             }
-                            if (hidDevice == null &&s.Equals(HidUuid))
+                            if (hidDevice == null && string.Compare(s, HidUuid, true) == 0)
                             {
                                 hidDevice = item;
                                 LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Found HID Device");