BuildRequires: pkgconfig(bundle)
BuildRequires: pkgconfig(accounts-svc)
BuildRequires: pkgconfig(capi-system-info)
+BuildRequires: pkgconfig(capi-telephony)
%description
Native API Integration TC (%{name})
accounts-svc
capi-system-info
dlog elementary
+ capi-telephony
)
INCLUDE_DIRECTORIES(
#include <contacts.h>
#include <glib.h>
#include <app.h>
+#include <telephony.h>
/** @addtogroup itc-contacts-service2
* @ingroup itc
* @ingroup itc-contacts_service2-sim
* @{
*/
+
+#ifdef WEARABLE //Starts WEARABLE
//& purpose: Checks whether SIM initialization is completed or not.
//& type: auto
return 0;
}
+
+#endif //End WEARABLE
+
+//& purpose: Checks whether SIM of the given SIM slot number is initialized
+//& type: auto
+
+/**
+* @testcase ITc_contacts_sim_get_initialization_status_by_sim_slot_no_p
+* @since_tizen 3.0
+* @author SRID(a.pandia1)
+* @reviewer SRID(shilpa.j)
+* @type auto
+* @description Checks whether SIM of the given SIM slot number is initialized
+* @scenario Telephony init\n
+* Check initialization status\n
+* Telephony deinit
+* @apicovered contacts_sim_get_initialization_status_by_sim_slot_no
+* @passcase When contacts_sim_get_initialization_status_by_sim_slot_no is successful.
+* @failcase If target API fails or any precondition API fails.
+* @precondition telephony_init should be called as precondition API
+* @postcondition None
+*/
+int ITc_contacts_sim_get_initialization_status_by_sim_slot_no_p(void)
+{
+ START_TEST;
+ telephony_handle_list_s hTelList;
+ int nSimSlotNo = 0;
+ bool bInitComplete = false;
+
+ int nRet = telephony_init(&hTelList);
+ PRINT_RESULT(TELEPHONY_ERROR_NONE, nRet, "telephony_init", "Telephony Api Failed");
+
+ for (nSimSlotNo = 0; nSimSlotNo < hTelList.count; nSimSlotNo++)
+ {
+ nRet = contacts_sim_get_initialization_status_by_sim_slot_no(nSimSlotNo, &bInitComplete);
+ if ( !g_bFeatureIsSupported )
+ {
+ telephony_deinit(&hTelList);
+ if(nRet != TIZEN_ERROR_NOT_SUPPORTED)
+ {
+ FPRINTF("[Line : %d][%s] contacts_sim_get_initialization_status_by_sim_slot_no API call returned mismatch %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, ContactsServiceGetError(nRet));
+ return 1;
+ }
+ else
+ {
+ FPRINTF("[Line : %d][%s] Telephony feature is not supported, Leaving test\\n", __LINE__, API_NAMESPACE);
+ return 0;
+ }
+ }
+ PRINT_RESULT_CLEANUP(CONTACTS_ERROR_NONE, nRet, "contacts_sim_get_initialization_status_by_sim_slot_no",
+ ContactsServiceGetError(nRet), telephony_deinit(&hTelList));
+ if ( bInitComplete == false )
+ {
+ FPRINTF("[Line : %d][%s] Sim not initialized for slot number = %d\\n", __LINE__ , API_NAMESPACE, nSimSlotNo);
+ }
+ }
+ telephony_deinit(&hTelList);
+ return 0;
+}
+
+//& purpose: Imports all contacts from SIM of the given SIM slot number to Contacts Database.
+//& type: auto
+
+/**
+* @testcase ITc_contacts_sim_import_all_contacts_by_sim_slot_no_p
+* @since_tizen 3.0
+* @author SRID(a.pandia1)
+* @reviewer SRID(shilpa.j)
+* @type auto
+* @description Imports all contacts from SIM of the given SIM slot number to Contacts Database.
+* @scenario Telephony init\n
+* Imports contacts from SIM slot number\n
+* Telephony deinit
+* @apicovered contacts_sim_import_all_contacts_by_sim_slot_no
+* @passcase When contacts_sim_import_all_contacts_by_sim_slot_no is successful.
+* @failcase If target API fails or any precondition API fails.
+* @precondition telephony_init should be called as precondition API
+* @postcondition None
+*/
+int ITc_contacts_sim_import_all_contacts_by_sim_slot_no_p(void)
+{
+ START_TEST;
+ telephony_handle_list_s hTelList;
+ int nSimSlotNo = 0;
+
+ int nRet = telephony_init(&hTelList);
+ PRINT_RESULT(TELEPHONY_ERROR_NONE, nRet, "telephony_init", "Telephony Api Failed");
+
+ for (nSimSlotNo = 0; nSimSlotNo < hTelList.count; nSimSlotNo++)
+ {
+ nRet = contacts_sim_import_all_contacts_by_sim_slot_no(nSimSlotNo);
+ if ( !g_bFeatureIsSupported )
+ {
+ telephony_deinit(&hTelList);
+ if(nRet != TIZEN_ERROR_NOT_SUPPORTED)
+ {
+ FPRINTF("[Line : %d][%s] contacts_sim_import_all_contacts_by_sim_slot_no API call returned mismatch %s error for unsupported feature\\n", __LINE__, API_NAMESPACE, ContactsServiceGetError(nRet));
+ return 1;
+ }
+ else
+ {
+ FPRINTF("[Line : %d][%s] Telephony feature is not supported, Leaving test\\n", __LINE__, API_NAMESPACE);
+ return 0;
+ }
+ }
+
+ if (CONTACTS_ERROR_NO_DATA != nRet && 0 != nSimSlotNo)
+ {
+ if ((CONTACTS_ERROR_NONE != nRet && CONTACTS_ERROR_NO_DATA != nRet) || (CONTACTS_ERROR_NO_DATA == nRet && 0 == nSimSlotNo))
+ {
+ FPRINTF("[Line : %d][%s] contacts_sim_import_all_contacts_by_sim_slot_no failed, error returned = %s [%d]\\n", __LINE__, API_NAMESPACE, ContactsServiceGetError(nRet), nRet);
+ telephony_deinit(&hTelList);
+ return 1;
+ }
+ }
+ }
+ telephony_deinit(&hTelList);
+
+ return 0;
+}
+
/** @} */
/** @} */
extern int ITc_contacts_setting_set_get_name_sorting_order_p(void);
extern int ITc_contacts_setting_add_remove_name_display_order_changed_cb_p(void);
extern int ITc_contacts_setting_add_remove_name_sorting_order_changed_cb_p(void);
-extern int ITc_contacts_sim_get_initialization_status_p(void);
-extern int ITc_contacts_sim_import_all_contacts_p(void);
extern int ITc_contacts_record_create_destroy_sip_p(void);
extern int ITc_contacts_record_set_get_str_sip_p(void);
extern int ITc_contacts_record_set_get_int_sip_p(void);
extern int ITc_contacts_db_search_records_with_query_for_snippet_p(void);
extern int ITc_contacts_db_search_records_with_range_for_snippet_p(void);
extern int ITc_contacts_db_search_records_for_snippet_p(void);
+extern int ITc_contacts_sim_get_initialization_status_by_sim_slot_no_p(void);
+extern int ITc_contacts_sim_import_all_contacts_by_sim_slot_no_p(void);
testcase tc_array[] = {
{"ITc_contacts_activity_delete_by_account_id_p", ITc_contacts_activity_delete_by_account_id_p, ITs_contacts_service2_activity_startup, ITs_contacts_service2_activity_cleanup},
{"ITc_contacts_setting_set_get_name_sorting_order_p", ITc_contacts_setting_set_get_name_sorting_order_p, ITs_contacts_service2_setting_startup, ITs_contacts_service2_setting_cleanup},
{"ITc_contacts_setting_add_remove_name_display_order_changed_cb_p", ITc_contacts_setting_add_remove_name_display_order_changed_cb_p, ITs_contacts_service2_setting_startup, ITs_contacts_service2_setting_cleanup},
{"ITc_contacts_setting_add_remove_name_sorting_order_changed_cb_p", ITc_contacts_setting_add_remove_name_sorting_order_changed_cb_p, ITs_contacts_service2_setting_startup, ITs_contacts_service2_setting_cleanup},
- {"ITc_contacts_sim_get_initialization_status_p", ITc_contacts_sim_get_initialization_status_p, ITs_contacts_service2_sim_startup, ITs_contacts_service2_sim_cleanup},
- {"ITc_contacts_sim_import_all_contacts_p", ITc_contacts_sim_import_all_contacts_p, ITs_contacts_service2_sim_startup, ITs_contacts_service2_sim_cleanup},
{"ITc_contacts_record_create_destroy_sip_p", ITc_contacts_record_create_destroy_sip_p, ITs_contacts_service2_sip_startup, ITs_contacts_service2_sip_cleanup},
{"ITc_contacts_record_set_get_str_sip_p", ITc_contacts_record_set_get_str_sip_p, ITs_contacts_service2_sip_startup, ITs_contacts_service2_sip_cleanup},
{"ITc_contacts_record_set_get_int_sip_p", ITc_contacts_record_set_get_int_sip_p, ITs_contacts_service2_sip_startup, ITs_contacts_service2_sip_cleanup},
{"ITc_contacts_db_search_records_with_query_for_snippet_p", ITc_contacts_db_search_records_with_query_for_snippet_p, ITs_contacts_service2_database_startup, ITs_contacts_service2_database_cleanup},
{"ITc_contacts_db_search_records_with_range_for_snippet_p", ITc_contacts_db_search_records_with_range_for_snippet_p, ITs_contacts_service2_database_startup, ITs_contacts_service2_database_cleanup},
{"ITc_contacts_db_search_records_for_snippet_p", ITc_contacts_db_search_records_for_snippet_p, ITs_contacts_service2_database_startup,ITs_contacts_service2_database_cleanup},
- {NULL, NULL}
+ {"ITc_contacts_sim_get_initialization_status_by_sim_slot_no_p", ITc_contacts_sim_get_initialization_status_by_sim_slot_no_p, ITs_contacts_service2_sim_startup, ITs_contacts_service2_sim_cleanup},
+ {"ITc_contacts_sim_import_all_contacts_by_sim_slot_no_p", ITc_contacts_sim_import_all_contacts_by_sim_slot_no_p, ITs_contacts_service2_sim_startup, ITs_contacts_service2_sim_cleanup},
+ {NULL, NULL}
};
#endif // __TCT_CONTACTS_SERVICE2_NATIVE_H__
extern int ITc_contacts_setting_add_remove_name_sorting_order_changed_cb_p(void);
extern int ITc_contacts_sim_get_initialization_status_p(void);
extern int ITc_contacts_sim_import_all_contacts_p(void);
+extern int ITc_contacts_sim_get_initialization_status_by_sim_slot_no_p(void);
+extern int ITc_contacts_sim_import_all_contacts_by_sim_slot_no_p(void);
extern int ITc_contacts_record_create_destroy_sip_p(void);
extern int ITc_contacts_record_set_get_str_sip_p(void);
extern int ITc_contacts_record_set_get_int_sip_p(void);
{"ITc_contacts_setting_add_remove_name_sorting_order_changed_cb_p", ITc_contacts_setting_add_remove_name_sorting_order_changed_cb_p, ITs_contacts_service2_setting_startup, ITs_contacts_service2_setting_cleanup},
{"ITc_contacts_sim_get_initialization_status_p", ITc_contacts_sim_get_initialization_status_p, ITs_contacts_service2_sim_startup, ITs_contacts_service2_sim_cleanup},
{"ITc_contacts_sim_import_all_contacts_p", ITc_contacts_sim_import_all_contacts_p, ITs_contacts_service2_sim_startup, ITs_contacts_service2_sim_cleanup},
+ {"ITc_contacts_sim_get_initialization_status_by_sim_slot_no_p", ITc_contacts_sim_get_initialization_status_by_sim_slot_no_p, ITs_contacts_service2_sim_startup, ITs_contacts_service2_sim_cleanup},
+ {"ITc_contacts_sim_import_all_contacts_by_sim_slot_no_p", ITc_contacts_sim_import_all_contacts_by_sim_slot_no_p, ITs_contacts_service2_sim_startup, ITs_contacts_service2_sim_cleanup},
{"ITc_contacts_record_create_destroy_sip_p", ITc_contacts_record_create_destroy_sip_p, ITs_contacts_service2_sip_startup, ITs_contacts_service2_sip_cleanup},
{"ITc_contacts_record_set_get_str_sip_p", ITc_contacts_record_set_get_str_sip_p, ITs_contacts_service2_sip_startup, ITs_contacts_service2_sip_cleanup},
{"ITc_contacts_record_set_get_int_sip_p", ITc_contacts_record_set_get_int_sip_p, ITs_contacts_service2_sip_startup, ITs_contacts_service2_sip_cleanup},