Configuring proxi test file by removing redundancies and making compatible with IIO... 56/30756/3
authorVibhor Gaur <vibhor.gaur@samsung.com>
Tue, 25 Nov 2014 05:50:32 +0000 (11:20 +0530)
committerVibhor Gaur <vibhor.gaur@samsung.com>
Thu, 27 Nov 2014 06:29:18 +0000 (11:59 +0530)
Change-Id: I8a38fcad95460b09cb8f78eb07d61f5521b16541

test/src/proxi.c

index 1bbd23d..7ed2d64 100644 (file)
@@ -21,7 +21,7 @@
 #include <glib.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <sensor.h>
+#include <sensor_internal.h>
 #include <stdbool.h>
 
 static GMainLoop *mainloop;
@@ -86,10 +86,7 @@ int main(int argc,char **argv)
 
        start_handle = sf_start(handle,0);
 
-       if (start_handle >= 0) {
-               printf("Success start \n");
-       }
-       else {
+       if (start_handle < 0) {
                printf("Error\n\n\n\n");
                sf_unregister_event(handle, event);
                sf_disconnect(handle);
@@ -103,8 +100,10 @@ int main(int argc,char **argv)
 
        stop_handle = sf_stop(handle);
 
-       if (stop_handle >= 0)
-               printf("Success stop \n");
+       if (stop_handle < 0) {
+               printf("Failed to stop proximity sensor\n\n");
+               return -1;
+       }
 
        sf_disconnect(handle);