diff options
author | Atul Rai <a.rai@samsung.com> | 2019-01-08 17:53:41 +0530 |
---|---|---|
committer | 김새롬/Tizen Platform Lab(SR)/Staff Engineer/삼성전자 <saerome.kim@samsung.com> | 2019-01-09 22:40:43 +0900 |
commit | 8beaec107d718a999d4419ec78b889ea2159962f (patch) | |
tree | 13856f8099ae10fb7efea661296ef0843da67680 /src/user-awareness-monitors.c | |
parent | 6aebb371305a4c7624edf8c748dc440a870aeb37 (diff) | |
download | user-awareness-8beaec107d718a999d4419ec78b889ea2159962f.tar.gz user-awareness-8beaec107d718a999d4419ec78b889ea2159962f.tar.bz2 user-awareness-8beaec107d718a999d4419ec78b889ea2159962f.zip |
Fixed unit test issues
This patch fixes following issues:
1/ Fixed ua_create_device API
2/ Fixed ua_device_clone API
3/ Fixed ua-test test-case GET DEFAULT USER, GET DEVICE etc.
4/ Modified macro names (*_SIZE -> *_LEN)
5/ Rename ua_device_get_wifi_mobile_id -> ua_device_get_mobile_id
Signed-off-by: Atul Rai <a.rai@samsung.com>
Diffstat (limited to 'src/user-awareness-monitors.c')
-rw-r--r-- | src/user-awareness-monitors.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/user-awareness-monitors.c b/src/user-awareness-monitors.c index 701ea57..11aae37 100644 --- a/src/user-awareness-monitors.c +++ b/src/user-awareness-monitors.c @@ -449,7 +449,7 @@ int ua_monitor_start_presence_detection( UA_VALIDATE_INPUT_PARAMETER(handle); UA_VALIDATE_HANDLE(handle, ua_monitor_list); retv_if(TRUE == monitor->presence_detection_started, UA_ERROR_NOW_IN_PROGRESS); - retv_if(UA_DETECT_MODE_INVALID == mode, UA_ERROR_INVALID_PARAMETER); + retv_if(UA_DETECT_MODE_INVALID <= mode, UA_ERROR_INVALID_PARAMETER); retv_if(0 == monitor->sensor_bitmask, UA_ERROR_NO_SENSOR_DATA); UA_INITIALIZE(); @@ -486,7 +486,7 @@ int ua_monitor_start_absence_detection( UA_VALIDATE_INPUT_PARAMETER(handle); UA_VALIDATE_HANDLE(handle, ua_monitor_list); retv_if(TRUE == monitor->absence_detection_started, UA_ERROR_NOW_IN_PROGRESS); - retv_if(UA_DETECT_MODE_INVALID == mode, UA_ERROR_INVALID_PARAMETER); + retv_if(UA_DETECT_MODE_INVALID <= mode, UA_ERROR_INVALID_PARAMETER); retv_if(0 == monitor->sensor_bitmask, UA_ERROR_NO_SENSOR_DATA); UA_INITIALIZE(); @@ -1038,10 +1038,11 @@ int ua_monitor_set_brightness_threshold(ua_monitor_h handle, int presence_thresh UA_VALIDATE_INPUT_PARAMETER(handle); UA_VALIDATE_HANDLE(handle, ua_monitor_list); - retv_if(0 == monitor->sensor_bitmask, UA_ERROR_NO_SENSOR_DATA); + retv_if(0 == (monitor->sensor_bitmask & UAM_SENSOR_BITMASK_LIGHT), UA_ERROR_NO_SENSOR_DATA); UA_INITIALIZE(); - ret = _ua_get_error_code(_uam_request_set_detection_threshold(monitor->sensor_bitmask, presence_threshold, absence_threshold)); + ret = _ua_get_error_code(_uam_request_set_detection_threshold( + UAM_SENSOR_BITMASK_LIGHT, presence_threshold, absence_threshold)); if (UA_ERROR_NONE != ret) { UA_ERR("Set failed"); return ret; |