From: Ankur Date: Tue, 16 Jun 2015 12:54:09 +0000 (+0530) Subject: Updating Test files to test the Uncal_gyro sensor X-Git-Tag: submit/tizen/20151218.070016~58 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae70a6bddd6bf2a4a90e504b5895f7e2e47550d1;p=platform%2Fcore%2Fsystem%2Fsensord.git Updating Test files to test the Uncal_gyro sensor Add test cases for uncal_gyro sensor to the test files Change-Id: I20243d3ec6e5967ee96a3120a3178af30ab2cd1d --- diff --git a/test/src/api-test.c b/test/src/api-test.c index 599041a..8910bd4 100644 --- a/test/src/api-test.c +++ b/test/src/api-test.c @@ -235,6 +235,9 @@ int main(int argc, char **argv) result = check_sensor_api(GAMING_RV_RAW_DATA_EVENT, interval); fprintf(fp, "Gaming Rotation Vector - RAW_DATA_REPORT_ON_TIME - %d\n", result); + result = check_sensor_api(UNCAL_GYROSCOPE_SENSOR, interval); + fprintf(fp, "Uncal Gyro Sensor - RAW_DATA_REPORT_ON_TIME - %d\n", result); + result = check_sensor_api(TEMPERATURE_RAW_DATA_EVENT, interval); fprintf(fp, "Temperature - RAW_DATA_REPORT_ON_TIME - %d\n", result); diff --git a/test/src/check-sensor.c b/test/src/check-sensor.c index 9bba712..6f86cf2 100644 --- a/test/src/check-sensor.c +++ b/test/src/check-sensor.c @@ -75,6 +75,9 @@ void printpollinglogs(sensor_type_t type,sensor_data_t data) case(GAMING_RV_SENSOR): printf("Gaming Rv [%lld] [%6.6f] [%6.6f] [%6.6f] [%6.6f]\n\n", data.timestamp, data.values[0], data.values[1], data.values[2], data.values[3]); break; + case(UNCAL_GYROSCOPE_SENSOR): + printf("Uncal gyro [%lld] [%6.6f] [%6.6f] [%6.6f] [%6.6f] [%6.6f] [%6.6f]\n\n", data.timestamp, data.values[0], data.values[1], data.values[2], data.values[3], data.values[4], data.values[5]); + break; default: return; } @@ -139,6 +142,11 @@ int get_event(sensor_type_t sensor_type, char str[]) if (strcmp(str, "RAW_DATA_EVENT") == 0) return GAMING_RV_RAW_DATA_EVENT; break; + case UNCAL_GYROSCOPE_SENSOR: + if (strcmp(str, "RAW_DATA_EVENT") == 0) + return UNCAL_GYRO_RAW_DATA_EVENT; + break; + } return -1; } @@ -190,6 +198,10 @@ void callback(sensor_t sensor, unsigned int event_type, sensor_data_t *data, voi case GAMING_RV_SENSOR: printf("Gaming RV [%lld] [%6.6f] [%6.6f] [%6.6f] [%6.6f]\n", data->timestamp, data->values[0], data->values[1], data->values[2], data->values[3]); break; + case UNCAL_GYROSCOPE_SENSOR: + printf("Uncal gyro [%lld] [%6.6f] [%6.6f] [%6.6f] [%6.6f] [%6.6f] [%6.6f]\n\n", data.timestamp, data.values[0], data.values[1], data.values[2], data.values[3], data.values[4], data.values[5]); + break; + default: return; } diff --git a/test/src/sensor-test.c b/test/src/sensor-test.c index 99ea138..cb37818 100644 --- a/test/src/sensor-test.c +++ b/test/src/sensor-test.c @@ -45,6 +45,7 @@ void usage() printf("[geomagnetic_rv] "); printf("[gaming_rv] "); printf("[light]\n"); + printf("[uncal_gyro]"); printf("event:"); printf("[RAW_DATA_EVENT]\n"); printf("-p: [polling]\n"); @@ -128,6 +129,10 @@ int main(int argc, char **argv) sensor_type = PROXIMITY_SENSOR; event = PROXIMITY_CHANGE_STATE_EVENT; } + else if (strcmp(argv[1], "uncal_gyro") == 0) { + sensor_type = UNCAL_GYROSCOPE_SENSOR; + event = UNCAL_GYRO_RAW_DATA_EVENT; + } else { usage(); }