+++ /dev/null
-%define MODULE_NAME shortcut
-%define MODULE_LIBNAME shortcut
-Name: core-%{MODULE_NAME}-tests
-Summary: Core API unit TC (%{name})
-Version: 0.1
-Release: 0
-Group: Development/Tools
-License: Apache License, Version 2.0
-Source0: %{name}-%{version}.tar.gz
-BuildRequires: pkgconfig(%{MODULE_LIBNAME})
-BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: cmake
-BuildRequires: pkgconfig(capi-appfw-application)
-BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(elementary)
-BuildRequires: pkgconfig(capi-system-info)
-%description
-Core API unit 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="utc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TV:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="tizeniot" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
-%else
- %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TV:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
- %endif
- %if %{?DEVICE_BUILD_TYPE_TIZENIOT:1}0
- cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -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/utc/%{name}.xml %{buildroot}/usr/share/packages/
-%post
-
-%postun
-
-
-%files
-/usr/apps/%{name}/*
-/usr/share/packages/%{name}.xml
-/usr/share/license/%{name}
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" package="core-shortcut-tests" version="0.1.0" api-version="6.0">
- <label>CoreShortcutTest</label>
- <author email="test@tizen.org" href="www.tizen.org">test</author>
- <description>Core API test Application</description>
- <ui-application appid="core.shortcut-tests" exec="/usr/apps/core-shortcut-tests/bin/tct-shortcut-core" nodisplay="false" multiple="false" type="capp" taskmanage="true">
- <background-category value="background-network"/>
- <background-category value="download"/>
- <background-category value="iot-communication"/>
- <background-category value="location"/>
- <background-category value="media"/>
- <background-category value="sensor"/>
- </ui-application>
- <privileges>
- <privilege>http://tizen.org/privilege/shortcut</privilege>
- </privileges>
-</manifest>
ADD_SUBDIRECTORY(utc/runtime-info)
MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/utc/sensor")
ADD_SUBDIRECTORY(utc/sensor)
- MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/utc/shortcut")
- ADD_SUBDIRECTORY(utc/shortcut)
MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/utc/sound-manager")
ADD_SUBDIRECTORY(utc/sound-manager)
MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/utc/stt")
+++ /dev/null
-SET(PKG_NAME "shortcut")
-
-SET(EXEC_NAME "tct-${PKG_NAME}-core")
-SET(RPM_NAME "core-${PKG_NAME}-tests")
-
-SET(CAPI_LIB "shortcut")
-SET(TC_SOURCES
- utc-shortcut.c
-)
-
-PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
- ${CAPI_LIB}
- capi-appfw-application
- capi-system-info
- glib-2.0
- 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}
-)
-
-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()
-
+++ /dev/null
-shortcut_get_list
+++ /dev/null
-shortcut_icon_request_create
-shortcut_icon_request_data
-shortcut_icon_request_destroy
-shortcut_icon_request_send
-shortcut_icon_request_set_data
-shortcut_icon_request_set_info
-shortcut_icon_service_fini
-shortcut_icon_service_init
\ No newline at end of file
+++ /dev/null
-shortcut_add_to_home
-shortcut_remove_from_home
+++ /dev/null
-//
-// 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 <stdio.h>
-#include <string.h>
-#include <malloc.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <glib.h>
-#include <stdbool.h>
-#include "tct_common.h"
-#include <app.h>
-#include <dlog.h>
-
-
-
-#ifdef MOBILE
-#include "tct-shortcut-core_mobile.h"
-#endif
-#ifdef TV
-#include "tct-shortcut-core_tv.h"
-#endif // TV
-#ifdef WEARABLE
-#include "tct-shortcut-core_wearable.h"
-#endif //WEARABLE
-#ifdef TIZENIOT
-#include "tct-shortcut-core_tizeniot.h"
-#endif //TIZENIOT
-
-
-
-
-
-
-
-
-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)) )
- {
- DUMP_UTC_ERRLOG();
- 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);
- CLOSE_UTC_ERRLOG();
- 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;
-}
+++ /dev/null
-//
-// 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_SHORTCUT-NATIVE_H__
-#define __TCT_SHORTCUT-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-extern void utc_shortcut_startup(void);
-
-extern int utc_shortcut_add_to_home_n(void);
-extern int utc_shortcut_add_to_home_p(void);
-extern int utc_shortcut_add_to_home_widget_n(void);
-extern int utc_shortcut_add_to_home_widget_p(void);
-extern int utc_shortcut_remove_from_home_n(void);
-extern int utc_shortcut_remove_from_home_p(void);
-extern int utc_shortcut_set_request_cb_n(void);
-extern int utc_shortcut_set_request_cb_p(void);
-extern int utc_shortcut_set_remove_cb_n(void);
-extern int utc_shortcut_set_remove_cb_p(void);
-extern int utc_shortcut_unset_request_cb_n(void);
-extern int utc_shortcut_unset_request_cb_p(void);
-extern int utc_shortcut_unset_remove_cb_n(void);
-extern int utc_shortcut_unset_remove_cb_p(void);
-extern int utc_shortcut_get_list_n(void);
-extern int utc_shortcut_get_list_p(void);
-
-testcase tc_array[] = {
- {"utc_shortcut_add_to_home_n",utc_shortcut_add_to_home_n,utc_shortcut_startup,NULL},
- {"utc_shortcut_add_to_home_p",utc_shortcut_add_to_home_p,utc_shortcut_startup,NULL},
- {"utc_shortcut_add_to_home_widget_n",utc_shortcut_add_to_home_widget_n,utc_shortcut_startup,NULL},
- {"utc_shortcut_add_to_home_widget_p",utc_shortcut_add_to_home_widget_p,utc_shortcut_startup,NULL},
- {"utc_shortcut_remove_from_home_n",utc_shortcut_remove_from_home_n,utc_shortcut_startup,NULL},
- {"utc_shortcut_remove_from_home_p",utc_shortcut_remove_from_home_p,utc_shortcut_startup,NULL},
- {"utc_shortcut_set_request_cb_n",utc_shortcut_set_request_cb_n,utc_shortcut_startup,NULL},
- {"utc_shortcut_set_request_cb_p",utc_shortcut_set_request_cb_p,utc_shortcut_startup,NULL},
- {"utc_shortcut_set_remove_cb_n",utc_shortcut_set_remove_cb_n,utc_shortcut_startup,NULL},
- {"utc_shortcut_set_remove_cb_p",utc_shortcut_set_remove_cb_p,utc_shortcut_startup,NULL},
- {"utc_shortcut_unset_request_cb_n",utc_shortcut_unset_request_cb_n,utc_shortcut_startup,NULL},
- {"utc_shortcut_unset_request_cb_p",utc_shortcut_unset_request_cb_p,utc_shortcut_startup,NULL},
- {"utc_shortcut_unset_remove_cb_n",utc_shortcut_unset_remove_cb_n,utc_shortcut_startup,NULL},
- {"utc_shortcut_unset_remove_cb_p",utc_shortcut_unset_remove_cb_p,utc_shortcut_startup,NULL},
- {"utc_shortcut_get_list_n",utc_shortcut_get_list_n,utc_shortcut_startup,NULL},
- {"utc_shortcut_get_list_p",utc_shortcut_get_list_p,utc_shortcut_startup,NULL},
- {NULL, NULL}
-};
-
-#endif // __TCT_SHORTCUT-NATIVE_H__
+++ /dev/null
-//
-// 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_SHORTCUT-NATIVE_H__
-#define __TCT_SHORTCUT-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-extern void utc_shortcut_startup(void);
-
-extern int utc_shortcut_add_to_home_n(void);
-extern int utc_shortcut_add_to_home_p(void);
-extern int utc_shortcut_add_to_home_widget_n(void);
-extern int utc_shortcut_add_to_home_widget_p(void);
-extern int utc_shortcut_remove_from_home_n(void);
-extern int utc_shortcut_remove_from_home_p(void);
-extern int utc_shortcut_set_request_cb_n(void);
-extern int utc_shortcut_set_request_cb_p(void);
-extern int utc_shortcut_set_remove_cb_n(void);
-extern int utc_shortcut_set_remove_cb_p(void);
-extern int utc_shortcut_unset_request_cb_n(void);
-extern int utc_shortcut_unset_request_cb_p(void);
-extern int utc_shortcut_unset_remove_cb_n(void);
-extern int utc_shortcut_unset_remove_cb_p(void);
-extern int utc_shortcut_get_list_n(void);
-extern int utc_shortcut_get_list_p(void);
-
-testcase tc_array[] = {
- {"utc_shortcut_add_to_home_n",utc_shortcut_add_to_home_n,utc_shortcut_startup,NULL},
- {"utc_shortcut_add_to_home_p",utc_shortcut_add_to_home_p,utc_shortcut_startup,NULL},
- {"utc_shortcut_add_to_home_widget_n",utc_shortcut_add_to_home_widget_n,utc_shortcut_startup,NULL},
- {"utc_shortcut_add_to_home_widget_p",utc_shortcut_add_to_home_widget_p,utc_shortcut_startup,NULL},
- {"utc_shortcut_remove_from_home_n",utc_shortcut_remove_from_home_n,utc_shortcut_startup,NULL},
- {"utc_shortcut_remove_from_home_p",utc_shortcut_remove_from_home_p,utc_shortcut_startup,NULL},
- {"utc_shortcut_set_request_cb_n",utc_shortcut_set_request_cb_n,utc_shortcut_startup,NULL},
- {"utc_shortcut_set_request_cb_p",utc_shortcut_set_request_cb_p,utc_shortcut_startup,NULL},
- {"utc_shortcut_set_remove_cb_n",utc_shortcut_set_remove_cb_n,utc_shortcut_startup,NULL},
- {"utc_shortcut_set_remove_cb_p",utc_shortcut_set_remove_cb_p,utc_shortcut_startup,NULL},
- {"utc_shortcut_unset_request_cb_n",utc_shortcut_unset_request_cb_n,utc_shortcut_startup,NULL},
- {"utc_shortcut_unset_request_cb_p",utc_shortcut_unset_request_cb_p,utc_shortcut_startup,NULL},
- {"utc_shortcut_unset_remove_cb_n",utc_shortcut_unset_remove_cb_n,utc_shortcut_startup,NULL},
- {"utc_shortcut_unset_remove_cb_p",utc_shortcut_unset_remove_cb_p,utc_shortcut_startup,NULL},
- {"utc_shortcut_get_list_n",utc_shortcut_get_list_n,utc_shortcut_startup,NULL},
- {"utc_shortcut_get_list_p",utc_shortcut_get_list_p,utc_shortcut_startup,NULL},
- {NULL, NULL}
-};
-
-#endif // __TCT_SHORTCUT-NATIVE_H__
+++ /dev/null
-//
-// 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_SHORTCUT-NATIVE_H__
-#define __TCT_SHORTCUT-NATIVE_H__
-
-#include "testcase.h"
-#include "tct_common.h"
-
-
-
-testcase tc_array[] = {
- {NULL, NULL}
-};
-
-#endif // __TCT_SHORTCUT-NATIVE_H__
+++ /dev/null
-//
-// 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 "assert.h"
-#include <stdlib.h>
-#include <string.h>
-
-#include <system_info.h>
-
-#include <shortcut_manager.h>
-
-//& set: Shortcut
-
-#define SHORTCUT_FEATURE "http://tizen.org/feature/shortcut"
-static bool is_supported = false;
-
-void utc_shortcut_startup(void)
-{
- is_supported = false;
- system_info_get_platform_bool(SHORTCUT_FEATURE, &is_supported);
-}
-
-static int response_cb(int ret, void *data)
-{
- return 0;
-}
-
-/**
- * @testcase utc_shortcut_add_to_home_n
- * @since_tizen 2.3
- * @description Negative test case of shortcut_add_to_home()
- */
-int utc_shortcut_add_to_home_n(void)
-{
- int ret;
-
- ret = shortcut_add_to_home(NULL, -1, NULL, NULL, 1, NULL, NULL);
- if (!is_supported)
- assert_eq(ret, SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(ret, SHORTCUT_ERROR_INVALID_PARAMETER);
-
- return 0;
-}
-
-/**
- * @testcase utc_shortcut_add_to_home_p
- * @since_tizen 2.3
- * @description Positive test case of shortcut_add_to_home()
- */
-int utc_shortcut_add_to_home_p(void)
-{
- int ret;
-
- ret = shortcut_add_to_home(NULL, LAUNCH_BY_APP, NULL, NULL, 0, response_cb, NULL);
- if (!is_supported)
- assert_eq(ret, SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(ret, SHORTCUT_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_shortcut_add_to_home_widget_n
- * @since_tizen 2.3
- * @description Negative test case of shortcut_add_to_home_widget()
- */
-int utc_shortcut_add_to_home_widget_n(void)
-{
- int ret;
-
- ret = shortcut_add_to_home_widget(NULL, -1, NULL, NULL, -1.0f, 0, response_cb, NULL);
- if (!is_supported)
- assert_eq(ret, SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(ret, SHORTCUT_ERROR_INVALID_PARAMETER);
-
- return 0;
-}
-
-/**
- * @testcase utc_shortcut_add_to_home_widget_p
- * @since_tizen 2.4
- * @description Positive test case of shortcut_add_to_home_widget()
- */
-int utc_shortcut_add_to_home_widget_p(void)
-{
- int ret;
-
- ret = shortcut_add_to_home_widget("org.tizen.message", WIDGET_SIZE_1x1, NULL, NULL, -1.0f, 0, response_cb, NULL);
- if (!is_supported)
- assert_eq(ret, SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(ret, SHORTCUT_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_shortcut_remove_from_home_n
- * @since_tizen 3.0
- * @description Negative test case of shortcut_remove_from_home()
- */
-int utc_shortcut_remove_from_home_n(void)
-{
- int ret;
-
- ret = shortcut_remove_from_home(NULL, response_cb, NULL);
- if (!is_supported)
- assert_eq(ret, SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(ret, SHORTCUT_ERROR_INVALID_PARAMETER);
-
- return 0;
-}
-
-/**
- * @testcase utc_shortcut_remove_from_home_p
- * @since_tizen 3.0
- * @description Positive test case of shortcut_remove_from_home()
- */
-int utc_shortcut_remove_from_home_p(void)
-{
- int ret;
-
- ret = shortcut_remove_from_home("", response_cb, NULL);
- if (!is_supported)
- assert_eq(ret, SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(ret, SHORTCUT_ERROR_NONE);
-
- return 0;
-}
-
-int _request_cb(const char *package_name, const char *name, int type, const char *content_info, const char *icon, int pid, double period, int allow_duplicate, void *data)
-{
- fprintf(stderr, "_request_cb");
- return SHORTCUT_ERROR_NONE;
-}
-
-int _remove_cb(const char *package_name, const char *name, int sender_pid, void *user_data)
-{
- fprintf(stderr, "_remove_cb");
- return SHORTCUT_ERROR_NONE;
-}
-
-/**
- * @testcase utc_shortcut_set_request_cb_n
- * @since_tizen 2.3
- * @description Negative test case of shortcut_set_request_cb()
- */
-int utc_shortcut_set_request_cb_n(void)
-{
- int ret;
-
- ret = shortcut_set_request_cb(NULL, "temp");
- if (!is_supported)
- assert_eq(ret, SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(ret, SHORTCUT_ERROR_INVALID_PARAMETER);
-
- return 0;
-}
-
-/**
- * @testcase utc_shortcut_set_request_cb_p
- * @since_tizen 2.3
- * @description Positive test case of shortcut_set_request_cb()
- */
-int utc_shortcut_set_request_cb_p(void)
-{
- int ret;
-
- ret = shortcut_set_request_cb(_request_cb, "temp");
- if (!is_supported)
- assert_eq(ret, SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(ret, SHORTCUT_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_shortcut_set_remove_cb_n
- * @since_tizen 3.0
- * @description Negative test case of shortcut_set_remove_cb()
- */
-int utc_shortcut_set_remove_cb_n(void)
-{
- int ret;
-
- ret = shortcut_set_remove_cb(NULL, "temp");
- if (!is_supported)
- assert_eq(ret, SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(ret, SHORTCUT_ERROR_INVALID_PARAMETER);
-
- return 0;
-}
-
-/**
- * @testcase utc_shortcut_set_remove_cb_p
- * @since_tizen 3.0
- * @description Positive test case of shortcut_set_remove_cb()
- */
-int utc_shortcut_set_remove_cb_p(void)
-{
- int ret;
-
- ret = shortcut_set_remove_cb(_remove_cb, "temp");
- if (!is_supported)
- assert_eq(ret, SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(ret, SHORTCUT_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_shortcut_unset_request_cb_n
- * @since_tizen 3.0
- * @description Negative test case of shortcut_unset_request_cb()
- */
-int utc_shortcut_unset_request_cb_n(void)
-{
- int ret;
-
- ret = shortcut_set_request_cb(NULL, "temp");
- if (!is_supported)
- assert_eq(ret, SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(ret, SHORTCUT_ERROR_INVALID_PARAMETER);
-
- shortcut_unset_request_cb();
- if (!is_supported)
- assert_eq(get_last_result(), SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(get_last_result(), SHORTCUT_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_shortcut_unset_request_cb_p
- * @since_tizen 3.0
- * @description Positive test case of shortcut_unset_request_cb()
- */
-int utc_shortcut_unset_request_cb_p(void)
-{
- int ret;
-
- ret = shortcut_set_request_cb(_request_cb, "temp");
- if (!is_supported)
- assert_eq(ret, SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(ret, SHORTCUT_ERROR_NONE);
-
- shortcut_unset_request_cb();
- if (!is_supported)
- assert_eq(get_last_result(), SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(get_last_result(), SHORTCUT_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_shortcut_unset_remove_cb_n
- * @since_tizen 3.0
- * @description Negative test case of shortcut_unset_remove_cb()
- */
-int utc_shortcut_unset_remove_cb_n(void)
-{
- int ret;
-
- ret = shortcut_set_remove_cb(NULL, "temp");
- if (!is_supported)
- assert_eq(ret, SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(ret, SHORTCUT_ERROR_INVALID_PARAMETER);
-
- shortcut_unset_remove_cb();
- if (!is_supported)
- assert_eq(get_last_result(), SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(get_last_result(), SHORTCUT_ERROR_NONE);
-
- return 0;
-}
-
-/**
- * @testcase utc_shortcut_unset_remove_cb_p
- * @since_tizen 3.0
- * @description Positive test case of shortcut_unset_remove_cb()
- */
-int utc_shortcut_unset_remove_cb_p(void)
-{
- int ret;
-
- ret = shortcut_set_remove_cb(_remove_cb, "temp");
- if (!is_supported)
- assert_eq(ret, SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(ret, SHORTCUT_ERROR_NONE);
-
- shortcut_unset_remove_cb();
- if (!is_supported)
- assert_eq(get_last_result(), SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(get_last_result(), SHORTCUT_ERROR_NONE);
- return 0;
-}
-
-int list_cb(const char *package_name, const char *icon, const char *name, const char *extra_key, const char *extra_data, void *user_data)
-{
- return SHORTCUT_ERROR_NONE;
-}
-
-/**
- * @testcase utc_shortcut_get_list_n
- * @since_tizen 2.3
- * @description Negative test case of shortcut_get_list()
- */
-int utc_shortcut_get_list_n(void)
-{
- int ret;
-
- ret = shortcut_get_list(NULL, NULL, NULL);
- if (!is_supported)
- assert_eq(ret, SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(ret, SHORTCUT_ERROR_INVALID_PARAMETER);
-
- return 0;
-}
-
-/**
- * @testcase utc_shortcut_get_list_p
- * @since_tizen 2.3
- * @description Positive test case of shortcut_get_list()
- */
-int utc_shortcut_get_list_p(void)
-{
- int ret;
-
- ret = shortcut_get_list("org.tizen.message", list_cb, NULL);
- if (!is_supported)
- assert_eq(ret, SHORTCUT_ERROR_NOT_SUPPORTED);
- else
- assert_eq(ret, SHORTCUT_ERROR_NONE);
-
- return 0;
-}