+SDL_tizen_app_init
SDL_Vulkan_GetInstanceExtensions
SDL_Vulkan_CreateSurface
char ** gArgv;
int test_return_value;
-int SDL_main(int argc, char *argv[])
+int main(int argc, char *argv[])
{
int result = -1;
int i;
}
char* func_name = (char*)argv[1];
-
if (smack_mode) {
encoded_byte=(char*)argv[3];
dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Coverage *.gcda File location set to /tmp/home/abuild/rpmbuild/BUILD/ ", __FUNCTION__, __LINE__);
dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, func_name);
- //Initialize SDL
- if( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_EVENTS ) < 0 ) {
- printf( "SDL could not initialize! SDL_Error: %s\n", SDL_GetError() );
- SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "SDL could not initialize! SDL_Error: %s", SDL_GetError());
-
- PRINT_TC_RESULT("%d", result=-1);
- return result;
- }
-
-
+ setArgument(argc, argv);
for (i = 0; tc_array[i].name; i++) {
if (!strncmp(func_name, tc_array[i].name, strlen(func_name))) {
if ( tc_array[i].startup )
{
dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name);
+ initSDLApp();
tc_array[i].startup();
}
#include "testcase.h"
#include "tct_common.h"
+extern void setArgument(int argc, char* argv[]);
+extern void initSDLApp();
+
+extern int utc_SDL_tizen_app_init_p(void);
+extern int utc_SDL_tizen_app_init_n(void);
+extern int utc_SDL_tizen_app_init_n2(void);
+extern int utc_SDL_tizen_app_init_n3(void);
+
extern void utc_sdl_startup(void);
extern void utc_sdl_cleanup(void);
extern int utc_SDL_Vulkan_CreateSurface_n4(void);
testcase tc_array[] = {
+ {"utc_SDL_tizen_app_init_p", utc_SDL_tizen_app_init_p, NULL, NULL},
+ {"utc_SDL_tizen_app_init_n", utc_SDL_tizen_app_init_n, NULL, NULL},
+ {"utc_SDL_tizen_app_init_n2", utc_SDL_tizen_app_init_n2, NULL, NULL},
+ {"utc_SDL_tizen_app_init_n3", utc_SDL_tizen_app_init_n3, NULL, NULL},
{"utc_SDL_Vulkan_GetInstanceExtensions_p",utc_SDL_Vulkan_GetInstanceExtensions_p,utc_sdl_startup,utc_sdl_cleanup},
{"utc_SDL_Vulkan_GetInstanceExtensions_p2",utc_SDL_Vulkan_GetInstanceExtensions_p2,utc_sdl_startup,utc_sdl_cleanup},
{"utc_SDL_Vulkan_GetInstanceExtensions_n",utc_SDL_Vulkan_GetInstanceExtensions_n,utc_sdl_startup,utc_sdl_cleanup},
#include "testcase.h"
#include "tct_common.h"
+extern void setArgument(int argc, char* argv[]);
+extern void initSDLApp();
+
+extern int utc_SDL_tizen_app_init_p(void);
+extern int utc_SDL_tizen_app_init_n(void);
+extern int utc_SDL_tizen_app_init_n2(void);
+extern int utc_SDL_tizen_app_init_n3(void);
+
extern void utc_sdl_startup(void);
extern void utc_sdl_cleanup(void);
extern int utc_SDL_Vulkan_CreateSurface_n4(void);
testcase tc_array[] = {
+ {"utc_SDL_tizen_app_init_p", utc_SDL_tizen_app_init_p, NULL, NULL},
+ {"utc_SDL_tizen_app_init_n", utc_SDL_tizen_app_init_n, NULL, NULL},
+ {"utc_SDL_tizen_app_init_n2", utc_SDL_tizen_app_init_n2, NULL, NULL},
+ {"utc_SDL_tizen_app_init_n3", utc_SDL_tizen_app_init_n3, NULL, NULL},
{"utc_SDL_Vulkan_GetInstanceExtensions_p", utc_SDL_Vulkan_GetInstanceExtensions_p, utc_sdl_startup, utc_sdl_cleanup},
{"utc_SDL_Vulkan_GetInstanceExtensions_p2", utc_SDL_Vulkan_GetInstanceExtensions_p2, utc_sdl_startup, utc_sdl_cleanup},
{"utc_SDL_Vulkan_GetInstanceExtensions_n", utc_SDL_Vulkan_GetInstanceExtensions_n, utc_sdl_startup, utc_sdl_cleanup},
#include "assert.h"
#include "tct_common.h"
+#include <app.h>
#include <system_info.h>
#include <SDL.h>
#include <vulkan/vulkan.h>
#include <dlog.h>
#include <dlfcn.h>
+static int argc;
+static char **argv;
+
+/**
+ * @function setArgument
+ * @description sets global arguments variable
+ * @parameter argc : argument count
+ * @parameter argv : argument vector
+ * @return NA
+ */
+void setArgument(int _argc, char* _argv[])
+{
+ argc = _argc;
+ argv = _argv;
+}
+
+/**
+ * @function initSDLApp
+ * @description initialize SDL application
+ * @return NA
+ */
+void initSDLApp()
+{
+ SDL_tizen_app_init(argc, argv);
+ SDL_SetMainReady();
+}
+
+/**
+ * @testcase utc_SDL_tizen_app_init_p
+ * @since_tizen 4.0
+ * @description testcase for check normal inputs
+ */
+int utc_SDL_tizen_app_init_p(void)
+{
+ int ret = SDL_tizen_app_init(argc, argv);
+ assert_eq(ret, APP_ERROR_NONE);
+ return 0;
+}
+
+/**
+ * @testcase utc_SDL_tizen_app_init_n
+ * @since_tizen 4.0
+ * @description testcase for calling api twice
+ */
+int utc_SDL_tizen_app_init_n(void)
+{
+ int ret = SDL_tizen_app_init(argc, argv);
+ assert_eq(ret, APP_ERROR_NONE);
+ if(ret == APP_ERROR_NONE)
+ {
+ ret = SDL_tizen_app_init(argc, argv);
+ }
+ assert_eq(ret, APP_ERROR_ALREADY_RUNNING);
+ return 0;
+}
+
+/**
+ * @testcase utc_SDL_tizen_app_init_n2
+ * @since_tizen 4.0
+ * @description testcase for check invalid input
+ (argc is 0)
+ */
+int utc_SDL_tizen_app_init_n2(void)
+{
+ argc = 0;
+ int ret = SDL_tizen_app_init(argc, argv);
+ assert_eq(ret, APP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
+/**
+ * @testcase utc_SDL_tizen_app_init_n3
+ * @since_tizen 4.0
+ * @description testcase for check invalid input
+ (argv is NULL)
+ */
+int utc_SDL_tizen_app_init_n3(void)
+{
+ argv = NULL;
+ int ret = SDL_tizen_app_init(argc, argv);
+ assert_eq(ret, APP_ERROR_INVALID_PARAMETER);
+ return 0;
+}
+
void *vulkan_handle;
PFN_vkGetInstanceProcAddr fn_vkGetInstanceProcAddr;
}
//Initialize SDL
+ if( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_EVENTS ) < 0 ) {
+ printf( "SDL could not initialize! SDL_Error: %s\n", SDL_GetError() );
+ SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "SDL could not initialize! SDL_Error: %s", SDL_GetError());
+
+ return;
+ }
SDL_GetDisplayMode(0, 0, &(tcData.sdl_mode));
tcData.width = tcData.sdl_mode.w;
/**
* @testcase utc_SDL_Vulkan_GetInstanceExtension_n
* @since_tizen 3.0
- * @description testcase for check invalid input
+ * @description testcase for check invalid input
* (SDL_Window* window : NULL, unsigned int* count : NULL, char** names : NULL)
*/
int utc_SDL_Vulkan_GetInstanceExtensions_n(void)
/**
* @testcase utc_SDL_Vulkan_GetInstanceExtension_n2
* @since_tizen 3.0
- * @description testcase for check invalid input
+ * @description testcase for check invalid input
* (SDL_Window* window : valid, unsigned int* count : NULL, char** names : NULL)
*/
int utc_SDL_Vulkan_GetInstanceExtensions_n2(void)
/**
* @testcase utc_SDL_Vulkan_GetInstanceExtension_n3
* @since_tizen 3.0
- * @description testcase for check invalid input
+ * @description testcase for check invalid input
* (SDL_Window* window : valid, unsigned int* count : NULL, char** names : valid)
*/
int utc_SDL_Vulkan_GetInstanceExtensions_n3(void)