[ITC][capi-system-device][Non-ACR] Fix return type of power lock/unlock by feature 51/318751/4
authorYoungjae Cho <y0.cho@samsung.com>
Thu, 23 Jan 2025 07:58:33 +0000 (16:58 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Mon, 3 Feb 2025 08:06:22 +0000 (17:06 +0900)
Take an additional feature, http://tizen.org/feature/display.state,
into account as well as http://tizen.org/feature/display.

Change-Id: Ie06d1279aa5029c18666a1dbae871daa244b6960
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/itc/device/ITs-device_power.c

index 0825b3cf83268ebcfff06fc09dbdaa9232e770bf..b178ec1d88fc7e0df109d09a87d033ba757dbc2d 100644 (file)
@@ -91,33 +91,34 @@ int ITc_device_power_request_release_lock_p(void)
 {
        START_TEST;
 
-       struct expect_return_by_profile {
+       struct expect_return_by_feature {
                power_lock_e lock_type;
-               int headed;
-               int headless;
+               int headed_and_stateful;
+               int headless_or_stateless;
        } expect_return[] = {
                {
                        .lock_type = POWER_LOCK_CPU,
-                       .headed = DEVICE_ERROR_NONE,
-                       .headless = DEVICE_ERROR_NONE,
+                       .headed_and_stateful = DEVICE_ERROR_NONE,
+                       .headless_or_stateless = DEVICE_ERROR_NONE,
                }, {
                        .lock_type = POWER_LOCK_DISPLAY,
-                       .headed = DEVICE_ERROR_NONE,
-                       .headless = DEVICE_ERROR_NOT_SUPPORTED,
+                       .headed_and_stateful = DEVICE_ERROR_NONE,
+                       .headless_or_stateless = DEVICE_ERROR_NOT_SUPPORTED,
                }, {
                        .lock_type = POWER_LOCK_DISPLAY_DIM,
-                       .headed = DEVICE_ERROR_NONE,
-                       .headless = DEVICE_ERROR_NOT_SUPPORTED,
+                       .headed_and_stateful = DEVICE_ERROR_NONE,
+                       .headless_or_stateless = DEVICE_ERROR_NOT_SUPPORTED,
                },
        };
        int enum_size = sizeof(expect_return) / sizeof(expect_return[0]);
        int enum_counter = 0;
+       bool feature = (bIsDisplayFeatureSupported && bIsDisplayStateFeatureSupported);
 
        for ( enum_counter=0; enum_counter<enum_size; enum_counter++)
        {
                // Target API
                int nRet = device_power_request_lock(expect_return[enum_counter].lock_type, 10);
-               int nExpectedRet = bIsDisplayFeatureSupported ? expect_return[enum_counter].headed : expect_return[enum_counter].headless;
+               int nExpectedRet = feature ? expect_return[enum_counter].headed_and_stateful : expect_return[enum_counter].headless_or_stateless;
                if ( nRet != nExpectedRet )
                {
                        FPRINTF("[Line : %d][%s] device_power_request_lock failed for enum = %s, error returned = %s, expected return = %s\\n",