diff options
author | Yunmi Ha <yunmi.ha@samsung.com> | 2021-04-20 14:18:48 +0900 |
---|---|---|
committer | Yunmi Ha <yunmi.ha@samsung.com> | 2021-04-20 14:18:48 +0900 |
commit | b2dd5c2eac316410837e9b46de41d1e4a2461adf (patch) | |
tree | 8766ba9b6115ee6fa6c6a81b70273734b2368469 | |
parent | 471dbdce40f1eed3a8d7f1679580829607b26c74 (diff) | |
download | sensor-tw3-b2dd5c2eac316410837e9b46de41d1e4a2461adf.tar.gz sensor-tw3-b2dd5c2eac316410837e9b46de41d1e4a2461adf.tar.bz2 sensor-tw3-b2dd5c2eac316410837e9b46de41d1e4a2461adf.zip |
Use system error instaed of sensor_error_e
Change-Id: I382b0289352a1e3972179690f671915b06dca012
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
-rwxr-xr-x | src/accel/accel_device.cpp | 10 | ||||
-rwxr-xr-x | src/gyro/gyro_device.cpp | 10 | ||||
-rwxr-xr-x | src/hrm/hrm_device.cpp | 10 | ||||
-rwxr-xr-x | src/hrm_raw/hrm_raw_device.cpp | 10 | ||||
-rwxr-xr-x | src/light/light_device.cpp | 10 | ||||
-rwxr-xr-x | src/pressure/pressure_device.cpp | 10 | ||||
-rw-r--r-- | src/sensorhub/sensorhub.cpp | 2 | ||||
-rwxr-xr-x | testcase/sensor_device_haltest.cpp | 61 |
8 files changed, 61 insertions, 62 deletions
diff --git a/src/accel/accel_device.cpp b/src/accel/accel_device.cpp index 964d443..79620a2 100755 --- a/src/accel/accel_device.cpp +++ b/src/accel/accel_device.cpp @@ -122,7 +122,7 @@ int accel_device::get_poll_fd(void) int accel_device::get_sensors(const sensor_info_t **sensors) { - retvm_if(sensors == NULL || sensors == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL interface", SENSOR_NAME); + retvm_if(sensors == NULL || sensors == nullptr, -EINVAL, "%s:NULL interface", SENSOR_NAME); *sensors = &sensor_info; return 1; @@ -248,7 +248,7 @@ bool accel_device::update_value_input_event(void) int accel_device::read_fd(uint32_t **ids) { - retvm_if(ids == NULL || ids == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL interface", SENSOR_NAME); + retvm_if(ids == NULL || ids == nullptr, -EINVAL, "%s:NULL interface", SENSOR_NAME); if (!update_value_input_event()) { _D("Failed to update value"); @@ -266,9 +266,9 @@ int accel_device::read_fd(uint32_t **ids) int accel_device::get_data(uint32_t id, sensor_data_t **data, int *length) { sensor_data_t *sensor_data; - retvm_if(data == NULL || data == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL data interface", SENSOR_NAME); - retvm_if(length == NULL || length == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL length interface", SENSOR_NAME); - retvm_if(id == 0 || id > MAX_ID, SENSOR_ERROR_INVALID_PARAMETER, "%s:Invalid ID Received", SENSOR_NAME); + retvm_if(data == NULL || data == nullptr, -EINVAL, "%s:NULL data interface", SENSOR_NAME); + retvm_if(length == NULL || length == nullptr, -EINVAL, "%s:NULL length interface", SENSOR_NAME); + retvm_if(id == 0 || id > MAX_ID, -EINVAL, "%s:Invalid ID Received", SENSOR_NAME); sensor_data = (sensor_data_t *)malloc(sizeof(sensor_data_t)); retvm_if(!sensor_data, -ENOMEM, "Memory allocation failed"); diff --git a/src/gyro/gyro_device.cpp b/src/gyro/gyro_device.cpp index 2e3155a..81d40c5 100755 --- a/src/gyro/gyro_device.cpp +++ b/src/gyro/gyro_device.cpp @@ -120,7 +120,7 @@ int gyro_device::get_poll_fd(void) int gyro_device::get_sensors(const sensor_info_t **sensors) { - retvm_if(sensors == NULL || sensors == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL interface", SENSOR_NAME); + retvm_if(sensors == NULL || sensors == nullptr, -EINVAL, "%s:NULL interface", SENSOR_NAME); *sensors = &sensor_info; return 1; @@ -245,7 +245,7 @@ bool gyro_device::update_value_input_event(void) int gyro_device::read_fd(uint32_t **ids) { - retvm_if(ids == NULL || ids == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL interface", SENSOR_NAME); + retvm_if(ids == NULL || ids == nullptr, -EINVAL, "%s:NULL interface", SENSOR_NAME); if (!update_value_input_event()) { _D("Failed to update value"); @@ -263,9 +263,9 @@ int gyro_device::read_fd(uint32_t **ids) int gyro_device::get_data(uint32_t id, sensor_data_t **data, int *length) { sensor_data_t *sensor_data; - retvm_if(data == NULL || data == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL data interface", SENSOR_NAME); - retvm_if(length == NULL || length == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL length interface", SENSOR_NAME); - retvm_if(id == 0 || id > MAX_ID, SENSOR_ERROR_INVALID_PARAMETER, "%s:Invalid ID Received", SENSOR_NAME); + retvm_if(data == NULL || data == nullptr, -EINVAL, "%s:NULL data interface", SENSOR_NAME); + retvm_if(length == NULL || length == nullptr, -EINVAL, "%s:NULL length interface", SENSOR_NAME); + retvm_if(id == 0 || id > MAX_ID, -EINVAL, "%s:Invalid ID Received", SENSOR_NAME); sensor_data = (sensor_data_t *)malloc(sizeof(sensor_data_t)); retvm_if(!sensor_data, -ENOMEM, "Memory allocation failed"); diff --git a/src/hrm/hrm_device.cpp b/src/hrm/hrm_device.cpp index 961f249..eb7c068 100755 --- a/src/hrm/hrm_device.cpp +++ b/src/hrm/hrm_device.cpp @@ -122,7 +122,7 @@ int hrm_device::get_poll_fd(void) int hrm_device::get_sensors(const sensor_info_t **sensors) { - retvm_if(sensors == NULL || sensors == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL interface", SENSOR_NAME); + retvm_if(sensors == NULL || sensors == nullptr, -EINVAL, "%s:NULL interface", SENSOR_NAME); *sensors = &sensor_info; @@ -249,7 +249,7 @@ bool hrm_device::update_value_input_event(void) int hrm_device::read_fd(uint32_t **ids) { - retvm_if(ids == NULL || ids == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL interface", SENSOR_NAME); + retvm_if(ids == NULL || ids == nullptr, -EINVAL, "%s:NULL interface", SENSOR_NAME); if (!update_value_input_event()) { _D("Failed to update value"); @@ -267,9 +267,9 @@ int hrm_device::read_fd(uint32_t **ids) int hrm_device::get_data(uint32_t id, sensor_data_t **data, int *length) { sensor_data_t *sensor_data; - retvm_if(data == NULL || data == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL data interface", SENSOR_NAME); - retvm_if(length == NULL || length == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL length interface", SENSOR_NAME); - retvm_if(id == 0 || id > MAX_ID, SENSOR_ERROR_INVALID_PARAMETER, "%s:Invalid ID Received", SENSOR_NAME); + retvm_if(data == NULL || data == nullptr, -EINVAL, "%s:NULL data interface", SENSOR_NAME); + retvm_if(length == NULL || length == nullptr, -EINVAL, "%s:NULL length interface", SENSOR_NAME); + retvm_if(id == 0 || id > MAX_ID, -EINVAL, "%s:Invalid ID Received", SENSOR_NAME); sensor_data = (sensor_data_t *)malloc(sizeof(sensor_data_t)); retvm_if(!sensor_data, -ENOMEM, "Memory allocation failed"); diff --git a/src/hrm_raw/hrm_raw_device.cpp b/src/hrm_raw/hrm_raw_device.cpp index 5fedc22..c74c8d8 100755 --- a/src/hrm_raw/hrm_raw_device.cpp +++ b/src/hrm_raw/hrm_raw_device.cpp @@ -146,7 +146,7 @@ int hrm_raw_device::get_poll_fd(void) int hrm_raw_device::get_sensors(const sensor_info_t **sensors) { - retvm_if(sensors == NULL || sensors == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL interface", SENSOR_NAME); + retvm_if(sensors == NULL || sensors == nullptr, -EINVAL, "%s:NULL interface", SENSOR_NAME); *sensors = sensor_info; return 2; @@ -280,7 +280,7 @@ bool hrm_raw_device::update_value_input_event(void) int hrm_raw_device::read_fd(uint32_t **ids) { - retvm_if(ids == NULL || ids == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL interface", SENSOR_NAME); + retvm_if(ids == NULL || ids == nullptr, -EINVAL, "%s:NULL interface", SENSOR_NAME); if (!update_value_input_event()) { _D("Failed to update value"); @@ -303,9 +303,9 @@ int hrm_raw_device::get_data(uint32_t id, sensor_data_t **data, int *length) { int remains = 1; sensor_data_t *sensor_data; - retvm_if(data == NULL || data == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL data interface", SENSOR_NAME); - retvm_if(length == NULL || length == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL length interface", SENSOR_NAME); - retvm_if(id == 0 || id > MAX_ID, SENSOR_ERROR_INVALID_PARAMETER, "%s:Invalid ID Received", SENSOR_NAME); + retvm_if(data == NULL || data == nullptr, -EINVAL, "%s:NULL data interface", SENSOR_NAME); + retvm_if(length == NULL || length == nullptr, -EINVAL, "%s:NULL length interface", SENSOR_NAME); + retvm_if(id == 0 || id > MAX_ID, -EINVAL, "%s:Invalid ID Received", SENSOR_NAME); sensor_data = (sensor_data_t *)malloc(sizeof(sensor_data_t)); retvm_if(!sensor_data, -ENOMEM, "Memory allocation failed"); diff --git a/src/light/light_device.cpp b/src/light/light_device.cpp index dd834bd..2aabcac 100755 --- a/src/light/light_device.cpp +++ b/src/light/light_device.cpp @@ -116,7 +116,7 @@ int light_device::get_poll_fd() int light_device::get_sensors(const sensor_info_t **sensors) { - retvm_if(sensors == NULL || sensors == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL interface", SENSOR_NAME); + retvm_if(sensors == NULL || sensors == nullptr, -EINVAL, "%s:NULL interface", SENSOR_NAME); *sensors = &sensor_info; return 1; @@ -194,7 +194,7 @@ bool light_device::update_value_lux(void) int light_device::read_fd(uint32_t **ids) { - retvm_if(ids == NULL || ids == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL interface", SENSOR_NAME); + retvm_if(ids == NULL || ids == nullptr, -EINVAL, "%s:NULL interface", SENSOR_NAME); if (!update_value_lux()) { _D("Failed to update value"); @@ -212,9 +212,9 @@ int light_device::read_fd(uint32_t **ids) int light_device::get_data(uint32_t id, sensor_data_t **data, int *length) { sensor_data_t *sensor_data; - retvm_if(data == NULL || data == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL data interface", SENSOR_NAME); - retvm_if(length == NULL || length == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL length interface", SENSOR_NAME); - retvm_if(id == 0 || id > MAX_ID, SENSOR_ERROR_INVALID_PARAMETER, "%s:Invalid ID Received", SENSOR_NAME); + retvm_if(data == NULL || data == nullptr, -EINVAL, "%s:NULL data interface", SENSOR_NAME); + retvm_if(length == NULL || length == nullptr, -EINVAL, "%s:NULL length interface", SENSOR_NAME); + retvm_if(id == 0 || id > MAX_ID, -EINVAL, "%s:Invalid ID Received", SENSOR_NAME); sensor_data = (sensor_data_t *)malloc(sizeof(sensor_data_t)); retvm_if(!sensor_data, -ENOMEM, "Memory allocation failed"); diff --git a/src/pressure/pressure_device.cpp b/src/pressure/pressure_device.cpp index ec4b340..7c84546 100755 --- a/src/pressure/pressure_device.cpp +++ b/src/pressure/pressure_device.cpp @@ -134,7 +134,7 @@ int pressure_device::get_poll_fd(void) int pressure_device::get_sensors(const sensor_info_t **sensors) { - retvm_if(sensors == NULL || sensors == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL interface", SENSOR_NAME); + retvm_if(sensors == NULL || sensors == nullptr, -EINVAL, "%s:NULL interface", SENSOR_NAME); *sensors = &sensor_info; return 1; @@ -270,7 +270,7 @@ bool pressure_device::update_value_input_event(void) int pressure_device::read_fd(uint32_t **ids) { - retvm_if(ids == NULL || ids == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL interface", SENSOR_NAME); + retvm_if(ids == NULL || ids == nullptr, -EINVAL, "%s:NULL interface", SENSOR_NAME); if (!update_value_input_event()) { _D("Failed to update value"); @@ -288,9 +288,9 @@ int pressure_device::read_fd(uint32_t **ids) int pressure_device::get_data(uint32_t id, sensor_data_t **data, int *length) { sensor_data_t *sensor_data; - retvm_if(data == NULL || data == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL data interface", SENSOR_NAME); - retvm_if(length == NULL || length == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "%s:NULL length interface", SENSOR_NAME); - retvm_if(id == 0 || id > MAX_ID, SENSOR_ERROR_INVALID_PARAMETER, "%s:Invalid ID Received", SENSOR_NAME); + retvm_if(data == NULL || data == nullptr, -EINVAL, "%s:NULL data interface", SENSOR_NAME); + retvm_if(length == NULL || length == nullptr, -EINVAL, "%s:NULL length interface", SENSOR_NAME); + retvm_if(id == 0 || id > MAX_ID, -EINVAL, "%s:Invalid ID Received", SENSOR_NAME); sensor_data = (sensor_data_t *)malloc(sizeof(sensor_data_t)); retvm_if(!sensor_data, -ENOMEM, "Memory allocation failed"); diff --git a/src/sensorhub/sensorhub.cpp b/src/sensorhub/sensorhub.cpp index 511de82..130e46f 100644 --- a/src/sensorhub/sensorhub.cpp +++ b/src/sensorhub/sensorhub.cpp @@ -57,7 +57,7 @@ int sensorhub_device::get_sensors(const sensor_info_t **sensors) { int size; - retvm_if(sensors == NULL || sensors == nullptr, SENSOR_ERROR_INVALID_PARAMETER, "sensorhub_device:NULL interface"); + retvm_if(sensors == NULL || sensors == nullptr, -EINVAL, "sensorhub_device:NULL interface"); size = manager->get_sensor_infos(sensors); diff --git a/testcase/sensor_device_haltest.cpp b/testcase/sensor_device_haltest.cpp index f9da72b..dd60c93 100755 --- a/testcase/sensor_device_haltest.cpp +++ b/testcase/sensor_device_haltest.cpp @@ -35,7 +35,6 @@ using namespace std; do {\ if (!sensor_supported) {\ cout << #name <<" SENSOR NOT SUPPORTED" << endl;\ - EXPECT_EQ(ret, SENSOR_ERROR_NOT_SUPPORTED);\ return;\ }\ } while (0) @@ -310,7 +309,7 @@ TEST_F(AccelSensorHalTest, get_sensorsN) { SENSOR_SUPPORT_CHECK(ACCEL); ret = sensor_handle->get_sensors(nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } @@ -454,7 +453,7 @@ TEST_F(AccelSensorHalTest, read_fdN) { SENSOR_SUPPORT_CHECK(ACCEL); ret = sensor_handle->read_fd(nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } /** @@ -502,15 +501,15 @@ TEST_F(AccelSensorHalTest, get_dataN) sensor_data_t *data = nullptr; int length = 0; ret = sensor_handle->get_data(id, nullptr, &length); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); data = nullptr; ret = sensor_handle->get_data(id, &data, nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); id = 0; data = nullptr; length = 0; ret = sensor_handle->get_data(id, &data, &length); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } @@ -627,7 +626,7 @@ TEST_F(GyroSensorHalTest, get_sensorsN) { SENSOR_SUPPORT_CHECK(GYRO); ret = sensor_handle->get_sensors(nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } @@ -771,7 +770,7 @@ TEST_F(GyroSensorHalTest, read_fdN) { SENSOR_SUPPORT_CHECK(GYRO); ret = sensor_handle->read_fd(nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } /** @@ -819,15 +818,15 @@ TEST_F(GyroSensorHalTest, get_dataN) sensor_data_t *data = nullptr; int length = 0; ret = sensor_handle->get_data(id, nullptr, &length); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); data = nullptr; ret = sensor_handle->get_data(id, &data, nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); id = 0; data = nullptr; length = 0; ret = sensor_handle->get_data(id, &data, &length); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } @@ -944,7 +943,7 @@ TEST_F(HRMSensorHalTest, get_sensorsN) { SENSOR_SUPPORT_CHECK(HRM); ret = sensor_handle->get_sensors(nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } @@ -1088,7 +1087,7 @@ TEST_F(HRMSensorHalTest, read_fdN) { SENSOR_SUPPORT_CHECK(HRM); ret = sensor_handle->read_fd(nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } /** @@ -1136,15 +1135,15 @@ TEST_F(HRMSensorHalTest, get_dataN) sensor_data_t *data = nullptr; int length = 0; ret = sensor_handle->get_data(id, nullptr, &length); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); data = nullptr; ret = sensor_handle->get_data(id, &data, nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); id = 0; data = nullptr; length = 0; ret = sensor_handle->get_data(id, &data, &length); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } @@ -1262,7 +1261,7 @@ TEST_F(HRMRawSensorHalTest, get_sensorsN) { SENSOR_SUPPORT_CHECK(HRMRAW); ret = sensor_handle->get_sensors(nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } @@ -1406,7 +1405,7 @@ TEST_F(HRMRawSensorHalTest, read_fdN) { SENSOR_SUPPORT_CHECK(HRMRAW); ret = sensor_handle->read_fd(nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } /** @@ -1454,15 +1453,15 @@ TEST_F(HRMRawSensorHalTest, get_dataN) sensor_data_t *data = nullptr; int length = 0; ret = sensor_handle->get_data(id, nullptr, &length); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); data = nullptr; ret = sensor_handle->get_data(id, &data, nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); id = 0; data = nullptr; length = 0; ret = sensor_handle->get_data(id, &data, &length); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } @@ -1580,7 +1579,7 @@ TEST_F(LightSensorHalTest, get_sensorsN) { SENSOR_SUPPORT_CHECK(LIGHT); ret = sensor_handle->get_sensors(nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } @@ -1724,7 +1723,7 @@ TEST_F(LightSensorHalTest, read_fdN) { SENSOR_SUPPORT_CHECK(LIGHT); ret = sensor_handle->read_fd(nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } /** @@ -1772,15 +1771,15 @@ TEST_F(LightSensorHalTest, get_dataN) sensor_data_t *data = nullptr; int length = 0; ret = sensor_handle->get_data(id, nullptr, &length); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); data = nullptr; ret = sensor_handle->get_data(id, &data, nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); id = 0; data = nullptr; length = 0; ret = sensor_handle->get_data(id, &data, &length); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } @@ -1897,7 +1896,7 @@ TEST_F(PressureSensorHalTest, get_sensorsN) { SENSOR_SUPPORT_CHECK(PRESSURE); ret = sensor_handle->get_sensors(nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } @@ -2041,7 +2040,7 @@ TEST_F(PressureSensorHalTest, read_fdN) { SENSOR_SUPPORT_CHECK(PRESSURE); ret = sensor_handle->read_fd(nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } /** @@ -2089,15 +2088,15 @@ TEST_F(PressureSensorHalTest, get_dataN) sensor_data_t *data = nullptr; int length = 0; ret = sensor_handle->get_data(id, nullptr, &length); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); data = nullptr; ret = sensor_handle->get_data(id, &data, nullptr); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); id = 0; data = nullptr; length = 0; ret = sensor_handle->get_data(id, &data, &length); - EXPECT_EQ(ret, SENSOR_ERROR_INVALID_PARAMETER); + EXPECT_EQ(ret, -EINVAL); } |