[SDL_Tizen] Modify SDL_hint failed. 02/103802/1
authorhuiyu.eun <huiyu.eun@samsung.com>
Fri, 9 Dec 2016 12:06:21 +0000 (21:06 +0900)
committerhuiyu.eun <huiyu.eun@samsung.com>
Fri, 9 Dec 2016 12:07:57 +0000 (21:07 +0900)
Change-Id: I86020b8c1f94426a934fed0daa953771ca13efb1
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/joystick/tizen/SDL_sysjoystick.c
src/test/SDL_test_log.c
test/testautomation_hints.c

index 8639389..cd2fb08 100755 (executable)
@@ -108,6 +108,7 @@ _tizen_cb_event_joystick_change(void *data, int type EINA_UNUSED, void *event)
 int SDL_SYS_JoystickInit(void)
 {
     SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1");
+    SDL_SetHint("SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS", "1");
     ecore_input_joystick_init();
     int i;
     for (i = 0; i < 16; i++)
index 7156659..fd70832 100755 (executable)
@@ -89,17 +89,17 @@ void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
     size_t len = SDL_strlen(logMessage);
     SDL_strlcpy(message, logMessage,len+1);
 
-    SDL_RWops *rwops = SDL_RWFromFile("log.txt", "a+");
+//    SDL_RWops *rwops = SDL_RWFromFile("log.txt", "a+");
     char *text;
     text = SDL_stack_alloc(char, SDLTEST_MAX_LOGMESSAGE_LENGTH);
     if(text)
     {
         SDL_snprintf(text, SDLTEST_MAX_LOGMESSAGE_LENGTH,  " INFO: %s: %s\n", SDLTest_TimestampToString(time(0)), message);
-        SDL_RWwrite(rwops, text, 1, SDL_strlen(text));
+//        SDL_RWwrite(rwops, text, 1, SDL_strlen(text));
         SDL_stack_free(text);
     }
 
-    SDL_RWclose(rwops);
+//    SDL_RWclose(rwops);
     SDL_stack_free(message);
 
     /* Log with timestamp and newline */
@@ -130,17 +130,17 @@ void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
     size_t len = SDL_strlen(logMessage);
     SDL_strlcpy(message, logMessage,len+1);
 
-    SDL_RWops *rwops = SDL_RWFromFile("log.txt", "a+");
+//    SDL_RWops *rwops = SDL_RWFromFile("log.txt", "a+");
     char *text;
     text = SDL_stack_alloc(char, SDLTEST_MAX_LOGMESSAGE_LENGTH);
     if(text)
     {
         SDL_snprintf(text, SDLTEST_MAX_LOGMESSAGE_LENGTH,  " ERROR: %s: %s\n", SDLTest_TimestampToString(time(0)), message);
-        SDL_RWwrite(rwops, text, 1, SDL_strlen(text));
+//        SDL_RWwrite(rwops, text, 1, SDL_strlen(text));
         SDL_stack_free(text);
     }
 
-    SDL_RWclose(rwops);
+//    SDL_RWclose(rwops);
     SDL_stack_free(message);
 
     /* Log with timestamp and newline */
index a6beb88..75cf9f1 100755 (executable)
@@ -84,8 +84,13 @@ hints_getHint(void *arg)
     SDLTest_AssertPass("Call to SDL_GetHint(%s) - using define definition", (char*)_HintsEnum[i]);
     result2 = (char *)SDL_GetHint((char *)_HintsVerbose[i]);
     SDLTest_AssertPass("Call to SDL_GetHint(%s) - using string definition", (char*)_HintsVerbose[i]);
+
+    int res = -1;
+    if(result1!=NULL && result2!=NULL)
+        res = SDL_strcmp(result1, result2);
+
     SDLTest_AssertCheck(
-      (result1 == NULL && result2 == NULL) || (SDL_strcmp(result1, result2) == 0),
+      (result1 == NULL && result2 == NULL) || (res == 0),
       "Verify returned values are equal; got: result1='%s' result2='%s",
       (result1 == NULL) ? "null" : result1,
       (result2 == NULL) ? "null" : result2);