{
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",