From e9b9dd180b165937059978e7d08c35f561c7e4be Mon Sep 17 00:00:00 2001 From: "huiyu.eun" Date: Tue, 13 Dec 2016 02:02:51 +0900 Subject: [PATCH] [SDL_Tizen] Fix SDL_Test - 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 --- src/audio/SDL_audio.c | 8 +++++++- test/testautomation_audio.c | 4 ++++ test/testautomation_render.c | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 2ffd216..059b23e 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -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(¤t_audio.inputDevices, ¤t_audio.inputDeviceCount); /* Free the driver data */ - current_audio.impl.Deinitialize(); + if(current_audio.impl.Deinitialize) + current_audio.impl.Deinitialize(); SDL_DestroyMutex(current_audio.detectionLock); diff --git a/test/testautomation_audio.c b/test/testautomation_audio.c index c26ec45..4a61e30 100755 --- a/test/testautomation_audio.c +++ b/test/testautomation_audio.c @@ -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); diff --git a/test/testautomation_render.c b/test/testautomation_render.c index 484ef1d..c67ea77 100755 --- a/test/testautomation_render.c +++ b/test/testautomation_render.c @@ -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) */ -- 2.7.4