sensorctl: fix bug which senosr type was not set 42/150042/2
authorkibak.yoon <kibak.yoon@samsung.com>
Thu, 14 Sep 2017 05:45:33 +0000 (14:45 +0900)
committerkibak.yoon <kibak.yoon@samsung.com>
Thu, 14 Sep 2017 05:49:46 +0000 (14:49 +0900)
Change-Id: Ie441084d2b95f0ea99c70ca0c70b6a2d0b5ba50b
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
src/sensorctl/tester_manual.cpp

index f2270eb..2e40851 100644 (file)
@@ -32,7 +32,7 @@
 
 #define TEST_MANUAL "manual"
 
-static sensor_type_t type;
+static sensor_type_t stype;
 static int interval;
 static int latency;
 static int powersave;
@@ -61,6 +61,7 @@ tester_manual::~tester_manual()
 
 bool tester_manual::setup(sensor_type_t type, int argc, char *argv[])
 {
+       stype = type;
        interval = TEST_DEFAULT_INTERVAL;
        latency = TEST_DEFAULT_LATENCY;
        powersave = TEST_DEFAULT_POWERSAVE_OPTION;
@@ -127,18 +128,18 @@ TESTCASE(manual_test, sensor)
        int index = 0;
        sensor_data_t data;
 
-       if (sensor_adapter::get_count(type) > 1) {
+       if (sensor_adapter::get_count(stype) > 1) {
                _N("There are more than 2 sensors. please enter the index : ");
                if (scanf("%d", &index) != 1)
                        return false;
        }
 
-       sensor_info info(type, index, interval, latency, powersave, test_cb, NULL);
+       sensor_info info(stype, index, interval, latency, powersave, test_cb, NULL);
 
        ret = sensor_adapter::start(info, handle);
        ASSERT_TRUE(ret);
 
-       ret = sensor_adapter::get_data(handle, type, data);
+       ret = sensor_adapter::get_data(handle, stype, data);
        EXPECT_TRUE(ret);
 
        mainloop::run();