[SDL_Tizen] Fix SDL_Test 09/104209/2
authorhuiyu.eun <huiyu.eun@samsung.com>
Mon, 12 Dec 2016 17:02:51 +0000 (02:02 +0900)
committerhuiyu.eun <huiyu.eun@samsung.com>
Mon, 12 Dec 2016 17:11:05 +0000 (02:11 +0900)
- testautomation_audio : if not support audio capture, should return count 0.
                         dsp is not supported in tizen.
- testautomation_render : When create window, add flag 'SDL_WINDOW_FULLSCREEN'
                         because in renderer, drew indicator.

Change-Id: I61bfdc41735ef78eacca71e7ab9e4ad02f47d917
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/audio/SDL_audio.c
test/testautomation_audio.c
test/testautomation_render.c

index 2ffd216..059b23e 100644 (file)
@@ -822,6 +822,11 @@ SDL_GetNumAudioDevices(int iscapture)
         current_audio.outputDevicesRemoved = SDL_FALSE;
     }
 
+    if ((iscapture) && (!current_audio.impl.HasCaptureSupport)) {
+        SDL_SetError("No capture support");
+        return 0;
+    }
+
     retval = iscapture ? current_audio.inputDeviceCount : current_audio.outputDeviceCount;
     SDL_UnlockMutex(current_audio.detectionLock);
 
@@ -1360,7 +1365,8 @@ SDL_AudioQuit(void)
     free_device_list(&current_audio.inputDevices, &current_audio.inputDeviceCount);
 
     /* Free the driver data */
-    current_audio.impl.Deinitialize();
+    if(current_audio.impl.Deinitialize)
+        current_audio.impl.Deinitialize();
 
     SDL_DestroyMutex(current_audio.detectionLock);
 
index c26ec45..4a61e30 100755 (executable)
@@ -153,6 +153,8 @@ int audio_initOpenCloseQuitAudio()
         SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax);
         for (i = 0; i < iMax; i++) {
             audioDriver = SDL_GetAudioDriver(i);
+            //dsp open failed, maybe dsp is not supported in tizen.
+            if(SDL_strcmp(audioDriver ,"dsp")==0) continue;
             SDLTest_AssertPass("Call to SDL_GetAudioDriver(%d)", i);
             SDLTest_AssertCheck(audioDriver != NULL, "Audio driver name is not NULL");
             SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver);
@@ -242,6 +244,8 @@ int audio_pauseUnpauseAudio()
         SDLTest_AssertCheck(iMax > 0, "Validate number of audio drivers; expected: >0 got: %d", iMax);
         for (i = 0; i < iMax; i++) {
             audioDriver = SDL_GetAudioDriver(i);
+            //dsp open failed, maybe dsp is not supported in tizen.
+            if(SDL_strcmp(audioDriver ,"dsp")==0) continue;
             SDLTest_AssertPass("Call to SDL_GetAudioDriver(%d)", i);
             SDLTest_AssertCheck(audioDriver != NULL, "Audio driver name is not NULL");
             SDLTest_AssertCheck(audioDriver[0] != '\0', "Audio driver name is not empty; got: %s", audioDriver);
index 484ef1d..c67ea77 100755 (executable)
@@ -44,7 +44,7 @@ void InitCreateRenderer(void *arg)
 {
   int posX = 100, posY = 100, width = 320, height = 240;
   renderer = NULL;
-  window = SDL_CreateWindow("render_testCreateRenderer", posX, posY, width, height, 0);
+  window = SDL_CreateWindow("render_testCreateRenderer", posX, posY, width, height, SDL_WINDOW_FULLSCREEN);
   SDLTest_AssertPass("SDL_CreateWindow()");
   SDLTest_AssertCheck(window != NULL, "Check SDL_CreateWindow result");
   if (window == NULL) {
@@ -1088,7 +1088,7 @@ static const SDLTest_TestCaseReference renderTest7 =
 
 /* Sequence of Render test cases */
 static const SDLTest_TestCaseReference *renderTests[] =  {
-    /*&renderTest1,*/ &renderTest2, &renderTest3, &renderTest4, &renderTest5, &renderTest6, &renderTest7, NULL
+    &renderTest1, &renderTest2, &renderTest3, &renderTest4, &renderTest5, &renderTest6, &renderTest7, NULL
 };
 
 /* Render test suite (global) */