Updating Test files to test the Uncal_gyro sensor 71/41571/3
authorAnkur <ankur29.garg@samsung.com>
Tue, 16 Jun 2015 12:54:09 +0000 (18:24 +0530)
committerAnkur Garg <ankur29.garg@samsung.com>
Thu, 18 Jun 2015 04:19:31 +0000 (21:19 -0700)
Add test cases for uncal_gyro sensor to the test files

Change-Id: I20243d3ec6e5967ee96a3120a3178af30ab2cd1d

test/src/api-test.c
test/src/check-sensor.c
test/src/sensor-test.c

index 599041a..8910bd4 100644 (file)
@@ -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);
 
index 9bba712..6f86cf2 100644 (file)
@@ -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;
        }
index 99ea138..cb37818 100644 (file)
@@ -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();
        }