From: Jihun Park Date: Thu, 29 Oct 2015 02:22:26 +0000 (+0900) Subject: [TCT][Patch 1 : update source code to make sync with binary] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eda66cae7eb54cff044d7c7ca8505c65f7f9b713;p=test%2Ftct%2Fnative%2Fapi.git [TCT][Patch 1 : update source code to make sync with binary] Change-Id: I21e4fce3b46ed1a1ba6cc492f413281490cc87c2 Signed-off-by: Jihun Park --- diff --git a/src/common/tct_common.h b/src/common/tct_common.h index be099ad48..ca62a4914 100755 --- a/src/common/tct_common.h +++ b/src/common/tct_common.h @@ -30,11 +30,7 @@ #define CONFIG_LINE_LEN_MAX 2048 #define CONFIG_VALUE_LEN_MAX 1024 -#define UTC_LOG "/tmp/utclog_core" -#define TC_RESULT "/tmp/tcresult" - FILE *g_fpLog; -FILE *g_fpLogDump; #define FPRINTF(...) {\ g_fpLog = fopen(ERR_LOG, "a");\ @@ -43,38 +39,10 @@ FILE *g_fpLogDump; } #define DUMP_UTC_ERRLOG() {\ - g_fpLogDump = freopen(ERR_LOG, "w", stderr);\ + freopen(ERR_UTC_LOG, "w", stderr);\ fflush(stderr);\ } -#define CLOSE_UTC_ERRLOG() {\ - if(g_fpLogDump) \ - { fclose(g_fpLogDump); g_fpLogDump = NULL; }\ -} - -#define PRINT_UTC_LOG(...) {\ - g_fpLog = fopen(UTC_LOG, "a");\ - fprintf(g_fpLog, __VA_ARGS__);\ - fclose(g_fpLog);\ -} - - -#define PRINT_TC_RESULT(...) {\ - g_fpLog = fopen(TC_RESULT, "w");\ - fprintf(g_fpLog, __VA_ARGS__);\ - fclose(g_fpLog);\ -} - - -#define FREE_MEMORY_TC(buffer) {\ - if ( buffer != NULL )\ -{\ - free(buffer);\ - buffer = NULL;\ -}\ -} - - #define IS_FEATURE_SUPPORTED(feature_name, featureFlag, ModuleName)\ {\ diff --git a/src/ctc/audio-io/CMakeLists.txt b/src/ctc/audio-io/CMakeLists.txt index e92492c54..cdd0ff672 100755 --- a/src/ctc/audio-io/CMakeLists.txt +++ b/src/ctc/audio-io/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 bundle capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/ctc/audio-io/tct-audio-io-native.c b/src/ctc/audio-io/tct-audio-io-native.c index 130425b52..9ae83cc90 100755 --- a/src/ctc/audio-io/tct-audio-io-native.c +++ b/src/ctc/audio-io/tct-audio-io-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/camera/CMakeLists.txt b/src/ctc/camera/CMakeLists.txt index f173a0e91..7d5d0befc 100755 --- a/src/ctc/camera/CMakeLists.txt +++ b/src/ctc/camera/CMakeLists.txt @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED ${CAPI_LIB} capi-appfw-application capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/ctc/camera/tct-camera-native.c b/src/ctc/camera/tct-camera-native.c index 3e9ac4129..a77f8f43a 100755 --- a/src/ctc/camera/tct-camera-native.c +++ b/src/ctc/camera/tct-camera-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/connection/CMakeLists.txt b/src/ctc/connection/CMakeLists.txt index bb2a9cb55..9dcf5884f 100755 --- a/src/ctc/connection/CMakeLists.txt +++ b/src/ctc/connection/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/ctc/connection/tct-connection-native.c b/src/ctc/connection/tct-connection-native.c index 931a0e77f..c78458804 100755 --- a/src/ctc/connection/tct-connection-native.c +++ b/src/ctc/connection/tct-connection-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/device/CMakeLists.txt b/src/ctc/device/CMakeLists.txt index aa01a8189..c206c8f40 100755 --- a/src/ctc/device/CMakeLists.txt +++ b/src/ctc/device/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/ctc/device/tct-device-native.c b/src/ctc/device/tct-device-native.c index 98bbadcda..6d2d99813 100755 --- a/src/ctc/device/tct-device-native.c +++ b/src/ctc/device/tct-device-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/filesystem-permission/CMakeLists.txt b/src/ctc/filesystem-permission/CMakeLists.txt index 2a16d1c68..11bed7f66 100755 --- a/src/ctc/filesystem-permission/CMakeLists.txt +++ b/src/ctc/filesystem-permission/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/ctc/filesystem-permission/tct-filesystem-permission-native.c b/src/ctc/filesystem-permission/tct-filesystem-permission-native.c index 3e4be879f..0b1dec92a 100755 --- a/src/ctc/filesystem-permission/tct-filesystem-permission-native.c +++ b/src/ctc/filesystem-permission/tct-filesystem-permission-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/image-util/CMakeLists.txt b/src/ctc/image-util/CMakeLists.txt index 407d7bdb5..c601c3025 100755 --- a/src/ctc/image-util/CMakeLists.txt +++ b/src/ctc/image-util/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/ctc/image-util/tct-image-util-native.c b/src/ctc/image-util/tct-image-util-native.c index c94eedb30..5395db829 100755 --- a/src/ctc/image-util/tct-image-util-native.c +++ b/src/ctc/image-util/tct-image-util-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/libstorage/CMakeLists.txt b/src/ctc/libstorage/CMakeLists.txt index 12bcdc40b..37ba52ad9 100755 --- a/src/ctc/libstorage/CMakeLists.txt +++ b/src/ctc/libstorage/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/ctc/libstorage/tct-libstorage-native.c b/src/ctc/libstorage/tct-libstorage-native.c index f8de2535d..1b8db5a0f 100755 --- a/src/ctc/libstorage/tct-libstorage-native.c +++ b/src/ctc/libstorage/tct-libstorage-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/location-manager/CMakeLists.txt b/src/ctc/location-manager/CMakeLists.txt index 695198dfe..de575600e 100755 --- a/src/ctc/location-manager/CMakeLists.txt +++ b/src/ctc/location-manager/CMakeLists.txt @@ -3,7 +3,7 @@ SET(PKG_NAME "location-manager") SET(EXEC_NAME "tct-${PKG_NAME}-ctc") SET(RPM_NAME "native-${PKG_NAME}-ctc") -SET(CAPI_LIB "capi-location-manager capi-appfw-application bundle glib-2.0 gthread-2.0 dlog elementary capi-system-info") +SET(CAPI_LIB "capi-location-manager capi-appfw-application bundle glib-2.0 gthread-2.0 dlog capi-system-info") SET(TC_SOURCES CTs-location-manager-common.c CTs-location-manager.c @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 gthread-2.0 - dlog elementary + dlog capi-system-info ) diff --git a/src/ctc/location-manager/tct-location-manager-native.c b/src/ctc/location-manager/tct-location-manager-native.c index 7c85792ce..48005c190 100755 --- a/src/ctc/location-manager/tct-location-manager-native.c +++ b/src/ctc/location-manager/tct-location-manager-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/mediacodec/CMakeLists.txt b/src/ctc/mediacodec/CMakeLists.txt index c467d95bb..5ffae22b5 100755 --- a/src/ctc/mediacodec/CMakeLists.txt +++ b/src/ctc/mediacodec/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application bundle capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/ctc/mediacodec/tct-mediacodec-native.c b/src/ctc/mediacodec/tct-mediacodec-native.c index ab475f2b9..cff777444 100755 --- a/src/ctc/mediacodec/tct-mediacodec-native.c +++ b/src/ctc/mediacodec/tct-mediacodec-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/opengl/CMakeLists.txt b/src/ctc/opengl/CMakeLists.txt index 72ac80538..3e2c3624d 100755 --- a/src/ctc/opengl/CMakeLists.txt +++ b/src/ctc/opengl/CMakeLists.txt @@ -3,7 +3,7 @@ SET(PKG_NAME "opengl") SET(EXEC_NAME "tct-${PKG_NAME}-ctc") SET(RPM_NAME "native-${PKG_NAME}-ctc") -SET(CAPI_LIB "elementary capi-appfw-application bundle utilX capi-system-info dlog elementary glib-2.0 evas edje ecore-x ecore ecore-input capi-content-media-content capi-appfw-app-manager evas capi-media-player x11 icu-i18n") +SET(CAPI_LIB "elementary capi-appfw-application bundle utilX capi-system-info dlog glib-2.0 evas edje ecore-x ecore ecore-input capi-content-media-content capi-appfw-app-manager evas capi-media-player x11 icu-i18n") SET(TC_SOURCES CTs-opengl-common.c CTs-opengl.c @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle utilX capi-system-info - dlog elementary + dlog glib-2.0 evas edje diff --git a/src/ctc/opengl/tct-opengl-native.c b/src/ctc/opengl/tct-opengl-native.c index a97a2b70f..7948ccdb0 100755 --- a/src/ctc/opengl/tct-opengl-native.c +++ b/src/ctc/opengl/tct-opengl-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/platform-permission/CMakeLists.txt b/src/ctc/platform-permission/CMakeLists.txt index d3f0dfb34..9fa64eee5 100755 --- a/src/ctc/platform-permission/CMakeLists.txt +++ b/src/ctc/platform-permission/CMakeLists.txt @@ -3,7 +3,7 @@ SET(PKG_NAME "platform-permission") SET(EXEC_NAME "tct-${PKG_NAME}-ctc") SET(RPM_NAME "native-${PKG_NAME}-ctc") -SET(CAPI_LIB "capi-media-camera sqlite3 shortcut dlog elementary db-util glib-2.0 ecore ecore-evas ecore-x deviced pkgmgr-info security-server libsmack appcore-common appcore-efl capi-base-common alarm-service capi-network-bluetooth capi-system-info capi-system-runtime-info capi-location-manager capi-network-connection capi-network-wifi capi-messaging-email capi-web-url-download capi-system-device tapi capi-telephony capi-appfw-package-manager capi-media-recorder capi-messaging-messages msg-service push capi-system-system-settings capi-media-sound-manager contacts-service2 calendar-service2 notification capi-appfw-app-manager capi-content-media-content key-manager capi-media-player capi-system-sensor capi-media-wav-player accounts-svc capi-appfw-application capi-appfw-alarm capi-appfw-app-control capi-data-control capi-media-audio-io capi-message-port capi-network-wifi-direct capi-network-nfc bundle badge storage") +SET(CAPI_LIB "capi-media-camera sqlite3 shortcut dlog db-util glib-2.0 ecore ecore-evas ecore-x deviced pkgmgr-info security-server libsmack appcore-common appcore-efl capi-base-common alarm-service capi-network-bluetooth capi-system-info capi-system-runtime-info capi-location-manager capi-network-connection capi-network-wifi capi-messaging-email capi-web-url-download capi-system-device tapi capi-telephony capi-appfw-package-manager capi-media-recorder capi-messaging-messages msg-service push capi-system-system-settings capi-media-sound-manager contacts-service2 calendar-service2 notification capi-appfw-app-manager capi-content-media-content key-manager capi-media-player capi-system-sensor capi-media-wav-player accounts-svc capi-appfw-application capi-appfw-alarm capi-appfw-app-control capi-data-control capi-media-audio-io capi-message-port capi-network-wifi-direct capi-network-nfc bundle badge storage") SET(TC_SOURCES CTs-platform-permission-common.c CTs-platform-permission.c @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED ${CAPI_LIB} sqlite3 shortcut - dlog elementary + dlog db-util glib-2.0 ecore diff --git a/src/ctc/platform-permission/tct-platform-permission-native.c b/src/ctc/platform-permission/tct-platform-permission-native.c index 7b9875e5d..8973668e6 100755 --- a/src/ctc/platform-permission/tct-platform-permission-native.c +++ b/src/ctc/platform-permission/tct-platform-permission-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/player/CMakeLists.txt b/src/ctc/player/CMakeLists.txt index 532a1fed2..026c09334 100755 --- a/src/ctc/player/CMakeLists.txt +++ b/src/ctc/player/CMakeLists.txt @@ -3,7 +3,7 @@ SET(PKG_NAME "player") SET(EXEC_NAME "tct-${PKG_NAME}-ctc") SET(RPM_NAME "native-${PKG_NAME}-ctc") -SET(CAPI_LIB "capi-media-player bundle glib-2.0 dlog elementary gthread-2.0 capi-system-runtime-info capi-appfw-application capi-appfw-app-manager capi-system-info") +SET(CAPI_LIB "capi-media-player bundle glib-2.0 dlog gthread-2.0 capi-system-runtime-info capi-appfw-application capi-appfw-app-manager capi-system-info") SET(TC_SOURCES CTs-player-common.c CTs-player.c @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED ${CAPI_LIB} bundle glib-2.0 - dlog elementary + dlog gthread-2.0 capi-system-runtime-info capi-appfw-application @@ -30,7 +30,7 @@ TARGET_LINK_LIBRARIES(${EXEC_NAME} ${${CAPI_LIB}_LIBRARIES} bundle glib-2.0 - dlog elementary + dlog gthread-2.0 capi-system-runtime-info capi-appfw-application diff --git a/src/ctc/player/tct-player-native.c b/src/ctc/player/tct-player-native.c index dad9972c5..fc21fa861 100755 --- a/src/ctc/player/tct-player-native.c +++ b/src/ctc/player/tct-player-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/runtime-info/CMakeLists.txt b/src/ctc/runtime-info/CMakeLists.txt index 0466170bf..07a56b975 100755 --- a/src/ctc/runtime-info/CMakeLists.txt +++ b/src/ctc/runtime-info/CMakeLists.txt @@ -3,7 +3,7 @@ SET(PKG_NAME "runtime-info") SET(EXEC_NAME "tct-${PKG_NAME}-ctc") SET(RPM_NAME "native-${PKG_NAME}-ctc") -SET(CAPI_LIB "capi-system-runtime-info capi-appfw-application bundle glib-2.0 dlog elementary capi-system-info") +SET(CAPI_LIB "capi-system-runtime-info capi-appfw-application bundle glib-2.0 dlog capi-system-info") SET(TC_SOURCES CTs-runtime-info-common.c CTs-runtime-info.c @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application bundle glib-2.0 - dlog elementary + dlog capi-system-info ) diff --git a/src/ctc/runtime-info/tct-runtime-info-native.c b/src/ctc/runtime-info/tct-runtime-info-native.c index a20afca8d..03565dbe6 100755 --- a/src/ctc/runtime-info/tct-runtime-info-native.c +++ b/src/ctc/runtime-info/tct-runtime-info-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/sensor/CMakeLists.txt b/src/ctc/sensor/CMakeLists.txt index 2a6ad18be..d960fad7f 100755 --- a/src/ctc/sensor/CMakeLists.txt +++ b/src/ctc/sensor/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/ctc/sensor/tct-sensor-native.c b/src/ctc/sensor/tct-sensor-native.c index acba13af7..bbf9bc14e 100755 --- a/src/ctc/sensor/tct-sensor-native.c +++ b/src/ctc/sensor/tct-sensor-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/sound-manager/CMakeLists.txt b/src/ctc/sound-manager/CMakeLists.txt index 19e300a97..4c745b6eb 100755 --- a/src/ctc/sound-manager/CMakeLists.txt +++ b/src/ctc/sound-manager/CMakeLists.txt @@ -17,7 +17,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info capi-media-tone-player capi-media-player - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/ctc/sound-manager/tct-sound-manager-native.c b/src/ctc/sound-manager/tct-sound-manager-native.c index 3d5882858..a15f98ed1 100755 --- a/src/ctc/sound-manager/tct-sound-manager-native.c +++ b/src/ctc/sound-manager/tct-sound-manager-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/system-info/CMakeLists.txt b/src/ctc/system-info/CMakeLists.txt index e715fd08d..753958867 100755 --- a/src/ctc/system-info/CMakeLists.txt +++ b/src/ctc/system-info/CMakeLists.txt @@ -3,7 +3,7 @@ SET(PKG_NAME "system-info") SET(EXEC_NAME "tct-${PKG_NAME}-ctc") SET(RPM_NAME "native-${PKG_NAME}-ctc") -SET(CAPI_LIB "capi-system-info capi-appfw-application bundle glib-2.0 dlog elementary capi-system-info") +SET(CAPI_LIB "capi-system-info capi-appfw-application bundle glib-2.0 dlog capi-system-info") SET(TC_SOURCES CTs-system-info-common.c CTs-system-info.c @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application bundle glib-2.0 - dlog elementary + dlog capi-system-info ) diff --git a/src/ctc/system-info/tct-system-info-native.c b/src/ctc/system-info/tct-system-info-native.c index 15b06bff8..157a4326a 100755 --- a/src/ctc/system-info/tct-system-info-native.c +++ b/src/ctc/system-info/tct-system-info-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/telephony/CMakeLists.txt b/src/ctc/telephony/CMakeLists.txt index ea4f1dec6..3bb6bd833 100755 --- a/src/ctc/telephony/CMakeLists.txt +++ b/src/ctc/telephony/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 capi-messaging-messages capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/ctc/telephony/tct-telephony-native.c b/src/ctc/telephony/tct-telephony-native.c index bae567598..844dfb4be 100755 --- a/src/ctc/telephony/tct-telephony-native.c +++ b/src/ctc/telephony/tct-telephony-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/video-util/CMakeLists.txt b/src/ctc/video-util/CMakeLists.txt index f3a198cae..aea0a9b31 100755 --- a/src/ctc/video-util/CMakeLists.txt +++ b/src/ctc/video-util/CMakeLists.txt @@ -17,7 +17,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-media-player storage capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/ctc/video-util/tct-video-util-native.c b/src/ctc/video-util/tct-video-util-native.c index b8bbfaff7..8dd157584 100755 --- a/src/ctc/video-util/tct-video-util-native.c +++ b/src/ctc/video-util/tct-video-util-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/ctc/wifi-direct/CMakeLists.txt b/src/ctc/wifi-direct/CMakeLists.txt index f226f408f..41584740c 100755 --- a/src/ctc/wifi-direct/CMakeLists.txt +++ b/src/ctc/wifi-direct/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 gobject-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/ctc/wifi-direct/tct-wifi-direct-native.c b/src/ctc/wifi-direct/tct-wifi-direct-native.c index 2ded6bb02..0091c7362 100755 --- a/src/ctc/wifi-direct/tct-wifi-direct-native.c +++ b/src/ctc/wifi-direct/tct-wifi-direct-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/accounts-svc/CMakeLists.txt b/src/itc/accounts-svc/CMakeLists.txt index 1d8a0dfea..54a37cab6 100755 --- a/src/itc/accounts-svc/CMakeLists.txt +++ b/src/itc/accounts-svc/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/accounts-svc/ITs-accounts-svc.c b/src/itc/accounts-svc/ITs-accounts-svc.c index c88320054..2b902a05b 100755 --- a/src/itc/accounts-svc/ITs-accounts-svc.c +++ b/src/itc/accounts-svc/ITs-accounts-svc.c @@ -604,7 +604,6 @@ int ITc_account_type_query_provider_feature_by_app_id_p(void) nRet = account_type_query_app_id_exist(g_pstrAppId); PRINT_RESULT_CLEANUP(ACCOUNT_ERROR_NONE, nRet, "account_type_query_app_id_exist", AccManagerGetErrorMSG(nRet), AcountTypeDestroyHelper(accountTypeHandle);); - g_nProviderCount = 0; nRet = account_type_query_provider_feature_by_app_id(ServiceProviderFeatureCB, g_pstrAppId, (void *)pProviderFeature); PRINT_RESULT_CLEANUP(ACCOUNT_ERROR_NONE, nRet, "account_type_query_provider_feature_by_app_id", AccManagerGetErrorMSG(nRet), AcountTypeDestroyHelper(accountTypeHandle);); RUN_POLLING_LOOP; @@ -1964,7 +1963,6 @@ int ITc_account_type_get_provider_feature_all_p(void) PRINT_RESULT_CLEANUP(ACCOUNT_ERROR_NONE, nRet, "account_type_query_by_app_id", AccManagerGetErrorMSG(nRet),AcountTypeDestroyHelper(accountTypeHandle)); g_bAccountTypeCB = false; - g_nProviderCount = 0; nRet = account_type_get_provider_feature_all(accountTypeHandle, ServiceProviderFeatureCB, NULL); PRINT_RESULT_CLEANUP(ACCOUNT_ERROR_NONE, nRet, "account_type_get_provider_feature_all", AccManagerGetErrorMSG(nRet),AcountTypeDestroyHelper(accountTypeHandle)); RUN_POLLING_LOOP; diff --git a/src/itc/accounts-svc/tct-accounts-svc-native.c b/src/itc/accounts-svc/tct-accounts-svc-native.c index 905c6390e..7931fd218 100755 --- a/src/itc/accounts-svc/tct-accounts-svc-native.c +++ b/src/itc/accounts-svc/tct-accounts-svc-native.c @@ -27,97 +27,100 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/app-manager/CMakeLists.txt b/src/itc/app-manager/CMakeLists.txt index 1c1930935..6ca23f8f0 100755 --- a/src/itc/app-manager/CMakeLists.txt +++ b/src/itc/app-manager/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application bundle capi-base-common - dlog elementary + dlog gthread-2.0 glib-2.0 gobject-2.0 diff --git a/src/itc/app-manager/tct-app-manager-native.c b/src/itc/app-manager/tct-app-manager-native.c index 5321b6f35..da313cc7c 100755 --- a/src/itc/app-manager/tct-app-manager-native.c +++ b/src/itc/app-manager/tct-app-manager-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/appcore-agent/CMakeLists.txt b/src/itc/appcore-agent/CMakeLists.txt index e079a509c..e24e89f0d 100755 --- a/src/itc/appcore-agent/CMakeLists.txt +++ b/src/itc/appcore-agent/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle capi-system-info ecore - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/appcore-agent/tct-appcore-agent-native.c b/src/itc/appcore-agent/tct-appcore-agent-native.c index 15b33910e..15b3b9a67 100755 --- a/src/itc/appcore-agent/tct-appcore-agent-native.c +++ b/src/itc/appcore-agent/tct-appcore-agent-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/appcore-widget/CMakeLists.txt b/src/itc/appcore-widget/CMakeLists.txt index 89169c79b..d400c0784 100755 --- a/src/itc/appcore-widget/CMakeLists.txt +++ b/src/itc/appcore-widget/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle capi-appfw-application capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/appcore-widget/tct-appcore-widget-native.c b/src/itc/appcore-widget/tct-appcore-widget-native.c index c8d4d1c16..bd934e091 100755 --- a/src/itc/appcore-widget/tct-appcore-widget-native.c +++ b/src/itc/appcore-widget/tct-appcore-widget-native.c @@ -26,38 +26,71 @@ #include "tct_common.h" #include #include -#include +#include "ITs-appcore-widget-common.h" -#include -#include -#include -#include +static char *func_name = NULL; +int result; -#include +int run_testcases(void) +{ + int result = -1; + int i; + + for (i = 0; tc_array[i].name; i++) + { + if (func_name && !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); + tc_array[i].startup(); + } + + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); + result = tc_array[i].function(); + + if (tc_array[i].cleanup) + { + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); + tc_array[i].cleanup(); + } + + FILE *fres = fopen("/tmp/tcresult","w"); + if(NULL == fres) + { + return result; + } + fprintf(fres, "%d", result); + fclose(fres); -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; + return result; + } + } -static bool app_create(void *data) + printf("Unknown testcase name: \"%s\"\n", func_name); + + return 2; +} + +static widget_class_h widget_app_create(void *user_data) { - return true; + sleep(1); + run_testcases(); + return NULL; } -char* pszGetTCName = NULL; static int check_func_name(int argc, char **argv) { gsize byte_size; const gchar *encoded_byte; guchar *byte = NULL; - const size_t sz_byte_len = sizeof(size_t); - const size_t sz_type = sizeof(int); - const size_t sz_keysize = sizeof(size_t); - const size_t sz_size = sizeof(size_t); + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); - if (argc > 2) { + if (argc > 2) + { encoded_byte = argv[3]; byte = g_base64_decode(encoded_byte, &byte_size); byte += sz_byte_len; @@ -70,108 +103,48 @@ static int check_func_name(int argc, char **argv) void *val = (void *)byte; byte += size; - pszGetTCName = strdup((char *)val); - if (pszGetTCName) { - if (!strcmp(pszGetTCName, "ITc_appcore_widget_widget_app_main_exit_p")) - return 1; - } - - } - - return 0; -} - -static gboolean run_testcases(gpointer user_data) { - - int i=0, result=0, nRet=0; - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); - for ( i = 0; tc_array[i].name; i++ ) - { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + func_name = strdup((char *)val); + if (!strcmp(func_name, "ITc_appcore_widget_widget_app_main_exit_p")) { - if ( tc_array[i].startup ) - { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); - tc_array[i].startup(); - } - - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); - result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); - - if ( tc_array[i].cleanup ) - { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); - tc_array[i].cleanup(); - } - - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return FALSE; + return 1; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - - return FALSE; - - -} - - -static void app_control(app_control_h app_control, void *data) -{ - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) - { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; - } - -run_testcases(NULL); - - - return; + return 0; } -static void app_terminate(void *data) +static int check_support(int eCompare, int eRetVal, char* api, char* error) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + bool g_bAppcoreWidgetFeatureSupported = false; + system_info_get_platform_bool(APPCORE_WIDGET_FEATURE, &g_bAppcoreWidgetFeatureSupported); + CHECK_SUPPORT(eCompare, eRetVal, api, error); + return 0; } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - - if (check_func_name(argc, argv)) { - run_testcases(NULL); - } else { + widget_app_lifecycle_callback_s event_callback = {0,}; - ui_app_lifecycle_callback_s event_callback = {0,}; - event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + if (check_func_name(argc, argv)) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + sleep(1); + run_testcases(); } + else + { + event_callback.create = widget_app_create; + int nRet = widget_app_main(argc, argv, &event_callback, NULL); + result = check_support(WIDGET_ERROR_NOT_SUPPORTED, nRet, "widget_app_main", AppcoreWidgetGetError(nRet)); } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; + if (func_name) + { + free(func_name); + } + + FILE *fres = fopen("/tmp/tcresult","w"); + fprintf(fres, "%d", result); + fclose(fres); + + return 0; } diff --git a/src/itc/application/CMakeLists.txt b/src/itc/application/CMakeLists.txt index ed31df657..91db6622f 100755 --- a/src/itc/application/CMakeLists.txt +++ b/src/itc/application/CMakeLists.txt @@ -7,13 +7,6 @@ SET(CAPI_LIB "capi-appfw-application") SET(TC_SOURCES ITs-application-common.c ITs-application.c - ITs-application-alarm.c - ITs-application-app-common.c - ITs-application-app-control.c - ITs-application-event.c - ITs-application-internationalization.c - ITs-application-preference.c - ITs-application-resource-manager.c ) PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED @@ -24,7 +17,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 gobject-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/application/ITs-application-alarm.c b/src/itc/application/ITs-application-alarm.c deleted file mode 100755 index f7b79561f..000000000 --- a/src/itc/application/ITs-application-alarm.c +++ /dev/null @@ -1,827 +0,0 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "ITs-application-common.h" - -/** @addtogroup itc-application -* @ingroup itc -* @{ -*/ -//& set: Application - -int g_AlarmRegisteredReceived = 0; -int g_AlarmIDValueReceived = -1; - -bool g_bCallBackHit_alarm = false; -bool g_bUserDataMismatch_alarm = false; - -void *g_pUserData_alarm = "user_data_1"; - - -/** -* @function ITs_application_alarm_startup -* @description Called before each test -* @parameter NA -* @return NA -*/ -void ITs_application_alarm_startup(void) -{ - g_bCallBackHit_alarm = false; - g_bUserDataMismatch_alarm = false; - - struct stat stBuff; - if ( stat(ERR_LOG, &stBuff) == 0 ) - { - remove(ERR_LOG); - } - -#if DEBUG - FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_Application_alarm_p\\n", __LINE__, API_NAMESPACE); -#endif - return; -} - -/** -* @function ITs_application_alarm_cleanup -* @description Called after each test -* @parameter NA -* @return NA -*/ -void ITs_application_alarm_cleanup(void) -{ -#if DEBUG - FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_Application_alarm_p\\n", __LINE__, API_NAMESPACE); -#endif - return; -} - -/** -* @function application_alarm_registered_alarm_cb -* @description callback function for registered alarm -* @parameter nAlarmID : alarm ID, user_data : user data sent to callback -* @return true -*/ -bool application_alarm_registered_alarm_cb(int nAlarmID, void *user_data) -{ - g_bCallBackHit_alarm = true; - if(strcmp((char *)user_data,(char *)g_pUserData_alarm) != 0) - { - g_bUserDataMismatch_alarm = true; - } - - FPRINTF("[Line : %d][%s]application_alarm_registered_alarm_cb invoked;alarm id = %d\\n", __LINE__, API_NAMESPACE, nAlarmID); - - g_AlarmIDValueReceived = nAlarmID; - ++g_AlarmRegisteredReceived; - return true; -} - -//& type: auto -//& purpose: Set Alarm after Delay. -/** -* @testcase ITc_application_alarm_schedule_once_after_delay_p -* @since_tizen 2.3 -* @author SRID(satyajit.a) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Set Alarm after delay and checks the Alarm ID. -* @scenario Create AppControl\n -* Set Alarm after Delay\n -* Check Alarm ID\n -* Destroy AppControl -* @apicovered app_control_create, app_control_destroy, alarm_schedule_once_after_delay, alarm_cancel, app_control_set_operation, app_control_set_app_id -* @passcase When alarm_schedule_once_after_delay is success full and return proper Alarm ID. -* @failcase If target API fails or return value is not proper. -* @precondition None -* @postcondition None -*/ -int ITc_application_alarm_schedule_once_after_delay_p(void) -{ - START_TEST; - - app_control_h hAppControl; - char* pszPackage = SET_PACKAGE_LAUNCH; - - int nRet = app_control_create(&hAppControl); - PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_create", AppControlGetError(nRet)); - - nRet = app_control_set_operation(hAppControl, APP_CONTROL_OPERATION_DEFAULT); - PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_set_operation", AppControlGetError(nRet), app_control_destroy(hAppControl)); - - nRet = app_control_set_app_id(hAppControl, pszPackage); - PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_set_app_id", AppControlGetError(nRet), app_control_destroy(hAppControl)); - - int nAlarmID = -1; - int nDelay = 60;//sample 1 min - - //Target API - nRet = alarm_schedule_once_after_delay(hAppControl, nDelay, &nAlarmID); - PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_schedule_once_after_delay", AlarmGetError(nRet), app_control_destroy(hAppControl)); - - if ( nAlarmID < 0 ) - { - FPRINTF("[Line : %d][%s] alarm_schedule_once_after_delay on invalid alarm id = %d\\n", __LINE__, API_NAMESPACE, nAlarmID); - app_control_destroy(hAppControl); - return 1; - } - - nRet = alarm_cancel(nAlarmID); - PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_cancel", AlarmGetError(nRet), app_control_destroy(hAppControl)); - - nRet = app_control_destroy(hAppControl); - PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_destroy", AppControlGetError(nRet)); - - return 0; -} - -//& type: auto -//& purpose: Set Alarm at Date. -/** -* @testcase ITc_application_alarm_schedule_once_at_date_p -* @since_tizen 2.3 -* @author SRID(satyajit.a) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Set Alarm at date and checks the Alarm ID. -* @scenario Create AppControl\n -* Set Alarm at date\n -* Check Alarm ID\n -* Destroy AppControl -* @apicovered app_control_create, app_control_destroy, alarm_schedule_once_at_date, alarm_cancel, app_control_set_operation, app_control_set_app_id -* @passcase When alarm_schedule_once_at_date is successful and return proper Alarm ID. -* @failcase If target API fails or return value is not proper. -* @precondition None -* @postcondition None -*/ -int ITc_application_alarm_schedule_once_at_date_p(void) -{ - START_TEST; - - app_control_h hAppControl; - char* pszPackage = SET_PACKAGE_LAUNCH; - - int nRet = app_control_create(&hAppControl); - PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_create", AppControlGetError(nRet)); - - nRet = app_control_set_operation(hAppControl, APP_CONTROL_OPERATION_DEFAULT); - PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_set_operation", AppControlGetError(nRet), app_control_destroy(hAppControl)); - - nRet = app_control_set_app_id(hAppControl, pszPackage); - PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_set_app_id", AppControlGetError(nRet), app_control_destroy(hAppControl)); - - struct tm stDate; - alarm_get_current_time(&stDate); - stDate.tm_sec += 60;//set after 1 min - int nAlarmID = -1; - - //Target API - nRet = alarm_schedule_once_at_date(hAppControl, &stDate, &nAlarmID); - PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_schedule_once_at_date", AlarmGetError(nRet), app_control_destroy(hAppControl)); - - if ( nAlarmID < 0 ) - { - FPRINTF("[Line : %d][%s] alarm_schedule_once_at_date returned invalid alarm id = %d\\n", __LINE__, API_NAMESPACE, nAlarmID); - app_control_destroy(hAppControl); - return 1; - } - - FPRINTF("[Line : %d][%s] alarm_schedule_once_at_date returned alarm ID = %d\\n", __LINE__, API_NAMESPACE, nAlarmID); - nRet = alarm_cancel(nAlarmID); - PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_cancel", AlarmGetError(nRet), app_control_destroy(hAppControl)); - - nRet = app_control_destroy(hAppControl); - PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_destroy", AppControlGetError(nRet)); - - return 0; -} - -//& type: auto -//& purpose: Set Alarm at Date with recurrence week set option. -/** -* @testcase ITc_application_alarm_schedule_with_recurrence_week_flag_p -* @since_tizen 2.3 -* @author SRID(satyajit.a) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Set Alarm at date and with recurrence week flag set option. -* @scenario Create AppControl\n -* Set Alarm at date with recurrence week flag set option\n -* Check Alarm ID\n -* Destroy AppControl -* @apicovered app_control_create, app_control_destroy, alarm_schedule_with_recurrence_week_flag, alarm_cancel, app_control_set_operation, app_control_set_app_id -* @passcase When alarm_schedule_with_recurrence_week_flag is successful and return proper Alarm ID. -* @failcase If target API fails or return value is not proper. -* @precondition None -* @postcondition None -*/ -int ITc_application_alarm_schedule_with_recurrence_week_flag_p(void) -{ - START_TEST; - - app_control_h hAppControl; - char* pszPackage = SET_PACKAGE_LAUNCH; - - int nRet = app_control_create(&hAppControl); - PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_create", AlarmGetError(nRet)); - - nRet = app_control_set_operation(hAppControl, APP_CONTROL_OPERATION_DEFAULT); - PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_set_operation", AppControlGetError(nRet), app_control_destroy(hAppControl)); - - nRet = app_control_set_app_id(hAppControl, pszPackage); - PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_set_app_id", AppControlGetError(nRet), app_control_destroy(hAppControl)); - - struct tm stDate; - alarm_get_current_time(&stDate); - stDate.tm_sec += 60;//set after 1 min - - alarm_week_flag_e flag_type[] = { ALARM_WEEK_FLAG_SUNDAY, - ALARM_WEEK_FLAG_MONDAY, - ALARM_WEEK_FLAG_TUESDAY, - ALARM_WEEK_FLAG_WEDNESDAY, - ALARM_WEEK_FLAG_THURSDAY, - ALARM_WEEK_FLAG_FRIDAY, - ALARM_WEEK_FLAG_SATURDAY}; - - int enum_size = sizeof(flag_type) / sizeof(flag_type[0]); - int enum_counter = 0; - - for ( enum_counter=0;enum_counter= WAIT_CALLBACK ) - { - FPRINTF("[Line : %d][%s] app_control_foreach_app_matched callback\\n", __LINE__, API_NAMESPACE); - app_control_destroy(hAppControl); - return 1; - } - - if(false == g_bCallBackHit_appControl) - { - FPRINTF("[Line : %d][%s] Callback not invoked\\n", __LINE__, API_NAMESPACE); - app_control_destroy(hAppControl); - return 1; - } - - if(g_bUserDataMismatch_appControl) - { - FPRINTF("[Line : %d][%s] User data in callback is not same which is passed through caller function.\\n", __LINE__, API_NAMESPACE); - app_control_destroy(hAppControl); - return 1; - } - - - nRet = app_control_destroy(hAppControl); - PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_destroy", AppControlGetError(nRet)); - - return 0; -} - -//& type: auto -//& purpose: set app_control extra data, set the extra data callback to check the extra data in callback. -/** -* @testcase ITc_application_app_control_for_each_extra_data_p -* @since_tizen 2.3 -* @author SRID(satyajit.a) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Create app_control, set app_control extra data, set the extra data callback to check the extra data in callback. -* @scenario Create AppControl\n -* Set app_control extra data\n -* Set the extra data Callback\n -* Destroy AppControl -* @apicovered app_control_create, app_control_destroy, app_control_add_extra_data, app_control_foreach_extra_data -* @passcase When app_control_foreach_extra_data is successful and callback function invokes properly. -* @failcase If target API fails or callback not invoked. -* @precondition None -* @postcondition None -*/ -int ITc_application_app_control_for_each_extra_data_p(void) -{ - START_TEST; - - app_control_h hAppControl; - int nRet = app_control_create(&hAppControl); - PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_create", AppControlGetError(nRet)); - - char *pszKey = "Sample_Key";//sample key-value pair - char *pszValue = "Sample_Value"; - nRet = app_control_add_extra_data(hAppControl, pszKey, pszValue); - PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_add_extra_data", AppControlGetError(nRet), app_control_destroy(hAppControl)); - - g_bAppControlExtraData = false; - //Target API - nRet = app_control_foreach_extra_data(hAppControl, application_app_control_extra_data_cb, g_pUserData_appControl); - PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_foreach_extra_data", AppControlGetError(nRet), app_control_destroy(hAppControl)); - - int nTimer = 0; - for (;nTimer= WAIT_CALLBACK ) - { - FPRINTF("[Line : %d][%s] app_control_foreach_app_matched callback\\n", __LINE__, API_NAMESPACE); - app_control_destroy(hAppControl); - return 1; - } - - if(false == g_bCallBackHit_appControl) - { - FPRINTF("[Line : %d][%s] Callback not invoked\\n", __LINE__, API_NAMESPACE); - app_control_destroy(hAppControl); - return 1; - } - - if(g_bUserDataMismatch_appControl) - { - FPRINTF("[Line : %d][%s] User data in callback is not same which is passed through caller function.\\n", __LINE__, API_NAMESPACE); - app_control_destroy(hAppControl); - return 1; - } - - nRet = app_control_destroy(hAppControl); - PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_destroy", AppControlGetError(nRet)); - - return 0; -} - -//& type: auto -//& purpose: Set and get the launch mode of the application. -/** -* @testcase ITc_application_app_control_set_get_launch_mode_p -* @since_tizen 2.4 -* @author SRID(satyajit.a) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Set and get the launch mode of the application -* @scenario Create AppControl\n -* set the launch mode\n -* get the launch mode\n -* Destroy AppControl -* @apicovered app_control_create, app_control_destroy, app_control_set_launch_mode, app_control_get_launch_mode -* @passcase When app_control_set_launch_mode, app_control_get_launch_mode are successful and set value should match the get value. -* @failcase If target API fails or value mis-match happens. -* @precondition None -* @postcondition None -*/ -int ITc_application_app_control_set_get_launch_mode_p(void) -{ - START_TEST; - - app_control_h hAppControl; - app_control_launch_mode_e eAppControlLaunch[] = { APP_CONTROL_LAUNCH_MODE_SINGLE, - APP_CONTROL_LAUNCH_MODE_GROUP - }; - int enum_size = sizeof(eAppControlLaunch) / sizeof(eAppControlLaunch[0]); - int enum_counter = 0; - app_control_launch_mode_e eGetMode; - - int nRet = app_control_create(&hAppControl); - PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_create", AppControlGetError(nRet)); - - for ( enum_counter=0;enum_counter= WAIT_CALLBACK ) - { - FPRINTF("[Line : %d][%s] preference_item_cb callback not hit\\n", __LINE__, API_NAMESPACE); - preference_remove(pszKey); - return 1; - } - - if(false == g_bCallBackHit_preference) - { - FPRINTF("[Line : %d][%s] Callback not invoked\\n", __LINE__, API_NAMESPACE); - preference_remove(pszKey); - return 1; - } - - if(g_bUserDataMismatch_preference) - { - FPRINTF("[Line : %d][%s] User data in callback is not same which is passed through caller function.\\n", __LINE__, API_NAMESPACE); - preference_remove(pszKey); - return 1; - } - - preference_remove(pszKey); - - return 0; -} - -/** @} */ -/** @} */ diff --git a/src/itc/application/ITs-application-resource-manager.c b/src/itc/application/ITs-application-resource-manager.c deleted file mode 100755 index 2acfcc14d..000000000 --- a/src/itc/application/ITs-application-resource-manager.c +++ /dev/null @@ -1,166 +0,0 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "ITs-application-common.h" - -/** @addtogroup itc-application -* @ingroup itc -* @{ -*/ -//& set: Application - -bool g_bCallBackHit_resourceManager = false; -bool g_bUserDataMismatch_resourceManager = false; - - -/** -* @function ITs_application_resourceManager_startup -* @description Called before each test -* @parameter NA -* @return NA -*/ -void ITs_application_resourceManager_startup(void) -{ - g_bCallBackHit_resourceManager = false; - g_bUserDataMismatch_resourceManager = false; - - struct stat stBuff; - if ( stat(ERR_LOG, &stBuff) == 0 ) - { - remove(ERR_LOG); - } - -#if DEBUG - FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_Application_p\\n", __LINE__, API_NAMESPACE); -#endif - return; -} - -/** -* @function ITs_application_resourceManager_cleanup -* @description Called after each test -* @parameter NA -* @return NA -*/ -void ITs_application_resourceManager_cleanup(void) -{ -#if DEBUG - FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_Application_p\\n", __LINE__, API_NAMESPACE); -#endif - return; -} - -//& type: auto -//& purpose: Initialize and release the resource manager -/** -* @testcase ITc_application_app_resource_manager_init_release_p -* @since_tizen 2.4 -* @author SRID(satyajit.a) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Creates resource manager and get from db -* @scenario Initialize the resource manager -* Release the resource manager -* @apicovered app_resource_manager_init, app_resource_manager_release -* @passcase When app_resource_manager_init and app_resource_manager_release are successful and set value should match the get value -* @failcase If any of target API fails -* @precondition None -* @postcondition None -*/ -int ITc_application_app_resource_manager_init_release_p(void) -{ - START_TEST; - - //Target API - int nRet = app_resource_manager_init(); - PRINT_RESULT(APP_RESOURCE_ERROR_NONE, nRet, "app_resource_manager_init", AppResourceGetError(nRet)); - - nRet = app_resource_manager_release(); - PRINT_RESULT(APP_RESOURCE_ERROR_NONE, nRet, "app_resource_manager_release", AppResourceGetError(nRet)); - - return 0; -} - -//& type: auto -//& purpose: Convert resource ID to path name -/** -* @testcase ITc_application_app_resource_manager_get_p -* @since_tizen 2.4 -* @author SRID(satyajit.a) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description Convert resource ID to path name -* @scenario create a key -* set the resource id -* @apicovered app_resource_manager_get -* @passcase When app_resource_manager_get are successful and set value should match the get value. -* @failcase If target API fails or value mis-match happens. -* @precondition None -* @postcondition None -*/ -int ITc_application_app_resource_manager_get_p(void) -{ - START_TEST; - - app_resource_e eResourceType[] = { - APP_RESOURCE_TYPE_IMAGE, /**= WAIT_CALLBACK ) + { + FPRINTF("[Line : %d][%s] app_control_foreach_app_matched callback\\n", __LINE__, API_NAMESPACE); + app_control_destroy(hAppControl); + return 1; + } + + if(false == g_bCallBackHit) + { + FPRINTF("[Line : %d][%s] Callback not invoked\\n", __LINE__, API_NAMESPACE); + app_control_destroy(hAppControl); + return 1; + } + + if(g_bUserDataMismatch) + { + FPRINTF("[Line : %d][%s] User data in callback is not same which is passed through caller function.\\n", __LINE__, API_NAMESPACE); + app_control_destroy(hAppControl); + return 1; + } + + + nRet = app_control_destroy(hAppControl); + PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_destroy", AppControlGetError(nRet)); + + return 0; +} + +//& type: auto +//& purpose: set app_control extra data, set the extra data callback to check the extra data in callback. +/** +* @testcase ITc_application_app_control_for_each_extra_data_p +* @since_tizen 2.3 +* @author SRID(satyajit.a) +* @reviewer SRID(gupta.sanjay) +* @type auto +* @description Create app_control, set app_control extra data, set the extra data callback to check the extra data in callback. +* @scenario Create AppControl\n +* Set app_control extra data\n +* Set the extra data Callback\n +* Destroy AppControl +* @apicovered app_control_create, app_control_destroy, app_control_add_extra_data, app_control_foreach_extra_data +* @passcase When app_control_foreach_extra_data is successful and callback function invokes properly. +* @failcase If target API fails or callback not invoked. +* @precondition None +* @postcondition None +*/ +int ITc_application_app_control_for_each_extra_data_p(void) +{ + START_TEST; + + app_control_h hAppControl; + int nRet = app_control_create(&hAppControl); + PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_create", AppControlGetError(nRet)); + + char *pszKey = "Sample_Key";//sample key-value pair + char *pszValue = "Sample_Value"; + nRet = app_control_add_extra_data(hAppControl, pszKey, pszValue); + PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_add_extra_data", AppControlGetError(nRet), app_control_destroy(hAppControl)); + + g_bAppControlExtraData = false; + //Target API + nRet = app_control_foreach_extra_data(hAppControl, application_app_control_extra_data_cb, g_pUserData); + PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_foreach_extra_data", AppControlGetError(nRet), app_control_destroy(hAppControl)); + + int nTimer = 0; + for (;nTimer= WAIT_CALLBACK ) + { + FPRINTF("[Line : %d][%s] app_control_foreach_app_matched callback\\n", __LINE__, API_NAMESPACE); + app_control_destroy(hAppControl); + return 1; + } + + if(false == g_bCallBackHit) + { + FPRINTF("[Line : %d][%s] Callback not invoked\\n", __LINE__, API_NAMESPACE); + app_control_destroy(hAppControl); + return 1; + } + + if(g_bUserDataMismatch) + { + FPRINTF("[Line : %d][%s] User data in callback is not same which is passed through caller function.\\n", __LINE__, API_NAMESPACE); + app_control_destroy(hAppControl); + return 1; + } + + nRet = app_control_destroy(hAppControl); + PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_destroy", AppControlGetError(nRet)); + + return 0; +} + +//& type: auto +//& purpose: Call i18n_get_text to get the localized translation for the specified string. +/** +* @testcase ITc_application_internationalization_i18n_get_text_p +* @since_tizen 2.3 +* @author SRID(satyajit.a) +* @reviewer SRID(gupta.sanjay) +* @type auto +* @description Call i18n_get_text to get the localized translation for the specified string. +* @scenario Call i18n_get_text to get the localized translation for the specified string. +* @apicovered i18n_get_text +* @passcase When i18n_get_text is successful and returns correct value +* @failcase If target API fails or returns incorrect value +* @precondition None +* @postcondition None +*/ +int ITc_application_internationalization_i18n_get_text_p(void) +{ + START_TEST; + + char* pMessage = "Sample Text for Internationalization";//sample message string + + //Target API + char* pTranslatedMsg = i18n_get_text(pMessage); + if ( NULL == pTranslatedMsg ) + { + FPRINTF("[Line : %d][%s]i18n_get_text failed, values returned = NULL\\n", __LINE__, API_NAMESPACE); + return 1; + } + + return 0; +} + +//& type: auto +//& purpose: Set Alarm after Delay. +/** +* @testcase ITc_application_alarm_schedule_once_after_delay_p +* @since_tizen 2.3 +* @author SRID(satyajit.a) +* @reviewer SRID(gupta.sanjay) +* @type auto +* @description Set Alarm after delay and checks the Alarm ID. +* @scenario Create AppControl\n +* Set Alarm after Delay\n +* Check Alarm ID\n +* Destroy AppControl +* @apicovered app_control_create, app_control_destroy, alarm_schedule_once_after_delay, alarm_cancel, app_control_set_operation, app_control_set_app_id +* @passcase When alarm_schedule_once_after_delay is success full and return proper Alarm ID. +* @failcase If target API fails or return value is not proper. +* @precondition None +* @postcondition None +*/ +int ITc_application_alarm_schedule_once_after_delay_p(void) +{ + START_TEST; + + app_control_h hAppControl; + char* pszPackage = SET_PACKAGE_LAUNCH; + + int nRet = app_control_create(&hAppControl); + PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_create", AppControlGetError(nRet)); + + nRet = app_control_set_operation(hAppControl, APP_CONTROL_OPERATION_DEFAULT); + PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_set_operation", AppControlGetError(nRet), app_control_destroy(hAppControl)); + + nRet = app_control_set_app_id(hAppControl, pszPackage); + PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_set_app_id", AppControlGetError(nRet), app_control_destroy(hAppControl)); + + int nAlarmID = -1; + int nDelay = 60;//sample 1 min + + //Target API + nRet = alarm_schedule_once_after_delay(hAppControl, nDelay, &nAlarmID); + PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_schedule_once_after_delay", AlarmGetError(nRet), app_control_destroy(hAppControl)); + + if ( nAlarmID < 0 ) + { + FPRINTF("[Line : %d][%s] alarm_schedule_once_after_delay on invalid alarm id = %d\\n", __LINE__, API_NAMESPACE, nAlarmID); + app_control_destroy(hAppControl); + return 1; + } + + nRet = alarm_cancel(nAlarmID); + PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_cancel", AlarmGetError(nRet), app_control_destroy(hAppControl)); + + nRet = app_control_destroy(hAppControl); + PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_destroy", AppControlGetError(nRet)); + + return 0; +} + +//& type: auto +//& purpose: Set Alarm at Date. +/** +* @testcase ITc_application_alarm_schedule_once_at_date_p +* @since_tizen 2.3 +* @author SRID(satyajit.a) +* @reviewer SRID(gupta.sanjay) +* @type auto +* @description Set Alarm at date and checks the Alarm ID. +* @scenario Create AppControl\n +* Set Alarm at date\n +* Check Alarm ID\n +* Destroy AppControl +* @apicovered app_control_create, app_control_destroy, alarm_schedule_once_at_date, alarm_cancel, app_control_set_operation, app_control_set_app_id +* @passcase When alarm_schedule_once_at_date is successful and return proper Alarm ID. +* @failcase If target API fails or return value is not proper. +* @precondition None +* @postcondition None +*/ +int ITc_application_alarm_schedule_once_at_date_p(void) +{ + START_TEST; + + app_control_h hAppControl; + char* pszPackage = SET_PACKAGE_LAUNCH; + + int nRet = app_control_create(&hAppControl); + PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_create", AppControlGetError(nRet)); + + nRet = app_control_set_operation(hAppControl, APP_CONTROL_OPERATION_DEFAULT); + PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_set_operation", AppControlGetError(nRet), app_control_destroy(hAppControl)); + + nRet = app_control_set_app_id(hAppControl, pszPackage); + PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_set_app_id", AppControlGetError(nRet), app_control_destroy(hAppControl)); + + struct tm stDate; + alarm_get_current_time(&stDate); + stDate.tm_sec += 60;//set after 1 min + int nAlarmID = -1; + + //Target API + nRet = alarm_schedule_once_at_date(hAppControl, &stDate, &nAlarmID); + PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_schedule_once_at_date", AlarmGetError(nRet), app_control_destroy(hAppControl)); + + if ( nAlarmID < 0 ) + { + FPRINTF("[Line : %d][%s] alarm_schedule_once_at_date returned invalid alarm id = %d\\n", __LINE__, API_NAMESPACE, nAlarmID); + app_control_destroy(hAppControl); + return 1; + } + + FPRINTF("[Line : %d][%s] alarm_schedule_once_at_date returned alarm ID = %d\\n", __LINE__, API_NAMESPACE, nAlarmID); + nRet = alarm_cancel(nAlarmID); + PRINT_RESULT_CLEANUP(ALARM_ERROR_NONE, nRet, "alarm_cancel", AlarmGetError(nRet), app_control_destroy(hAppControl)); + + nRet = app_control_destroy(hAppControl); + PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_destroy", AppControlGetError(nRet)); + + return 0; +} + +//& type: auto +//& purpose: Set Alarm at Date with recurrence week set option. +/** +* @testcase ITc_application_alarm_schedule_with_recurrence_week_flag_p +* @since_tizen 2.3 +* @author SRID(satyajit.a) +* @reviewer SRID(gupta.sanjay) +* @type auto +* @description Set Alarm at date and with recurrence week flag set option. +* @scenario Create AppControl\n +* Set Alarm at date with recurrence week flag set option\n +* Check Alarm ID\n +* Destroy AppControl +* @apicovered app_control_create, app_control_destroy, alarm_schedule_with_recurrence_week_flag, alarm_cancel, app_control_set_operation, app_control_set_app_id +* @passcase When alarm_schedule_with_recurrence_week_flag is successful and return proper Alarm ID. +* @failcase If target API fails or return value is not proper. +* @precondition None +* @postcondition None +*/ +int ITc_application_alarm_schedule_with_recurrence_week_flag_p(void) +{ + START_TEST; + + app_control_h hAppControl; + char* pszPackage = SET_PACKAGE_LAUNCH; + + int nRet = app_control_create(&hAppControl); + PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_create", AlarmGetError(nRet)); + + nRet = app_control_set_operation(hAppControl, APP_CONTROL_OPERATION_DEFAULT); + PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_set_operation", AppControlGetError(nRet), app_control_destroy(hAppControl)); + + nRet = app_control_set_app_id(hAppControl, pszPackage); + PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_set_app_id", AppControlGetError(nRet), app_control_destroy(hAppControl)); + + struct tm stDate; + alarm_get_current_time(&stDate); + stDate.tm_sec += 60;//set after 1 min + + alarm_week_flag_e flag_type[] = { ALARM_WEEK_FLAG_SUNDAY, + ALARM_WEEK_FLAG_MONDAY, + ALARM_WEEK_FLAG_TUESDAY, + ALARM_WEEK_FLAG_WEDNESDAY, + ALARM_WEEK_FLAG_THURSDAY, + ALARM_WEEK_FLAG_FRIDAY, + ALARM_WEEK_FLAG_SATURDAY}; + + int enum_size = sizeof(flag_type) / sizeof(flag_type[0]); + int enum_counter = 0; + + for ( enum_counter=0;enum_counter= WAIT_CALLBACK ) + { + FPRINTF("[Line : %d][%s] preference_item_cb callback not hit\\n", __LINE__, API_NAMESPACE); + preference_remove(pszKey); + return 1; + } + + if(false == g_bCallBackHit) + { + FPRINTF("[Line : %d][%s] Callback not invoked\\n", __LINE__, API_NAMESPACE); + preference_remove(pszKey); + return 1; + } + + if(g_bUserDataMismatch) + { + FPRINTF("[Line : %d][%s] User data in callback is not same which is passed through caller function.\\n", __LINE__, API_NAMESPACE); + preference_remove(pszKey); + return 1; + } + + preference_remove(pszKey); + + return 0; +} + +#if 0 +//& type: auto +//& purpose: Set and Get AppControl Category. +/** +* @testcase ITc_application_app_control_get_event_data_p +* @since_tizen 2.4 +* @author SRID(satyajit.a) +* @reviewer SRID(gupta.sanjay) +* @type auto +* @description Set AppControl Category, Get AppControl Category and then checks the set value should match the get value +* @scenario Create AppControl\n +* Set AppControl Category\n +* Get AppControl Category\n +* Destroy AppControl +* @apicovered app_control_create, app_control_destroy, app_control_get_event_data +* @passcase When app_control_get_event_data are successful and set value should match the get value. +* @failcase If target API fails or value mis-match happens. +* @precondition None +* @postcondition None +*/ +//int ITc_application_app_control_get_event_data_p(void) +{ + START_TEST; + + app_control_h hAppControl; + int nRet = app_control_create(&hAppControl); + PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_create", AppControlGetError(nRet)); + + bundle* pEventData = bundle_create(); + CHECK_HANDLE(pEventData,"bundle_create"); + //Target API + nRet = app_control_get_event_data(hAppControl, &pEventData); + PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_get_event_data", AppControlGetError(nRet), app_control_destroy(hAppControl)); + bundle_free(pEventData); + + nRet = app_control_destroy(hAppControl); + PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_destroy", AppControlGetError(nRet)); + return 0; +} + +//& type: auto +//& purpose: Set and Get AppControl Category. +/** +* @testcase ITc_application_app_control_send_user_event_p +* @since_tizen 2.4 +* @author SRID(satyajit.a) +* @reviewer SRID(gupta.sanjay) +* @type auto +* @description Set AppControl Category, Get AppControl Category and then checks the set value should match the get value +* @scenario Create AppControl\n +* Set AppControl Category\n +* Get AppControl Category\n +* Destroy AppControl +* @apicovered app_control_create, app_control_destroy, app_control_send_user_event +* @passcase When app_control_send_user_event are successful and set value should match the get value. +* @failcase If target API fails or value mis-match happens. +* @precondition None +* @postcondition None +*/ +//int ITc_application_app_control_send_user_event_p(void) +{ + START_TEST; + + bundle* pEventData = bundle_create(); + CHECK_HANDLE(pEventData, "bundle_create"); + + int nRet = bundle_add_str(pEventData, "user_data_key1", "user_data_1"); + PRINT_RESULT_CLEANUP(BUNDLE_ERROR_NONE, nRet, "bundle_add_str", BundleGetError(nRet), bundle_free(pEventData)); + + app_control_h hAppControl; + nRet = app_control_create(&hAppControl); + PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_create", AppControlGetError(nRet), bundle_free(pEventData)); + + const char *szEventName = "eventsystem.tizen.system.event.usb.connected"; + + //Target API + nRet = app_control_send_user_event((const char *)szEventName, pEventData); + PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_send_user_event", AppControlGetError(nRet), app_control_destroy(hAppControl);bundle_free(pEventData)); + + nRet = app_control_destroy(hAppControl); + PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_destroy", AppControlGetError(nRet), bundle_free(pEventData)); + + nRet = bundle_free(pEventData); + PRINT_RESULT(BUNDLE_ERROR_NONE, nRet, "bundle_free", BundleGetError(nRet)); + + return 0; +} + +//& type: auto +//& purpose: Set and Get AppControl Category. +/** +* @testcase ITc_application_app_control_send_user_event_trusted_p +* @since_tizen 2.4 +* @author SRID(satyajit.a) +* @reviewer SRID(gupta.sanjay) +* @type auto +* @description Set AppControl Category, Get AppControl Category and then checks the set value should match the get value +* @scenario Create AppControl\n +* Set AppControl Category\n +* Get AppControl Category\n +* Destroy AppControl +* @apicovered app_control_create, app_control_destroy, app_control_send_user_event_trusted +* @passcase When app_control_send_user_event_trusted are successful and set value should match the get value. +* @failcase If target API fails or value mis-match happens. +* @precondition None +* @postcondition None +*/ +//int ITc_application_app_control_send_user_event_trusted_p(void) +{ + START_TEST; + + bundle* pEventData = bundle_create(); + CHECK_HANDLE(pEventData, "bundle_create"); + + int nRet = bundle_add_str(pEventData, "user_data_key1", "user_data_1"); + PRINT_RESULT_CLEANUP(BUNDLE_ERROR_NONE, nRet, "bundle_add_str", BundleGetError(nRet), bundle_free(pEventData)); + + app_control_h hAppControl; + nRet = app_control_create(&hAppControl); + PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_create", AppControlGetError(nRet)); + + const char *szEventName = "eventsystem.tizen.system.event.usb.connected"; + + //Target API + nRet = app_control_send_user_event_trusted((const char *)szEventName, pEventData); + PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_send_user_event_trusted", AppControlGetError(nRet), app_control_destroy(hAppControl);bundle_free(pEventData)); + + nRet = app_control_destroy(hAppControl); + PRINT_RESULT_CLEANUP(APP_CONTROL_ERROR_NONE, nRet, "app_control_destroy", AppControlGetError(nRet), bundle_free(pEventData)); + + nRet = bundle_free(pEventData); + PRINT_RESULT(BUNDLE_ERROR_NONE, nRet, "bundle_free", BundleGetError(nRet)); + + return 0; +} +#endif + +//& type: auto +//& purpose: Set and get the launch mode of the application. +/** +* @testcase ITc_application_app_control_set_get_launch_mode_p +* @since_tizen 2.4 +* @author SRID(satyajit.a) +* @reviewer SRID(gupta.sanjay) +* @type auto +* @description Set and get the launch mode of the application +* @scenario Create AppControl\n +* set the launch mode\n +* get the launch mode\n +* Destroy AppControl +* @apicovered app_control_create, app_control_destroy, app_control_set_launch_mode, app_control_get_launch_mode +* @passcase When app_control_set_launch_mode, app_control_get_launch_mode are successful and set value should match the get value. +* @failcase If target API fails or value mis-match happens. +* @precondition None +* @postcondition None +*/ +int ITc_application_app_control_set_get_launch_mode_p(void) +{ + START_TEST; + + app_control_h hAppControl; + app_control_launch_mode_e eAppControlLaunch[] = { APP_CONTROL_LAUNCH_MODE_SINGLE, + APP_CONTROL_LAUNCH_MODE_GROUP + }; + int enum_size = sizeof(eAppControlLaunch) / sizeof(eAppControlLaunch[0]); + int enum_counter = 0; + app_control_launch_mode_e eGetMode; + + int nRet = app_control_create(&hAppControl); + PRINT_RESULT(APP_CONTROL_ERROR_NONE, nRet, "app_control_create", AppControlGetError(nRet)); + + for ( enum_counter=0;enum_counter #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; + return nRet; } diff --git a/src/itc/application/tct-application-native.h b/src/itc/application/tct-application-native.h index 9dc6e398a..bba068413 100755 --- a/src/itc/application/tct-application-native.h +++ b/src/itc/application/tct-application-native.h @@ -19,34 +19,10 @@ #include "testcase.h" #include "tct_common.h" -extern void ITs_application_alarm_startup(void); -extern void ITs_application_alarm_cleanup(void); -extern void ITs_application_app_common_startup(void); -extern void ITs_application_app_common_cleanup(void); -extern void ITs_application_app_control_startup(void); -extern void ITs_application_app_control_cleanup(void); -extern void ITs_application_event_startup(void); -extern void ITs_application_event_cleanup(void); -extern void ITs_application_internationalization_startup(void); -extern void ITs_application_internationalization_cleanup(void); -extern void ITs_application_preference_startup(void); -extern void ITs_application_preference_cleanup(void); -extern void ITs_application_resourceManager_startup(void); -extern void ITs_application_resourceManager_cleanup(void); extern void ITs_application_startup(void); extern void ITs_application_cleanup(void); -extern int ITc_application_alarm_schedule_once_after_delay_p(void); -extern int ITc_application_alarm_schedule_once_at_date_p(void); -extern int ITc_application_alarm_schedule_with_recurrence_week_flag_p(void); -extern int ITc_application_alarm_foreach_registered_alarm_p(void); -extern int ITc_application_alarm_get_app_control_p(void); -extern int ITc_application_alarm_get_scheduled_period_p(void); -extern int ITc_application_alarm_get_scheduled_date_p(void); -extern int ITc_application_alarm_get_scheduled_recurrence_week_flag_p(void); -extern int ITc_application_alarm_cancel_p(void); -extern int ITc_application_alarm_cancel_all_p(void); -extern int ITc_application_alarm_get_current_time_p(void); +extern int ITc_application_ui_app_add_remove_event_handler_p(void); extern int ITc_application_app_get_cache_path_p(void); extern int ITc_application_app_get_data_path_p(void); extern int ITc_application_app_get_external_data_path_p(void); @@ -59,6 +35,7 @@ extern int ITc_application_app_get_shared_trusted_path_p(void); extern int ITc_application_app_get_id_p(void); extern int ITc_application_app_get_version_p(void); extern int ITc_application_app_get_name_p(void); +extern int ITc_application_app_get_device_orientation_p(void); extern int ITc_application_app_control_create_destroy_p(void); extern int ITc_application_app_control_set_get_operation_p(void); extern int ITc_application_app_control_set_get_app_id_p(void); @@ -73,11 +50,18 @@ extern int ITc_application_app_control_remove_extra_data_p(void); extern int ITc_application_app_control_send_launch_terminate_request_p(void); extern int ITc_application_app_control_for_each_app_matched_p(void); extern int ITc_application_app_control_for_each_extra_data_p(void); -extern int ITc_application_app_control_set_get_launch_mode_p(void); -extern int ITc_app_event_add_remove_event_handler_p(void); -extern int ITc_application_event_publish_app_event_p(void); -extern int ITc_application_event_publish_trusted_app_event_p(void); extern int ITc_application_internationalization_i18n_get_text_p(void); +extern int ITc_application_alarm_schedule_once_after_delay_p(void); +extern int ITc_application_alarm_schedule_once_at_date_p(void); +extern int ITc_application_alarm_schedule_with_recurrence_week_flag_p(void); +extern int ITc_application_alarm_foreach_registered_alarm_p(void); +extern int ITc_application_alarm_get_app_control_p(void); +extern int ITc_application_alarm_get_scheduled_period_p(void); +extern int ITc_application_alarm_get_scheduled_date_p(void); +extern int ITc_application_alarm_get_scheduled_recurrence_week_flag_p(void); +extern int ITc_application_alarm_cancel_p(void); +extern int ITc_application_alarm_cancel_all_p(void); +extern int ITc_application_alarm_get_current_time_p(void); extern int ITc_application_preference_set_get_boolean_p(void); extern int ITc_application_preference_set_get_double_p(void); extern int ITc_application_preference_set_get_string_p(void); @@ -85,67 +69,69 @@ extern int ITc_application_preference_is_existing_remove_p(void); extern int ITc_application_preference_remove_all_p(void); extern int ITc_application_preference_set_unset_changed_callback_p(void); extern int ITc_application_preference_for_each_item_callback_p(void); +extern int ITc_application_app_control_set_get_launch_mode_p(void); extern int ITc_application_app_resource_manager_init_release_p(void); extern int ITc_application_app_resource_manager_get_p(void); -extern int ITc_application_ui_app_add_remove_event_handler_p(void); -extern int ITc_application_app_get_device_orientation_p(void); +extern int ITc_app_event_add_remove_event_handler_p(void); +extern int ITc_application_event_publish_app_event_p(void); +extern int ITc_application_event_publish_trusted_app_event_p(void); extern int ITc_application_app_get_tep_resource_path_p(void); extern int ITc_app_control_enable_app_started_result_event_p(void); testcase tc_array[] = { - {"ITc_application_alarm_schedule_once_after_delay_p", ITc_application_alarm_schedule_once_after_delay_p, ITs_application_alarm_startup, ITs_application_alarm_cleanup}, - {"ITc_application_alarm_schedule_once_at_date_p", ITc_application_alarm_schedule_once_at_date_p, ITs_application_alarm_startup, ITs_application_alarm_cleanup}, - {"ITc_application_alarm_schedule_with_recurrence_week_flag_p", ITc_application_alarm_schedule_with_recurrence_week_flag_p, ITs_application_alarm_startup, ITs_application_alarm_cleanup}, - {"ITc_application_alarm_foreach_registered_alarm_p", ITc_application_alarm_foreach_registered_alarm_p, ITs_application_alarm_startup, ITs_application_alarm_cleanup}, - {"ITc_application_alarm_get_app_control_p", ITc_application_alarm_get_app_control_p, ITs_application_alarm_startup, ITs_application_alarm_cleanup}, - {"ITc_application_alarm_get_scheduled_period_p", ITc_application_alarm_get_scheduled_period_p, ITs_application_alarm_startup, ITs_application_alarm_cleanup}, - {"ITc_application_alarm_get_scheduled_date_p", ITc_application_alarm_get_scheduled_date_p, ITs_application_alarm_startup, ITs_application_alarm_cleanup}, - {"ITc_application_alarm_get_scheduled_recurrence_week_flag_p", ITc_application_alarm_get_scheduled_recurrence_week_flag_p, ITs_application_alarm_startup, ITs_application_alarm_cleanup}, - {"ITc_application_alarm_cancel_p", ITc_application_alarm_cancel_p, ITs_application_alarm_startup, ITs_application_alarm_cleanup}, - {"ITc_application_alarm_cancel_all_p", ITc_application_alarm_cancel_all_p, ITs_application_alarm_startup, ITs_application_alarm_cleanup}, - {"ITc_application_alarm_get_current_time_p", ITc_application_alarm_get_current_time_p, ITs_application_alarm_startup, ITs_application_alarm_cleanup}, - {"ITc_application_app_get_cache_path_p", ITc_application_app_get_cache_path_p, ITs_application_app_common_startup, ITs_application_app_common_cleanup}, - {"ITc_application_app_get_data_path_p", ITc_application_app_get_data_path_p, ITs_application_app_common_startup, ITs_application_app_common_cleanup}, - {"ITc_application_app_get_external_data_path_p", ITc_application_app_get_external_data_path_p, ITs_application_app_common_startup, ITs_application_app_common_cleanup}, - {"ITc_application_app_get_external_cache_path_p", ITc_application_app_get_external_cache_path_p, ITs_application_app_common_startup, ITs_application_app_common_cleanup}, - {"ITc_application_app_get_external_shared_data_path_p", ITc_application_app_get_external_shared_data_path_p, ITs_application_app_common_startup, ITs_application_app_common_cleanup}, - {"ITc_application_app_get_resource_path_p", ITc_application_app_get_resource_path_p, ITs_application_app_common_startup, ITs_application_app_common_cleanup}, - {"ITc_application_app_get_shared_data_path_p", ITc_application_app_get_shared_data_path_p, ITs_application_app_common_startup, ITs_application_app_common_cleanup}, - {"ITc_application_app_get_shared_resource_path_p", ITc_application_app_get_shared_resource_path_p, ITs_application_app_common_startup, ITs_application_app_common_cleanup}, - {"ITc_application_app_get_shared_trusted_path_p", ITc_application_app_get_shared_trusted_path_p, ITs_application_app_common_startup, ITs_application_app_common_cleanup}, - {"ITc_application_app_get_id_p", ITc_application_app_get_id_p, ITs_application_app_common_startup, ITs_application_app_common_cleanup}, - {"ITc_application_app_get_version_p", ITc_application_app_get_version_p, ITs_application_app_common_startup, ITs_application_app_common_cleanup}, - {"ITc_application_app_get_name_p", ITc_application_app_get_name_p, ITs_application_app_common_startup, ITs_application_app_common_cleanup}, - {"ITc_application_app_control_create_destroy_p", ITc_application_app_control_create_destroy_p, ITs_application_app_control_startup, ITs_application_app_control_cleanup}, - {"ITc_application_app_control_set_get_operation_p", ITc_application_app_control_set_get_operation_p, ITs_application_app_control_startup, ITs_application_app_control_cleanup}, - {"ITc_application_app_control_set_get_app_id_p", ITc_application_app_control_set_get_app_id_p, ITs_application_app_control_startup, ITs_application_app_control_cleanup}, - {"ITc_application_app_control_set_get_uri_p", ITc_application_app_control_set_get_uri_p, ITs_application_app_control_startup, ITs_application_app_control_cleanup}, - {"ITc_application_app_control_set_get_mime_p", ITc_application_app_control_set_get_mime_p, ITs_application_app_control_startup, ITs_application_app_control_cleanup}, - {"ITc_application_app_control_set_get_category_p", ITc_application_app_control_set_get_category_p, ITs_application_app_control_startup, ITs_application_app_control_cleanup}, - {"ITc_application_app_control_add_get_extra_data_p", ITc_application_app_control_add_get_extra_data_p, ITs_application_app_control_startup, ITs_application_app_control_cleanup}, - {"ITc_application_app_control_add_get_extra_data_array_p", ITc_application_app_control_add_get_extra_data_array_p, ITs_application_app_control_startup, ITs_application_app_control_cleanup}, - {"ITc_application_app_control_is_extra_data_array_p", ITc_application_app_control_is_extra_data_array_p, ITs_application_app_control_startup, ITs_application_app_control_cleanup}, - {"ITc_application_app_control_clone_p", ITc_application_app_control_clone_p, ITs_application_app_control_startup, ITs_application_app_control_cleanup}, - {"ITc_application_app_control_remove_extra_data_p", ITc_application_app_control_remove_extra_data_p, ITs_application_app_control_startup, ITs_application_app_control_cleanup}, - {"ITc_application_app_control_send_launch_terminate_request_p", ITc_application_app_control_send_launch_terminate_request_p, ITs_application_app_control_startup, ITs_application_app_control_cleanup}, - {"ITc_application_app_control_for_each_app_matched_p", ITc_application_app_control_for_each_app_matched_p, ITs_application_app_control_startup, ITs_application_app_control_cleanup}, - {"ITc_application_app_control_for_each_extra_data_p", ITc_application_app_control_for_each_extra_data_p, ITs_application_app_control_startup, ITs_application_app_control_cleanup}, - {"ITc_application_app_control_set_get_launch_mode_p", ITc_application_app_control_set_get_launch_mode_p, ITs_application_app_control_startup, ITs_application_app_control_cleanup}, - {"ITc_app_event_add_remove_event_handler_p", ITc_app_event_add_remove_event_handler_p, ITs_application_event_startup, ITs_application_event_cleanup}, - {"ITc_application_event_publish_app_event_p", ITc_application_event_publish_app_event_p, ITs_application_event_startup, ITs_application_event_cleanup}, - {"ITc_application_event_publish_trusted_app_event_p", ITc_application_event_publish_trusted_app_event_p, ITs_application_event_startup, ITs_application_event_cleanup}, - {"ITc_application_internationalization_i18n_get_text_p", ITc_application_internationalization_i18n_get_text_p, ITs_application_internationalization_startup, ITs_application_internationalization_cleanup}, - {"ITc_application_preference_set_get_boolean_p", ITc_application_preference_set_get_boolean_p, ITs_application_preference_startup, ITs_application_preference_cleanup}, - {"ITc_application_preference_set_get_double_p", ITc_application_preference_set_get_double_p, ITs_application_preference_startup, ITs_application_preference_cleanup}, - {"ITc_application_preference_set_get_string_p", ITc_application_preference_set_get_string_p, ITs_application_preference_startup, ITs_application_preference_cleanup}, - {"ITc_application_preference_is_existing_remove_p", ITc_application_preference_is_existing_remove_p, ITs_application_preference_startup, ITs_application_preference_cleanup}, - {"ITc_application_preference_remove_all_p", ITc_application_preference_remove_all_p, ITs_application_preference_startup, ITs_application_preference_cleanup}, - {"ITc_application_preference_set_unset_changed_callback_p", ITc_application_preference_set_unset_changed_callback_p, ITs_application_preference_startup, ITs_application_preference_cleanup}, - {"ITc_application_preference_for_each_item_callback_p", ITc_application_preference_for_each_item_callback_p, ITs_application_preference_startup, ITs_application_preference_cleanup}, - {"ITc_application_app_resource_manager_init_release_p", ITc_application_app_resource_manager_init_release_p, ITs_application_resourceManager_startup, ITs_application_resourceManager_cleanup}, - {"ITc_application_app_resource_manager_get_p", ITc_application_app_resource_manager_get_p, ITs_application_resourceManager_startup, ITs_application_resourceManager_cleanup}, {"ITc_application_ui_app_add_remove_event_handler_p", ITc_application_ui_app_add_remove_event_handler_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_get_cache_path_p", ITc_application_app_get_cache_path_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_get_data_path_p", ITc_application_app_get_data_path_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_get_external_data_path_p", ITc_application_app_get_external_data_path_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_get_external_cache_path_p", ITc_application_app_get_external_cache_path_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_get_external_shared_data_path_p", ITc_application_app_get_external_shared_data_path_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_get_resource_path_p", ITc_application_app_get_resource_path_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_get_shared_data_path_p", ITc_application_app_get_shared_data_path_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_get_shared_resource_path_p", ITc_application_app_get_shared_resource_path_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_get_shared_trusted_path_p", ITc_application_app_get_shared_trusted_path_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_get_id_p", ITc_application_app_get_id_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_get_version_p", ITc_application_app_get_version_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_get_name_p", ITc_application_app_get_name_p, ITs_application_startup, ITs_application_cleanup}, {"ITc_application_app_get_device_orientation_p", ITc_application_app_get_device_orientation_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_control_create_destroy_p", ITc_application_app_control_create_destroy_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_control_set_get_operation_p", ITc_application_app_control_set_get_operation_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_control_set_get_app_id_p", ITc_application_app_control_set_get_app_id_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_control_set_get_uri_p", ITc_application_app_control_set_get_uri_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_control_set_get_mime_p", ITc_application_app_control_set_get_mime_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_control_set_get_category_p", ITc_application_app_control_set_get_category_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_control_add_get_extra_data_p", ITc_application_app_control_add_get_extra_data_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_control_add_get_extra_data_array_p", ITc_application_app_control_add_get_extra_data_array_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_control_is_extra_data_array_p", ITc_application_app_control_is_extra_data_array_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_control_clone_p", ITc_application_app_control_clone_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_control_remove_extra_data_p", ITc_application_app_control_remove_extra_data_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_control_send_launch_terminate_request_p", ITc_application_app_control_send_launch_terminate_request_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_control_for_each_app_matched_p", ITc_application_app_control_for_each_app_matched_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_control_for_each_extra_data_p", ITc_application_app_control_for_each_extra_data_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_internationalization_i18n_get_text_p", ITc_application_internationalization_i18n_get_text_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_alarm_schedule_once_after_delay_p", ITc_application_alarm_schedule_once_after_delay_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_alarm_schedule_once_at_date_p", ITc_application_alarm_schedule_once_at_date_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_alarm_schedule_with_recurrence_week_flag_p", ITc_application_alarm_schedule_with_recurrence_week_flag_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_alarm_foreach_registered_alarm_p", ITc_application_alarm_foreach_registered_alarm_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_alarm_get_app_control_p", ITc_application_alarm_get_app_control_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_alarm_get_scheduled_period_p", ITc_application_alarm_get_scheduled_period_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_alarm_get_scheduled_date_p", ITc_application_alarm_get_scheduled_date_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_alarm_get_scheduled_recurrence_week_flag_p", ITc_application_alarm_get_scheduled_recurrence_week_flag_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_alarm_cancel_p", ITc_application_alarm_cancel_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_alarm_cancel_all_p", ITc_application_alarm_cancel_all_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_alarm_get_current_time_p", ITc_application_alarm_get_current_time_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_preference_set_get_boolean_p", ITc_application_preference_set_get_boolean_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_preference_set_get_double_p", ITc_application_preference_set_get_double_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_preference_set_get_string_p", ITc_application_preference_set_get_string_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_preference_is_existing_remove_p", ITc_application_preference_is_existing_remove_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_preference_remove_all_p", ITc_application_preference_remove_all_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_preference_set_unset_changed_callback_p", ITc_application_preference_set_unset_changed_callback_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_preference_for_each_item_callback_p", ITc_application_preference_for_each_item_callback_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_control_set_get_launch_mode_p", ITc_application_app_control_set_get_launch_mode_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_resource_manager_init_release_p", ITc_application_app_resource_manager_init_release_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_app_resource_manager_get_p", ITc_application_app_resource_manager_get_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_app_event_add_remove_event_handler_p", ITc_app_event_add_remove_event_handler_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_event_publish_app_event_p", ITc_application_event_publish_app_event_p, ITs_application_startup, ITs_application_cleanup}, + {"ITc_application_event_publish_trusted_app_event_p", ITc_application_event_publish_trusted_app_event_p, ITs_application_startup, ITs_application_cleanup}, {"ITc_application_app_get_tep_resource_path_p", ITc_application_app_get_tep_resource_path_p, ITs_application_startup, ITs_application_cleanup}, {"ITc_app_control_enable_app_started_result_event_p", ITc_app_control_enable_app_started_result_event_p, ITs_application_startup, ITs_application_cleanup}, {NULL, NULL} diff --git a/src/itc/audio-io/CMakeLists.txt b/src/itc/audio-io/CMakeLists.txt index 26bf82a53..7dad5b3f6 100755 --- a/src/itc/audio-io/CMakeLists.txt +++ b/src/itc/audio-io/CMakeLists.txt @@ -20,7 +20,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle capi-system-info capi-media-sound-manager - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/audio-io/tct-audio-io-native.c b/src/itc/audio-io/tct-audio-io-native.c index 130425b52..9ae83cc90 100755 --- a/src/itc/audio-io/tct-audio-io-native.c +++ b/src/itc/audio-io/tct-audio-io-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/badge/CMakeLists.txt b/src/itc/badge/CMakeLists.txt index 708ceea07..9424c334a 100755 --- a/src/itc/badge/CMakeLists.txt +++ b/src/itc/badge/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/badge/tct-badge-native.c b/src/itc/badge/tct-badge-native.c index c49fc7d05..586812161 100755 --- a/src/itc/badge/tct-badge-native.c +++ b/src/itc/badge/tct-badge-native.c @@ -27,97 +27,97 @@ #include #include -#include -#include -#include -#include - -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +static char* key; +static char* fname; +static int nNum; +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if (nNum > 2) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte=key;//argv[3]; + byte=g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); - for ( i = 0; tc_array[i].name; i++ ) + for (i = 0; tc_array[i].name; i++) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if (!strncmp(func_name, tc_array[i].name, strlen(func_name))) { - if ( tc_array[i].startup ) - { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + if (tc_array[i].startup) tc_array[i].startup(); - } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); - if ( tc_array[i].cleanup ) - { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + if (tc_array[i].cleanup) tc_array[i].cleanup(); - } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult","w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) + +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + ret = ui_app_main(argc, argv, &event_callback, NULL); + if (ret != APP_ERROR_NONE) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FILE *fres = fopen(ERR_LOG,"a"); + if(NULL == fres) + { + return 1; + } + fprintf(fres, "\\nUnable to execute test cases: ui_app_main API call gets failed\n"); + fclose(fres); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); return ret; -} \ No newline at end of file +} diff --git a/src/itc/base-utils/CMakeLists.txt b/src/itc/base-utils/CMakeLists.txt index 5a09074dd..433d699d4 100755 --- a/src/itc/base-utils/CMakeLists.txt +++ b/src/itc/base-utils/CMakeLists.txt @@ -28,7 +28,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( diff --git a/src/itc/base-utils/tct-base-utils-native.c b/src/itc/base-utils/tct-base-utils-native.c index e7ac52580..ebb7914a7 100755 --- a/src/itc/base-utils/tct-base-utils-native.c +++ b/src/itc/base-utils/tct-base-utils-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/bluetooth/CMakeLists.txt b/src/itc/bluetooth/CMakeLists.txt index 1939e47e5..e7db66833 100755 --- a/src/itc/bluetooth/CMakeLists.txt +++ b/src/itc/bluetooth/CMakeLists.txt @@ -3,7 +3,7 @@ SET(PKG_NAME "bluetooth") SET(EXEC_NAME "tct-${PKG_NAME}-native") SET(RPM_NAME "native-${PKG_NAME}-itc") -SET(CAPI_LIB "capi-network-bluetooth glib-2.0 bundle capi-system-info storage dlog elementary") +SET(CAPI_LIB "capi-network-bluetooth glib-2.0 bundle capi-system-info storage dlog") SET(TC_SOURCES ITs-bluetooth-common.c ITs-bluetooth-audio.c @@ -21,7 +21,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle capi-system-info storage - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/bluetooth/tct-bluetooth-native.c b/src/itc/bluetooth/tct-bluetooth-native.c index 018912d7a..50b9a1eb2 100755 --- a/src/itc/bluetooth/tct-bluetooth-native.c +++ b/src/itc/bluetooth/tct-bluetooth-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/bundle/CMakeLists.txt b/src/itc/bundle/CMakeLists.txt index b449ce4db..8dd4807f1 100755 --- a/src/itc/bundle/CMakeLists.txt +++ b/src/itc/bundle/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/bundle/tct-bundle-native.c b/src/itc/bundle/tct-bundle-native.c index fc50f937d..9d0360187 100755 --- a/src/itc/bundle/tct-bundle-native.c +++ b/src/itc/bundle/tct-bundle-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/cairo/CMakeLists.txt b/src/itc/cairo/CMakeLists.txt index 1c3400ab7..c03613b80 100755 --- a/src/itc/cairo/CMakeLists.txt +++ b/src/itc/cairo/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application bundle capi-base-common - dlog elementary + dlog gthread-2.0 glib-2.0 gobject-2.0 diff --git a/src/itc/cairo/tct-cairo-native.c b/src/itc/cairo/tct-cairo-native.c index 2ddc350ad..b40adf108 100755 --- a/src/itc/cairo/tct-cairo-native.c +++ b/src/itc/cairo/tct-cairo-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/calendar-service2/CMakeLists.txt b/src/itc/calendar-service2/CMakeLists.txt index bbd06aff2..6d1d83edd 100755 --- a/src/itc/calendar-service2/CMakeLists.txt +++ b/src/itc/calendar-service2/CMakeLists.txt @@ -22,7 +22,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 bundle capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/calendar-service2/tct-calendar-service2-native.c b/src/itc/calendar-service2/tct-calendar-service2-native.c index 6efc177d5..46e77cbcc 100755 --- a/src/itc/calendar-service2/tct-calendar-service2-native.c +++ b/src/itc/calendar-service2/tct-calendar-service2-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/camera/CMakeLists.txt b/src/itc/camera/CMakeLists.txt index 074f18307..8af7a0c92 100755 --- a/src/itc/camera/CMakeLists.txt +++ b/src/itc/camera/CMakeLists.txt @@ -18,7 +18,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 bundle capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( diff --git a/src/itc/camera/tct-camera-native.c b/src/itc/camera/tct-camera-native.c index 3e9ac4129..a77f8f43a 100755 --- a/src/itc/camera/tct-camera-native.c +++ b/src/itc/camera/tct-camera-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/capi-maps-service/CMakeLists.txt b/src/itc/capi-maps-service/CMakeLists.txt index c1320c64b..f200b4b90 100755 --- a/src/itc/capi-maps-service/CMakeLists.txt +++ b/src/itc/capi-maps-service/CMakeLists.txt @@ -21,7 +21,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/capi-maps-service/tct-capi-maps-service-native.c b/src/itc/capi-maps-service/tct-capi-maps-service-native.c index a83cfab98..f5afac53a 100755 --- a/src/itc/capi-maps-service/tct-capi-maps-service-native.c +++ b/src/itc/capi-maps-service/tct-capi-maps-service-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/capi-media-tool/CMakeLists.txt b/src/itc/capi-media-tool/CMakeLists.txt index d74a050a1..62aa750c9 100755 --- a/src/itc/capi-media-tool/CMakeLists.txt +++ b/src/itc/capi-media-tool/CMakeLists.txt @@ -19,7 +19,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED gobject-2.0 libtbm capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/capi-media-tool/tct-capi-media-tool-native.c b/src/itc/capi-media-tool/tct-capi-media-tool-native.c index 0b912114f..1acff8a5f 100755 --- a/src/itc/capi-media-tool/tct-capi-media-tool-native.c +++ b/src/itc/capi-media-tool/tct-capi-media-tool-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/capi-message-port/CMakeLists.txt b/src/itc/capi-message-port/CMakeLists.txt index c4357c5c5..9f0dee931 100755 --- a/src/itc/capi-message-port/CMakeLists.txt +++ b/src/itc/capi-message-port/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle capi-system-info capi-appfw-app-manager - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/capi-message-port/tct-capi-message-port-native.c b/src/itc/capi-message-port/tct-capi-message-port-native.c index 9f4078a89..03ae59325 100755 --- a/src/itc/capi-message-port/tct-capi-message-port-native.c +++ b/src/itc/capi-message-port/tct-capi-message-port-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/capi-ui-inputmethod-manager/CMakeLists.txt b/src/itc/capi-ui-inputmethod-manager/CMakeLists.txt index c0a41c517..853760b99 100755 --- a/src/itc/capi-ui-inputmethod-manager/CMakeLists.txt +++ b/src/itc/capi-ui-inputmethod-manager/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/capi-ui-inputmethod-manager/tct-capi-ui-inputmethod-manager-native.c b/src/itc/capi-ui-inputmethod-manager/tct-capi-ui-inputmethod-manager-native.c index c821f4003..b8e1f79f3 100755 --- a/src/itc/capi-ui-inputmethod-manager/tct-capi-ui-inputmethod-manager-native.c +++ b/src/itc/capi-ui-inputmethod-manager/tct-capi-ui-inputmethod-manager-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/connection/CMakeLists.txt b/src/itc/connection/CMakeLists.txt index be17fcd99..e9626c289 100755 --- a/src/itc/connection/CMakeLists.txt +++ b/src/itc/connection/CMakeLists.txt @@ -22,7 +22,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-network-wifi bundle capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/connection/tct-connection-native.c b/src/itc/connection/tct-connection-native.c index 931a0e77f..c78458804 100755 --- a/src/itc/connection/tct-connection-native.c +++ b/src/itc/connection/tct-connection-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/contacts-service2/CMakeLists.txt b/src/itc/contacts-service2/CMakeLists.txt index f2369e19d..d0532e4b1 100755 --- a/src/itc/contacts-service2/CMakeLists.txt +++ b/src/itc/contacts-service2/CMakeLists.txt @@ -27,7 +27,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 accounts-svc capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/contacts-service2/tct-contacts-service2-native.c b/src/itc/contacts-service2/tct-contacts-service2-native.c index 6457560dd..381f88634 100755 --- a/src/itc/contacts-service2/tct-contacts-service2-native.c +++ b/src/itc/contacts-service2/tct-contacts-service2-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/context/CMakeLists.txt b/src/itc/context/CMakeLists.txt index ac31c39b9..df22e7a57 100755 --- a/src/itc/context/CMakeLists.txt +++ b/src/itc/context/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application bundle capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/context/tct-context-native.c b/src/itc/context/tct-context-native.c index e0b57e1dc..0405bfb3a 100755 --- a/src/itc/context/tct-context-native.c +++ b/src/itc/context/tct-context-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/data-control/CMakeLists.txt b/src/itc/data-control/CMakeLists.txt index e1754bcb0..4a71399d4 100755 --- a/src/itc/data-control/CMakeLists.txt +++ b/src/itc/data-control/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application bundle data-control - dlog elementary + dlog glib-2.0 capi-base-common aul diff --git a/src/itc/data-control/tct-data-control-native.c b/src/itc/data-control/tct-data-control-native.c index 732454992..19d878fa6 100755 --- a/src/itc/data-control/tct-data-control-native.c +++ b/src/itc/data-control/tct-data-control-native.c @@ -27,75 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -static gboolean run_testcases(gpointer user_data, char **argv) { - - int i=0, result=0; - char* pszGetTCName = NULL; +int run_testcases() +{ + int result = -1; + int i; gsize byte_size; - const gchar *encoded_byte; - guchar *byte = NULL; - const size_t sz_byte_len = sizeof(size_t); - const size_t sz_type = sizeof(int); - const size_t sz_keysize = sizeof(size_t); - const size_t sz_size = sizeof(size_t); + const gchar* encoded_byte; + guchar* byte = NULL; + + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) + { + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } + } - encoded_byte = argv[3]; - byte = g_base64_decode(encoded_byte, &byte_size); - byte += sz_byte_len; - byte += sz_type; - size_t keysize = *((size_t *)byte); - byte += sz_keysize; - byte += keysize; - size_t size = *((size_t *)byte); - byte += sz_size; - void *val = (void *)byte; - byte += size; - pszGetTCName = strdup((char *)val); - for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return FALSE; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); + if (nNum > 2) + free(func_name); + return 2; +} - return FALSE; +static bool app_create(void *data) +{ + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - run_testcases(NULL, argv); - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return 0; + fname = argv[1]; + key = argv[3]; + nNum = argc; + ui_app_lifecycle_callback_s event_callback = {0,}; + event_callback.create = app_create; + + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) + { + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); + } + return nRet; } diff --git a/src/itc/device/CMakeLists.txt b/src/itc/device/CMakeLists.txt index 56b4318f4..09fffe3eb 100755 --- a/src/itc/device/CMakeLists.txt +++ b/src/itc/device/CMakeLists.txt @@ -20,7 +20,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 bundle capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/device/tct-device-native.c b/src/itc/device/tct-device-native.c index 98bbadcda..6d2d99813 100755 --- a/src/itc/device/tct-device-native.c +++ b/src/itc/device/tct-device-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/dlog/CMakeLists.txt b/src/itc/dlog/CMakeLists.txt index 53c26a441..9d1e77f82 100755 --- a/src/itc/dlog/CMakeLists.txt +++ b/src/itc/dlog/CMakeLists.txt @@ -11,7 +11,6 @@ SET(TC_SOURCES PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED ${CAPI_LIB} - elementary capi-appfw-application libsystemd-journal bundle @@ -33,4 +32,4 @@ INSTALL(PROGRAMS ${EXEC_NAME} ) SET(CMAKE_C_FLAGS " -fPIE -Wall") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -pie") +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -pie") \ No newline at end of file diff --git a/src/itc/dlog/tct-dlog-native.c b/src/itc/dlog/tct-dlog-native.c index 1a4cf1105..d714b7451 100755 --- a/src/itc/dlog/tct-dlog-native.c +++ b/src/itc/dlog/tct-dlog-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/efl-ext/CMakeLists.txt b/src/itc/efl-ext/CMakeLists.txt index 52bf44ee1..dffd14356 100755 --- a/src/itc/efl-ext/CMakeLists.txt +++ b/src/itc/efl-ext/CMakeLists.txt @@ -17,7 +17,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info ecore elementary - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/efl-ext/tct-efl-ext-native.c b/src/itc/efl-ext/tct-efl-ext-native.c index 57094e60e..1b6d97130 100755 --- a/src/itc/efl-ext/tct-efl-ext-native.c +++ b/src/itc/efl-ext/tct-efl-ext-native.c @@ -27,97 +27,100 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } + return nRet; +} - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file diff --git a/src/itc/efl-util/CMakeLists.txt b/src/itc/efl-util/CMakeLists.txt index 32c16f209..3fcb704c7 100755 --- a/src/itc/efl-util/CMakeLists.txt +++ b/src/itc/efl-util/CMakeLists.txt @@ -12,7 +12,7 @@ SET(TC_SOURCES PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED ${CAPI_LIB} capi-appfw-application - dlog elementary + dlog x11 utilX elementary diff --git a/src/itc/efl-util/tct-efl-util-native.c b/src/itc/efl-util/tct-efl-util-native.c index 05a4592cd..e8168e8c9 100755 --- a/src/itc/efl-util/tct-efl-util-native.c +++ b/src/itc/efl-util/tct-efl-util-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/email/CMakeLists.txt b/src/itc/email/CMakeLists.txt index 43e995877..40fece72a 100755 --- a/src/itc/email/CMakeLists.txt +++ b/src/itc/email/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/email/tct-email-native.c b/src/itc/email/tct-email-native.c index d41f76727..4a1ce5672 100755 --- a/src/itc/email/tct-email-native.c +++ b/src/itc/email/tct-email-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/eom/CMakeLists.txt b/src/itc/eom/CMakeLists.txt index 95966002a..682eda48e 100755 --- a/src/itc/eom/CMakeLists.txt +++ b/src/itc/eom/CMakeLists.txt @@ -18,7 +18,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info elementary eom - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/eom/tct-eom-native.c b/src/itc/eom/tct-eom-native.c index 615bf2576..abc704fbe 100755 --- a/src/itc/eom/tct-eom-native.c +++ b/src/itc/eom/tct-eom-native.c @@ -27,98 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} - -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; + + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; + return nRet; } - diff --git a/src/itc/geofence-manager/CMakeLists.txt b/src/itc/geofence-manager/CMakeLists.txt index 24e9f5de8..3873c07f1 100755 --- a/src/itc/geofence-manager/CMakeLists.txt +++ b/src/itc/geofence-manager/CMakeLists.txt @@ -13,7 +13,7 @@ SET(TC_SOURCES PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED ${CAPI_LIB} capi-appfw-application - dlog elementary + dlog capi-base-common bundle glib-2.0 diff --git a/src/itc/geofence-manager/tct-geofence-manager-native.c b/src/itc/geofence-manager/tct-geofence-manager-native.c index 340445379..99802e806 100755 --- a/src/itc/geofence-manager/tct-geofence-manager-native.c +++ b/src/itc/geofence-manager/tct-geofence-manager-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; + return nRet; } diff --git a/src/itc/image-util/CMakeLists.txt b/src/itc/image-util/CMakeLists.txt index da5a17b6c..d582089de 100755 --- a/src/itc/image-util/CMakeLists.txt +++ b/src/itc/image-util/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/image-util/tct-image-util-native.c b/src/itc/image-util/tct-image-util-native.c index c94eedb30..f85ace857 100755 --- a/src/itc/image-util/tct-image-util-native.c +++ b/src/itc/image-util/tct-image-util-native.c @@ -27,97 +27,100 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } + } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/key-manager/CMakeLists.txt b/src/itc/key-manager/CMakeLists.txt index aedec803b..600ecab53 100755 --- a/src/itc/key-manager/CMakeLists.txt +++ b/src/itc/key-manager/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/key-manager/tct-key-manager-native.c b/src/itc/key-manager/tct-key-manager-native.c index 9a1a18f87..9e94055b8 100755 --- a/src/itc/key-manager/tct-key-manager-native.c +++ b/src/itc/key-manager/tct-key-manager-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/libfeedback/CMakeLists.txt b/src/itc/libfeedback/CMakeLists.txt index a9da1e6c5..771596795 100755 --- a/src/itc/libfeedback/CMakeLists.txt +++ b/src/itc/libfeedback/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/libfeedback/tct-libfeedback-native.c b/src/itc/libfeedback/tct-libfeedback-native.c index a271261be..1dde9410a 100755 --- a/src/itc/libfeedback/tct-libfeedback-native.c +++ b/src/itc/libfeedback/tct-libfeedback-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/libstorage/CMakeLists.txt b/src/itc/libstorage/CMakeLists.txt index b8c812efc..da359b787 100755 --- a/src/itc/libstorage/CMakeLists.txt +++ b/src/itc/libstorage/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/libstorage/tct-libstorage-native.c b/src/itc/libstorage/tct-libstorage-native.c index f8de2535d..1b8db5a0f 100755 --- a/src/itc/libstorage/tct-libstorage-native.c +++ b/src/itc/libstorage/tct-libstorage-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/location-manager/CMakeLists.txt b/src/itc/location-manager/CMakeLists.txt index 095d8d57b..4326bc7a4 100755 --- a/src/itc/location-manager/CMakeLists.txt +++ b/src/itc/location-manager/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED ${CAPI_LIB} capi-appfw-application bundle - dlog elementary + dlog location capi-base-common vconf diff --git a/src/itc/location-manager/tct-location-manager-native.c b/src/itc/location-manager/tct-location-manager-native.c index 7c85792ce..48005c190 100755 --- a/src/itc/location-manager/tct-location-manager-native.c +++ b/src/itc/location-manager/tct-location-manager-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/media-content/CMakeLists.txt b/src/itc/media-content/CMakeLists.txt index de05d957c..e8c827c52 100755 --- a/src/itc/media-content/CMakeLists.txt +++ b/src/itc/media-content/CMakeLists.txt @@ -27,7 +27,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog libmedia-service media-thumbnail libmedia-utils diff --git a/src/itc/media-content/tct-media-content-native.c b/src/itc/media-content/tct-media-content-native.c index 7c45af793..6284707f3 100755 --- a/src/itc/media-content/tct-media-content-native.c +++ b/src/itc/media-content/tct-media-content-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/media-controller/CMakeLists.txt b/src/itc/media-controller/CMakeLists.txt index 3e0bd6b12..66bb76933 100755 --- a/src/itc/media-controller/CMakeLists.txt +++ b/src/itc/media-controller/CMakeLists.txt @@ -3,7 +3,7 @@ SET(PKG_NAME "media-controller") SET(EXEC_NAME "tct-${PKG_NAME}-native") SET(RPM_NAME "native-${PKG_NAME}-itc") -SET(CAPI_LIB "capi-media-controller capi-appfw-application bundle glib-2.0 capi-system-info capi-base-common dlog elementary gio-2.0 sqlite3 db-util aul security-server ecore") +SET(CAPI_LIB "capi-media-controller capi-appfw-application bundle glib-2.0 capi-system-info capi-base-common dlog gio-2.0 sqlite3 db-util aul security-server ecore") SET(TC_SOURCES ITs-media-controller-common.c ITs-media-controller-server.c @@ -17,7 +17,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 capi-system-info capi-base-common - dlog elementary + dlog gio-2.0 sqlite3 db-util diff --git a/src/itc/media-controller/tct-media-controller-native.c b/src/itc/media-controller/tct-media-controller-native.c index 3ba62c543..377b8e563 100755 --- a/src/itc/media-controller/tct-media-controller-native.c +++ b/src/itc/media-controller/tct-media-controller-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/media-key/CMakeLists.txt b/src/itc/media-key/CMakeLists.txt index ba5ac9d76..8c758adfd 100755 --- a/src/itc/media-key/CMakeLists.txt +++ b/src/itc/media-key/CMakeLists.txt @@ -19,7 +19,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED ecore-x appcore-efl capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( diff --git a/src/itc/media-key/tct-media-key-native.c b/src/itc/media-key/tct-media-key-native.c index 82cd9e1fb..8db5b9203 100755 --- a/src/itc/media-key/tct-media-key-native.c +++ b/src/itc/media-key/tct-media-key-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/media-vision/CMakeLists.txt b/src/itc/media-vision/CMakeLists.txt index 4273e2460..94e049c76 100755 --- a/src/itc/media-vision/CMakeLists.txt +++ b/src/itc/media-vision/CMakeLists.txt @@ -3,7 +3,7 @@ SET(PKG_NAME "media-vision") SET(EXEC_NAME "tct-${PKG_NAME}-native") SET(RPM_NAME "native-${PKG_NAME}-itc") -SET(CAPI_LIB "capi-media-vision capi-appfw-application bundle glib-2.0 capi-system-info capi-media-tool libtbm dlog elementary opencv zbar libavcodec libavformat libswscale") +SET(CAPI_LIB "capi-media-vision capi-appfw-application bundle glib-2.0 capi-system-info capi-media-tool libtbm dlog opencv zbar libavcodec libavformat libswscale") SET(TC_SOURCES ITs-media-vision-common.c ITs-media-vision-source.c @@ -19,7 +19,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info capi-media-tool libtbm - dlog elementary + dlog opencv zbar libavcodec diff --git a/src/itc/media-vision/tct-media-vision-native.c b/src/itc/media-vision/tct-media-vision-native.c index 27ca5c661..b9ade593a 100755 --- a/src/itc/media-vision/tct-media-vision-native.c +++ b/src/itc/media-vision/tct-media-vision-native.c @@ -27,75 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -static gboolean run_testcases(gpointer user_data, char **argv) { - - int i=0, result=0; - char* pszGetTCName = NULL; +int run_testcases() +{ + int result = -1; + int i; gsize byte_size; - const gchar *encoded_byte; - guchar *byte = NULL; - const size_t sz_byte_len = sizeof(size_t); - const size_t sz_type = sizeof(int); - const size_t sz_keysize = sizeof(size_t); - const size_t sz_size = sizeof(size_t); + const gchar* encoded_byte; + guchar* byte = NULL; + + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) + { + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } + } - encoded_byte = argv[3]; - byte = g_base64_decode(encoded_byte, &byte_size); - byte += sz_byte_len; - byte += sz_type; - size_t keysize = *((size_t *)byte); - byte += sz_keysize; - byte += keysize; - size_t size = *((size_t *)byte); - byte += sz_size; - void *val = (void *)byte; - byte += size; - pszGetTCName = strdup((char *)val); - for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY(pszGetTCName); - return FALSE; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - FPRINTF("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY(pszGetTCName); + if (nNum > 2) + free(func_name); + return 2; +} - return FALSE; +static bool app_create(void *data) +{ + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - run_testcases(NULL, argv); - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return 0; + fname = argv[1]; + key = argv[3]; + nNum = argc; + ui_app_lifecycle_callback_s event_callback = {0,}; + event_callback.create = app_create; + + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) + { + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); + } + return nRet; } diff --git a/src/itc/mediacodec/CMakeLists.txt b/src/itc/mediacodec/CMakeLists.txt index ca3182851..48bf7dce0 100755 --- a/src/itc/mediacodec/CMakeLists.txt +++ b/src/itc/mediacodec/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED ecore appcore-efl capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/mediacodec/tct-mediacodec-native.c b/src/itc/mediacodec/tct-mediacodec-native.c index 821ce31c6..cff777444 100755 --- a/src/itc/mediacodec/tct-mediacodec-native.c +++ b/src/itc/mediacodec/tct-mediacodec-native.c @@ -27,75 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -static gboolean run_testcases(gpointer user_data, char **argv) { - - int i=0, result=0; - char* pszGetTCName = NULL; +int run_testcases() +{ + int result = -1; + int i; gsize byte_size; - const gchar *encoded_byte; - guchar *byte = NULL; - const size_t sz_byte_len = sizeof(size_t); - const size_t sz_type = sizeof(int); - const size_t sz_keysize = sizeof(size_t); - const size_t sz_size = sizeof(size_t); + const gchar* encoded_byte; + guchar* byte = NULL; + + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) + { + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } + } - encoded_byte = argv[3]; - byte = g_base64_decode(encoded_byte, &byte_size); - byte += sz_byte_len; - byte += sz_type; - size_t keysize = *((size_t *)byte); - byte += sz_keysize; - byte += keysize; - size_t size = *((size_t *)byte); - byte += sz_size; - void *val = (void *)byte; - byte += size; - pszGetTCName = strdup((char *)val); - for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return FALSE; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); + if (nNum > 2) + free(func_name); + return 2; +} - return FALSE; +static bool app_create(void *data) +{ + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - run_testcases(NULL, argv); - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return 0; + fname = argv[1]; + key = argv[3]; + nNum = argc; + ui_app_lifecycle_callback_s event_callback = {0,}; + event_callback.create = app_create; + + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) + { + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); + } + return nRet; } diff --git a/src/itc/messages/CMakeLists.txt b/src/itc/messages/CMakeLists.txt index b16b83c57..0e22c0d48 100755 --- a/src/itc/messages/CMakeLists.txt +++ b/src/itc/messages/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application bundle capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/messages/tct-messages-native.c b/src/itc/messages/tct-messages-native.c index 6f25b173b..1b5453c86 100755 --- a/src/itc/messages/tct-messages-native.c +++ b/src/itc/messages/tct-messages-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/metadata-editor/CMakeLists.txt b/src/itc/metadata-editor/CMakeLists.txt index c00e180f9..68985e38d 100755 --- a/src/itc/metadata-editor/CMakeLists.txt +++ b/src/itc/metadata-editor/CMakeLists.txt @@ -17,7 +17,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 gobject-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/metadata-editor/tct-metadata-editor-native.c b/src/itc/metadata-editor/tct-metadata-editor-native.c index 2e9eae6da..c1bf32f06 100755 --- a/src/itc/metadata-editor/tct-metadata-editor-native.c +++ b/src/itc/metadata-editor/tct-metadata-editor-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/metadata-extractor/CMakeLists.txt b/src/itc/metadata-extractor/CMakeLists.txt index 05c4c5e63..13f57d00e 100755 --- a/src/itc/metadata-extractor/CMakeLists.txt +++ b/src/itc/metadata-extractor/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application bundle capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/metadata-extractor/tct-metadata-extractor-native.c b/src/itc/metadata-extractor/tct-metadata-extractor-native.c index 50bb60ff9..e72c80cf9 100755 --- a/src/itc/metadata-extractor/tct-metadata-extractor-native.c +++ b/src/itc/metadata-extractor/tct-metadata-extractor-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/mime-type/CMakeLists.txt b/src/itc/mime-type/CMakeLists.txt index 46699f0b2..93d44e70f 100755 --- a/src/itc/mime-type/CMakeLists.txt +++ b/src/itc/mime-type/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/mime-type/tct-mime-type-native.c b/src/itc/mime-type/tct-mime-type-native.c index 71219fbe1..51b876ba8 100755 --- a/src/itc/mime-type/tct-mime-type-native.c +++ b/src/itc/mime-type/tct-mime-type-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/minicontrol/CMakeLists.txt b/src/itc/minicontrol/CMakeLists.txt index 2c7c266e9..51a1e5a6c 100755 --- a/src/itc/minicontrol/CMakeLists.txt +++ b/src/itc/minicontrol/CMakeLists.txt @@ -21,7 +21,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED dbus-glib-1 elementary capi-appfw-application - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/minicontrol/tct-minicontrol-native.c b/src/itc/minicontrol/tct-minicontrol-native.c index bb5a4145d..6c4b701ee 100755 --- a/src/itc/minicontrol/tct-minicontrol-native.c +++ b/src/itc/minicontrol/tct-minicontrol-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/motion/CMakeLists.txt b/src/itc/motion/CMakeLists.txt index 1f428f6aa..16c0e9bd3 100755 --- a/src/itc/motion/CMakeLists.txt +++ b/src/itc/motion/CMakeLists.txt @@ -13,7 +13,7 @@ SET(TC_SOURCES PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED ${CAPI_LIB} capi-appfw-application - dlog elementary + dlog glib-2.0 dbus-glib-1 json-glib-1.0 diff --git a/src/itc/motion/tct-motion-native.c b/src/itc/motion/tct-motion-native.c index b10a5968d..71d07d0b8 100755 --- a/src/itc/motion/tct-motion-native.c +++ b/src/itc/motion/tct-motion-native.c @@ -26,98 +26,99 @@ #include "tct_common.h" #include #include +static char* key; +static char* fname; +static int nNum; -#include -#include -#include -#include - -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/native-common/CMakeLists.txt b/src/itc/native-common/CMakeLists.txt index 0f44ec593..ffa09ebf2 100755 --- a/src/itc/native-common/CMakeLists.txt +++ b/src/itc/native-common/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/native-common/tct-native-common-native.c b/src/itc/native-common/tct-native-common-native.c index 0dac769ce..149254d01 100755 --- a/src/itc/native-common/tct-native-common-native.c +++ b/src/itc/native-common/tct-native-common-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/nfc/CMakeLists.txt b/src/itc/nfc/CMakeLists.txt index ab92593df..70198c907 100755 --- a/src/itc/nfc/CMakeLists.txt +++ b/src/itc/nfc/CMakeLists.txt @@ -19,7 +19,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle capi-system-info capi-appfw-app-manager - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/nfc/tct-nfc-native.c b/src/itc/nfc/tct-nfc-native.c index 2a11f1f05..0ff56cf6f 100755 --- a/src/itc/nfc/tct-nfc-native.c +++ b/src/itc/nfc/tct-nfc-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/notification/CMakeLists.txt b/src/itc/notification/CMakeLists.txt index 875066e5d..0db404cda 100755 --- a/src/itc/notification/CMakeLists.txt +++ b/src/itc/notification/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 gobject-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( diff --git a/src/itc/notification/tct-notification-native.c b/src/itc/notification/tct-notification-native.c index f141395e6..4e7b8cd54 100755 --- a/src/itc/notification/tct-notification-native.c +++ b/src/itc/notification/tct-notification-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/oauth2/CMakeLists.txt b/src/itc/oauth2/CMakeLists.txt index a3ea81223..96e0a1d86 100755 --- a/src/itc/oauth2/CMakeLists.txt +++ b/src/itc/oauth2/CMakeLists.txt @@ -18,7 +18,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info libcurl gobject-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/oauth2/tct-oauth2-native.c b/src/itc/oauth2/tct-oauth2-native.c index 01ba6fcca..bf53171b1 100755 --- a/src/itc/oauth2/tct-oauth2-native.c +++ b/src/itc/oauth2/tct-oauth2-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/package-manager/CMakeLists.txt b/src/itc/package-manager/CMakeLists.txt index 383fbc539..63b4a86f0 100755 --- a/src/itc/package-manager/CMakeLists.txt +++ b/src/itc/package-manager/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( diff --git a/src/itc/package-manager/tct-package-manager-native.c b/src/itc/package-manager/tct-package-manager-native.c index 465e34a0f..d272021d6 100755 --- a/src/itc/package-manager/tct-package-manager-native.c +++ b/src/itc/package-manager/tct-package-manager-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/phonenumber-utils/CMakeLists.txt b/src/itc/phonenumber-utils/CMakeLists.txt index 77596da6b..80e66b145 100755 --- a/src/itc/phonenumber-utils/CMakeLists.txt +++ b/src/itc/phonenumber-utils/CMakeLists.txt @@ -11,7 +11,6 @@ SET(TC_SOURCES PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED ${CAPI_LIB} - capi-appfw-application bundle glib-2.0 capi-system-info @@ -19,7 +18,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED protobuf libphonenumber capi-base-utils-i18n - dlog elementary + dlog ) INCLUDE_DIRECTORIES( diff --git a/src/itc/phonenumber-utils/tct-phonenumber-utils-native.c b/src/itc/phonenumber-utils/tct-phonenumber-utils-native.c index 6133ffd20..f9f846fa2 100755 --- a/src/itc/phonenumber-utils/tct-phonenumber-utils-native.c +++ b/src/itc/phonenumber-utils/tct-phonenumber-utils-native.c @@ -23,99 +23,115 @@ #include #include #include -#include -#include -#include -#include -#include - -#include +int main(int argc, const char *argv[]) +{ + int result = -1; + int i = 0; + FILE *fres = NULL; + gsize byte_size = 0; + char* encoded_byte; + unsigned char* byte=NULL; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; + if (argc < 2) + { + fres = fopen(ERR_LOG,"w"); + if(NULL == fres) + { + return result; + } + fprintf(fres, "Usage: %s \\n", argv[0]); + fclose(fres); + return 2; + } -static bool app_create(void *data) -{ - return true; -} + size_t sz_byte_len = sizeof(size_t); + size_t sz_type = sizeof(int); + size_t sz_keysize = sizeof(size_t); + size_t sz_size = sizeof(size_t); -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + struct stat buf; + if ( stat(ERR_LOG, &buf) == 0 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + return 1; } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); - for ( i = 0; tc_array[i].name; i++ ) + char *func_name = NULL; + if (argc > 2) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) - { - if ( tc_array[i].startup ) - { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); - tc_array[i].startup(); - } + encoded_byte = (char *)argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); - result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); + byte += sz_byte_len; + byte += sz_type; - if ( tc_array[i].cleanup ) - { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); - tc_array[i].cleanup(); - } + size_t keysize = *((size_t *)byte); + byte += sz_keysize; + byte += keysize; + + size_t size = *((size_t *)byte); + byte += sz_size; + void *val = (void *)byte; byte += size; - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + func_name = strdup((char *)val); + if(NULL ==func_name) + { + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; -} -static void app_terminate(void *data) -{ - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); -} + for (i = 0; tc_array[i].name; i++) + { + if(func_name != NULL) + { + if((strcmp(func_name, "smacktestkey") == 0) || (strcmp(func_name, tc_array[i].name) == 0)) + { + sleep(1); + if (tc_array[i].startup) + { + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); + tc_array[i].startup(); + } -int main(int argc, char *argv[]) -{ - int ret = 0; - appdata_s ad = {0,}; + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); + result = tc_array[i].function(); - ui_app_lifecycle_callback_s event_callback = {0,}; - event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; + if (tc_array[i].cleanup) + { + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); + tc_array[i].cleanup(); + } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) - { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; - } + fres = fopen("/tmp/tcresult","w"); + if(NULL == fres) + { + if(argc > 2) + free(func_name); + return result; + } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; + fprintf(fres, "%d", result); + fclose(fres); + if(argc > 2) + free(func_name); + return result; + } + else + { + fres = fopen(ERR_LOG,"w"); + if(NULL == fres) + { + if(argc > 2) + free(func_name); + return result; + } + fprintf(fres, "Unknown testcase name: \"%s\"\\n", func_name); + fclose(fres); + } + } + } + if(argc > 2) + free(func_name); + return 2; } diff --git a/src/itc/player/CMakeLists.txt b/src/itc/player/CMakeLists.txt index 71f4f79ba..703cf32a0 100755 --- a/src/itc/player/CMakeLists.txt +++ b/src/itc/player/CMakeLists.txt @@ -24,7 +24,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED evas ecore-x capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/player/tct-player-native.c b/src/itc/player/tct-player-native.c index 982ed7f8f..fc21fa861 100755 --- a/src/itc/player/tct-player-native.c +++ b/src/itc/player/tct-player-native.c @@ -27,75 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -static gboolean run_testcases(gpointer user_data, char **argv) { - - int i=0, result=0; - char* pszGetTCName = NULL; +int run_testcases() +{ + int result = -1; + int i; gsize byte_size; - const gchar *encoded_byte; - guchar *byte = NULL; - const size_t sz_byte_len = sizeof(size_t); - const size_t sz_type = sizeof(int); - const size_t sz_keysize = sizeof(size_t); - const size_t sz_size = sizeof(size_t); + const gchar* encoded_byte; + guchar* byte = NULL; + + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) + { + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } + } - encoded_byte = argv[3]; - byte = g_base64_decode(encoded_byte, &byte_size); - byte += sz_byte_len; - byte += sz_type; - size_t keysize = *((size_t *)byte); - byte += sz_keysize; - byte += keysize; - size_t size = *((size_t *)byte); - byte += sz_size; - void *val = (void *)byte; - byte += size; - pszGetTCName = strdup((char *)val); - for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY(pszGetTCName); - return FALSE; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - FPRINTF("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY(pszGetTCName); + if (nNum > 2) + free(func_name); + return 2; +} - return FALSE; +static bool app_create(void *data) +{ + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - run_testcases(NULL, argv); - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return 0; -} \ No newline at end of file + fname = argv[1]; + key = argv[3]; + nNum = argc; + ui_app_lifecycle_callback_s event_callback = {0,}; + event_callback.create = app_create; + + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) + { + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); + } + return nRet; +} diff --git a/src/itc/privilege-info/CMakeLists.txt b/src/itc/privilege-info/CMakeLists.txt index 8d03e7a5d..ab63ff7c8 100755 --- a/src/itc/privilege-info/CMakeLists.txt +++ b/src/itc/privilege-info/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-security-privilege-manager glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/privilege-info/tct-privilege-info-native.c b/src/itc/privilege-info/tct-privilege-info-native.c index 0b89ca985..c9ee4f6d2 100755 --- a/src/itc/privilege-info/tct-privilege-info-native.c +++ b/src/itc/privilege-info/tct-privilege-info-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/push/CMakeLists.txt b/src/itc/push/CMakeLists.txt index 86d915b76..88630d2eb 100755 --- a/src/itc/push/CMakeLists.txt +++ b/src/itc/push/CMakeLists.txt @@ -20,7 +20,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED aul json-glib-1.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/push/tct-push-native.c b/src/itc/push/tct-push-native.c index b5be4898f..996741735 100755 --- a/src/itc/push/tct-push-native.c +++ b/src/itc/push/tct-push-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/radio/CMakeLists.txt b/src/itc/radio/CMakeLists.txt index 24c500f96..604cdf2ea 100755 --- a/src/itc/radio/CMakeLists.txt +++ b/src/itc/radio/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 gobject-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/radio/tct-radio-native.c b/src/itc/radio/tct-radio-native.c index 71da9a5ca..2a4c1e150 100755 --- a/src/itc/radio/tct-radio-native.c +++ b/src/itc/radio/tct-radio-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/recorder/CMakeLists.txt b/src/itc/recorder/CMakeLists.txt index 01f265d67..76b202d8d 100755 --- a/src/itc/recorder/CMakeLists.txt +++ b/src/itc/recorder/CMakeLists.txt @@ -17,7 +17,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED storage ecore capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( diff --git a/src/itc/recorder/tct-recorder-native.c b/src/itc/recorder/tct-recorder-native.c index 51e7e37bc..79692a80b 100755 --- a/src/itc/recorder/tct-recorder-native.c +++ b/src/itc/recorder/tct-recorder-native.c @@ -27,75 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -static gboolean run_testcases(gpointer user_data, char **argv) { - - int i=0, result=0; - char* pszGetTCName = NULL; +int run_testcases() +{ + int result = -1; + int i; gsize byte_size; - const gchar *encoded_byte; - guchar *byte = NULL; - const size_t sz_byte_len = sizeof(size_t); - const size_t sz_type = sizeof(int); - const size_t sz_keysize = sizeof(size_t); - const size_t sz_size = sizeof(size_t); + const gchar* encoded_byte; + guchar* byte = NULL; + + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) + { + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } + } - encoded_byte = argv[3]; - byte = g_base64_decode(encoded_byte, &byte_size); - byte += sz_byte_len; - byte += sz_type; - size_t keysize = *((size_t *)byte); - byte += sz_keysize; - byte += keysize; - size_t size = *((size_t *)byte); - byte += sz_size; - void *val = (void *)byte; - byte += size; - pszGetTCName = strdup((char *)val); - for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY(pszGetTCName); - return FALSE; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - FPRINTF("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY(pszGetTCName); + if (nNum > 2) + free(func_name); + return 2; +} - return FALSE; +static bool app_create(void *data) +{ + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - run_testcases(NULL, argv); - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return 0; + fname = argv[1]; + key = argv[3]; + nNum = argc; + ui_app_lifecycle_callback_s event_callback = {0,}; + event_callback.create = app_create; + + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) + { + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); + } + return nRet; } diff --git a/src/itc/runtime-info/CMakeLists.txt b/src/itc/runtime-info/CMakeLists.txt index ba09018b9..7a1a3d252 100755 --- a/src/itc/runtime-info/CMakeLists.txt +++ b/src/itc/runtime-info/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/runtime-info/tct-runtime-info-native.c b/src/itc/runtime-info/tct-runtime-info-native.c index a20afca8d..03565dbe6 100755 --- a/src/itc/runtime-info/tct-runtime-info-native.c +++ b/src/itc/runtime-info/tct-runtime-info-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/screen-mirroring/CMakeLists.txt b/src/itc/screen-mirroring/CMakeLists.txt index 26cb643a2..a14f69f39 100755 --- a/src/itc/screen-mirroring/CMakeLists.txt +++ b/src/itc/screen-mirroring/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application bundle capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/screen-mirroring/tct-screen-mirroring-native.c b/src/itc/screen-mirroring/tct-screen-mirroring-native.c index 7c6e96707..4c7fe3ce2 100755 --- a/src/itc/screen-mirroring/tct-screen-mirroring-native.c +++ b/src/itc/screen-mirroring/tct-screen-mirroring-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/sensor/CMakeLists.txt b/src/itc/sensor/CMakeLists.txt index 56119cd35..50bc26ba0 100755 --- a/src/itc/sensor/CMakeLists.txt +++ b/src/itc/sensor/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/sensor/tct-sensor-native.c b/src/itc/sensor/tct-sensor-native.c index acba13af7..bbf9bc14e 100755 --- a/src/itc/sensor/tct-sensor-native.c +++ b/src/itc/sensor/tct-sensor-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/service-adaptor-client/CMakeLists.txt b/src/itc/service-adaptor-client/CMakeLists.txt index 9f33e30ad..89feeaf3b 100755 --- a/src/itc/service-adaptor-client/CMakeLists.txt +++ b/src/itc/service-adaptor-client/CMakeLists.txt @@ -18,7 +18,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 capi-system-info ecore - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/service-adaptor-client/tct-service-adaptor-client-native.c b/src/itc/service-adaptor-client/tct-service-adaptor-client-native.c index 2be89988f..5a7818d38 100755 --- a/src/itc/service-adaptor-client/tct-service-adaptor-client-native.c +++ b/src/itc/service-adaptor-client/tct-service-adaptor-client-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/shortcut/CMakeLists.txt b/src/itc/shortcut/CMakeLists.txt index 5d05643e6..5d200759d 100755 --- a/src/itc/shortcut/CMakeLists.txt +++ b/src/itc/shortcut/CMakeLists.txt @@ -3,7 +3,7 @@ SET(PKG_NAME "shortcut") SET(EXEC_NAME "tct-${PKG_NAME}-native") SET(RPM_NAME "native-${PKG_NAME}-itc") -SET(CAPI_LIB "shortcut capi-appfw-application bundle glib-2.0 capi-system-info dlog elementary db-util sqlite3 com-core libxml-2.0 vconf capi-base-common aul elementary") +SET(CAPI_LIB "shortcut capi-appfw-application bundle glib-2.0 capi-system-info dlog db-util sqlite3 com-core libxml-2.0 vconf capi-base-common aul elementary") SET(TC_SOURCES ITs-shortcut-common.c ITs-shortcut.c @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog db-util sqlite3 com-core diff --git a/src/itc/shortcut/ITs-shortcut-common.h b/src/itc/shortcut/ITs-shortcut-common.h index 5056bb169..81c797e30 100755 --- a/src/itc/shortcut/ITs-shortcut-common.h +++ b/src/itc/shortcut/ITs-shortcut-common.h @@ -40,7 +40,7 @@ bool g_b2CallbackValueCheck; #define API_NAMESPACE "SHORTCUT_ITC" #define ICON_PATH "/opt/usr/media/icon.png" -#define APPID "org.tizen.shortcut_test" +#define APPID "org.tizen.shorcut_test" #define TIMEOUT_CB 15000 #define SHORTCUTPERIOD -1.0f #define DUPLICATEALLOWED 1 diff --git a/src/itc/shortcut/res/org.tizen.shorcut_test-1.0.0-arm.tpk b/src/itc/shortcut/res/org.tizen.shorcut_test-1.0.0-arm.tpk new file mode 100755 index 000000000..b05e24403 Binary files /dev/null and b/src/itc/shortcut/res/org.tizen.shorcut_test-1.0.0-arm.tpk differ diff --git a/src/itc/shortcut/res/org.tizen.shorcut_test-1.0.0-i386.tpk b/src/itc/shortcut/res/org.tizen.shorcut_test-1.0.0-i386.tpk new file mode 100755 index 000000000..b794c53bb Binary files /dev/null and b/src/itc/shortcut/res/org.tizen.shorcut_test-1.0.0-i386.tpk differ diff --git a/src/itc/shortcut/res/org.tizen.shortcut_test-1.0.0-arm.tpk b/src/itc/shortcut/res/org.tizen.shortcut_test-1.0.0-arm.tpk deleted file mode 100644 index 623dbd22e..000000000 Binary files a/src/itc/shortcut/res/org.tizen.shortcut_test-1.0.0-arm.tpk and /dev/null differ diff --git a/src/itc/shortcut/res/org.tizen.shortcut_test-1.0.0-i386.tpk b/src/itc/shortcut/res/org.tizen.shortcut_test-1.0.0-i386.tpk deleted file mode 100644 index 537ca9c72..000000000 Binary files a/src/itc/shortcut/res/org.tizen.shortcut_test-1.0.0-i386.tpk and /dev/null differ diff --git a/src/itc/shortcut/tct-shortcut-native.c b/src/itc/shortcut/tct-shortcut-native.c index c7e31b4ae..1ee2b69bb 100755 --- a/src/itc/shortcut/tct-shortcut-native.c +++ b/src/itc/shortcut/tct-shortcut-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/smartcard/CMakeLists.txt b/src/itc/smartcard/CMakeLists.txt index 02eede467..70d0acbbb 100755 --- a/src/itc/smartcard/CMakeLists.txt +++ b/src/itc/smartcard/CMakeLists.txt @@ -18,7 +18,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/smartcard/tct-smartcard-native.c b/src/itc/smartcard/tct-smartcard-native.c index 9d0156a27..d2fa969b8 100755 --- a/src/itc/smartcard/tct-smartcard-native.c +++ b/src/itc/smartcard/tct-smartcard-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/sound-manager/CMakeLists.txt b/src/itc/sound-manager/CMakeLists.txt index e28b0b5a5..d3a4fa9c0 100755 --- a/src/itc/sound-manager/CMakeLists.txt +++ b/src/itc/sound-manager/CMakeLists.txt @@ -19,7 +19,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 bundle capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/sound-manager/tct-sound-manager-native.c b/src/itc/sound-manager/tct-sound-manager-native.c index 3d5882858..a15f98ed1 100755 --- a/src/itc/sound-manager/tct-sound-manager-native.c +++ b/src/itc/sound-manager/tct-sound-manager-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/stt/CMakeLists.txt b/src/itc/stt/CMakeLists.txt index 036f5d606..ee67fa74a 100755 --- a/src/itc/stt/CMakeLists.txt +++ b/src/itc/stt/CMakeLists.txt @@ -17,7 +17,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 ecore elementary - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/stt/tct-stt-native.c b/src/itc/stt/tct-stt-native.c index 1f5267531..509c5d856 100755 --- a/src/itc/stt/tct-stt-native.c +++ b/src/itc/stt/tct-stt-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/sync-manager/CMakeLists.txt b/src/itc/sync-manager/CMakeLists.txt index bda3ef8f0..dd1282437 100755 --- a/src/itc/sync-manager/CMakeLists.txt +++ b/src/itc/sync-manager/CMakeLists.txt @@ -3,7 +3,7 @@ SET(PKG_NAME "sync-manager") SET(EXEC_NAME "tct-${PKG_NAME}-native") SET(RPM_NAME "native-${PKG_NAME}-itc") -SET(CAPI_LIB "core-sync-client capi-appfw-application bundle capi-system-info capi-system-runtime-info capi-system-device capi-appfw-app-manager capi-appfw-package-manager capi-network-connection appcore-efl dlog elementary db-util pkgmgr pkgmgr-info appsvc vconf vconf-internal-keys libxml-2.0 glib-2.0 gio-unix-2.0 accounts-svc alarm-service calendar-service2 contacts-service2 vasum elementary ecore") +SET(CAPI_LIB "core-sync-client capi-appfw-application bundle capi-system-info capi-system-runtime-info capi-system-device capi-appfw-app-manager capi-appfw-package-manager capi-network-connection appcore-efl dlog db-util pkgmgr pkgmgr-info appsvc vconf vconf-internal-keys libxml-2.0 glib-2.0 gio-unix-2.0 accounts-svc alarm-service calendar-service2 contacts-service2 vasum elementary ecore") SET(TC_SOURCES ITs-sync-manager-common.c @@ -21,7 +21,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-package-manager capi-network-connection appcore-efl - dlog elementary + dlog db-util pkgmgr pkgmgr-info diff --git a/src/itc/sync-manager/tct-sync-manager-native.c b/src/itc/sync-manager/tct-sync-manager-native.c index 1a5814fa2..c38cea23e 100755 --- a/src/itc/sync-manager/tct-sync-manager-native.c +++ b/src/itc/sync-manager/tct-sync-manager-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/system-info/CMakeLists.txt b/src/itc/system-info/CMakeLists.txt index 0f51e2c3f..68e817039 100755 --- a/src/itc/system-info/CMakeLists.txt +++ b/src/itc/system-info/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application bundle glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/system-info/tct-system-info-native.c b/src/itc/system-info/tct-system-info-native.c index 15b06bff8..157a4326a 100755 --- a/src/itc/system-info/tct-system-info-native.c +++ b/src/itc/system-info/tct-system-info-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/system-settings/CMakeLists.txt b/src/itc/system-settings/CMakeLists.txt index 3dd295da1..a880ddd84 100755 --- a/src/itc/system-settings/CMakeLists.txt +++ b/src/itc/system-settings/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/system-settings/tct-system-settings-native.c b/src/itc/system-settings/tct-system-settings-native.c index 4250c0ed5..516bc21f6 100755 --- a/src/itc/system-settings/tct-system-settings-native.c +++ b/src/itc/system-settings/tct-system-settings-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/tbm/CMakeLists.txt b/src/itc/tbm/CMakeLists.txt index 9f5a3df37..6773a087c 100755 --- a/src/itc/tbm/CMakeLists.txt +++ b/src/itc/tbm/CMakeLists.txt @@ -19,7 +19,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/tbm/tct-tbm-native.c b/src/itc/tbm/tct-tbm-native.c index 3853b3efe..fe8752ded 100755 --- a/src/itc/tbm/tct-tbm-native.c +++ b/src/itc/tbm/tct-tbm-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/telephony/CMakeLists.txt b/src/itc/telephony/CMakeLists.txt index a8ff1b28b..29cc78623 100755 --- a/src/itc/telephony/CMakeLists.txt +++ b/src/itc/telephony/CMakeLists.txt @@ -18,7 +18,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED tapi glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/telephony/tct-telephony-native.c b/src/itc/telephony/tct-telephony-native.c index bae567598..844dfb4be 100755 --- a/src/itc/telephony/tct-telephony-native.c +++ b/src/itc/telephony/tct-telephony-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/thumbnail-util/CMakeLists.txt b/src/itc/thumbnail-util/CMakeLists.txt index af8ddc27f..208dc1729 100755 --- a/src/itc/thumbnail-util/CMakeLists.txt +++ b/src/itc/thumbnail-util/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application bundle capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/thumbnail-util/tct-thumbnail-util-native.c b/src/itc/thumbnail-util/tct-thumbnail-util-native.c index c7aad2f6e..b26952d58 100755 --- a/src/itc/thumbnail-util/tct-thumbnail-util-native.c +++ b/src/itc/thumbnail-util/tct-thumbnail-util-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/tone-player/CMakeLists.txt b/src/itc/tone-player/CMakeLists.txt index 51f642318..b68451749 100755 --- a/src/itc/tone-player/CMakeLists.txt +++ b/src/itc/tone-player/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/tone-player/tct-tone-player-native.c b/src/itc/tone-player/tct-tone-player-native.c index 5df55bb2e..546bff44c 100755 --- a/src/itc/tone-player/tct-tone-player-native.c +++ b/src/itc/tone-player/tct-tone-player-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/ttrace/CMakeLists.txt b/src/itc/ttrace/CMakeLists.txt index 154f4de4d..1a0ff3054 100755 --- a/src/itc/ttrace/CMakeLists.txt +++ b/src/itc/ttrace/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/ttrace/tct-ttrace-native.c b/src/itc/ttrace/tct-ttrace-native.c index ef62918fe..07ed720e5 100755 --- a/src/itc/ttrace/tct-ttrace-native.c +++ b/src/itc/ttrace/tct-ttrace-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/tts/CMakeLists.txt b/src/itc/tts/CMakeLists.txt index c9444e700..70804fc56 100755 --- a/src/itc/tts/CMakeLists.txt +++ b/src/itc/tts/CMakeLists.txt @@ -17,7 +17,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED ecore capi-system-info elementary - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/tts/tct-tts-native.c b/src/itc/tts/tct-tts-native.c index e194b66d8..262db4619 100755 --- a/src/itc/tts/tct-tts-native.c +++ b/src/itc/tts/tct-tts-native.c @@ -27,75 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -static gboolean run_testcases(gpointer user_data, char **argv) { - - int i=0, result=0; - char* pszGetTCName = NULL; +int run_testcases() +{ + int result = -1; + int i; gsize byte_size; - const gchar *encoded_byte; - guchar *byte = NULL; - const size_t sz_byte_len = sizeof(size_t); - const size_t sz_type = sizeof(int); - const size_t sz_keysize = sizeof(size_t); - const size_t sz_size = sizeof(size_t); + const gchar* encoded_byte; + guchar* byte = NULL; + + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) + { + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } + } - encoded_byte = argv[3]; - byte = g_base64_decode(encoded_byte, &byte_size); - byte += sz_byte_len; - byte += sz_type; - size_t keysize = *((size_t *)byte); - byte += sz_keysize; - byte += keysize; - size_t size = *((size_t *)byte); - byte += sz_size; - void *val = (void *)byte; - byte += size; - pszGetTCName = strdup((char *)val); - for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY(pszGetTCName); - return FALSE; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - FPRINTF("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY(pszGetTCName); + if (nNum > 2) + free(func_name); + return 2; +} - return FALSE; +static bool app_create(void *data) +{ + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - run_testcases(NULL, argv); - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return 0; -} \ No newline at end of file + fname = argv[1]; + key = argv[3]; + nNum = argc; + ui_app_lifecycle_callback_s event_callback = {0,}; + event_callback.create = app_create; + + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) + { + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); + } + return nRet; +} diff --git a/src/itc/url-download/CMakeLists.txt b/src/itc/url-download/CMakeLists.txt index 217e9c56c..1dd50e995 100755 --- a/src/itc/url-download/CMakeLists.txt +++ b/src/itc/url-download/CMakeLists.txt @@ -18,7 +18,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 gobject-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( diff --git a/src/itc/url-download/tct-url-download-native.c b/src/itc/url-download/tct-url-download-native.c index 1477e6755..fb6cf9a30 100755 --- a/src/itc/url-download/tct-url-download-native.c +++ b/src/itc/url-download/tct-url-download-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/video-util/CMakeLists.txt b/src/itc/video-util/CMakeLists.txt index 5a61f70db..e9fe6bf07 100755 --- a/src/itc/video-util/CMakeLists.txt +++ b/src/itc/video-util/CMakeLists.txt @@ -17,7 +17,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle ecore capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/video-util/tct-video-util-native.c b/src/itc/video-util/tct-video-util-native.c index b8bbfaff7..8dd157584 100755 --- a/src/itc/video-util/tct-video-util-native.c +++ b/src/itc/video-util/tct-video-util-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/voice-control-elm/CMakeLists.txt b/src/itc/voice-control-elm/CMakeLists.txt index b05355497..c07866925 100755 --- a/src/itc/voice-control-elm/CMakeLists.txt +++ b/src/itc/voice-control-elm/CMakeLists.txt @@ -3,7 +3,7 @@ SET(PKG_NAME "voice-control-elm") SET(EXEC_NAME "tct-${PKG_NAME}-native") SET(RPM_NAME "native-${PKG_NAME}-itc") -SET(CAPI_LIB "voice-control-elm capi-appfw-application bundle capi-system-info bundle appcore-efl capi-base-common evas eina ecore elementary voice-control-widget dlog elementary edje libxml-2.0 aul capi-base-common capi-media-audio-io capi-media-sound-manager capi-network-bluetooth dbus-1 dlog elementary ecore glib-2.0 libprivilege-control libxml-2.0 vconf") +SET(CAPI_LIB "voice-control-elm capi-appfw-application bundle capi-system-info bundle appcore-efl capi-base-common evas eina ecore elementary voice-control-widget dlog edje libxml-2.0 aul capi-base-common capi-media-audio-io capi-media-sound-manager capi-network-bluetooth dbus-1 dlog ecore glib-2.0 libprivilege-control libxml-2.0 vconf") SET(TC_SOURCES ITs-voice-control-elm-common.c ITs-voice-control-elm.c @@ -22,7 +22,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED ecore elementary voice-control-widget - dlog elementary + dlog edje libxml-2.0 aul @@ -31,7 +31,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-media-sound-manager capi-network-bluetooth dbus-1 - dlog elementary + dlog ecore glib-2.0 libprivilege-control diff --git a/src/itc/voice-control-elm/tct-voice-control-elm-native.c b/src/itc/voice-control-elm/tct-voice-control-elm-native.c index 12c720dde..e07dd2dbf 100755 --- a/src/itc/voice-control-elm/tct-voice-control-elm-native.c +++ b/src/itc/voice-control-elm/tct-voice-control-elm-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/voice-control/CMakeLists.txt b/src/itc/voice-control/CMakeLists.txt index 107cdcbe0..64f315ee2 100755 --- a/src/itc/voice-control/CMakeLists.txt +++ b/src/itc/voice-control/CMakeLists.txt @@ -3,7 +3,7 @@ SET(PKG_NAME "voice-control") SET(EXEC_NAME "tct-${PKG_NAME}-native") SET(RPM_NAME "native-${PKG_NAME}-itc") -SET(CAPI_LIB "voice-control capi-appfw-application bundle capi-system-info bundle appcore-efl capi-base-common evas eina ecore elementary dlog elementary edje libxml-2.0 aul capi-base-common capi-media-audio-io capi-media-sound-manager capi-network-bluetooth dbus-1 dlog elementary ecore glib-2.0 libprivilege-control libxml-2.0 vconf") +SET(CAPI_LIB "voice-control capi-appfw-application bundle capi-system-info bundle appcore-efl capi-base-common evas eina ecore elementary dlog edje libxml-2.0 aul capi-base-common capi-media-audio-io capi-media-sound-manager capi-network-bluetooth dbus-1 dlog ecore glib-2.0 libprivilege-control libxml-2.0 vconf") SET(TC_SOURCES ITs-voice-control-common.c ITs-voice-control.c @@ -21,7 +21,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED eina ecore elementary - dlog elementary + dlog edje libxml-2.0 aul @@ -30,7 +30,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-media-sound-manager capi-network-bluetooth dbus-1 - dlog elementary + dlog ecore glib-2.0 libprivilege-control diff --git a/src/itc/voice-control/tct-voice-control-native.c b/src/itc/voice-control/tct-voice-control-native.c index 7f4c8026a..b1e81606d 100755 --- a/src/itc/voice-control/tct-voice-control-native.c +++ b/src/itc/voice-control/tct-voice-control-native.c @@ -27,75 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -static gboolean run_testcases(gpointer user_data, char **argv) { - - int i=0, result=0; - char* pszGetTCName = NULL; +int run_testcases() +{ + int result = -1; + int i; gsize byte_size; - const gchar *encoded_byte; - guchar *byte = NULL; - const size_t sz_byte_len = sizeof(size_t); - const size_t sz_type = sizeof(int); - const size_t sz_keysize = sizeof(size_t); - const size_t sz_size = sizeof(size_t); + const gchar* encoded_byte; + guchar* byte = NULL; + + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) + { + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } + } - encoded_byte = argv[3]; - byte = g_base64_decode(encoded_byte, &byte_size); - byte += sz_byte_len; - byte += sz_type; - size_t keysize = *((size_t *)byte); - byte += sz_keysize; - byte += keysize; - size_t size = *((size_t *)byte); - byte += sz_size; - void *val = (void *)byte; - byte += size; - pszGetTCName = strdup((char *)val); - for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY(pszGetTCName); - return FALSE; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - FPRINTF("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY(pszGetTCName); + if (nNum > 2) + free(func_name); + return 2; +} - return FALSE; +static bool app_create(void *data) +{ + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - run_testcases(NULL, argv); - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return 0; + fname = argv[1]; + key = argv[3]; + nNum = argc; + ui_app_lifecycle_callback_s event_callback = {0,}; + event_callback.create = app_create; + + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) + { + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); + } + return nRet; } diff --git a/src/itc/wav-player/CMakeLists.txt b/src/itc/wav-player/CMakeLists.txt index 0f830549c..1517e81aa 100755 --- a/src/itc/wav-player/CMakeLists.txt +++ b/src/itc/wav-player/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/wav-player/tct-wav-player-native.c b/src/itc/wav-player/tct-wav-player-native.c index 05fa8c8bf..c72938cb5 100755 --- a/src/itc/wav-player/tct-wav-player-native.c +++ b/src/itc/wav-player/tct-wav-player-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/webkit2/CMakeLists.txt b/src/itc/webkit2/CMakeLists.txt index 23ddb1290..58bca9cec 100755 --- a/src/itc/webkit2/CMakeLists.txt +++ b/src/itc/webkit2/CMakeLists.txt @@ -32,7 +32,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application ewebkit2 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( diff --git a/src/itc/webkit2/tct-webkit2-native.c b/src/itc/webkit2/tct-webkit2-native.c index 1260d59a5..39cbe37d4 100755 --- a/src/itc/webkit2/tct-webkit2-native.c +++ b/src/itc/webkit2/tct-webkit2-native.c @@ -27,75 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -static gboolean run_testcases(gpointer user_data, char **argv) { - - int i=0, result=0; - char* pszGetTCName = NULL; +int run_testcases() +{ + int result = -1; + int i; gsize byte_size; - const gchar *encoded_byte; - guchar *byte = NULL; - const size_t sz_byte_len = sizeof(size_t); - const size_t sz_type = sizeof(int); - const size_t sz_keysize = sizeof(size_t); - const size_t sz_size = sizeof(size_t); + const gchar* encoded_byte; + guchar* byte = NULL; + + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) + { + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } + } - encoded_byte = argv[3]; - byte = g_base64_decode(encoded_byte, &byte_size); - byte += sz_byte_len; - byte += sz_type; - size_t keysize = *((size_t *)byte); - byte += sz_keysize; - byte += keysize; - size_t size = *((size_t *)byte); - byte += sz_size; - void *val = (void *)byte; - byte += size; - pszGetTCName = strdup((char *)val); - for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY(pszGetTCName); - return FALSE; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - FPRINTF("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY(pszGetTCName); + if (nNum > 2) + free(func_name); + return 2; +} - return FALSE; +static bool app_create(void *data) +{ + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - run_testcases(NULL, argv); - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return 0; + fname = argv[1]; + key = argv[3]; + nNum = argc; + ui_app_lifecycle_callback_s event_callback = {0,}; + event_callback.create = app_create; + + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) + { + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); + } + return nRet; } diff --git a/src/itc/widget_service/CMakeLists.txt b/src/itc/widget_service/CMakeLists.txt index 3b36521c5..6d8948a74 100755 --- a/src/itc/widget_service/CMakeLists.txt +++ b/src/itc/widget_service/CMakeLists.txt @@ -17,7 +17,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info elementary widget_viewer_evas - dlog elementary + dlog ) INCLUDE_DIRECTORIES( diff --git a/src/itc/widget_service/tct-widget_service-native.c b/src/itc/widget_service/tct-widget_service-native.c index 39b1113f2..0fbd318a8 100755 --- a/src/itc/widget_service/tct-widget_service-native.c +++ b/src/itc/widget_service/tct-widget_service-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/widget_viewer_evas/CMakeLists.txt b/src/itc/widget_viewer_evas/CMakeLists.txt index 18e4cb7b6..ab9845c1c 100755 --- a/src/itc/widget_viewer_evas/CMakeLists.txt +++ b/src/itc/widget_viewer_evas/CMakeLists.txt @@ -3,7 +3,7 @@ SET(PKG_NAME "widget_viewer_evas") SET(EXEC_NAME "tct-${PKG_NAME}-native") SET(RPM_NAME "native-${PKG_NAME}-itc") -SET(CAPI_LIB "widget_viewer_evas capi-appfw-application bundle glib-2.0 capi-system-info dlog elementary capi-base-common icu-i18n vconf widget_service elementary") +SET(CAPI_LIB "widget_viewer_evas capi-appfw-application bundle glib-2.0 capi-system-info dlog capi-base-common icu-i18n vconf widget_service elementary") SET(TC_SOURCES ITs-widget_viewer_evas-common.c ITs-widget_viewer_evas.c @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog capi-base-common icu-i18n vconf diff --git a/src/itc/widget_viewer_evas/tct-widget_viewer_evas-native.c b/src/itc/widget_viewer_evas/tct-widget_viewer_evas-native.c index 5cb06f062..0a091eafd 100755 --- a/src/itc/widget_viewer_evas/tct-widget_viewer_evas-native.c +++ b/src/itc/widget_viewer_evas/tct-widget_viewer_evas-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/itc/wifi/CMakeLists.txt b/src/itc/wifi/CMakeLists.txt index 208c4b1e1..c48157d5d 100755 --- a/src/itc/wifi/CMakeLists.txt +++ b/src/itc/wifi/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 gobject-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/itc/wifi/tct-wifi-native.c b/src/itc/wifi/tct-wifi-native.c index 733fc9eb7..9d51d5acf 100755 --- a/src/itc/wifi/tct-wifi-native.c +++ b/src/itc/wifi/tct-wifi-native.c @@ -27,97 +27,99 @@ #include #include -#include -#include -#include -#include +static char* key; +static char* fname; +static int nNum; -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/tcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/accounts-svc/CMakeLists.txt b/src/utc/accounts-svc/CMakeLists.txt index f81a57f50..cc618f9be 100755 --- a/src/utc/accounts-svc/CMakeLists.txt +++ b/src/utc/accounts-svc/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info capi-base-common glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/accounts-svc/tct-accounts-svc-core.c b/src/utc/accounts-svc/tct-accounts-svc-core.c index c4e1f9915..b4caaf586 100755 --- a/src/utc/accounts-svc/tct-accounts-svc-core.c +++ b/src/utc/accounts-svc/tct-accounts-svc-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { - DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + DUMP_UTC_ERRLOG(); + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/app-manager/CMakeLists.txt b/src/utc/app-manager/CMakeLists.txt index d75bcd902..c57f58005 100755 --- a/src/utc/app-manager/CMakeLists.txt +++ b/src/utc/app-manager/CMakeLists.txt @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/app-manager/tct-app-manager-core.c b/src/utc/app-manager/tct-app-manager-core.c index 8dfa899ff..3849d9ccd 100755 --- a/src/utc/app-manager/tct-app-manager-core.c +++ b/src/utc/app-manager/tct-app-manager-core.c @@ -29,94 +29,84 @@ #include "tct_common.h" #include "tct-app-manager-core.h" -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) -{ - return true; -} - -static void app_control(app_control_h app_control, void *data) +static gboolean run_testcases(void *user_data) { - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) - { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; - } + char *func_name = (char *)user_data; + int i; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); - for ( i = 0; tc_array[i].name; i++ ) - { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) - { + utc_result = -1; + for (i = 0; tc_array[i].name; i++) { + if (func_name && !strncmp(func_name, tc_array[i].name, strlen(func_name))) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); - result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); + tc_array[i].function(); - if ( tc_array[i].cleanup ) + if (tc_array[i].cleanup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + free(func_name); + return FALSE; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + printf("Unknown testcase name: \"%s\"\n", func_name); + if (func_name) + free(func_name); + + return FALSE; } -static void app_terminate(void *data) + +static bool ui_app_create(void *user_data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + return true; +} + +static void ui_app_control(app_control_h app_control, void *user_data) +{ + int ret; + char *func_name = NULL; + + ret = app_control_get_extra_data(app_control, "smacktestkey", &func_name); + if (ret != APP_CONTROL_ERROR_NONE) { + printf("Failed to get extra data\n"); + ui_app_exit(); + } + + sleep(1); + g_idle_add(run_testcases, func_name); } int main(int argc, char *argv[]) { int ret = 0; - appdata_s ad = {0,}; - ui_app_lifecycle_callback_s event_callback = {0,}; - event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) - { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); + + event_callback.create = ui_app_create; + event_callback.app_control = ui_app_control; + + ret = ui_app_main(argc, argv, &event_callback, NULL); + if (ret != APP_ERROR_NONE) { + printf("\n[Line No : %d]Unable to execute test cases: ui_app_main API call gets failed\n", __LINE__); + } + + FILE *fres = fopen("/tmp/utcresult","w"); + if (fres == NULL) { + printf("\n[[Line No : %d]Unable to open file\n", __LINE__); return ret; } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); + fprintf(fres, "%d", utc_result); + fclose(fres); + return ret; -} \ No newline at end of file +} diff --git a/src/utc/appcore-agent/CMakeLists.txt b/src/utc/appcore-agent/CMakeLists.txt index 4ef6b6b03..9f5a02cb4 100755 --- a/src/utc/appcore-agent/CMakeLists.txt +++ b/src/utc/appcore-agent/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info ecore glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/appcore-agent/tct-appcore-agent-core.c b/src/utc/appcore-agent/tct-appcore-agent-core.c index c965cb666..447b7b80e 100755 --- a/src/utc/appcore-agent/tct-appcore-agent-core.c +++ b/src/utc/appcore-agent/tct-appcore-agent-core.c @@ -28,101 +28,136 @@ #include "tct_common.h" #include "tct-appcore-agent-core.h" -#include - -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +static gboolean run_testcases(void *user_data) { - return true; -} - -static gboolean run_testcase(gpointer data) -{ - char *pszGetTCName = (char *)data; + char *func_name = (char *)user_data; int i; - int ret; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); + utc_result = -1; + for (i = 0; tc_array[i].name; i++) { - if (strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) == 0) { + if (func_name && !strncmp(func_name, tc_array[i].name, strlen(func_name))) { DUMP_UTC_ERRLOG(); - if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + if (tc_array[i].startup) + { + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); - ret = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns = %d", pszGetTCName, ret); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); + tc_array[i].function(); - if (tc_array[i].cleanup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + if (tc_array[i].cleanup) + { + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d", ret); - FREE_MEMORY_TC(pszGetTCName); + free(func_name); return FALSE; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d", 1); - FREE_MEMORY_TC(pszGetTCName); + printf("Unknown testcase name: \"%s\"\n", func_name); + if (func_name) + free(func_name); + + service_app_exit(); return FALSE; } -static void app_control(app_control_h app_control, void *data) +static bool service_app_create(void *user_data) +{ + return true; +} + +static void service_app_control(app_control_h app_control, void *user_data) { - char *tc_name = NULL; int ret; + char *func_name = NULL; - ret = app_control_get_extra_data(app_control, "testcase_name", &tc_name); + ret = app_control_get_extra_data(app_control, "smacktestkey", &func_name); if (ret != APP_CONTROL_ERROR_NONE) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, ret); - PRINT_TC_RESULT("%d", 1); - FREE_MEMORY_TC(tc_name); - return; + printf("Failed to get extra data\n"); + service_app_exit(); } - - g_idle_add(run_testcase, tc_name); + + sleep(1); + g_idle_add(run_testcases, func_name); } -static void app_terminate(void *data) +static int check_utc_name(int argc, char **argv, char **func_name) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + const gchar *encoded_byte = NULL;; + guchar *byte = NULL; + gsize byte_size; + const size_t sz_byte_len = sizeof(size_t); + const size_t sz_type = sizeof(int); + const size_t sz_keysize = sizeof(size_t); + const size_t sz_size = sizeof(size_t); + size_t keysize; + size_t size; + void *val = NULL; + + if (argc > 2) { + encoded_byte = argv[3]; + byte = g_base64_decode(encoded_byte, &byte_size); + byte += sz_byte_len; + byte += sz_type; + keysize = *((size_t *)byte); + byte += sz_keysize; + byte += keysize; + size = *((size_t *)byte); + byte += sz_size; + val = (void *)byte; + byte += size; + + *func_name = strdup((const char *)val); + if (*func_name) { + if (!strcmp(*func_name, "utc_appcore_agent_service_app_main_p1") + || !strcmp(*func_name, "utc_appcore_agent_service_app_main_p2") + || !strcmp(*func_name, "utc_appcore_agent_service_app_main_n1") + || !strcmp(*func_name, "utc_appcore_agent_service_app_main_n2") + || !strcmp(*func_name, "utc_appcore_agent_service_app_main_n3") + || !strcmp(*func_name, "utc_appcore_agent_service_app_exit_p")) { + return 1; + } else { + free(*func_name); + *func_name = NULL; + } + } + } + + return 0; } int main(int argc, char *argv[]) { int ret = 0; - appdata_s ad = {0,}; + char *func_name = NULL; service_app_lifecycle_callback_s event_callback = {0,}; - event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; + if (check_utc_name(argc, argv, &func_name)) { + run_testcases(func_name); + } else { + event_callback.create = service_app_create; + event_callback.app_control = service_app_control; + + ret = service_app_main(argc, argv, &event_callback, NULL); + if (ret != APP_ERROR_NONE) { + printf("\n[Line No : %d]Unable to execute test cases: service_app_main API call gets failed\n", __LINE__); + } + } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = service_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); + FILE *fres = fopen("/tmp/utcresult","w"); + if (fres == NULL) { + printf("\n[Line No : %d]Unable to open file\n", __LINE__); return ret; } + fprintf(fres, "%d", utc_result); + fclose(fres); - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); return ret; } diff --git a/src/utc/appcore-widget/CMakeLists.txt b/src/utc/appcore-widget/CMakeLists.txt index a97fb81ae..565cef862 100755 --- a/src/utc/appcore-widget/CMakeLists.txt +++ b/src/utc/appcore-widget/CMakeLists.txt @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/appcore-widget/tct-appcore-widget-core.c b/src/utc/appcore-widget/tct-appcore-widget-core.c index 52795f454..742606079 100755 --- a/src/utc/appcore-widget/tct-appcore-widget-core.c +++ b/src/utc/appcore-widget/tct-appcore-widget-core.c @@ -30,21 +30,98 @@ #include "tct-appcore-widget-core.h" #include "assert_common.h" -#include -#include +static char *func_name = NULL; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; +static gboolean run_testcases(gpointer user_data) +{ + int i; + + utc_result = -1; + for (i = 0; tc_array[i].name; i++) { + if (func_name && !strncmp(func_name, tc_array[i].name, strlen(func_name))) { + DUMP_UTC_ERRLOG(); + if (tc_array[i].startup) + { + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); + tc_array[i].startup(); + } + + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); + tc_array[i].function(); + + if (tc_array[i].cleanup) + { + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); + tc_array[i].cleanup(); + } + + free(func_name); + + return FALSE; + } + } + + printf("Unknown testcase name: \"%s\"\n", func_name); + if (func_name) + free(func_name); + + return FALSE; +} + +static int widget_obj_create(widget_context_h context, bundle *content, int w, + int h, void *user_data) +{ + return 0; +} -static bool app_create(void *data) +static int widget_obj_destroy(widget_context_h context, + widget_app_destroy_type_e reason, bundle *content, void *user_data) +{ + return 0; +} + +static int widget_obj_pause(widget_context_h context, void *user_data) +{ + return 0; +} + +static int widget_obj_resume(widget_context_h context, void *user_data) +{ + return 0; +} + +static int widget_obj_update(widget_context_h context, bundle *content, + int force, void *user_data) +{ + return 0; +} + +static int widget_obj_resize(widget_context_h context, int w, int h, void *user_data) +{ + return 0; +} + +static widget_class_h _app_create(void *user_data) +{ + widget_instance_lifecycle_callback_s ops = { + .create = widget_obj_create, + .destroy = widget_obj_destroy, + .pause = widget_obj_pause, + .resume = widget_obj_resume, + .update = widget_obj_update, + .resize = widget_obj_resize, + }; + + sleep(1); + g_idle_add(run_testcases, NULL); + + return widget_app_class_create(ops, user_data); +} + +static void _app_terminate(void *user_data) { - return true; } -char* pszGetTCName = NULL; static int check_func_name(int argc, char **argv) { gsize byte_size; @@ -68,13 +145,13 @@ static int check_func_name(int argc, char **argv) void *val = (void *)byte; byte += size; - pszGetTCName = strdup((char *)val); - if (pszGetTCName) { - if (!strcmp(pszGetTCName, "utc_appcore_widget_widget_app_main_p") - || !strcmp(pszGetTCName, "utc_appcore_widget_widget_app_main_n1") - || !strcmp(pszGetTCName, "utc_appcore_widget_widget_app_main_n2") - || !strcmp(pszGetTCName, "utc_appcore_widget_widget_app_main_n3") - || !strcmp(pszGetTCName, "utc_appcore_widget_widget_app_exit_p")) { + func_name = strdup((char *)val); + if (func_name) { + if (!strcmp(func_name, "utc_appcore_widget_widget_app_main_p") + || !strcmp(func_name, "utc_appcore_widget_widget_app_main_n1") + || !strcmp(func_name, "utc_appcore_widget_widget_app_main_n2") + || !strcmp(func_name, "utc_appcore_widget_widget_app_main_n3") + || !strcmp(func_name, "utc_appcore_widget_widget_app_exit_p")) { return 1; } } @@ -83,100 +160,30 @@ static int check_func_name(int argc, char **argv) return 0; } -static gboolean run_testcases(gpointer user_data) { - - int i=0, result=0, nRet=0; - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); - for ( i = 0; tc_array[i].name; i++ ) - { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) - { - DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) - { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); - tc_array[i].startup(); - } - - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); - result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); - - if ( tc_array[i].cleanup ) - { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); - tc_array[i].cleanup(); - } - - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return FALSE; - } - } - - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - - return FALSE; - - -} - - -static void app_control(app_control_h app_control, void *data) -{ - - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) - { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; - } - - run_testcases(NULL); - - - return; -} - -static void app_terminate(void *data) -{ - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); -} - int main(int argc, char *argv[]) { int ret = 0; - appdata_s ad = {0,}; + widget_app_lifecycle_callback_s callback = {0, }; if (check_func_name(argc, argv)) { run_testcases(NULL); } else { + callback.create = _app_create; + callback.terminate = _app_terminate; - ui_app_lifecycle_callback_s event_callback = {0,}; - event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) - { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + ret = widget_app_main(argc, argv, &callback, NULL); + if (ret != WIDGET_ERROR_NONE) { + printf("\n[Line No : %d]Unable to execute test cases: widget_app_main API call gets failed\n", __LINE__); } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); + FILE *fres = fopen("/tmp/utcresult","w"); + if (fres == NULL) { + printf("\n[Line No : %d]Unable to open file\n", __LINE__); + return ret; + } + fprintf(fres, "%d", utc_result); + fclose(fres); + return ret; } diff --git a/src/utc/application/CMakeLists.txt b/src/utc/application/CMakeLists.txt index 3faf1dd75..43350df96 100755 --- a/src/utc/application/CMakeLists.txt +++ b/src/utc/application/CMakeLists.txt @@ -25,7 +25,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle ecore capi-appfw-app-manager - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/application/assert_common.h b/src/utc/application/assert_common.h index 94178f22a..791af9042 100755 --- a/src/utc/application/assert_common.h +++ b/src/utc/application/assert_common.h @@ -20,6 +20,7 @@ char *__correct_value; "Following expression is not true:\n" \ "%s\n", #exp); \ utc_result = 1; \ + ui_app_exit(); \ return 1; \ } \ } while (0) @@ -33,6 +34,7 @@ char *__correct_value; "%s == %d, %s == %d\n", \ #var, #ref, #var, (int)var, #ref, (int)ref); \ utc_result = 1; \ + ui_app_exit(); \ return 1; \ } \ } while (0) @@ -46,6 +48,7 @@ char *__correct_value; "%s == %s == %d\n", \ #var, #ref, #var, #ref, (int)ref); \ utc_result = 1; \ + ui_app_exit(); \ return 1; \ } \ } while (0) @@ -78,6 +81,7 @@ char *__correct_value; #define normal_exit(result) do { \ utc_result = result; \ + ui_app_exit(); \ } while (0) diff --git a/src/utc/application/tct-application-core.c b/src/utc/application/tct-application-core.c index 0e2b44705..b60a9cc63 100755 --- a/src/utc/application/tct-application-core.c +++ b/src/utc/application/tct-application-core.c @@ -29,124 +29,131 @@ #include "tct-application-core.h" #include "tct_common.h" -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static char *pszGetTCName = NULL; - -static bool app_create(void *data) -{ - return true; -} - -static gboolean set_result(gpointer data) -{ - if (utc_result == -1) - return TRUE; - - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d", utc_result); - FREE_MEMORY_TC(pszGetTCName); - - return FALSE; -} - - -static gboolean run_testcase(gpointer data) +static gboolean run_testcases(void *user_data) { - int i = 0; + char *func_name = (char *)user_data; + int i; utc_result = -1; - dlog_print(DLOG_INFO, "NativeTCT", "Executing TC Name = %s", pszGetTCName); - for ( i = 0; tc_array[i].name; i++ ) - { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) - { + for (i = 0; tc_array[i].name; i++) { + if (func_name && !strncmp(func_name, tc_array[i].name, strlen(func_name))) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); tc_array[i].function(); - if ( tc_array[i].cleanup ) + if (tc_array[i].cleanup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - if (strcmp(pszGetTCName, "utc_application_ui_app_exit_p") == 0) - return FALSE; - - g_idle_add(set_result, pszGetTCName); - + free(func_name); return FALSE; } } - dlog_print(DLOG_ERROR, "NativeTCT", "Unable to execute %s : Unknown Test Case Name", pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d", 1); - FREE_MEMORY_TC(pszGetTCName); + printf("Unknown testcase name: \"%s\"\n", func_name); + if (func_name) + free(func_name); + + ui_app_exit(); + return FALSE; } -static void app_control(app_control_h app_control, void *data) +static bool ui_app_create(void *data) { - int ret; + return true; +} - pszGetTCName = NULL; +static void ui_app_control(app_control_h app_control, void *user_data) +{ + int ret; + char *func_name = NULL; - ret = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); + ret = app_control_get_extra_data(app_control, "smacktestkey", &func_name); if (ret != APP_CONTROL_ERROR_NONE) { - dlog_print(DLOG_ERROR, "NativeTCT", "app_control_get_extra_data returns error = %d", ret); - PRINT_TC_RESULT("%d", 1); - return; + printf("Failed to get extra data\n"); + ui_app_exit(); } - g_idle_add(run_testcase, pszGetTCName); + sleep(1); + g_idle_add(run_testcases, func_name); } -static void app_terminate(void *data) +static int check_utc_name(int argc, char **argv, char **func_name) { - dlog_print(DLOG_INFO, "NativeTCT", "Application Package is now Terminating"); - - if (pszGetTCName && strcmp(pszGetTCName, "utc_application_ui_app_exit_p") == 0) { - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d", utc_result); - FREE_MEMORY_TC(pszGetTCName); + const gchar *encoded_byte = NULL;; + guchar *byte = NULL; + gsize byte_size; + const size_t sz_byte_len = sizeof(size_t); + const size_t sz_type = sizeof(int); + const size_t sz_keysize = sizeof(size_t); + const size_t sz_size = sizeof(size_t); + size_t keysize; + size_t size; + void *val = NULL; + + if (argc > 2) { + encoded_byte = argv[3]; + byte = g_base64_decode(encoded_byte, &byte_size); + byte += sz_byte_len; + byte += sz_type; + keysize = *((size_t *)byte); + byte += sz_keysize; + byte += keysize; + size = *((size_t *)byte); + byte += sz_size; + val = (void *)byte; + byte += size; + + *func_name = strdup((const char *)val); + if (*func_name) { + if (!strcmp(*func_name, "utc_application_ui_app_main_p") + || !strcmp(*func_name, "utc_application_ui_app_main_n") + || !strcmp(*func_name, "utc_application_ui_app_exit_p")) { + return 1; + } else { + free(*func_name); + *func_name = NULL; + } + } } + + return 0; } int main(int argc, char *argv[]) { int ret = 0; - appdata_s ad = {0,}; + char *func_name = NULL; ui_app_lifecycle_callback_s event_callback = {0,}; - event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - - dlog_print(DLOG_INFO, "NativeTCT", "Application Main Function is Invoked"); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) - { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + if (check_utc_name(argc, argv, &func_name)) { + run_testcases(func_name); + } else { + event_callback.create = ui_app_create; + event_callback.app_control = ui_app_control; + + ret = ui_app_main(argc, argv, &event_callback, NULL); + if (ret != APP_ERROR_NONE) { + printf("\n[Line No : %d]Unable to execute test cases: ui_app_main API call gets failed\n", __LINE__); + } + } + + FILE *fres = fopen("/tmp/utcresult","w"); + + if(fres != NULL){ + fprintf(fres, "%d", utc_result); + fclose(fres); } - dlog_print(DLOG_INFO, "NativeTCT", "Application Package is Terminated"); return ret; } diff --git a/src/utc/application/tct-application-core.h b/src/utc/application/tct-application-core.h index 9188c814f..c9a991a31 100755 --- a/src/utc/application/tct-application-core.h +++ b/src/utc/application/tct-application-core.h @@ -48,12 +48,13 @@ extern int utc_application_app_event_get_language_n(void); extern int utc_application_app_event_get_device_orientation_n(void); extern int utc_application_app_event_get_region_format_n(void); extern int utc_application_app_event_get_suspended_state_n(void); +extern int utc_application_ui_app_main_p(void); extern int utc_application_ui_app_main_n(void); +extern int utc_application_ui_app_exit_p(void); extern int utc_application_ui_app_add_event_handler_p(void); extern int utc_application_ui_app_add_event_handler_n(void); extern int utc_application_ui_app_remove_event_handler_p(void); extern int utc_application_ui_app_remove_event_handler_n(void); -extern int utc_application_ui_app_exit_p(void); extern int utc_application_i18n_get_text_p(void); extern int utc_application_i18n_get_text_n1(void); extern int utc_application_i18n_get_text_n2(void); @@ -318,12 +319,13 @@ testcase tc_array[] = { {"utc_application_app_event_get_device_orientation_n", utc_application_app_event_get_device_orientation_n, NULL, NULL}, {"utc_application_app_event_get_region_format_n", utc_application_app_event_get_region_format_n, NULL, NULL}, {"utc_application_app_event_get_suspended_state_n", utc_application_app_event_get_suspended_state_n, NULL, NULL}, + {"utc_application_ui_app_main_p", utc_application_ui_app_main_p, NULL, NULL}, {"utc_application_ui_app_main_n", utc_application_ui_app_main_n, NULL, NULL}, + {"utc_application_ui_app_exit_p", utc_application_ui_app_exit_p, NULL, NULL}, {"utc_application_ui_app_add_event_handler_p", utc_application_ui_app_add_event_handler_p, NULL, NULL}, {"utc_application_ui_app_add_event_handler_n", utc_application_ui_app_add_event_handler_n, NULL, NULL}, {"utc_application_ui_app_remove_event_handler_p", utc_application_ui_app_remove_event_handler_p, NULL, NULL}, {"utc_application_ui_app_remove_event_handler_n", utc_application_ui_app_remove_event_handler_n, NULL, NULL}, - {"utc_application_ui_app_exit_p", utc_application_ui_app_exit_p, NULL, NULL}, {"utc_application_i18n_get_text_p", utc_application_i18n_get_text_p, NULL, NULL}, {"utc_application_i18n_get_text_n1", utc_application_i18n_get_text_n1, NULL, NULL}, {"utc_application_i18n_get_text_n2", utc_application_i18n_get_text_n2, NULL, NULL}, diff --git a/src/utc/application/utc_app.c b/src/utc/application/utc_app.c index 505bd8408..0d1ea4303 100755 --- a/src/utc/application/utc_app.c +++ b/src/utc/application/utc_app.c @@ -20,6 +20,7 @@ #include //& set: ApplicationMain +static int main_loop_flag = 0; /** * @testcase utc_application_app_get_name_p @@ -173,6 +174,27 @@ int utc_application_app_get_id_n(void) return 0; } +static gboolean ui_app_exit_cb(gpointer user_data) +{ + ui_app_exit(); + + return FALSE; +} + +static bool _app_create(void *user_data) +{ + main_loop_flag = 1; + + g_idle_add(ui_app_exit_cb, NULL); + + return true; +} + +static void _app_terminate(void *user_data) +{ + main_loop_flag = 0; +} + /** * @testcase utc_application_app_get_cache_path_p * @since_tizen 2.3 @@ -506,6 +528,39 @@ int utc_application_app_event_get_suspended_state_n(void) return 0; } +/** + * @testcase utc_application_ui_app_main_p + * @since_tizen 2.3 + * @type Positive + * @description Runs the application's main loop until ui_app_exit() is called. + * @scenario Calls the ui_app_main() and stops the main loop by calling + * ui_app_exit(), and then checks the return value. + */ +int utc_application_ui_app_main_p(void) +{ + int ret = APP_ERROR_NONE; + int argc = 1; + char **argv = NULL; + ui_app_lifecycle_callback_s event_callback = {0,}; + + argv = malloc(sizeof(char *)); + assert_neq_without_exit(argv, NULL); + + argv[0] = "utc_application_ui_app_main_p"; + + main_loop_flag = 0; + event_callback.create = _app_create; + + ret = ui_app_main(argc, argv, &event_callback, NULL); + assert_eq_without_exit(ret, APP_ERROR_NONE); + assert_eq_without_exit(main_loop_flag, 1); + free(argv); + + utc_result = 0; + + return 0; +} + /** * @testcase utc_application_ui_app_main_n * @since_tizen 2.3 @@ -526,6 +581,39 @@ int utc_application_ui_app_main_n(void) return 0; } +/** + * @testcase utc_application_ui_app_exit_p + * @since_tizen 2.3 + * @type Positive + * @description Exits the main loop of application. + * @scenario Calls the ui_app_main() and Calls the ui_app_exit(). + */ +int utc_application_ui_app_exit_p(void) +{ + int ret = APP_ERROR_NONE; + int argc = 1; + char **argv = NULL; + ui_app_lifecycle_callback_s event_callback = {0,}; + + argv = malloc(sizeof(char *)); + assert_neq_without_exit(argv, NULL); + + argv[0] = "utc_application_ui_app_exit_p"; + + main_loop_flag = 1; + event_callback.create = _app_create; + event_callback.terminate = _app_terminate; + + ret = ui_app_main(argc, argv, &event_callback, NULL); + assert_eq_without_exit(ret, APP_ERROR_NONE); + assert_eq_without_exit(main_loop_flag, 0); + free(argv); + + utc_result = 0; + + return 0; +} + static void event_callback(void *event, void *data) { } @@ -622,19 +710,3 @@ int utc_application_ui_app_remove_event_handler_n(void) return 0; } - -/** - * @testcase utc_application_ui_app_exit_p - * @since_tizen 2.3 - * @type Positive - * @description Exits the main loop of application. - * @scenario Calls the ui_app_main() and Calls the ui_app_exit(). - */ -int utc_application_ui_app_exit_p(void) -{ - ui_app_exit(); - - utc_result = 0; - - return 0; -} diff --git a/src/utc/attach-panel/CMakeLists.txt b/src/utc/attach-panel/CMakeLists.txt index fb9ef118a..3e84ed5dd 100644 --- a/src/utc/attach-panel/CMakeLists.txt +++ b/src/utc/attach-panel/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog attach-panel elementary ) diff --git a/src/utc/attach-panel/tct-attach-panel-core.c b/src/utc/attach-panel/tct-attach-panel-core.c index 16d4e6761..c95395bf4 100755 --- a/src/utc/attach-panel/tct-attach-panel-core.c +++ b/src/utc/attach-panel/tct-attach-panel-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/audio-io/CMakeLists.txt b/src/utc/audio-io/CMakeLists.txt index 2058dc3cc..ab290e995 100755 --- a/src/utc/audio-io/CMakeLists.txt +++ b/src/utc/audio-io/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info storage glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/audio-io/tct-audio-io-core.c b/src/utc/audio-io/tct-audio-io-core.c index 89a33031a..0b973bd33 100755 --- a/src/utc/audio-io/tct-audio-io-core.c +++ b/src/utc/audio-io/tct-audio-io-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/badge/CMakeLists.txt b/src/utc/badge/CMakeLists.txt index df7a48434..fcb43b8ee 100755 --- a/src/utc/badge/CMakeLists.txt +++ b/src/utc/badge/CMakeLists.txt @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/badge/tct-badge-core.c b/src/utc/badge/tct-badge-core.c index cb946c67a..8d606da07 100755 --- a/src/utc/badge/tct-badge-core.c +++ b/src/utc/badge/tct-badge-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/base-utils/CMakeLists.txt b/src/utc/base-utils/CMakeLists.txt index 03142ba1c..092558793 100755 --- a/src/utc/base-utils/CMakeLists.txt +++ b/src/utc/base-utils/CMakeLists.txt @@ -27,7 +27,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info glib-2.0 bundle - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/base-utils/tct-base-utils-core.c b/src/utc/base-utils/tct-base-utils-core.c index 8d901b9b7..56297e0c3 100755 --- a/src/utc/base-utils/tct-base-utils-core.c +++ b/src/utc/base-utils/tct-base-utils-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/bluetooth/CMakeLists.txt b/src/utc/bluetooth/CMakeLists.txt index 54c2126e0..d08040f87 100755 --- a/src/utc/bluetooth/CMakeLists.txt +++ b/src/utc/bluetooth/CMakeLists.txt @@ -35,7 +35,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/bluetooth/tct-bluetooth-core.c b/src/utc/bluetooth/tct-bluetooth-core.c index 27e66f463..b3f77ea0b 100755 --- a/src/utc/bluetooth/tct-bluetooth-core.c +++ b/src/utc/bluetooth/tct-bluetooth-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/bundle/CMakeLists.txt b/src/utc/bundle/CMakeLists.txt index f5b43178e..a6b33c868 100755 --- a/src/utc/bundle/CMakeLists.txt +++ b/src/utc/bundle/CMakeLists.txt @@ -31,7 +31,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info capi-base-common glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/bundle/tct-bundle-core.c b/src/utc/bundle/tct-bundle-core.c index b707169f8..57b8546d2 100755 --- a/src/utc/bundle/tct-bundle-core.c +++ b/src/utc/bundle/tct-bundle-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/cairo/CMakeLists.txt b/src/utc/cairo/CMakeLists.txt index 908a46f27..cab35fe8d 100755 --- a/src/utc/cairo/CMakeLists.txt +++ b/src/utc/cairo/CMakeLists.txt @@ -17,7 +17,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED evas elementary bundle - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/cairo/tct-cairo-core.c b/src/utc/cairo/tct-cairo-core.c index a70e27ed0..d8ebbfe7d 100755 --- a/src/utc/cairo/tct-cairo-core.c +++ b/src/utc/cairo/tct-cairo-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/calendar-service2/CMakeLists.txt b/src/utc/calendar-service2/CMakeLists.txt index 7f8c37880..63b09e700 100755 --- a/src/utc/calendar-service2/CMakeLists.txt +++ b/src/utc/calendar-service2/CMakeLists.txt @@ -62,7 +62,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info storage glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES(${${CAPI_LIB}_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/utc/calendar-service2/tct-calendar-service2-core.c b/src/utc/calendar-service2/tct-calendar-service2-core.c index f7f34489f..87908ae3e 100755 --- a/src/utc/calendar-service2/tct-calendar-service2-core.c +++ b/src/utc/calendar-service2/tct-calendar-service2-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/camera/CMakeLists.txt b/src/utc/camera/CMakeLists.txt index b64d22c34..bdf53ef3f 100755 --- a/src/utc/camera/CMakeLists.txt +++ b/src/utc/camera/CMakeLists.txt @@ -17,7 +17,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 gthread-2.0 gobject-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/camera/tct-camera-core.c b/src/utc/camera/tct-camera-core.c index ec6071b8b..711dcc35a 100755 --- a/src/utc/camera/tct-camera-core.c +++ b/src/utc/camera/tct-camera-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/capi-maps-service/CMakeLists.txt b/src/utc/capi-maps-service/CMakeLists.txt index e70b564d3..9a01a1cce 100755 --- a/src/utc/capi-maps-service/CMakeLists.txt +++ b/src/utc/capi-maps-service/CMakeLists.txt @@ -35,7 +35,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info bundle glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( diff --git a/src/utc/capi-maps-service/tct-capi-maps-service-core.c b/src/utc/capi-maps-service/tct-capi-maps-service-core.c index e13c32bb7..b56d472f3 100755 --- a/src/utc/capi-maps-service/tct-capi-maps-service-core.c +++ b/src/utc/capi-maps-service/tct-capi-maps-service-core.c @@ -29,94 +29,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/capi-media-tool/CMakeLists.txt b/src/utc/capi-media-tool/CMakeLists.txt index b20ffcb55..5d84b7af4 100755 --- a/src/utc/capi-media-tool/CMakeLists.txt +++ b/src/utc/capi-media-tool/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED gthread-2.0 gobject-2.0 libtbm - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/capi-media-tool/tct-capi-media-tool-core.c b/src/utc/capi-media-tool/tct-capi-media-tool-core.c index dc43e2185..b58d8a3d2 100755 --- a/src/utc/capi-media-tool/tct-capi-media-tool-core.c +++ b/src/utc/capi-media-tool/tct-capi-media-tool-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/capi-media-vision/CMakeLists.txt b/src/utc/capi-media-vision/CMakeLists.txt index 53e4238eb..37be335e2 100755 --- a/src/utc/capi-media-vision/CMakeLists.txt +++ b/src/utc/capi-media-vision/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED ${CAPI_LIB} bundle storage - dlog elementary + dlog json-glib-1.0 libtbm capi-appfw-application @@ -31,7 +31,7 @@ TARGET_LINK_LIBRARIES(${EXEC_NAME} ${${CAPI_LIB}_LIBRARIES} capi-media-tool bundle - dlog elementary + dlog ) INSTALL(PROGRAMS ${EXEC_NAME} diff --git a/src/utc/capi-media-vision/tct-capi-media-vision-core.c b/src/utc/capi-media-vision/tct-capi-media-vision-core.c index a568ee289..acb0a29fc 100755 --- a/src/utc/capi-media-vision/tct-capi-media-vision-core.c +++ b/src/utc/capi-media-vision/tct-capi-media-vision-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/capi-message-port/CMakeLists.txt b/src/utc/capi-message-port/CMakeLists.txt index 571b0f95c..9347bc75c 100755 --- a/src/utc/capi-message-port/CMakeLists.txt +++ b/src/utc/capi-message-port/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-app-manager gobject-2.0 glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/capi-message-port/tct-capi-message-port-core.c b/src/utc/capi-message-port/tct-capi-message-port-core.c index 7c17366d9..89b85fbb0 100755 --- a/src/utc/capi-message-port/tct-capi-message-port-core.c +++ b/src/utc/capi-message-port/tct-capi-message-port-core.c @@ -28,94 +28,84 @@ #include #include -#include +char *__func_name = NULL; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) -{ - return true; -} - -static void app_control(app_control_h app_control, void *data) +static gboolean run_testcases(void *user_data) { - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) - { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; - } + __func_name = (char *)user_data; + int i; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); - for ( i = 0; tc_array[i].name; i++ ) - { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) - { + __result = 1; + for (i = 0; tc_array[i].name; i++) { + if (__func_name && !strncmp(__func_name, tc_array[i].name, strlen(__func_name))) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", __func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); - result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", __func_name); + tc_array[i].function(); - if ( tc_array[i].cleanup ) + if (tc_array[i].cleanup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", __func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + return FALSE; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + printf("Unknown testcase name: \"%s\"\n", __func_name); + + return FALSE; +} + +static bool ui_app_create(void *data) +{ + return true; } -static void app_terminate(void *data) +static void ui_app_control(app_control_h app_control, void *user_data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + int ret; + char *func_name = NULL; + + ret = app_control_get_extra_data(app_control, "smacktestkey", &func_name); + if (ret != APP_CONTROL_ERROR_NONE) { + printf("Failed to get extra data\n"); + ui_app_exit(); + } + + sleep(1); + g_idle_add(run_testcases, func_name); } int main(int argc, char *argv[]) { int ret = 0; - appdata_s ad = {0,}; - ui_app_lifecycle_callback_s event_callback = {0,}; - event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) - { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + + event_callback.create = ui_app_create; + event_callback.app_control = ui_app_control; + + ret = ui_app_main(argc, argv, &event_callback, NULL); + if (ret != APP_ERROR_NONE) { + printf("\n[Line No : %d]Unable to execute test cases: ui_app_main API call gets failed\n", __LINE__); } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); + FILE *fres = fopen("/tmp/utcresult","w"); + if (fres == NULL) { + printf("\n[Line No : %d]Unable to fopen utcresult\n", __LINE__); + } else { + fprintf(fres, "%d", __result); + fclose(fres); + } + free(__func_name); + if (__correct_value) + free(__correct_value); + return ret; -} \ No newline at end of file +} diff --git a/src/utc/capi-message-port/utc-capi-message-port.c b/src/utc/capi-message-port/utc-capi-message-port.c index 722a6c4f4..a3913e9e5 100755 --- a/src/utc/capi-message-port/utc-capi-message-port.c +++ b/src/utc/capi-message-port/utc-capi-message-port.c @@ -956,7 +956,7 @@ int utc_capi_message_port_send_message_with_local_port_p01(void) __correct_value = strdup(send_data); - res = message_port_send_message_with_local_port(__remote_app_id, __remote_port, __bundle, __port_id); + res = message_port_send_message_with_local_port(__remote_app_id, __remote_port, __bundle, __local_port_id); assert_eq_with_exit(res, MESSAGE_PORT_ERROR_NONE); @@ -1122,7 +1122,7 @@ int utc_capi_message_port_send_trusted_message_with_local_port_p01(void) __correct_value = strdup(send_data); - res = message_port_send_trusted_message_with_local_port(__remote_app_id, __remote_port, __bundle, __port_id); + res = message_port_send_trusted_message_with_local_port(__remote_app_id, __remote_port, __bundle, __local_port_id); assert_eq_with_exit(res, MESSAGE_PORT_ERROR_NONE); return 1; diff --git a/src/utc/capi-ui-inputmethod-manager/CMakeLists.txt b/src/utc/capi-ui-inputmethod-manager/CMakeLists.txt index e1cb5f65b..b2f204ea0 100755 --- a/src/utc/capi-ui-inputmethod-manager/CMakeLists.txt +++ b/src/utc/capi-ui-inputmethod-manager/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info bundle - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/capi-ui-inputmethod-manager/tct-capi-ui-inputmethod-manager-core.c b/src/utc/capi-ui-inputmethod-manager/tct-capi-ui-inputmethod-manager-core.c index 816ffe334..97d3471d0 100755 --- a/src/utc/capi-ui-inputmethod-manager/tct-capi-ui-inputmethod-manager-core.c +++ b/src/utc/capi-ui-inputmethod-manager/tct-capi-ui-inputmethod-manager-core.c @@ -28,94 +28,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/capi-ui-inputmethod/CMakeLists.txt b/src/utc/capi-ui-inputmethod/CMakeLists.txt index 30dda4f4d..ceb81de3e 100755 --- a/src/utc/capi-ui-inputmethod/CMakeLists.txt +++ b/src/utc/capi-ui-inputmethod/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info bundle - dlog elementary + dlog elementary ) INCLUDE_DIRECTORIES( diff --git a/src/utc/capi-ui-inputmethod/tct-capi-ui-inputmethod-core.c b/src/utc/capi-ui-inputmethod/tct-capi-ui-inputmethod-core.c index 339856ccf..eec8c167e 100755 --- a/src/utc/capi-ui-inputmethod/tct-capi-ui-inputmethod-core.c +++ b/src/utc/capi-ui-inputmethod/tct-capi-ui-inputmethod-core.c @@ -28,94 +28,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/connection/CMakeLists.txt b/src/utc/connection/CMakeLists.txt index 2b58e9f4a..b68ad9215 100755 --- a/src/utc/connection/CMakeLists.txt +++ b/src/utc/connection/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info glib-2.0 capi-network-wifi - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/connection/tct-connection-core.c b/src/utc/connection/tct-connection-core.c index 6f254014a..6cfa2fd52 100755 --- a/src/utc/connection/tct-connection-core.c +++ b/src/utc/connection/tct-connection-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/contacts-service2/CMakeLists.txt b/src/utc/contacts-service2/CMakeLists.txt index 243d1fca2..9c5a56c32 100755 --- a/src/utc/contacts-service2/CMakeLists.txt +++ b/src/utc/contacts-service2/CMakeLists.txt @@ -94,7 +94,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED accounts-svc storage glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/contacts-service2/tct-contacts-service2-core.c b/src/utc/contacts-service2/tct-contacts-service2-core.c index a14331f91..fe3f38400 100755 --- a/src/utc/contacts-service2/tct-contacts-service2-core.c +++ b/src/utc/contacts-service2/tct-contacts-service2-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/context/CMakeLists.txt b/src/utc/context/CMakeLists.txt index 2bf03eee7..ed6607d23 100755 --- a/src/utc/context/CMakeLists.txt +++ b/src/utc/context/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info bundle alarm-service - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/context/tct-context-core.c b/src/utc/context/tct-context-core.c index f36b8c90e..5351a5081 100755 --- a/src/utc/context/tct-context-core.c +++ b/src/utc/context/tct-context-core.c @@ -28,94 +28,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/dali-adaptor/tct-dali-adaptor-core.cpp b/src/utc/dali-adaptor/tct-dali-adaptor-core.cpp index 5eb71458c..562bbdf09 100755 --- a/src/utc/dali-adaptor/tct-dali-adaptor-core.cpp +++ b/src/utc/dali-adaptor/tct-dali-adaptor-core.cpp @@ -90,10 +90,10 @@ int main(int argc, const char *argv[]) } - FILE *fres = fopen("/tmp/tcresult","w"); + FILE *fres = fopen("/tmp/utcresult","w"); if( fres == NULL ) { - printf("Can't open /tmp/tcresult\n"); + printf("Can't open /tmp/utcresult\n"); return 3; } fprintf(fres, "%d", result); fclose(fres); diff --git a/src/utc/dali-core/tct-dali-core-core.cpp b/src/utc/dali-core/tct-dali-core-core.cpp index 891fe918a..33ef2ad30 100755 --- a/src/utc/dali-core/tct-dali-core-core.cpp +++ b/src/utc/dali-core/tct-dali-core-core.cpp @@ -83,10 +83,10 @@ int main(int argc, const char *argv[]) } - FILE *fres = fopen("/tmp/tcresult","w"); + FILE *fres = fopen("/tmp/utcresult","w"); if( fres == NULL ) { - printf("Can't open /tmp/tcresult\n"); + printf("Can't open /tmp/utcresult\n"); return 3; } fprintf(fres, "%d", result); diff --git a/src/utc/dali-toolkit/tct-dali-toolkit-core.cpp b/src/utc/dali-toolkit/tct-dali-toolkit-core.cpp index 0e96b68be..b834c2b0a 100755 --- a/src/utc/dali-toolkit/tct-dali-toolkit-core.cpp +++ b/src/utc/dali-toolkit/tct-dali-toolkit-core.cpp @@ -84,10 +84,10 @@ int main(int argc, const char *argv[]) - FILE *fres = fopen("/tmp/tcresult","w"); + FILE *fres = fopen("/tmp/utcresult","w"); if( fres == NULL ) { - printf("Can't open /tmp/tcresult\n"); + printf("Can't open /tmp/utcresult\n"); return 3; } fprintf(fres, "%d", result); diff --git a/src/utc/data-control/CMakeLists.txt b/src/utc/data-control/CMakeLists.txt index 8d5d7b0c4..34c87f713 100755 --- a/src/utc/data-control/CMakeLists.txt +++ b/src/utc/data-control/CMakeLists.txt @@ -17,7 +17,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle capi-base-common glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/data-control/tct-data-control-core.c b/src/utc/data-control/tct-data-control-core.c index 1428e7552..2ccc087a7 100755 --- a/src/utc/data-control/tct-data-control-core.c +++ b/src/utc/data-control/tct-data-control-core.c @@ -27,94 +27,83 @@ #include #include -#include +char *func_name = NULL; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) -{ - return true; -} - -static void app_control(app_control_h app_control, void *data) +static gboolean run_testcases(void *user_data) { - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) - { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; - } + func_name = (char *)user_data; + int i; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); - for ( i = 0; tc_array[i].name; i++ ) - { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) - { + __result = 1; + for (i = 0; tc_array[i].name; i++) { + if (func_name && !strncmp(func_name, tc_array[i].name, strlen(func_name))) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); - result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); + tc_array[i].function(); - if ( tc_array[i].cleanup ) + if (tc_array[i].cleanup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + return FALSE; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + printf("Unknown testcase name: \"%s\"\n", func_name); + + return FALSE; } -static void app_terminate(void *data) +static bool ui_app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + return true; +} + +static void ui_app_control(app_control_h app_control, void *user_data) +{ + int ret; + char *func_name = NULL; + + ret = app_control_get_extra_data(app_control, "smacktestkey", &func_name); + if (ret != APP_CONTROL_ERROR_NONE) { + printf("Failed to get extra data\n"); + ui_app_exit(); + } + + sleep(1); + + g_idle_add(run_testcases, func_name); } int main(int argc, char *argv[]) { int ret = 0; - appdata_s ad = {0,}; - ui_app_lifecycle_callback_s event_callback = {0,}; - event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) - { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + + event_callback.create = ui_app_create; + event_callback.app_control = ui_app_control; + + ret = ui_app_main(argc, argv, &event_callback, NULL); + if (ret != APP_ERROR_NONE) { + printf("\n[Line No : %d]Unable to execute test cases: ui_app_main API call gets failed\n", __LINE__); } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); + FILE *fres = fopen("/tmp/utcresult","w"); + if (fres == NULL) { + printf("\n[Line No : %d]Unable to fopen utcresult\n", __LINE__); + } else { + fprintf(fres, "%d", __result); + fclose(fres); + } + free(func_name); + return ret; -} \ No newline at end of file +} diff --git a/src/utc/device/CMakeLists.txt b/src/utc/device/CMakeLists.txt index 598d58955..44a4156e3 100755 --- a/src/utc/device/CMakeLists.txt +++ b/src/utc/device/CMakeLists.txt @@ -18,7 +18,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/device/tct-device-core.c b/src/utc/device/tct-device-core.c index b3fd1195f..0272cd568 100755 --- a/src/utc/device/tct-device-core.c +++ b/src/utc/device/tct-device-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/dlog/CMakeLists.txt b/src/utc/dlog/CMakeLists.txt index 71283ce0a..597e437e6 100755 --- a/src/utc/dlog/CMakeLists.txt +++ b/src/utc/dlog/CMakeLists.txt @@ -11,7 +11,6 @@ SET(TC_SOURCES PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED ${CAPI_LIB} - elementary capi-appfw-application capi-system-info glib-2.0 diff --git a/src/utc/dlog/tct-dlog-core.c b/src/utc/dlog/tct-dlog-core.c index 3ada0eceb..7e1c5741b 100755 --- a/src/utc/dlog/tct-dlog-core.c +++ b/src/utc/dlog/tct-dlog-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/efl-ext/CMakeLists.txt b/src/utc/efl-ext/CMakeLists.txt index 5c2d130ab..73324a73f 100755 --- a/src/utc/efl-ext/CMakeLists.txt +++ b/src/utc/efl-ext/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/efl-ext/tct-efl-ext-core.c b/src/utc/efl-ext/tct-efl-ext-core.c index 37e94c574..b1ad7bfe6 100755 --- a/src/utc/efl-ext/tct-efl-ext-core.c +++ b/src/utc/efl-ext/tct-efl-ext-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/efl-util/CMakeLists.txt b/src/utc/efl-util/CMakeLists.txt index 975d4e3fe..fb6ea320d 100755 --- a/src/utc/efl-util/CMakeLists.txt +++ b/src/utc/efl-util/CMakeLists.txt @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/efl-util/tct-efl-util-core.c b/src/utc/efl-util/tct-efl-util-core.c index 257e4a29c..d4da9814f 100755 --- a/src/utc/efl-util/tct-efl-util-core.c +++ b/src/utc/efl-util/tct-efl-util-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/email/CMakeLists.txt b/src/utc/email/CMakeLists.txt index 2ddf2ce27..a78452c2e 100755 --- a/src/utc/email/CMakeLists.txt +++ b/src/utc/email/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info glib-2.0 storage - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/email/tct-email-core.c b/src/utc/email/tct-email-core.c index 3a7696941..6cde06753 100755 --- a/src/utc/email/tct-email-core.c +++ b/src/utc/email/tct-email-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/eom/CMakeLists.txt b/src/utc/eom/CMakeLists.txt index 222148d04..629bbbe73 100755 --- a/src/utc/eom/CMakeLists.txt +++ b/src/utc/eom/CMakeLists.txt @@ -18,7 +18,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 elementary - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/eom/tct-eom-core.c b/src/utc/eom/tct-eom-core.c index e103554be..962cd5371 100755 --- a/src/utc/eom/tct-eom-core.c +++ b/src/utc/eom/tct-eom-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/geofence-manager/CMakeLists.txt b/src/utc/geofence-manager/CMakeLists.txt index 0b85a7813..62613e169 100755 --- a/src/utc/geofence-manager/CMakeLists.txt +++ b/src/utc/geofence-manager/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info bundle glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/geofence-manager/tct-geofence-manager-core.c b/src/utc/geofence-manager/tct-geofence-manager-core.c index 424c5e65b..b8ed3aacb 100755 --- a/src/utc/geofence-manager/tct-geofence-manager-core.c +++ b/src/utc/geofence-manager/tct-geofence-manager-core.c @@ -28,94 +28,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/image-util/CMakeLists.txt b/src/utc/image-util/CMakeLists.txt index 6d3ac9386..b7b3d98ae 100755 --- a/src/utc/image-util/CMakeLists.txt +++ b/src/utc/image-util/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info storage glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/image-util/tct-image-util-core.c b/src/utc/image-util/tct-image-util-core.c index 8f43d2f71..8e8e27866 100755 --- a/src/utc/image-util/tct-image-util-core.c +++ b/src/utc/image-util/tct-image-util-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/key-manager/CMakeLists.txt b/src/utc/key-manager/CMakeLists.txt index f3747bd59..659ac3e95 100755 --- a/src/utc/key-manager/CMakeLists.txt +++ b/src/utc/key-manager/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info glib-2.0 storage - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/key-manager/tct-key-manager-core.c b/src/utc/key-manager/tct-key-manager-core.c index 5b34002ed..74944383c 100755 --- a/src/utc/key-manager/tct-key-manager-core.c +++ b/src/utc/key-manager/tct-key-manager-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/libfeedback/CMakeLists.txt b/src/utc/libfeedback/CMakeLists.txt index 38c4d317c..e6b89f8f4 100755 --- a/src/utc/libfeedback/CMakeLists.txt +++ b/src/utc/libfeedback/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info glib-2.0 capi-base-common - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/libfeedback/tct-libfeedback-core.c b/src/utc/libfeedback/tct-libfeedback-core.c index 63b08b7ee..117513d15 100755 --- a/src/utc/libfeedback/tct-libfeedback-core.c +++ b/src/utc/libfeedback/tct-libfeedback-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/libstorage/CMakeLists.txt b/src/utc/libstorage/CMakeLists.txt index 589ed460a..4fef39f16 100755 --- a/src/utc/libstorage/CMakeLists.txt +++ b/src/utc/libstorage/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info glib-2.0 capi-base-common - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/libstorage/tct-libstorage-core.c b/src/utc/libstorage/tct-libstorage-core.c index 75a869880..d8994e09c 100755 --- a/src/utc/libstorage/tct-libstorage-core.c +++ b/src/utc/libstorage/tct-libstorage-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/libstorage64/CMakeLists.txt b/src/utc/libstorage64/CMakeLists.txt index 4bc6f335b..5854debd2 100755 --- a/src/utc/libstorage64/CMakeLists.txt +++ b/src/utc/libstorage64/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info glib-2.0 capi-base-common - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/libstorage64/tct-libstorage64-core.c b/src/utc/libstorage64/tct-libstorage64-core.c index 7977b048a..014d52f34 100755 --- a/src/utc/libstorage64/tct-libstorage64-core.c +++ b/src/utc/libstorage64/tct-libstorage64-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/location-manager/CMakeLists.txt b/src/utc/location-manager/CMakeLists.txt index a2e4aceae..513d753ae 100755 --- a/src/utc/location-manager/CMakeLists.txt +++ b/src/utc/location-manager/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/location-manager/tct-location-manager-core.c b/src/utc/location-manager/tct-location-manager-core.c index 19b4bb641..69a82147a 100755 --- a/src/utc/location-manager/tct-location-manager-core.c +++ b/src/utc/location-manager/tct-location-manager-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/media-content/CMakeLists.txt b/src/utc/media-content/CMakeLists.txt index 749a5f553..13d47f97e 100755 --- a/src/utc/media-content/CMakeLists.txt +++ b/src/utc/media-content/CMakeLists.txt @@ -29,7 +29,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info glib-2.0 storage - dlog elementary + dlog ) ADD_DEFINITIONS( -DCOMMERCIAL_FEATURE ) diff --git a/src/utc/media-content/tct-media-content-core.c b/src/utc/media-content/tct-media-content-core.c index 68c76a42b..2f635209f 100755 --- a/src/utc/media-content/tct-media-content-core.c +++ b/src/utc/media-content/tct-media-content-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/media-controller/CMakeLists.txt b/src/utc/media-controller/CMakeLists.txt index 99b3a7da9..ad09fb80d 100755 --- a/src/utc/media-controller/CMakeLists.txt +++ b/src/utc/media-controller/CMakeLists.txt @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) ADD_DEFINITIONS( -DCOMMERCIAL_FEATURE ) diff --git a/src/utc/media-controller/tct-media-controller-core.c b/src/utc/media-controller/tct-media-controller-core.c index d8d62a6aa..5f15038eb 100755 --- a/src/utc/media-controller/tct-media-controller-core.c +++ b/src/utc/media-controller/tct-media-controller-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/media-key/CMakeLists.txt b/src/utc/media-key/CMakeLists.txt index 171a52530..afd6f8537 100755 --- a/src/utc/media-key/CMakeLists.txt +++ b/src/utc/media-key/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/media-key/tct-media-key-core.c b/src/utc/media-key/tct-media-key-core.c index 8b59406f1..d927a45d7 100755 --- a/src/utc/media-key/tct-media-key-core.c +++ b/src/utc/media-key/tct-media-key-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/mediacodec/CMakeLists.txt b/src/utc/mediacodec/CMakeLists.txt index 317ee93f6..fefd7235f 100755 --- a/src/utc/mediacodec/CMakeLists.txt +++ b/src/utc/mediacodec/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info glib-2.0 storage - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/mediacodec/tct-mediacodec-core.c b/src/utc/mediacodec/tct-mediacodec-core.c index 03ed306ee..2693e0b80 100755 --- a/src/utc/mediacodec/tct-mediacodec-core.c +++ b/src/utc/mediacodec/tct-mediacodec-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); if ( tc_array[i].startup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/messages/CMakeLists.txt b/src/utc/messages/CMakeLists.txt index a46942856..208b5dfd5 100755 --- a/src/utc/messages/CMakeLists.txt +++ b/src/utc/messages/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info glib-2.0 storage - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/messages/tct-messages-core.c b/src/utc/messages/tct-messages-core.c index ad6c228f0..24717cf70 100755 --- a/src/utc/messages/tct-messages-core.c +++ b/src/utc/messages/tct-messages-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/messages/utc-messaging-messages.c b/src/utc/messages/utc-messaging-messages.c index 2e5e2055c..6de3b8382 100755 --- a/src/utc/messages/utc-messaging-messages.c +++ b/src/utc/messages/utc-messaging-messages.c @@ -177,35 +177,19 @@ void utc_messaging_messages_startup(void) void utc_messaging_messages_cleanup(void) { /* end of TC */ - if (_msg_mms) { + if(_msg_mms){ messages_destroy_message(_msg_mms); - _msg_mms = NULL; } - - if (_msg_sms) { + if(_msg_sms){ messages_destroy_message(_msg_sms); - _msg_sms = NULL; } - - if (_svc) { + if(_svc){ messages_close_service(_svc); _svc = NULL; } - - if (audio_path) { - free(audio_path); - audio_path = NULL; - } - - if (video_path) { - free(video_path); - video_path = NULL; - } - - if (image_path) { - free(image_path); - image_path = NULL; - } + if(audio_path) free(audio_path); + if(video_path) free(video_path); + if(image_path) free(image_path); } @@ -491,7 +475,7 @@ int utc_messaging_messages_add_address_p(void) int utc_messaging_messages_add_address_n(void) { int ret = MESSAGES_ERROR_NONE; - message_prepare msg = {0,0,0,0,0}; + message_prepare msg = {0,0,0,0}; if(is_sms_supported) { ret = msg_sms_prepare(msg); diff --git a/src/utc/metadata-editor/CMakeLists.txt b/src/utc/metadata-editor/CMakeLists.txt index 7a1328157..058ae8e32 100755 --- a/src/utc/metadata-editor/CMakeLists.txt +++ b/src/utc/metadata-editor/CMakeLists.txt @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info storage - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/metadata-editor/tct-metadata-editor-core.c b/src/utc/metadata-editor/tct-metadata-editor-core.c index 16253fdd4..761c84414 100755 --- a/src/utc/metadata-editor/tct-metadata-editor-core.c +++ b/src/utc/metadata-editor/tct-metadata-editor-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/metadata-extractor/CMakeLists.txt b/src/utc/metadata-extractor/CMakeLists.txt index 8ed0429fc..b169fe368 100755 --- a/src/utc/metadata-extractor/CMakeLists.txt +++ b/src/utc/metadata-extractor/CMakeLists.txt @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info storage - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/metadata-extractor/tct-metadata-extractor-core.c b/src/utc/metadata-extractor/tct-metadata-extractor-core.c index 1b3ccaeb4..3b14d11ec 100755 --- a/src/utc/metadata-extractor/tct-metadata-extractor-core.c +++ b/src/utc/metadata-extractor/tct-metadata-extractor-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/mime-type/CMakeLists.txt b/src/utc/mime-type/CMakeLists.txt index b23643fc4..bf3ab4345 100755 --- a/src/utc/mime-type/CMakeLists.txt +++ b/src/utc/mime-type/CMakeLists.txt @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/mime-type/tct-mime-type-core.c b/src/utc/mime-type/tct-mime-type-core.c index 7f2ee0b4f..1b834f4cf 100755 --- a/src/utc/mime-type/tct-mime-type-core.c +++ b/src/utc/mime-type/tct-mime-type-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/minicontrol/CMakeLists.txt b/src/utc/minicontrol/CMakeLists.txt index 52c2c3d69..1bb91f715 100755 --- a/src/utc/minicontrol/CMakeLists.txt +++ b/src/utc/minicontrol/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 capi-system-info elementary - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/minicontrol/tct-minicontrol-core.c b/src/utc/minicontrol/tct-minicontrol-core.c index 4e264985e..55608cc13 100755 --- a/src/utc/minicontrol/tct-minicontrol-core.c +++ b/src/utc/minicontrol/tct-minicontrol-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/motion/CMakeLists.txt b/src/utc/motion/CMakeLists.txt index aac4bba50..c8e4de5bb 100755 --- a/src/utc/motion/CMakeLists.txt +++ b/src/utc/motion/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/motion/tct-motion-core.c b/src/utc/motion/tct-motion-core.c index 5ebad81ea..993bc31ab 100755 --- a/src/utc/motion/tct-motion-core.c +++ b/src/utc/motion/tct-motion-core.c @@ -28,94 +28,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/native-common/CMakeLists.txt b/src/utc/native-common/CMakeLists.txt index 6f9682cc5..8122fbc4e 100755 --- a/src/utc/native-common/CMakeLists.txt +++ b/src/utc/native-common/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info glib-2.0 capi-base-common - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/native-common/tct-native-common-core.c b/src/utc/native-common/tct-native-common-core.c index 16db405c8..e38a4acc8 100755 --- a/src/utc/native-common/tct-native-common-core.c +++ b/src/utc/native-common/tct-native-common-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/nfc/CMakeLists.txt b/src/utc/nfc/CMakeLists.txt index 5372082e1..a4e77713d 100755 --- a/src/utc/nfc/CMakeLists.txt +++ b/src/utc/nfc/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/nfc/tct-nfc-core.c b/src/utc/nfc/tct-nfc-core.c index 3d69c0a31..df427c411 100755 --- a/src/utc/nfc/tct-nfc-core.c +++ b/src/utc/nfc/tct-nfc-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/notification/CMakeLists.txt b/src/utc/notification/CMakeLists.txt index b0d120262..0de953352 100755 --- a/src/utc/notification/CMakeLists.txt +++ b/src/utc/notification/CMakeLists.txt @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/notification/tct-notification-core.c b/src/utc/notification/tct-notification-core.c index ad4c2306e..00f2dae95 100755 --- a/src/utc/notification/tct-notification-core.c +++ b/src/utc/notification/tct-notification-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/oauth2/CMakeLists.txt b/src/utc/oauth2/CMakeLists.txt index 591e935e5..cc54e0cae 100755 --- a/src/utc/oauth2/CMakeLists.txt +++ b/src/utc/oauth2/CMakeLists.txt @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/oauth2/tct-oauth2-core.c b/src/utc/oauth2/tct-oauth2-core.c index 369435c28..076950b8c 100755 --- a/src/utc/oauth2/tct-oauth2-core.c +++ b/src/utc/oauth2/tct-oauth2-core.c @@ -28,94 +28,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/package-manager/CMakeLists.txt b/src/utc/package-manager/CMakeLists.txt index ae900e078..82b7c8e60 100755 --- a/src/utc/package-manager/CMakeLists.txt +++ b/src/utc/package-manager/CMakeLists.txt @@ -55,7 +55,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/package-manager/tct-package-manager-core.c b/src/utc/package-manager/tct-package-manager-core.c index 431a2a28f..04e2a3f67 100755 --- a/src/utc/package-manager/tct-package-manager-core.c +++ b/src/utc/package-manager/tct-package-manager-core.c @@ -29,94 +29,83 @@ #include "tct-package-manager-core.h" #include "assert_common.h" -#include - -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +static gboolean run_testcases(void *user_data) { - return true; -} + char *func_name = (char *)user_data; + int i; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) - { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; - } + utc_result = -1; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); - for ( i = 0; tc_array[i].name; i++ ) - { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) - { + for (i = 0; tc_array[i].name; i++) { + if (func_name && !strncmp(func_name, tc_array[i].name, strlen(func_name))) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); - result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); + tc_array[i].function(); - if ( tc_array[i].cleanup ) + if (tc_array[i].cleanup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + free(func_name); + return FALSE; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + printf("Unknown testcase name: \"%s\"\n", func_name); + if (func_name) + free(func_name); + + return FALSE; +} + +static bool ui_app_create(void *data) +{ + return true; } -static void app_terminate(void *data) +static void ui_app_control(app_control_h app_control, void *user_data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + int ret; + char *func_name = NULL; + + ret = app_control_get_extra_data(app_control, "smacktestkey", &func_name); + if (ret != APP_CONTROL_ERROR_NONE) { + printf("Failed to get extra data\n"); + ui_app_exit(); + } + + sleep(1); + g_idle_add(run_testcases, func_name); } int main(int argc, char *argv[]) { int ret = 0; - appdata_s ad = {0,}; - ui_app_lifecycle_callback_s event_callback = {0,}; - event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) - { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); + + event_callback.create = ui_app_create; + event_callback.app_control = ui_app_control; + + ret = ui_app_main(argc, argv, &event_callback, NULL); + if (ret != APP_ERROR_NONE) { + printf("\n[Line No : %d]Unable to execute test cases: ui_app_main API call gets failed\n", __LINE__); + } + + FILE *fres = fopen("/tmp/utcresult","w"); + if (fres == NULL) { + printf("\n[Line No : %d]Unable to open file\n", __LINE__); return ret; } + fprintf(fres, "%d", utc_result); + fclose(fres); - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); return ret; -} \ No newline at end of file +} diff --git a/src/utc/phonenumber-utils/CMakeLists.txt b/src/utc/phonenumber-utils/CMakeLists.txt index f2bbc1aea..c53287521 100755 --- a/src/utc/phonenumber-utils/CMakeLists.txt +++ b/src/utc/phonenumber-utils/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info bundle - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/phonenumber-utils/tct-phonenumber-utils-core.c b/src/utc/phonenumber-utils/tct-phonenumber-utils-core.c index cd6854188..46fb1a2ed 100755 --- a/src/utc/phonenumber-utils/tct-phonenumber-utils-core.c +++ b/src/utc/phonenumber-utils/tct-phonenumber-utils-core.c @@ -28,94 +28,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/player/CMakeLists.txt b/src/utc/player/CMakeLists.txt index f38f74e93..e2e4487db 100755 --- a/src/utc/player/CMakeLists.txt +++ b/src/utc/player/CMakeLists.txt @@ -24,7 +24,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED ecore evas storage - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/player/tct-player-core.c b/src/utc/player/tct-player-core.c index c6493a8ce..e6b268368 100755 --- a/src/utc/player/tct-player-core.c +++ b/src/utc/player/tct-player-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/privilege-info/CMakeLists.txt b/src/utc/privilege-info/CMakeLists.txt index 2b69697a3..fc2805876 100755 --- a/src/utc/privilege-info/CMakeLists.txt +++ b/src/utc/privilege-info/CMakeLists.txt @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog capi-security-privilege-manager ) diff --git a/src/utc/privilege-info/tct-privilege-info-core.c b/src/utc/privilege-info/tct-privilege-info-core.c index ca09f860f..598ca4cab 100755 --- a/src/utc/privilege-info/tct-privilege-info-core.c +++ b/src/utc/privilege-info/tct-privilege-info-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/push/CMakeLists.txt b/src/utc/push/CMakeLists.txt index fed1b7d50..02f99e2e3 100755 --- a/src/utc/push/CMakeLists.txt +++ b/src/utc/push/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 libcurl json-glib-1.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( diff --git a/src/utc/push/tct-push-core.c b/src/utc/push/tct-push-core.c index 98dfd1200..30d73eb00 100755 --- a/src/utc/push/tct-push-core.c +++ b/src/utc/push/tct-push-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/radio/CMakeLists.txt b/src/utc/radio/CMakeLists.txt index 069de1d02..ed0c5fdc4 100755 --- a/src/utc/radio/CMakeLists.txt +++ b/src/utc/radio/CMakeLists.txt @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/radio/tct-radio-core.c b/src/utc/radio/tct-radio-core.c index cf90ef832..b92c0fffc 100755 --- a/src/utc/radio/tct-radio-core.c +++ b/src/utc/radio/tct-radio-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/recorder/CMakeLists.txt b/src/utc/recorder/CMakeLists.txt index 5b278bfe1..526634242 100755 --- a/src/utc/recorder/CMakeLists.txt +++ b/src/utc/recorder/CMakeLists.txt @@ -19,7 +19,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED gobject-2.0 capi-media-camera storage - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/recorder/tct-recorder-core.c b/src/utc/recorder/tct-recorder-core.c index df2f27d98..c5cbd2371 100755 --- a/src/utc/recorder/tct-recorder-core.c +++ b/src/utc/recorder/tct-recorder-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/runtime-info/CMakeLists.txt b/src/utc/runtime-info/CMakeLists.txt index 5325aeb27..5af750b37 100755 --- a/src/utc/runtime-info/CMakeLists.txt +++ b/src/utc/runtime-info/CMakeLists.txt @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/runtime-info/tct-runtime-info-core.c b/src/utc/runtime-info/tct-runtime-info-core.c index cde99e1f9..a5415560c 100755 --- a/src/utc/runtime-info/tct-runtime-info-core.c +++ b/src/utc/runtime-info/tct-runtime-info-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/screen-mirroring/CMakeLists.txt b/src/utc/screen-mirroring/CMakeLists.txt index dcac1248b..6a7f28240 100755 --- a/src/utc/screen-mirroring/CMakeLists.txt +++ b/src/utc/screen-mirroring/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info glib-2.0 bundle - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/screen-mirroring/tct-screen-mirroring-core.c b/src/utc/screen-mirroring/tct-screen-mirroring-core.c index f7c232941..a54be7bb3 100755 --- a/src/utc/screen-mirroring/tct-screen-mirroring-core.c +++ b/src/utc/screen-mirroring/tct-screen-mirroring-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/sensor/CMakeLists.txt b/src/utc/sensor/CMakeLists.txt index 9e31db851..debdec2e2 100755 --- a/src/utc/sensor/CMakeLists.txt +++ b/src/utc/sensor/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/sensor/tct-sensor-core.c b/src/utc/sensor/tct-sensor-core.c index 482768792..7418fe52d 100755 --- a/src/utc/sensor/tct-sensor-core.c +++ b/src/utc/sensor/tct-sensor-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/service-adaptor-client/CMakeLists.txt b/src/utc/service-adaptor-client/CMakeLists.txt index f9f68a0e6..e83fe7dc4 100755 --- a/src/utc/service-adaptor-client/CMakeLists.txt +++ b/src/utc/service-adaptor-client/CMakeLists.txt @@ -22,7 +22,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED gio-2.0 gthread-2.0 capi-base-common - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/service-adaptor-client/tct-service-adaptor-client-core.c b/src/utc/service-adaptor-client/tct-service-adaptor-client-core.c index f89b7ecf6..4ad47aea8 100755 --- a/src/utc/service-adaptor-client/tct-service-adaptor-client-core.c +++ b/src/utc/service-adaptor-client/tct-service-adaptor-client-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/shortcut/CMakeLists.txt b/src/utc/shortcut/CMakeLists.txt index afeeec041..b54b0274d 100755 --- a/src/utc/shortcut/CMakeLists.txt +++ b/src/utc/shortcut/CMakeLists.txt @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/shortcut/tct-shortcut-core.c b/src/utc/shortcut/tct-shortcut-core.c index 7d821bc7d..12a4b4586 100755 --- a/src/utc/shortcut/tct-shortcut-core.c +++ b/src/utc/shortcut/tct-shortcut-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/smartcard/CMakeLists.txt b/src/utc/smartcard/CMakeLists.txt index 515974efc..620f20f07 100755 --- a/src/utc/smartcard/CMakeLists.txt +++ b/src/utc/smartcard/CMakeLists.txt @@ -18,7 +18,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info bundle - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/smartcard/tct-smartcard-core.c b/src/utc/smartcard/tct-smartcard-core.c index 1bf0ae001..bde36f7dc 100755 --- a/src/utc/smartcard/tct-smartcard-core.c +++ b/src/utc/smartcard/tct-smartcard-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/sound-manager/CMakeLists.txt b/src/utc/sound-manager/CMakeLists.txt index b128d98a4..163d60005 100755 --- a/src/utc/sound-manager/CMakeLists.txt +++ b/src/utc/sound-manager/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/sound-manager/tct-sound-manager-core.c b/src/utc/sound-manager/tct-sound-manager-core.c index 34ace8a45..a80d1a79e 100755 --- a/src/utc/sound-manager/tct-sound-manager-core.c +++ b/src/utc/sound-manager/tct-sound-manager-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/stt/CMakeLists.txt b/src/utc/stt/CMakeLists.txt index 1c2c82e98..b1d38299f 100755 --- a/src/utc/stt/CMakeLists.txt +++ b/src/utc/stt/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info glib-2.0 elementary - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/stt/tct-stt-core.c b/src/utc/stt/tct-stt-core.c index 04b64f9ee..23032eda6 100755 --- a/src/utc/stt/tct-stt-core.c +++ b/src/utc/stt/tct-stt-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/sync-manager/CMakeLists.txt b/src/utc/sync-manager/CMakeLists.txt index eb137b747..ea0a8be0c 100755 --- a/src/utc/sync-manager/CMakeLists.txt +++ b/src/utc/sync-manager/CMakeLists.txt @@ -17,7 +17,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-base-common bundle glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/sync-manager/tct-sync-manager-core.c b/src/utc/sync-manager/tct-sync-manager-core.c index 5a2a005b4..f57e1253b 100755 --- a/src/utc/sync-manager/tct-sync-manager-core.c +++ b/src/utc/sync-manager/tct-sync-manager-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/system-info/CMakeLists.txt b/src/utc/system-info/CMakeLists.txt index 08d963ae1..cdd65cf61 100755 --- a/src/utc/system-info/CMakeLists.txt +++ b/src/utc/system-info/CMakeLists.txt @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/system-info/tct-system-info-core.c b/src/utc/system-info/tct-system-info-core.c index f3c158717..f5a028858 100755 --- a/src/utc/system-info/tct-system-info-core.c +++ b/src/utc/system-info/tct-system-info-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/system-settings/CMakeLists.txt b/src/utc/system-settings/CMakeLists.txt index f30699dcc..9ed1adacf 100755 --- a/src/utc/system-settings/CMakeLists.txt +++ b/src/utc/system-settings/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info glib-2.0 storage - dlog elementary + dlog ) INCLUDE_DIRECTORIES( diff --git a/src/utc/system-settings/tct-system-settings-core.c b/src/utc/system-settings/tct-system-settings-core.c index abdbb6111..e9947ccea 100755 --- a/src/utc/system-settings/tct-system-settings-core.c +++ b/src/utc/system-settings/tct-system-settings-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/tbm/CMakeLists.txt b/src/utc/tbm/CMakeLists.txt index afba16e5e..5ec636917 100755 --- a/src/utc/tbm/CMakeLists.txt +++ b/src/utc/tbm/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/tbm/tct-tbm-core.c b/src/utc/tbm/tct-tbm-core.c index 47d6e09cf..f9527ad59 100755 --- a/src/utc/tbm/tct-tbm-core.c +++ b/src/utc/tbm/tct-tbm-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/telephony/CMakeLists.txt b/src/utc/telephony/CMakeLists.txt index f9012637b..5bd6e3c33 100755 --- a/src/utc/telephony/CMakeLists.txt +++ b/src/utc/telephony/CMakeLists.txt @@ -17,7 +17,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/telephony/tct-telephony-core.c b/src/utc/telephony/tct-telephony-core.c index 54fb47970..71f7e5a2d 100755 --- a/src/utc/telephony/tct-telephony-core.c +++ b/src/utc/telephony/tct-telephony-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/thumbnail-util/CMakeLists.txt b/src/utc/thumbnail-util/CMakeLists.txt index d17544288..8b917b95d 100755 --- a/src/utc/thumbnail-util/CMakeLists.txt +++ b/src/utc/thumbnail-util/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED bundle glib-2.0 storage - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/thumbnail-util/tct-thumbnail-util-core.c b/src/utc/thumbnail-util/tct-thumbnail-util-core.c index baa51d0ee..449009ddd 100755 --- a/src/utc/thumbnail-util/tct-thumbnail-util-core.c +++ b/src/utc/thumbnail-util/tct-thumbnail-util-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/tone-player/CMakeLists.txt b/src/utc/tone-player/CMakeLists.txt index 34ceba989..8b57e0544 100755 --- a/src/utc/tone-player/CMakeLists.txt +++ b/src/utc/tone-player/CMakeLists.txt @@ -13,7 +13,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/tone-player/tct-tone-player-core.c b/src/utc/tone-player/tct-tone-player-core.c index e462cdc0f..fe97487a4 100755 --- a/src/utc/tone-player/tct-tone-player-core.c +++ b/src/utc/tone-player/tct-tone-player-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/trace/CMakeLists.txt b/src/utc/trace/CMakeLists.txt index d9fbe9951..b31d875c6 100755 --- a/src/utc/trace/CMakeLists.txt +++ b/src/utc/trace/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info bundle - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/trace/tct-trace-core.c b/src/utc/trace/tct-trace-core.c index 8f7dc71d2..a29a3f1ab 100755 --- a/src/utc/trace/tct-trace-core.c +++ b/src/utc/trace/tct-trace-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/tts/CMakeLists.txt b/src/utc/tts/CMakeLists.txt index 0402fc1cf..f450a03ea 100755 --- a/src/utc/tts/CMakeLists.txt +++ b/src/utc/tts/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED ecore elementary glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/tts/tct-tts-core.c b/src/utc/tts/tct-tts-core.c index 378f56192..a92144ee7 100755 --- a/src/utc/tts/tct-tts-core.c +++ b/src/utc/tts/tct-tts-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/url-download/CMakeLists.txt b/src/utc/url-download/CMakeLists.txt index db65b9f86..ad89c054b 100755 --- a/src/utc/url-download/CMakeLists.txt +++ b/src/utc/url-download/CMakeLists.txt @@ -56,7 +56,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 gobject-2.0 storage - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/url-download/tct-url-download-core.c b/src/utc/url-download/tct-url-download-core.c index 287a2a52d..c46173038 100755 --- a/src/utc/url-download/tct-url-download-core.c +++ b/src/utc/url-download/tct-url-download-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/video-util/CMakeLists.txt b/src/utc/video-util/CMakeLists.txt index c52111e3b..c11854f7d 100755 --- a/src/utc/video-util/CMakeLists.txt +++ b/src/utc/video-util/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info glib-2.0 storage - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/video-util/tct-video-util-core.c b/src/utc/video-util/tct-video-util-core.c index 294eadc02..157c18f43 100755 --- a/src/utc/video-util/tct-video-util-core.c +++ b/src/utc/video-util/tct-video-util-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/voice-control-elm/CMakeLists.txt b/src/utc/voice-control-elm/CMakeLists.txt index dd0d7d35f..1502e7982 100755 --- a/src/utc/voice-control-elm/CMakeLists.txt +++ b/src/utc/voice-control-elm/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED glib-2.0 evas elementary - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/voice-control-elm/tct-voice-control-elm-core.c b/src/utc/voice-control-elm/tct-voice-control-elm-core.c index 8f12f8b99..9e3ac60a0 100755 --- a/src/utc/voice-control-elm/tct-voice-control-elm-core.c +++ b/src/utc/voice-control-elm/tct-voice-control-elm-core.c @@ -28,94 +28,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/voice-control/CMakeLists.txt b/src/utc/voice-control/CMakeLists.txt index 16ab3a791..0b87137bc 100755 --- a/src/utc/voice-control/CMakeLists.txt +++ b/src/utc/voice-control/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info bundle elementary - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/voice-control/tct-voice-control-core.c b/src/utc/voice-control/tct-voice-control-core.c index 5be879cdf..f26af80f4 100755 --- a/src/utc/voice-control/tct-voice-control-core.c +++ b/src/utc/voice-control/tct-voice-control-core.c @@ -27,94 +27,99 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/wav-player/CMakeLists.txt b/src/utc/wav-player/CMakeLists.txt index 5341c7ea5..749dc47ea 100755 --- a/src/utc/wav-player/CMakeLists.txt +++ b/src/utc/wav-player/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-system-info glib-2.0 storage - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/wav-player/tct-wav-player-core.c b/src/utc/wav-player/tct-wav-player-core.c index f505a8786..45a005200 100755 --- a/src/utc/wav-player/tct-wav-player-core.c +++ b/src/utc/wav-player/tct-wav-player-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/webkit2/CMakeLists.txt b/src/utc/webkit2/CMakeLists.txt index f9e93269b..5c3e06985 100755 --- a/src/utc/webkit2/CMakeLists.txt +++ b/src/utc/webkit2/CMakeLists.txt @@ -140,7 +140,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED gobject-2.0 x11 storage - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/webkit2/tct-webkit2-core.c b/src/utc/webkit2/tct-webkit2-core.c index d73118029..179a476d6 100755 --- a/src/utc/webkit2/tct-webkit2-core.c +++ b/src/utc/webkit2/tct-webkit2-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/widget_service/CMakeLists.txt b/src/utc/widget_service/CMakeLists.txt index cbc43ff02..06a7ee384 100755 --- a/src/utc/widget_service/CMakeLists.txt +++ b/src/utc/widget_service/CMakeLists.txt @@ -14,7 +14,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application elementary widget_viewer_evas - dlog elementary + dlog capi-system-info ) INCLUDE_DIRECTORIES( diff --git a/src/utc/widget_service/tct-widget_service-core.c b/src/utc/widget_service/tct-widget_service-core.c index 41865aa1b..0adcbba4a 100755 --- a/src/utc/widget_service/tct-widget_service-core.c +++ b/src/utc/widget_service/tct-widget_service-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/widget_viewer_evas/CMakeLists.txt b/src/utc/widget_viewer_evas/CMakeLists.txt index 54698599f..f8cbbd048 100755 --- a/src/utc/widget_viewer_evas/CMakeLists.txt +++ b/src/utc/widget_viewer_evas/CMakeLists.txt @@ -15,7 +15,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application bundle capi-system-info - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/widget_viewer_evas/tct-widget_viewer_evas-core.c b/src/utc/widget_viewer_evas/tct-widget_viewer_evas-core.c index f23637287..7cdfad4a0 100755 --- a/src/utc/widget_viewer_evas/tct-widget_viewer_evas-core.c +++ b/src/utc/widget_viewer_evas/tct-widget_viewer_evas-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/wifi-direct/CMakeLists.txt b/src/utc/wifi-direct/CMakeLists.txt index 77558fe96..eec824f8d 100755 --- a/src/utc/wifi-direct/CMakeLists.txt +++ b/src/utc/wifi-direct/CMakeLists.txt @@ -27,7 +27,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/wifi-direct/tct-wifi-direct-core.c b/src/utc/wifi-direct/tct-wifi-direct-core.c index 2efeeebcb..e42b6fba1 100755 --- a/src/utc/wifi-direct/tct-wifi-direct-core.c +++ b/src/utc/wifi-direct/tct-wifi-direct-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +} diff --git a/src/utc/wifi/CMakeLists.txt b/src/utc/wifi/CMakeLists.txt index 4a5ac1efe..58ecbca04 100755 --- a/src/utc/wifi/CMakeLists.txt +++ b/src/utc/wifi/CMakeLists.txt @@ -16,7 +16,7 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED capi-appfw-application capi-system-info glib-2.0 - dlog elementary + dlog ) INCLUDE_DIRECTORIES( ${${CAPI_LIB}_INCLUDE_DIRS} diff --git a/src/utc/wifi/tct-wifi-core.c b/src/utc/wifi/tct-wifi-core.c index 47cc6989b..0890f72a4 100755 --- a/src/utc/wifi/tct-wifi-core.c +++ b/src/utc/wifi/tct-wifi-core.c @@ -27,94 +27,100 @@ #include #include -#include +static char* key; +static char* fname; +static int nNum; -typedef struct appdata { - Evas_Object *win; - Evas_Object *conform; - Evas_Object *label; -} appdata_s; - -static bool app_create(void *data) +int run_testcases() { - return true; -} + int result = -1; + int i; + gsize byte_size; + const gchar* encoded_byte; + guchar* byte = NULL; -static void app_control(app_control_h app_control, void *data) -{ - char* pszGetTCName = NULL; - int i=0, result=0, nRet=0; - nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); - if(nRet != APP_CONTROL_ERROR_NONE) + static const size_t sz_byte_len = sizeof(size_t); + static const size_t sz_type = sizeof(int); + static const size_t sz_keysize = sizeof(size_t); + static const size_t sz_size = sizeof(size_t); + + char* func_name = fname;//argv[1]; + if ( nNum > 2 ) { - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + encoded_byte = key;//argv[3]; + byte = g_base64_decode(encoded_byte,&byte_size); + byte += sz_byte_len; + byte += sz_type; + size_t keysize = *((size_t *)byte); byte += sz_keysize; + byte += keysize; + size_t size = *((size_t *)byte); byte += sz_size; + void *val = (void *)byte; byte += size; + func_name = strdup((char *)val); + if (NULL == func_name) + { + return result; + } } - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); for ( i = 0; tc_array[i].name; i++ ) { - if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + if ( !strncmp(func_name, tc_array[i].name, strlen(func_name)) ) { DUMP_UTC_ERRLOG(); - if ( tc_array[i].startup ) + if (tc_array[i].startup) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", func_name); tc_array[i].startup(); } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", func_name); result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); if ( tc_array[i].cleanup ) { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", func_name); tc_array[i].cleanup(); } - CLOSE_UTC_ERRLOG(); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; + FILE *fres = fopen("/tmp/utcresult", "w"); + if(NULL == fres) + { + if(nNum > 2) + free(func_name); + return result; + } + if(nNum > 2) + free(func_name); + fprintf(fres, "%d", result); + fclose(fres); + return result; } } - dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); - PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); - PRINT_TC_RESULT("%d",1); - FREE_MEMORY_TC(pszGetTCName); - return; + if (nNum > 2) + free(func_name); + return 2; } -static void app_terminate(void *data) +static bool app_create(void *data) { - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); + sleep(1); + run_testcases(); + return false; // quit app } int main(int argc, char *argv[]) { - int ret = 0; - appdata_s ad = {0,}; - + fname = argv[1]; + key = argv[3]; + nNum = argc; ui_app_lifecycle_callback_s event_callback = {0,}; event_callback.create = app_create; - event_callback.terminate = app_terminate; - event_callback.app_control = app_control; - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - ret = ui_app_main(argc, argv, &event_callback, &ad); - if (ret != APP_ERROR_NONE) + int nRet = ui_app_main(argc, argv, &event_callback, NULL); + if ( nRet != APP_ERROR_NONE ) { - dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); - PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); - PRINT_TC_RESULT("%d",1); - return ret; + FPRINTF("\\n[Line: %d] Unable to execute test cases: ui_app_main API call gets failed\\n", __LINE__); } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} \ No newline at end of file + return nRet; +}