[TCT][Device][Non-ACR] Add not supported check for power API on headless 79/267479/1
authorYoungjae Cho <y0.cho@samsung.com>
Mon, 6 Dec 2021 05:58:20 +0000 (14:58 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Mon, 6 Dec 2021 06:00:11 +0000 (15:00 +0900)
Change-Id: I931ef5b006c4c9c4daa28b4d81020709a92404f8
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/itc/device/ITs-device_power.c

index bbbd8af8dbe111422da41c205f6991ca223c9970..650c87c4cd873b36fedaca513465eddd9c1de2de 100644 (file)
@@ -99,23 +99,11 @@ int ITc_device_power_request_release_lock_p(void)
        {
                // Target API
                int nRet = device_power_request_lock(power_locks[enum_counter], 10);
-               if ((bIsDisplayFeatureSupported == false) ||
-                       (bIsDisplayStateFeatureSupported == false))
+               if ((bIsDisplayFeatureSupported == false) || (bIsDisplayStateFeatureSupported == false))
                {
-                       if ((power_locks[enum_counter] == POWER_LOCK_DISPLAY) ||
-                               (power_locks[enum_counter] == POWER_LOCK_DISPLAY_DIM))
-                       {
-                               assert_eq(nRet, DEVICE_ERROR_NOT_SUPPORTED);
-                               return 0;
-                       }
-                       else if (power_locks[enum_counter] == POWER_LOCK_CPU)
-                       {
-                               assert_eq(nRet, DEVICE_ERROR_NONE);
-                               return 0;
-                       }
+                       assert_eq(nRet, DEVICE_ERROR_NOT_SUPPORTED);
                }
-
-               if ( nRet != DEVICE_ERROR_NONE )
+               else if ( nRet != DEVICE_ERROR_NONE )
                {
                        FPRINTF("[Line : %d][%s] device_power_request_lock failed for enum = %s, error returned = %s\\n",
                                __LINE__, API_NAMESPACE, DeviceGetPowerLock(power_locks[enum_counter]), DeviceGetError(nRet));
@@ -124,23 +112,11 @@ int ITc_device_power_request_release_lock_p(void)
 
                // Target API
                nRet  = device_power_release_lock(power_locks[enum_counter]);
-               if ((bIsDisplayFeatureSupported == false) ||
-                       (bIsDisplayStateFeatureSupported == false))
+               if ((bIsDisplayFeatureSupported == false) || (bIsDisplayStateFeatureSupported == false))
                {
-                       if ((power_locks[enum_counter] == POWER_LOCK_DISPLAY) ||
-                               (power_locks[enum_counter] == POWER_LOCK_DISPLAY_DIM))
-                       {
-                               assert_eq(nRet, DEVICE_ERROR_NOT_SUPPORTED);
-                               return 0;
-                       }
-                       else if (power_locks[enum_counter] == POWER_LOCK_CPU)
-                       {
-                               assert_eq(nRet, DEVICE_ERROR_NONE);
-                               return 0;
-                       }
+                       assert_eq(nRet, DEVICE_ERROR_NOT_SUPPORTED);
                }
-
-               if ( nRet != DEVICE_ERROR_NONE )
+               else if ( nRet != DEVICE_ERROR_NONE )
                {
                        FPRINTF("[Line : %d][%s] device_power_release_lock failed for enum = %s, error returned = %s\\n",
                                __LINE__, API_NAMESPACE, DeviceGetPowerLock(power_locks[enum_counter]), DeviceGetError(nRet));