From: shobhitv Date: Thu, 25 Jul 2024 08:40:48 +0000 (+0530) Subject: [ITC][badge][ACR-1841] Removed deprecated badge module X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a665eaac9e4548ad8da569f4a79c4e0b694b496;p=test%2Ftct%2Fnative%2Fapi.git [ITC][badge][ACR-1841] Removed deprecated badge module Change-Id: Ic6ba2fe5ce62882127e47e19ba1d3df50b65c13a Signed-off-by: shobhitv --- diff --git a/packaging/itc/native-badge-itc.spec b/packaging/itc/native-badge-itc.spec deleted file mode 100755 index 1b72e9cb5..000000000 --- a/packaging/itc/native-badge-itc.spec +++ /dev/null @@ -1,79 +0,0 @@ -%define MODULE_NAME badge -%define MODULE_LIBNAME badge -Name: native-%{MODULE_NAME}-itc -Summary: Native API Integration TC (%{name}) -Version: 0.1 -Release: 0 -Group: Development/Tools -License: Apache-2.0 -Source0: %{name}-%{version}.tar.gz -BuildRequires: pkgconfig(%{MODULE_LIBNAME}) -BuildRequires: pkgconfig(capi-appfw-application) -BuildRequires: pkgconfig(elementary) -BuildRequires: pkgconfig(dlog) -BuildRequires: pkgconfig(glib-2.0) -BuildRequires: cmake -BuildRequires: pkgconfig(bundle) -BuildRequires: pkgconfig(capi-system-info) - -%description -Native API Integration TC (%{name}) - -%prep -%setup -q - -%build - -%define PREFIX "%{_libdir}/%{name}" - -export LDFLAGS+="-Wl,--rpath=%{PREFIX} -Wl,--as-needed" - -%if %{?ASAN_BUILD:1}0 - %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_TV:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tizeniot" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif -%else - %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_TV:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif - %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0 - cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tizeniot" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix} - %endif -%endif - -make %{?jobs:-j%jobs} - -%install -rm -rf %{buildroot} -%make_install -mkdir -p %{buildroot}/usr/share/license -cp LICENSE %{buildroot}/usr/share/license/%{name} - -mkdir -p %{buildroot}/usr/share/packages/ -cp packaging/itc/native-%{MODULE_NAME}-itc.xml %{buildroot}/usr/share/packages/ -mkdir -p %{buildroot}%{APP_PATH}%{name}/bin -#cp templates/external_wrapper.sh %{buildroot}%{APP_PATH}%{name}/bin -%post - -%postun - - -%files -%{APP_PATH}%{name}/* -/usr/share/packages/native-%{MODULE_NAME}-itc.xml -/usr/share/license/%{name} diff --git a/packaging/itc/native-badge-itc.xml b/packaging/itc/native-badge-itc.xml deleted file mode 100755 index 917a73a43..000000000 --- a/packaging/itc/native-badge-itc.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - test - Native API test Application - - - - - - - - - - http://tizen.org/privilege/notification - - diff --git a/src/itc/badge/CMakeLists.txt b/src/itc/badge/CMakeLists.txt deleted file mode 100755 index 90c10b95c..000000000 --- a/src/itc/badge/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -SET(PKG_NAME "badge") - -SET(EXEC_NAME "tct-${PKG_NAME}-native") -SET(RPM_NAME "native-${PKG_NAME}-itc") - -SET(CAPI_LIB "badge") -SET(TC_SOURCES - ITs-badge-common.c - ITs-badge.c -) - -PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED - ${CAPI_LIB} - capi-appfw-application - bundle - glib-2.0 - capi-system-info - dlog -) - -INCLUDE_DIRECTORIES( - ${${CAPI_LIB}_INCLUDE_DIRS} -) - -ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.c ${TC_SOURCES} ${COMMON_FILE}) -TARGET_LINK_LIBRARIES(${EXEC_NAME} - ${${CAPI_LIB}_LIBRARIES} - bundle -) - -INSTALL(PROGRAMS ${EXEC_NAME} - DESTINATION ${BIN_DIR}/${RPM_NAME}/bin -) - -IF( DEFINED ASAN ) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -pie -g -fsanitize=address -fsanitize-recover=address -U_FORTIFY_SOURCE -fno-omit-frame-pointer") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -Wl,-fsanitize=address") -ELSE() -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -fPIE -Wall") -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -pie") -ENDIF() diff --git a/src/itc/badge/ITs-badge-common.c b/src/itc/badge/ITs-badge-common.c deleted file mode 100755 index f872ee378..000000000 --- a/src/itc/badge/ITs-badge-common.c +++ /dev/null @@ -1,99 +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-badge-common.h" - -/** @addtogroup itc-badge -* @ingroup itc -* @{ -*/ - -/** -* @function BadgeGetError -* @description Maps error enums to string values -* @parameter nRet : error code returned -* @return error string -*/ -char *BadgeGetError(int nRet) -{ - char *szErrorVal = NULL; - switch ( nRet ) - { - case BADGE_ERROR_INVALID_PARAMETER: szErrorVal = "BADGE_ERROR_INVALID_PARAMETER"; break; - case BADGE_ERROR_OUT_OF_MEMORY: szErrorVal = "BADGE_ERROR_OUT_OF_MEMORY"; break; - case BADGE_ERROR_IO_ERROR: szErrorVal = "BADGE_ERROR_IO_ERROR"; break; - case BADGE_ERROR_FROM_DB: szErrorVal = "BADGE_ERROR_FROM_DB"; break; - case BADGE_ERROR_ALREADY_EXIST: szErrorVal = "BADGE_ERROR_ALREADY_EXIST"; break; - case BADGE_ERROR_FROM_DBUS: szErrorVal = "BADGE_ERROR_FROM_DBUS"; break; - case BADGE_ERROR_NOT_EXIST: szErrorVal = "BADGE_ERROR_NOT_EXIST"; break; - case BADGE_ERROR_PERMISSION_DENIED: szErrorVal = "BADGE_ERROR_PERMISSION_DENIED"; break; - case BADGE_ERROR_SERVICE_NOT_READY: szErrorVal = "BADGE_ERROR_SERVICE_NOT_READY"; break; - case BADGE_ERROR_INVALID_PACKAGE: szErrorVal = "BADGE_ERROR_INVALID_PACKAGE"; break; - case BADGE_ERROR_NOT_SUPPORTED: szErrorVal = "BADGE_ERROR_NOT_SUPPORTED"; break; - default: szErrorVal = "Unknown Error"; break; - } - - return szErrorVal; -} - -/** - * @function TimeoutFunction - * @description Called if some callback is not invoked for a particular timeout - * @parameter gpointer data - * @return gboolean - */ -gboolean TimeoutFunction(gpointer data) -{ - GMainLoop *pMainLoop = NULL; - pMainLoop = (GMainLoop *)data; - if ( pMainLoop != NULL ) - { - g_main_loop_quit(pMainLoop); - } - return false; -} - -/** -* @function IterateGmainLoop -* @description Called to wait -* @parameter NA -* @return NA -*/ -void IterateGmainLoop(void) -{ - g_pMainLoop = g_main_loop_new(NULL, false); - g_nTimeoutId = g_timeout_add(TIMEOUT_CB, TimeoutFunction, g_pMainLoop); - g_main_loop_run(g_pMainLoop); - g_source_remove(g_nTimeoutId); - g_nTimeoutId = 0; - g_pMainLoop = NULL; -} - -/** -* @function QuitGmainLoop -* @description Called to quit -* @parameter NA -* @return NA -*/ -void QuitGmainLoop(void) -{ - if(g_pMainLoop != NULL) - { - g_main_loop_quit(g_pMainLoop); - g_pMainLoop = NULL; - } -} - -/** @} */ diff --git a/src/itc/badge/ITs-badge-common.h b/src/itc/badge/ITs-badge-common.h deleted file mode 100755 index 6d88ffd7b..000000000 --- a/src/itc/badge/ITs-badge-common.h +++ /dev/null @@ -1,67 +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. -// -#ifndef _ITS_BADGE_COMMON_H_ -#define _ITS_BADGE_COMMON_H_ - -//Add test package related includes here -#include "tct_common.h" -#include -#include - -/** @addtogroup itc-badge -* @ingroup itc -* @{ -*/ - -#define BUFFER 512 -#define BADGE_PACKAGE "native.badge-itc" -#define API_NAMESPACE "BADGE_ITC" -#define TIMEOUT_CB 15000 -#define BADGE_FEATURE "http://tizen.org/feature/badge" - -//Add helper function declarations here -#define START_TEST {\ - FPRINTF("[Line : %d] Starting test : %s\\n", __LINE__ ,__FUNCTION__);\ - if(g_bBadgeNotSupported)\ - {\ - FPRINTF("[Line : %d][%s] Feature =%s not supported :success ", __LINE__, API_NAMESPACE, BADGE_FEATURE);\ - return 0;\ - }\ - else if (g_bBadgeMismatch)\ - {\ - FPRINTF("[Line : %d][%s] Precondition of badge create feature=%s:Mismatch,failure ", __LINE__, API_NAMESPACE, BADGE_FEATURE);\ - return 1;\ - }\ - if ( !g_bBadgeInit )\ - {\ - FPRINTF("[Line : %d] [badge_ITC] Precondition of badge create failed\\n", __LINE__);\ - return 1;\ - }\ -} - -int g_nTimeoutId; -GMainLoop *g_pMainLoop; -bool g_bCallBackHit; -bool g_bBadgeNotSupported; -bool g_bBadgeMismatch; - -char *BadgeGetError(int nRet); -gboolean TimeoutFunction(gpointer data); -void IterateGmainLoop(void); -void QuitGmainLoop(void); - -/** @} */ -#endif //_ITS_BADGE_COMMON_H_ diff --git a/src/itc/badge/ITs-badge.c b/src/itc/badge/ITs-badge.c deleted file mode 100755 index 01dec4d45..000000000 --- a/src/itc/badge/ITs-badge.c +++ /dev/null @@ -1,381 +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-badge-common.h" - -/** @addtogroup itc-badge -* @ingroup itc -* @{ -*/ - -//& set: Badge - -/****************************************************Callback Start****************************************************/ - -/** - * @function BadgeForeachCallBack - * @description Callback Function - * @parameter const char *app_id, unsigned int count, void *user_data - * @return NA - */ -static bool BadgeForeachCallBack(const char *app_id, unsigned int count, void *user_data) -{ -#if DEBUG - FPRINTF("[Line : %d][%s] %s Callback Invoked\\n", __LINE__, API_NAMESPACE, "BadgeForeachCallBack"); -#endif - - g_bCallBackHit = true; - return false; -} - -/** - * @function BadgeChangedCallBack - * @description Callback Function - * @parameter unsigned int action, const char *app_id, unsigned int count, void *user_data - * @return NA - */ -static void BadgeChangedCallBack(unsigned int action, const char *app_id, unsigned int count, void *user_data) -{ -#if DEBUG - FPRINTF("[Line : %d][%s] %s Callback Invoked\\n", __LINE__, API_NAMESPACE, "BadgeChangedCallBack"); -#endif - - g_bCallBackHit = true; - QuitGmainLoop(); - return; -} - -/*****************************************************Callback End*****************************************************/ - -bool g_bBadgeInit = false; - -/** -* @function ITs_badge_startup -* @description Called before each test, creates a badge for the application itself. -* @parameter NA -* @return NA -*/ -void ITs_badge_startup(void) -{ - g_bBadgeInit = false; - g_bBadgeNotSupported = false; - g_bBadgeMismatch = false; - struct stat stBuff; - if ( stat(ERR_LOG, &stBuff) == 0 ) - { - remove(ERR_LOG); - } - -#if DEBUG - FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_Badge_p\\n", __LINE__, API_NAMESPACE); -#endif - - //badge_app_id, the id of the application for which the badge to be created, can be null when creating a badge for itself - badge_error_e eRetValue = badge_add(/*BADGE_PACKAGE*/NULL); - bool bFeatureBadge = TCTCheckSystemInfoFeatureSupported(BADGE_FEATURE, API_NAMESPACE); - - if(!bFeatureBadge) - { - if(eRetValue == BADGE_ERROR_NOT_SUPPORTED) - { - FPRINTF("[Line : %d][%s] badge_add() returned %s error for unsupported feature :success \\n", __LINE__, - API_NAMESPACE, BadgeGetError(eRetValue)); - g_bBadgeNotSupported = true; - } - else - { - FPRINTF("[Line : %d][%s] badge_add() returned %s error for unsupported feature, error mismatch :Failure \\n", - __LINE__, API_NAMESPACE, BadgeGetError(eRetValue)); - g_bBadgeMismatch = true; - } - - return; - } - - if ( eRetValue == BADGE_ERROR_NONE || eRetValue == BADGE_ERROR_ALREADY_EXIST ) - { - FPRINTF("[Line : %d] [%s] badge_add succeeded in startup\\n", __LINE__, API_NAMESPACE); - g_bBadgeInit = true; - } - else - { - FPRINTF("[Line : %d] [%s] badge_add failed in startup, error = %s\\n", __LINE__, API_NAMESPACE, BadgeGetError(eRetValue)); - g_bBadgeInit = false; - } -} - -/** -* @function ITs_badge_cleanup -* @description Called after each test, removes the created badge for the application -* @parameter NA -* @return NA -*/ -void ITs_badge_cleanup(void) -{ - if ( g_bBadgeInit ) - { - badge_error_e eRetValue = badge_remove(BADGE_PACKAGE); - if ( eRetValue == BADGE_ERROR_NONE ) - { - FPRINTF("[Line : %d] [%s] badge_remove succeeded in cleanup\\n", __LINE__, API_NAMESPACE); - } - else - { - FPRINTF("[Line : %d] [%s] badge_remove failed in cleanup, error = %s\\n", __LINE__, API_NAMESPACE, BadgeGetError(eRetValue)); - } - } - -#if DEBUG - FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_Badge_p\\n", __LINE__, API_NAMESPACE); -#endif -} - -/** @addtogroup itc-badge-testcases -* @brief Integration testcases for module badge -* @ingroup itc-badge -* @{ -*/ -//& type: auto -//& purpose: to create and remove a badge -/** -* @testcase ITc_badge_new_remove_p -* @since_tizen 2.3 -* @author SRID(saurabh.s9) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description To create and remove a badge -* @scenario Remove the badge created in startup\n -* Create a badge\n -* Remove badge\n -* Create a badge -* @apicovered badge_new, badge_remove -* @passcase If badge_new, badge_remove returns success -* @failcase If badge_new, badge_remove returns false -* @precondition badge should be created -* @postcondition badge should be removed -*/ -int ITc_badge_new_remove_p(void) -{ - START_TEST; - badge_error_e eRetValue = BADGE_ERROR_NONE; - - //Remove already created badge in startup - eRetValue = badge_remove(BADGE_PACKAGE); - PRINT_RESULT(BADGE_ERROR_NONE, eRetValue, "badge_remove", BadgeGetError(eRetValue)); - - // Target API - eRetValue = badge_new(BADGE_PACKAGE); - PRINT_RESULT(BADGE_ERROR_NONE, eRetValue, "badge_new", BadgeGetError(eRetValue)); - - // Target API - eRetValue = badge_remove(BADGE_PACKAGE); - PRINT_RESULT(BADGE_ERROR_NONE, eRetValue, "badge_remove", BadgeGetError(eRetValue)); - - //Create badge again to be removed in cleanup - eRetValue = badge_new(BADGE_PACKAGE); - PRINT_RESULT(BADGE_ERROR_NONE, eRetValue, "badge_new", BadgeGetError(eRetValue)); - return 0; -} - -//& type: auto -//& purpose: to create and remove a badge -/** -* @testcase ITc_badge_add_remove_p -* @since_tizen 2.4 -* @author SRID(saurabh.s9) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description To create and remove a badge -* @scenario Remove the badge created in startup\n -* Create a badge\n -* Remove badge\n -* Create a badge -* @apicovered badge_add, badge_remove -* @passcase If badge_add, badge_remove returns success -* @failcase If badge_add, badge_remove returns false -* @precondition badge should be created -* @postcondition badge should be removed -*/ -int ITc_badge_add_remove_p(void) -{ - START_TEST; - badge_error_e eRetValue = BADGE_ERROR_NONE; - - //Remove already created badge in startup - eRetValue = badge_remove(BADGE_PACKAGE); - PRINT_RESULT(BADGE_ERROR_NONE, eRetValue, "badge_remove", BadgeGetError(eRetValue)); - - // Target API - //badge_app_id, the id of the application for which the badge to be created, can be null when creating a badge for itself - eRetValue = badge_add(/*BADGE_PACKAGE*/NULL); - PRINT_RESULT(BADGE_ERROR_NONE, eRetValue, "badge_add", BadgeGetError(eRetValue)); - - // Target API - eRetValue = badge_remove(BADGE_PACKAGE); - PRINT_RESULT(BADGE_ERROR_NONE, eRetValue, "badge_remove", BadgeGetError(eRetValue)); - - //Create badge again to be removed in cleanup - //badge_app_id, the id of the application for which the badge to be created, can be null when creating a badge for itself - eRetValue = badge_add(/*BADGE_PACKAGE*/NULL); - PRINT_RESULT(BADGE_ERROR_NONE, eRetValue, "badge_add", BadgeGetError(eRetValue)); - return 0; -} - -//& type: auto -//& purpose: to set and get badge count for the designated package -/** -* @testcase ITc_badge_set_get_count_p -* @since_tizen 2.3 -* @author SRID(saurabh.s9) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description To set and get badge count for the designated package -* @scenario Set badge count for the designated package\n -* Get badge count for the designated package\n -* Compare set and get values -* @apicovered badge_set_count, badge_get_count -* @passcase If badge_set_count, badge_get_count returns success and set get values are same -* @failcase If either badge_set_count or badge_get_count returns false or set get values are not same -* @precondition badge should be created -* @postcondition badge should be removed -*/ -int ITc_badge_set_get_count_p(void) -{ - START_TEST; - - unsigned int unSetCount = 2, unGetCount = 0; - badge_error_e eRetValue = BADGE_ERROR_NONE; - - // Target API - eRetValue = badge_set_count(BADGE_PACKAGE, unSetCount); - PRINT_RESULT(BADGE_ERROR_NONE, eRetValue, "badge_set_count", BadgeGetError(eRetValue)); - - // Target API - eRetValue = badge_get_count(BADGE_PACKAGE, &unGetCount); - PRINT_RESULT(BADGE_ERROR_NONE, eRetValue, "badge_get_count", BadgeGetError(eRetValue)); - - if ( unGetCount != unSetCount ) - { - FPRINTF("[Line : %d] [%s] badge_get_count failed , error returned = get and set values are not same\\n", __LINE__, API_NAMESPACE); - return 1; - } - return 0; -} - -//& type: auto -//& purpose: to set and get the display option for the designated package. -/** -* @testcase ITc_badge_set_get_display_p -* @since_tizen 2.3 -* @author SRID(saurabh.s9) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description To set and get the display option for the designated package. -* @scenario Set the display option for the designated package\n -* Get the display option for the designated package\n -* Compare set and get values -* @apicovered badge_set_display, badge_get_display -* @passcase If badge_set_display, badge_get_display returns success and set get values are same -* @failcase If either badge_set_display or badge_get_display returns false or set get values are not same -* @precondition badge should be created -* @postcondition badge should be removed -*/ -int ITc_badge_set_get_display_p(void) -{ - START_TEST; - badge_error_e eRetValue = BADGE_ERROR_NONE; - unsigned int unSetDisplay = 1, unGetDisplay = 0; - - // Target API - eRetValue = badge_set_display(BADGE_PACKAGE, unSetDisplay); - PRINT_RESULT(BADGE_ERROR_NONE, eRetValue, "badge_set_display", BadgeGetError(eRetValue)); - - // Target API - eRetValue = badge_get_display(BADGE_PACKAGE, &unGetDisplay); - PRINT_RESULT(BADGE_ERROR_NONE, eRetValue, "badge_get_display", BadgeGetError(eRetValue)); - if ( unGetDisplay != unSetDisplay ) - { - FPRINTF("[Line : %d] [%s] badge_get_display failed , error returned = get and set values are not same\\n", __LINE__, API_NAMESPACE); - return 1; - } - return 0; -} - -//& type: auto -//& purpose: To Test badge_foreach -/** -* @testcase ITc_badge_foreach_p -* @since_tizen 2.4 -* @author SRID(abhishek1.g) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description To Test badge_foreach -* @scenario Call badge_foreach -* @apicovered badge_foreach -* @passcase If badge_foreach returns success and set get values are same -* @failcase If target api or precondition api fails -* @precondition badge should be created -* @postcondition badge should be removed -*/ -int ITc_badge_foreach_p(void) -{ - START_TEST; - int nRet = -1; - - g_bCallBackHit = false; - nRet = badge_foreach(BadgeForeachCallBack, NULL); - PRINT_RESULT(BADGE_ERROR_NONE, nRet, "badge_foreach", BadgeGetError(nRet)); - PRINT_RESULT(true, g_bCallBackHit, "badge_foreach", "CallBack Not Invoked"); - - return 0; -} - -//& type: auto -//& purpose: To Test badge_register_changed_cb and badge_unregister_changed_cb -/** -* @testcase ITc_badge_register_unregister_changed_cb_p -* @since_tizen 2.4 -* @author SRID(abhishek1.g) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @description To Test badge_register_changed_cb and badge_unregister_changed_cb -* @scenario Call badge_register_changed_cb, badge_unregister_changed_cb -* @apicovered badge_register_changed_cb, badge_unregister_changed_cb -* @passcase If badge_register_changed_cb and badge_unregister_changed_cb returns success and set get values are same -* @failcase If target api or precondition api fails -* @precondition badge should be created -* @postcondition badge should be removed -*/ -int ITc_badge_register_unregister_changed_cb_p(void) -{ - START_TEST; - int nRet = -1; - - g_bCallBackHit = false; - nRet = badge_register_changed_cb(BadgeChangedCallBack, NULL); - PRINT_RESULT(BADGE_ERROR_NONE, nRet, "badge_register_changed_cb", BadgeGetError(nRet)); - - nRet = badge_set_count(BADGE_PACKAGE, 2); - PRINT_RESULT(BADGE_ERROR_NONE, nRet, "badge_set_count", BadgeGetError(nRet)); - IterateGmainLoop(); - PRINT_RESULT(true, g_bCallBackHit, "badge_register_changed_cb", "CallBack Not Invoked"); - nRet = badge_unregister_changed_cb(BadgeChangedCallBack); - PRINT_RESULT(BADGE_ERROR_NONE, nRet, "badge_unregister_changed_cb", BadgeGetError(nRet)); - - return 0; -} - -/** @} */ -/** @} */ diff --git a/src/itc/badge/tct-badge-native.c b/src/itc/badge/tct-badge-native.c deleted file mode 100755 index ad5ae0293..000000000 --- a/src/itc/badge/tct-badge-native.c +++ /dev/null @@ -1,138 +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 -#include -#include "tct_common.h" - -#ifdef MOBILE //Starts MOBILE -#include "tct-badge-native_mobile.h" -#endif //MOBILE //End MOBILE - -#ifdef WEARABLE //Starts WEARABLE -#include "tct-badge-native_wearable.h" -#endif //WEARABLE //End WEARABLE - -#ifdef TV //Starts TV -#include "tct-badge-native_tv.h" -#endif //TV //End TV - -#ifdef TIZENIOT //Starts TIZENIOT -#include "tct-badge-native_tizeniot.h" -#endif //TIZENIOT //End TIZENIOT - - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -static bool app_create(void *data) -{ - 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) - { - 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; - } - - 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)) ) - { - dlog_print(DLOG_INFO, "NativeTCT", "%s : Startup begin", pszGetTCName); - if ( tc_array[i].startup ) - { - tc_array[i].startup(); - } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Startup end", pszGetTCName); - - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body begin", pszGetTCName); - result = tc_array[i].function(); - dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); - dlog_print(DLOG_INFO, "NativeTCT", "%s : Body end", pszGetTCName); - - dlog_print(DLOG_INFO, "NativeTCT", "%s : Cleanup begin", pszGetTCName); - if ( tc_array[i].cleanup ) - { - tc_array[i].cleanup(); - } - dlog_print(DLOG_INFO, "NativeTCT", "%s : Cleanup end", pszGetTCName); - PRINT_TC_RESULT("%d",result); - FREE_MEMORY_TC(pszGetTCName); - return; - } - } - - 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__); -} - -int main(int argc, char *argv[]) -{ - int ret = 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; - - //setting gcda file location for coverage - setenv("GCOV_PREFIX","/tmp",1); - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Coverage *.gcda File location set to /tmp/home/abuild/rpmbuild/BUILD/ ", __FUNCTION__, __LINE__); - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); - 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; - } - - dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); - return ret; -} diff --git a/src/itc/badge/tct-badge-native_mobile.h b/src/itc/badge/tct-badge-native_mobile.h deleted file mode 100755 index 6940193c5..000000000 --- a/src/itc/badge/tct-badge-native_mobile.h +++ /dev/null @@ -1,42 +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. -// -#ifndef __TCT_BADGE-NATIVE_H__ -#define __TCT_BADGE-NATIVE_H__ - -#include "testcase.h" -#include "tct_common.h" - -extern void ITs_badge_startup(void); -extern void ITs_badge_cleanup(void); - -extern int ITc_badge_new_remove_p(void); -extern int ITc_badge_add_remove_p(void); -extern int ITc_badge_set_get_count_p(void); -extern int ITc_badge_set_get_display_p(void); -extern int ITc_badge_foreach_p(void); -extern int ITc_badge_register_unregister_changed_cb_p(void); - -testcase tc_array[] = { - {"ITc_badge_new_remove_p",ITc_badge_new_remove_p,ITs_badge_startup,ITs_badge_cleanup}, - {"ITc_badge_add_remove_p",ITc_badge_add_remove_p,ITs_badge_startup,ITs_badge_cleanup}, - {"ITc_badge_set_get_count_p",ITc_badge_set_get_count_p,ITs_badge_startup,ITs_badge_cleanup}, - {"ITc_badge_set_get_display_p",ITc_badge_set_get_display_p,ITs_badge_startup,ITs_badge_cleanup}, - {"ITc_badge_foreach_p",ITc_badge_foreach_p,ITs_badge_startup,ITs_badge_cleanup}, - {"ITc_badge_register_unregister_changed_cb_p",ITc_badge_register_unregister_changed_cb_p,ITs_badge_startup,ITs_badge_cleanup}, - {NULL, NULL} -}; - -#endif // __TCT_BADGE-NATIVE_H__ diff --git a/src/itc/badge/tct-badge-native_tizeniot.h b/src/itc/badge/tct-badge-native_tizeniot.h deleted file mode 100755 index 6940193c5..000000000 --- a/src/itc/badge/tct-badge-native_tizeniot.h +++ /dev/null @@ -1,42 +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. -// -#ifndef __TCT_BADGE-NATIVE_H__ -#define __TCT_BADGE-NATIVE_H__ - -#include "testcase.h" -#include "tct_common.h" - -extern void ITs_badge_startup(void); -extern void ITs_badge_cleanup(void); - -extern int ITc_badge_new_remove_p(void); -extern int ITc_badge_add_remove_p(void); -extern int ITc_badge_set_get_count_p(void); -extern int ITc_badge_set_get_display_p(void); -extern int ITc_badge_foreach_p(void); -extern int ITc_badge_register_unregister_changed_cb_p(void); - -testcase tc_array[] = { - {"ITc_badge_new_remove_p",ITc_badge_new_remove_p,ITs_badge_startup,ITs_badge_cleanup}, - {"ITc_badge_add_remove_p",ITc_badge_add_remove_p,ITs_badge_startup,ITs_badge_cleanup}, - {"ITc_badge_set_get_count_p",ITc_badge_set_get_count_p,ITs_badge_startup,ITs_badge_cleanup}, - {"ITc_badge_set_get_display_p",ITc_badge_set_get_display_p,ITs_badge_startup,ITs_badge_cleanup}, - {"ITc_badge_foreach_p",ITc_badge_foreach_p,ITs_badge_startup,ITs_badge_cleanup}, - {"ITc_badge_register_unregister_changed_cb_p",ITc_badge_register_unregister_changed_cb_p,ITs_badge_startup,ITs_badge_cleanup}, - {NULL, NULL} -}; - -#endif // __TCT_BADGE-NATIVE_H__ diff --git a/src/itc/badge/tct-badge-native_wearable.h b/src/itc/badge/tct-badge-native_wearable.h deleted file mode 100755 index 6940193c5..000000000 --- a/src/itc/badge/tct-badge-native_wearable.h +++ /dev/null @@ -1,42 +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. -// -#ifndef __TCT_BADGE-NATIVE_H__ -#define __TCT_BADGE-NATIVE_H__ - -#include "testcase.h" -#include "tct_common.h" - -extern void ITs_badge_startup(void); -extern void ITs_badge_cleanup(void); - -extern int ITc_badge_new_remove_p(void); -extern int ITc_badge_add_remove_p(void); -extern int ITc_badge_set_get_count_p(void); -extern int ITc_badge_set_get_display_p(void); -extern int ITc_badge_foreach_p(void); -extern int ITc_badge_register_unregister_changed_cb_p(void); - -testcase tc_array[] = { - {"ITc_badge_new_remove_p",ITc_badge_new_remove_p,ITs_badge_startup,ITs_badge_cleanup}, - {"ITc_badge_add_remove_p",ITc_badge_add_remove_p,ITs_badge_startup,ITs_badge_cleanup}, - {"ITc_badge_set_get_count_p",ITc_badge_set_get_count_p,ITs_badge_startup,ITs_badge_cleanup}, - {"ITc_badge_set_get_display_p",ITc_badge_set_get_display_p,ITs_badge_startup,ITs_badge_cleanup}, - {"ITc_badge_foreach_p",ITc_badge_foreach_p,ITs_badge_startup,ITs_badge_cleanup}, - {"ITc_badge_register_unregister_changed_cb_p",ITc_badge_register_unregister_changed_cb_p,ITs_badge_startup,ITs_badge_cleanup}, - {NULL, NULL} -}; - -#endif // __TCT_BADGE-NATIVE_H__ diff --git a/tct_unsupported.txt b/tct_unsupported.txt index 0299328fa..c81471155 100755 --- a/tct_unsupported.txt +++ b/tct_unsupported.txt @@ -281,7 +281,6 @@ tv:armv7l:itc:calendar-service2; tv:armv7l:itc:capi-network-softap; tv:armv7l:itc:stc; tv:armv7l:itc:wifi-direct; -tv:armv7l:itc:badge; tv:armv7l:itc:job-scheduler; tv:armv7l:itc:minicontrol; tv:armv7l:itc:shortcut;