(Automated Tests) Fix compiler warnings in some test cases 90/27590/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 16 Sep 2014 09:00:45 +0000 (10:00 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 16 Sep 2014 09:00:45 +0000 (10:00 +0100)
Change-Id: I91eb66e9a01c39951b80341f73e71cc185da86af

automated-tests/src/dali-adaptor-internal/utc-Dali-CommandLineOptions.cpp
automated-tests/src/dali-adaptor-internal/utc-Dali-TiltSensor.cpp
automated-tests/src/dali-adaptor/utc-Dali-Timer.cpp

index d0e6339..4531017 100644 (file)
@@ -40,12 +40,6 @@ void command_line_options_cleanup(void)
   test_return_value = TET_PASS;
 }
 
-namespace
-{
-int gOriginalOptIndValue(0);
-}
-
-
 int UtcDaliCommandLineOptionsNoArgs(void)
 {
   optind=1;
@@ -186,7 +180,7 @@ int UtcDaliCommandLineOptionsMixture(void)
 {
   optind = 1; // Reset opt for test
 
-  char* argList[] =
+  const char* argList[] =
   {
     "program",
     "--width=800",
@@ -196,7 +190,7 @@ int UtcDaliCommandLineOptionsMixture(void)
     "-r",
   };
   int argc( sizeof( argList ) / sizeof( argList[0] ) );
-  char** argv = argList;
+  char** argv = const_cast<char**>( argList );
 
   CommandLineOptions options( &argc, &argv );
 
@@ -217,7 +211,7 @@ int UtcDaliCommandLineOptionsMixtureDaliOpsAtStart(void)
 {
   optind=1;
 
-  char* argList[] =
+  const char* argList[] =
   {
       "program",
       "--width=800",
@@ -227,7 +221,7 @@ int UtcDaliCommandLineOptionsMixtureDaliOpsAtStart(void)
       "-y", "600",
   };
   int argc( sizeof( argList ) / sizeof( argList[0] ) );
-  char** argv = argList;
+  char** argv = const_cast<char**>( argList );
 
   CommandLineOptions options( &argc, &argv );
 
@@ -248,7 +242,7 @@ int UtcDaliCommandLineOptionsMixtureDaliOpsAtEnd(void)
 {
   optind=1;
 
-  char* argList[] =
+  const char* argList[] =
   {
       "program",
       "hello-world",
@@ -258,7 +252,7 @@ int UtcDaliCommandLineOptionsMixtureDaliOpsAtEnd(void)
       "--height", "1000",
   };
   int argc( sizeof( argList ) / sizeof( argList[0] ) );
-  char** argv = argList;
+  char** argv = const_cast<char**>( argList );
 
   CommandLineOptions options( &argc, &argv );
 
index 8461789..d364d46 100644 (file)
@@ -18,6 +18,7 @@
 #include <iostream>
 
 #include <stdlib.h>
+#include <stdint.h>
 #include <Ecore.h>
 #include <dali/dali.h>
 #include <dali-test-suite-utils.h>
@@ -74,8 +75,7 @@ TiltSensor GetTiltSensor()
 bool ecore_timer_running = false;
 Ecore_Task_Cb timer_callback_func=NULL;
 const void* timer_callback_data=NULL;
-bool main_loop_can_run = false;
-int timerId = 8;
+intptr_t timerId = 8; // intptr_t has the same size as a pointer and is platform independent so this can be returned as a pointer in ecore_timer_add below without compilation warnings
 }// anon namespace
 extern "C"
 {
index 2f4e48e..4a57090 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <iostream>
 #include <stdlib.h>
+#include <stdint.h>
 #include <dali/dali.h>
 #include <Ecore.h>
 #include <dali-test-suite-utils.h>
@@ -39,7 +40,7 @@ bool ecore_timer_running = false;
 Ecore_Task_Cb timer_callback_func=NULL;
 const void* timer_callback_data=NULL;
 bool main_loop_can_run = false;
-int timerId = 0;
+intptr_t timerId = 0; // intptr_t has the same size as a pointer and is platform independent so this can be returned as a pointer in ecore_timer_add below without compilation warnings
 }// anon namespace
 
 extern "C"