extern int utc_account_foreach_account_from_db_n(void);
extern int utc_account_query_account_by_account_id_p(void);
extern int utc_account_query_account_by_account_id_n(void);
+extern int utc_account_query_deleted_account_info_by_account_id_p(void);
+extern int utc_account_query_deleted_account_info_by_account_id_n(void);
extern int utc_account_query_account_by_user_name_p(void);
extern int utc_account_query_account_by_user_name_n(void);
extern int utc_account_query_account_by_package_name_p(void);
{"utc_account_foreach_account_from_db_n",utc_account_foreach_account_from_db_n,utc_account_startup,utc_account_cleanup},
{"utc_account_query_account_by_account_id_p",utc_account_query_account_by_account_id_p,utc_account_startup,utc_account_cleanup},
{"utc_account_query_account_by_account_id_n",utc_account_query_account_by_account_id_n,utc_account_startup,utc_account_cleanup},
+ {"utc_account_query_deleted_account_info_by_account_id_p",utc_account_query_deleted_account_info_by_account_id_p,utc_account_startup,utc_account_cleanup},
+ {"utc_account_query_deleted_account_info_by_account_id_n",utc_account_query_deleted_account_info_by_account_id_n,utc_account_startup,utc_account_cleanup},
{"utc_account_query_account_by_user_name_p",utc_account_query_account_by_user_name_p,utc_account_startup,utc_account_cleanup},
{"utc_account_query_account_by_user_name_n",utc_account_query_account_by_user_name_n,utc_account_startup,utc_account_cleanup},
{"utc_account_query_account_by_package_name_p",utc_account_query_account_by_package_name_p,utc_account_startup,utc_account_cleanup},
extern int utc_account_foreach_account_from_db_n(void);
extern int utc_account_query_account_by_account_id_p(void);
extern int utc_account_query_account_by_account_id_n(void);
+extern int utc_account_query_deleted_account_info_by_account_id_p(void);
+extern int utc_account_query_deleted_account_info_by_account_id_n(void);
extern int utc_account_query_account_by_user_name_p(void);
extern int utc_account_query_account_by_user_name_n(void);
extern int utc_account_query_account_by_package_name_p(void);
{"utc_account_foreach_account_from_db_n",utc_account_foreach_account_from_db_n,utc_account_startup,utc_account_cleanup},
{"utc_account_query_account_by_account_id_p",utc_account_query_account_by_account_id_p,utc_account_startup,utc_account_cleanup},
{"utc_account_query_account_by_account_id_n",utc_account_query_account_by_account_id_n,utc_account_startup,utc_account_cleanup},
+ {"utc_account_query_deleted_account_info_by_account_id_p",utc_account_query_deleted_account_info_by_account_id_p,utc_account_startup,utc_account_cleanup},
+ {"utc_account_query_deleted_account_info_by_account_id_n",utc_account_query_deleted_account_info_by_account_id_n,utc_account_startup,utc_account_cleanup},
{"utc_account_query_account_by_user_name_p",utc_account_query_account_by_user_name_p,utc_account_startup,utc_account_cleanup},
{"utc_account_query_account_by_user_name_n",utc_account_query_account_by_user_name_n,utc_account_startup,utc_account_cleanup},
{"utc_account_query_account_by_package_name_p",utc_account_query_account_by_package_name_p,utc_account_startup,utc_account_cleanup},
extern int utc_account_foreach_account_from_db_n(void);
extern int utc_account_query_account_by_account_id_p(void);
extern int utc_account_query_account_by_account_id_n(void);
+extern int utc_account_query_deleted_account_info_by_account_id_p(void);
+extern int utc_account_query_deleted_account_info_by_account_id_n(void);
extern int utc_account_query_account_by_user_name_p(void);
extern int utc_account_query_account_by_user_name_n(void);
extern int utc_account_query_account_by_package_name_p(void);
{"utc_account_foreach_account_from_db_n",utc_account_foreach_account_from_db_n,utc_account_startup,utc_account_cleanup},
{"utc_account_query_account_by_account_id_p",utc_account_query_account_by_account_id_p,utc_account_startup,utc_account_cleanup},
{"utc_account_query_account_by_account_id_n",utc_account_query_account_by_account_id_n,utc_account_startup,utc_account_cleanup},
+ {"utc_account_query_deleted_account_info_by_account_id_p",utc_account_query_deleted_account_info_by_account_id_p,utc_account_startup,utc_account_cleanup},
+ {"utc_account_query_deleted_account_info_by_account_id_n",utc_account_query_deleted_account_info_by_account_id_n,utc_account_startup,utc_account_cleanup},
{"utc_account_query_account_by_user_name_p",utc_account_query_account_by_user_name_p,utc_account_startup,utc_account_cleanup},
{"utc_account_query_account_by_user_name_n",utc_account_query_account_by_user_name_n,utc_account_startup,utc_account_cleanup},
{"utc_account_query_account_by_package_name_p",utc_account_query_account_by_package_name_p,utc_account_startup,utc_account_cleanup},
return 0;
}
+/**
+ * @testcase utc_account_query_deleted_account_info_by_account_id_p
+ * @since_tizen 5.5
+ * @description Positive test case of account_query_deleted_account_info_by_account_id()
+ */
+int utc_account_query_deleted_account_info_by_account_id_p(void)
+{
+ assert(created);
+ int ret = ACCOUNT_ERROR_NONE;
+ int account_id = -1;
+ account_h ret_account = NULL;
+ account_h del_account = NULL;
+ char* ret_user_name = NULL;
+ char* del_user_name = NULL;
+ char* ret_package_name = NULL;
+ char* del_package_name = NULL;
+
+ account_capability_state_e ret_capability_type = 0;
+ account_capability_state_e del_capability_type = 0;
+
+ ret = account_set_user_name(account, user_name);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
+ ret = account_set_package_name(account, package_name);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
+ ret = account_set_capability(account, contact_capability, ACCOUNT_CAPABILITY_ENABLED);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
+ /* insert account */
+ ret = account_insert_to_db(account, &account_id);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
+ /* get inserted account handle */
+ ret = account_create(&ret_account);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
+ ret = account_query_account_by_account_id(account_id, &ret_account);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
+ /* delete account */
+ ret = account_delete_from_db_by_id(account_id);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
+ /* get deleted account handle */
+ ret = account_create(&del_account);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
+ ret = account_query_deleted_account_info_by_account_id(account_id, &del_account);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
+ /* get user-names of both inserted & deleted account handles */
+ ret = account_get_user_name(ret_account, &ret_user_name);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
+ ret = account_get_user_name(del_account, &del_user_name);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
+ /* get package-names of both inserted & deleted account handles */
+ ret = account_get_package_name(ret_account, &ret_package_name);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
+ ret = account_get_package_name(del_account, &del_package_name);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
+ /* get capabilities */
+ ret = account_get_capability(ret_account, contact_capability, &ret_capability_type);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
+ ret = account_get_capability(del_account, contact_capability, &del_capability_type);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
+ /* compare inserted info with original info */
+ assert_eq(strcmp(ret_user_name, user_name), 0);
+ assert_eq(strcmp(ret_package_name, package_name), 0);
+ assert_eq(ret_capability_type, ACCOUNT_CAPABILITY_ENABLED);
+
+ /* compare deleted info with inserted info */
+ assert_eq(strcmp(ret_user_name, del_user_name), 0);
+ assert_eq(strcmp(ret_package_name, del_package_name), 0);
+ assert_eq(del_capability_type, ACCOUNT_CAPABILITY_ENABLED);
+
+ _account_free_text(ret_user_name);
+ _account_free_text(ret_package_name);
+
+ _account_free_text(del_user_name);
+ _account_free_text(del_package_name);
+
+ ret = account_destroy(ret_account);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
+ ret = account_destroy(del_account);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
+ return 0;
+}
+
+/**
+ * @testcase utc_account_query_deleted_account_info_by_account_id_n
+ * @since_tizen 5.5
+ * @description Negative test case of account_query_deleted_account_info_by_account_id()
+ */
+int utc_account_query_deleted_account_info_by_account_id_n(void)
+{
+ assert(created);
+ int ret = ACCOUNT_ERROR_NONE;
+ int account_id = -1;
+ account_h ret_account = NULL;
+
+ ret = account_query_deleted_account_info_by_account_id(10000, NULL);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
+
+ ret = account_query_deleted_account_info_by_account_id(-9999, &account);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
+
+ return 0;
+}
+
/**
* @testcase utc_account_query_account_by_user_name_p
* @since_tizen 2.3