#include <dlog.h>
#include <app.h>
#include <tct_common.h>
+#include <system_info.h>
#define TEST_PACKAGE_NAME "core.accounts-svc-tests" // app_id
#define USER_NAME "user_name"
#define TPK_APP_PREFIX "org.tizen."
#define API_NAMESPACE "accounts-svc"
+#define ACCOUNT_FEATURE "http://tizen.org/feature/account"
#define check_fail(exp) \
if (!(exp)) { \
//& set: AccountsSvc
static bool created = false;
static account_h account = NULL;
-static GMainLoop* mainloop = NULL;
static int _is_fail = true;
+static bool is_account_supported = false;
static const char* package_name = TEST_PACKAGE_NAME;
static const char* test_label_default = LABEL_DEFAULT;
static const char* test_label_en_gb = LABEL_EN_GB;
*/
void utc_account_startup(void)
{
- account_type_h account_type = NULL;
- int account_type_id = -1;
+ /* start of TC */
+ system_info_get_platform_bool(ACCOUNT_FEATURE, &is_account_supported);
+
int ret1 = account_create(&account);
if (ACCOUNT_ERROR_NONE == ret1) {
created = true;
*/
void utc_account_cleanup(void)
{
- int ret1 = ACCOUNT_ERROR_NONE, ret2 = ACCOUNT_ERROR_NONE;
+ int ret1 = ACCOUNT_ERROR_NONE;
ret1 = account_destroy(account);
if (ACCOUNT_ERROR_NONE == ret1) {
created = false;
account_h account_data = NULL;
ret = account_create(&account_data);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_destroy(account_data);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_create(NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int i = -1;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_display_name(account, display_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_icon_path(account, icon_path);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_domain_name(account, domain_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_email_address(account, email_address);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_source(account, source);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_custom(account, key, value);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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, capability_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_access_token(account, access_token);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
for (i = 0; i < 5; i++){
ret = account_set_user_text(account, i, user_text);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
}
for (i = 0; i < 5; i++){
ret = account_set_user_int(account, i, i*10);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
}
ret = account_set_auth_type(account, auth_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_secret(account, secrecy_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_sync_support(account, sync_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_insert_to_db(account, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_create(&ret_account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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(ret != ACCOUNT_ERROR_NONE) {
- account_destroy(ret_account);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ if(ret != ACCOUNT_ERROR_NONE) {
+ account_destroy(ret_account);
+ }
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
}
- assert_eq(ret, ACCOUNT_ERROR_NONE);
// User Name
ret = account_get_user_name(ret_account, &ret_user_name);
- assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_user_name, ret_account);
- assert_eq_free_text(strcmp(ret_user_name, user_name), 0, ret_user_name, ret_account);
- _account_free_text(ret_user_name);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ _account_free_text(ret_user_name);
+ }
+ else
+ {
+ assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_user_name, ret_account);
+ assert_eq_free_text(strcmp(ret_user_name, user_name), 0, ret_user_name, ret_account);
+ _account_free_text(ret_user_name);
+ }
// Package Name
ret = account_get_package_name(ret_account, &ret_package_name);
- assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_package_name, ret_account);
- assert_eq_free_text(strcmp(ret_package_name, package_name), 0, ret_package_name, ret_account);
- _account_free_text(ret_package_name);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ _account_free_text(ret_package_name);
+ }
+ else
+ {
+ assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_package_name, ret_account);
+ assert_eq_free_text(strcmp(ret_package_name, package_name), 0, ret_package_name, ret_account);
+ _account_free_text(ret_package_name);
+ }
// Display Name
ret = account_get_display_name(ret_account, &ret_display_name);
- assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_display_name, ret_account);
- assert_eq_free_text(strcmp(ret_display_name, display_name), 0, ret_display_name, ret_account);
- _account_free_text(ret_display_name);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ _account_free_text(ret_display_name);
+ }
+ else
+ {
+ assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_display_name, ret_account);
+ assert_eq_free_text(strcmp(ret_display_name, display_name), 0, ret_display_name, ret_account);
+ _account_free_text(ret_display_name);
+ }
// Icon Path
ret = account_get_icon_path(ret_account, &ret_icon_path);
- assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_icon_path, ret_account);
- assert_eq_free_text(strcmp(ret_icon_path, icon_path), 0, ret_icon_path, ret_account);
- _account_free_text(ret_icon_path);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ _account_free_text(ret_icon_path);
+ }
+ else
+ {
+ assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_icon_path, ret_account);
+ assert_eq_free_text(strcmp(ret_icon_path, icon_path), 0, ret_icon_path, ret_account);
+ _account_free_text(ret_icon_path);
+ }
// Domain Name
ret = account_get_domain_name(ret_account, &ret_domain_name);
- assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_domain_name, ret_account);
- assert_eq_free_text(strcmp(ret_domain_name, domain_name), 0, ret_domain_name, ret_account);
- _account_free_text(ret_domain_name);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ _account_free_text(ret_domain_name);
+ }
+ else
+ {
+ assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_domain_name, ret_account);
+ assert_eq_free_text(strcmp(ret_domain_name, domain_name), 0, ret_domain_name, ret_account);
+ _account_free_text(ret_domain_name);
+ }
// Email Address
ret = account_get_email_address(ret_account, &ret_email_address);
- assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_email_address, ret_account);
- assert_eq_free_text(strcmp(ret_email_address, email_address), 0, ret_email_address, ret_account);
- _account_free_text(ret_email_address);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ _account_free_text(ret_email_address);
+ }
+ else
+ {
+ assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_email_address, ret_account);
+ assert_eq_free_text(strcmp(ret_email_address, email_address), 0, ret_email_address, ret_account);
+ _account_free_text(ret_email_address);
+ }
// Source
ret = account_get_source(ret_account, &ret_source);
- assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_source, ret_account);
- assert_eq_free_text(strcmp(ret_source, source), 0, ret_source, ret_account);
- _account_free_text(ret_source);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ _account_free_text(ret_source);
+ }
+ else
+ {
+ assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_source, ret_account);
+ assert_eq_free_text(strcmp(ret_source, source), 0, ret_source, ret_account);
+ _account_free_text(ret_source);
+ }
// Custom
ret = account_get_custom(ret_account, key, &ret_value);
- assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_value, ret_account);
- assert_eq_free_text(strcmp(ret_value, value), 0, ret_value, ret_account);
- _account_free_text(ret_value);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ _account_free_text(ret_value);
+ }
+ else
+ {
+ assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_value, ret_account);
+ assert_eq_free_text(strcmp(ret_value, value), 0, ret_value, ret_account);
+ _account_free_text(ret_value);
+ }
// Capability
ret = account_get_capability(ret_account, contact_capability, &ret_capability_state);
- assert_eq_free(ret, ACCOUNT_ERROR_NONE, ret_account);
- assert_eq_free(ret_capability_state, capability_state, ret_account);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq_free(ret, ACCOUNT_ERROR_NONE, ret_account);
+ assert_eq_free(ret_capability_state, capability_state, ret_account);
+ }
// Access Token
ret = account_get_access_token(ret_account, &ret_access_token);
- assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_access_token, ret_account);
- if (ret_access_token != NULL && access_token != NULL) {
- assert_eq_free_text(strcmp(ret_access_token, access_token), 0, ret_access_token, ret_account);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ _account_free_text(ret_access_token);
+ }
+ else
+ {
+ assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_access_token, ret_account);
+ if (ret_access_token != NULL && access_token != NULL) {
+ assert_eq_free_text(strcmp(ret_access_token, access_token), 0, ret_access_token, ret_account);
+ }
+ _account_free_text(ret_access_token);
}
- _account_free_text(ret_access_token);
// User Text
for (i = 0; i < 5; i++){
ret = account_get_user_text(ret_account, i, &ret_user_text);
- assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_user_text, ret_account);
- assert_eq_free_text(strcmp(ret_user_text, user_text), 0, ret_user_text, ret_account);
- _account_free_text(ret_user_text);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ _account_free_text(ret_user_text);
+ }
+ else
+ {
+ assert_eq_free_text(ret, ACCOUNT_ERROR_NONE, ret_user_text, ret_account);
+ assert_eq_free_text(strcmp(ret_user_text, user_text), 0, ret_user_text, ret_account);
+ _account_free_text(ret_user_text);
+ }
}
// User Int
for (i = 0; i < 5; i++){
int ret_user_int = -1;
ret = account_get_user_int(ret_account, i, &ret_user_int);
- assert_eq_free(ret, ACCOUNT_ERROR_NONE, ret_account);
- assert_eq_free(ret_user_int, i*10, ret_account);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq_free(ret, ACCOUNT_ERROR_NONE, ret_account);
+ assert_eq_free(ret_user_int, i*10, ret_account);
+ }
}
// Auth Type
ret = account_get_auth_type(ret_account, &ret_auth_type);
- assert_eq_free(ret, ACCOUNT_ERROR_NONE, ret_account);
- assert_eq_free(ret_auth_type, auth_type, ret_account);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq_free(ret, ACCOUNT_ERROR_NONE, ret_account);
+ assert_eq_free(ret_auth_type, auth_type, ret_account);
+ }
// Secret
ret = account_get_secret(ret_account, &ret_secrecy_state);
- assert_eq_free(ret, ACCOUNT_ERROR_NONE, ret_account);
- assert_eq_free(ret_secrecy_state, secrecy_state, ret_account);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq_free(ret, ACCOUNT_ERROR_NONE, ret_account);
+ assert_eq_free(ret_secrecy_state, secrecy_state, ret_account);
+ }
// Sync Support
ret = account_get_sync_support(ret_account, &ret_sync_state);
- assert_eq_free(ret, ACCOUNT_ERROR_NONE, ret_account);
- assert_eq_free(ret_sync_state, sync_state, ret_account);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq_free(ret, ACCOUNT_ERROR_NONE, ret_account);
+ assert_eq_free(ret_sync_state, sync_state, ret_account);
+ }
ret = account_destroy(ret_account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_delete_from_db_by_id(account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_insert_to_db(NULL, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_insert_to_db(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
const char* display_name = "display_name";
ret = account_set_display_name(account, display_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
const char* display_name = "display_name";
ret = account_set_display_name(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_set_display_name(NULL, display_name);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_user_name(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_set_user_name(NULL, user_name);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
const char* icon_path = "icon_path";
ret = account_set_icon_path(account, icon_path);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
const char* icon_path = "icon_path";
ret = account_set_icon_path(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_set_icon_path(NULL, icon_path);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
const char* domain_name = "domain_name";
ret = account_set_domain_name(account, domain_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
const char* domain_name = "domain_name";
ret = account_set_domain_name(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_set_domain_name(NULL, domain_name);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
const char* email_address = "email_address";
ret = account_set_email_address(account, email_address);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
const char* email_address = "email_address";
ret = account_set_email_address(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_set_email_address(NULL, email_address);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
const char* source = "source";
ret = account_set_source(account, source);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
const char* source = "source";
ret = account_set_source(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_set_source(NULL, source);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
const char* value = "value";
ret = account_set_custom(account, key, value);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_custom(account, key, value);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
const char* value = "value";
ret = account_set_custom(account, NULL, value);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_set_custom(account, key, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_set_custom(NULL, key, value);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
char* ret_value = NULL;
ret = account_set_custom(account, key, value);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_custom(account, key, &ret_value);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(ret_value, value), 0);
- _account_free_text(ret_value);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ _account_free_text(ret_value);
+ }
+ else{
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(ret_value, value), 0);
+ _account_free_text(ret_value);
+ }
return 0;
}
char *returned_val = NULL;
ret = account_get_custom(account, not_set_key, &returned_val);
- assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);}
ret = account_get_custom(account, NULL, &returned_val);
free(returned_val);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
_is_fail = true;
}
-// g_main_loop_quit(mainloop);
-// mainloop = NULL;
-
return true;
}
const char* value = "value";
ret = account_set_custom(account, key, value);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_custom(account, key2, value);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
_is_fail = false;
-// mainloop = g_main_loop_new(NULL, FALSE);
-// assert(mainloop);
ret = account_get_custom_all(account, account_custom_cb_func, value);
-// assert_eq(_is_fail, false);
- is_callback_fail();
- assert_eq(ret, ACCOUNT_ERROR_NONE);
-// int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-// g_main_loop_run(mainloop);
-// g_source_remove(timeout_id);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ is_callback_fail();
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ }
_is_fail = true;
return 0;
int ret = ACCOUNT_ERROR_NONE;
ret = account_get_custom_all(account, NULL, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_custom_all(NULL, account_custom_cb_func, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_package_name(account, package_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_package_name(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_set_package_name(NULL, package_name);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
const char* access_token = "access_token";
ret = account_set_access_token(account, access_token);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_access_token(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_auth_type(account, ACCOUNT_AUTH_TYPE_OAUTH);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_auth_type(account, -999);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_set_auth_type(NULL, ACCOUNT_AUTH_TYPE_OAUTH);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_secret(account, ACCOUNT_SECRECY_INVISIBLE);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_secret(account, -999);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_set_secret(NULL, ACCOUNT_SECRECY_INVISIBLE);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_sync_support(account, ACCOUNT_SYNC_STATUS_IDLE);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_sync_support(account, -999);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_set_sync_support(NULL, ACCOUNT_SYNC_STATUS_IDLE);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int i;
for ( i = 0; i < 5; i++){
ret = account_set_user_text(account, i, user_text);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
}
return 0;
int i;
for (i = 0; i < 5; i++){
ret = account_set_user_text(account, i, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
}
ret = account_set_user_text(account, 100, user_text);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_set_user_text(account, -1, user_text);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_set_user_text(NULL, 1, user_text);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int i;
for (i = 0; i < 5; i++){
ret = account_set_user_int(account, i, 999);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
}
return 0;
int i;
for (i = 0; i < 5; i++){
ret = account_set_user_int(NULL, i, 999);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
}
ret = account_set_user_int(account, 100, 999);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_set_user_int(account, -1, 999);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_capability(account, contact_capability, ACCOUNT_CAPABILITY_ENABLED);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_capability(NULL, contact_capability, ACCOUNT_CAPABILITY_ENABLED);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_set_capability(account, NULL, ACCOUNT_CAPABILITY_ENABLED);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_set_capability(account, contact_capability, -1);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
static bool capability_cb_func (const char* capability_type, account_capability_state_e capability_state, void *user_data) {
account_capability_state_e* _capability_state = (account_capability_state_e*)user_data;
-// if(capability_state == *_capability_state)
-// _is_fail = false;
+
if(capability_state != *_capability_state)
_is_fail = true;
-// g_main_loop_quit(mainloop);
-// mainloop = NULL;
return true;
}
const account_capability_state_e capability_state = ACCOUNT_CAPABILITY_ENABLED;
ret = account_set_capability(account, contact_capability, capability_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_capability(account, calendar_capability, capability_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
_is_fail = false;
ret = account_get_capability_all(account, capability_cb_func, &capability_state);
- is_callback_fail();
- assert_eq(ret, ACCOUNT_ERROR_NONE);
-
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ is_callback_fail();
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ }
+
_is_fail = true;
return 0;
int ret = ACCOUNT_ERROR_NONE;
ret = account_get_capability_all(NULL, capability_cb_func, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_capability_all(account, NULL, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_display_name(account, display_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_display_name(account, &ret_display_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(ret_display_name, display_name), 0);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(ret_display_name, display_name), 0);
+ }
_account_free_text(ret_display_name);
return 0;
char * display_name;
ret = account_get_display_name(NULL, &display_name);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_display_name(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_insert_to_db(account, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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, &account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_account_id(account, &ret_account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(account_id, ret_account_id);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(account_id, ret_account_id);
+ }
ret = account_delete_from_db_by_id(account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int account_id = -1;
ret = account_get_account_id(NULL, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_account_id(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_user_name(account, &ret_user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(ret_user_name, user_name), 0);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(ret_user_name, user_name), 0);
+ }
_account_free_text(ret_user_name);
return 0;
int ret = ACCOUNT_ERROR_NONE;
ret = account_get_user_name(NULL, &get_user_name);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_user_name(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_icon_path(account, icon_path);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_icon_path(account, &ret_icon_path);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(ret_icon_path, icon_path), 0);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(ret_icon_path, icon_path), 0);
+ }
_account_free_text(ret_icon_path);
return 0;
int ret = ACCOUNT_ERROR_NONE;
ret = account_get_icon_path(NULL, &ret_icon_path);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_icon_path(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_domain_name(account, domain_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_domain_name(account, &ret_domain_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(ret_domain_name, domain_name), 0);
- _account_free_text(ret_domain_name);
-
- return 0;
-}
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(ret_domain_name, domain_name), 0);
+ }
+ _account_free_text(ret_domain_name);
+
+ return 0;
+}
/**
* @testcase utc_account_get_domain_name_n
int ret = ACCOUNT_ERROR_NONE;
ret = account_get_domain_name(NULL, &domain_name);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_domain_name(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_email_address(account, email_address);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_email_address(account, &ret_email_address);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(ret_email_address, email_address), 0);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(ret_email_address, email_address), 0);
+ }
_account_free_text(ret_email_address);
return 0;
int ret = ACCOUNT_ERROR_NONE;
ret = account_get_email_address(NULL, &ret_email_address);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_email_address(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_source(account, source);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_source(account, &ret_source);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(ret_source, source), 0);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(ret_source, source), 0);
+ }
_account_free_text(ret_source);
return 0;
int ret = ACCOUNT_ERROR_NONE;
ret = account_get_source(NULL, &ret_source);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_source(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_package_name(account, package_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_package_name(account, &ret_package_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(ret_package_name, package_name), 0);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(ret_package_name, package_name), 0);
+ }
_account_free_text(ret_package_name);
return 0;
int ret = ACCOUNT_ERROR_NONE;
ret = account_get_package_name(NULL, &ret_package_name);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_package_name(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_access_token(account, access_token);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_access_token(account, &ret_access_token);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(access_token, ret_access_token), 0);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(access_token, ret_access_token), 0);
+ }
_account_free_text(ret_access_token);
return 0;
char *ret_access_token = NULL;
ret = account_get_access_token(NULL, &ret_access_token);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_access_token(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_auth_type(account, ACCOUNT_AUTH_TYPE_XAUTH);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_auth_type(account, &auth_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(auth_type, ACCOUNT_AUTH_TYPE_XAUTH);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(auth_type, ACCOUNT_AUTH_TYPE_XAUTH);
+ }
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_get_auth_type(NULL, &auth_type);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_auth_type(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_secret(account, ACCOUNT_SECRECY_INVISIBLE);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_secret(account, &secret);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(secret, ACCOUNT_SECRECY_INVISIBLE);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(secret, ACCOUNT_SECRECY_INVISIBLE);
+ }
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_sync_support(account, ACCOUNT_SYNC_STATUS_IDLE);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_sync_support(account, &sync_support);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(sync_support, ACCOUNT_SYNC_STATUS_IDLE);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(sync_support, ACCOUNT_SYNC_STATUS_IDLE);
+ }
return 0;
}
account_secrecy_state_e secret;
ret = account_get_secret(NULL, &secret);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_secret(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_get_sync_support(NULL, &sync_support);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_sync_support(account, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int i;
for ( i = 0; i < 5; i++){
ret = account_set_user_text(account, i, user_text);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
}
for ( i = 0; i < 5; i++){
ret = account_get_user_text(account, i, &ret_user_text);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(ret_user_text, user_text), 0);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(ret_user_text, user_text), 0);
+ }
_account_free_text(ret_user_text);
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_get_user_text(NULL, 0, &ret_user_text);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_user_text(account, 100, &ret_user_text);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_user_text(account, -1, &ret_user_text);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_user_text(account, 0, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int i;
for (i = 0; i < 5; i++){
ret = account_set_user_int(account, i, i*10);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
}
for (i = 0; i < 5; i++){
ret = account_get_user_int(account, i, &user_int);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(user_int, i*10);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(user_int, i*10);
+ }
}
return 0;
int ret = ACCOUNT_ERROR_NONE;
ret = account_get_user_int(NULL, 0, 100);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_user_int(account, 100, 100);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_user_int(account, -1, 100);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_user_int(account, 0, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
const char* capability = contact_capability;
ret = account_get_package_name(account_data, &str);
- if(ret != ACCOUNT_ERROR_NONE) {
- _account_free_text(str);
- _is_fail = true;
- return true;
- }
- if(strcmp(str, package_name) !=0) {
- _account_free_text(str);
- _is_fail = true;
- return true;
+ if(is_account_supported)
+ {
+ if(ret != ACCOUNT_ERROR_NONE) {
+ _account_free_text(str);
+ _is_fail = true;
+ return true;
+ }
+ if(strcmp(str, package_name) !=0) {
+ _account_free_text(str);
+ _is_fail = true;
+ return true;
+ }
}
ret = account_get_user_name(account_data, &str);
- if(ret != ACCOUNT_ERROR_NONE) {
- _account_free_text(str);
- _is_fail = true;
- return true;
- }
- if(strcmp(str, user_name) !=0) {
- _account_free_text(str);
- _is_fail = true;
- return true;
- }
-
- if( strcmp(capability_type, capability)==0 ) {
- ret = account_get_capability(account_data, capability, &_capability_state);
+ if(is_account_supported)
+ {
if(ret != ACCOUNT_ERROR_NONE) {
_account_free_text(str);
_is_fail = true;
return true;
}
- if(_capability_state != capability_state) {
+ if(strcmp(str, user_name) !=0) {
_account_free_text(str);
_is_fail = true;
return true;
}
}
+ if( strcmp(capability_type, capability)==0 ) {
+ ret = account_get_capability(account_data, capability, &_capability_state);
+ if(is_account_supported) {
+ if(ret != ACCOUNT_ERROR_NONE) {
+ _account_free_text(str);
+ _is_fail = true;
+ return true;
+ }
+ if(_capability_state != capability_state) {
+ _account_free_text(str);
+ _is_fail = true;
+ return true;
+ }
+ }
+ }
+
_account_free_text(str);
_is_fail = false;
account_capability_state_e value;
ret = account_set_capability(account, contact_capability, ACCOUNT_CAPABILITY_ENABLED);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_capability(account, contact_capability, &value);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(value, ACCOUNT_CAPABILITY_ENABLED);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(value, ACCOUNT_CAPABILITY_ENABLED);
+ }
return 0;
}
account_capability_state_e value;
ret = account_get_capability(NULL, contact_capability, &value);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_capability(account, NULL, &value);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_get_capability(account, contact_capability, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
account_h _account = *((account_h*)user_data);
ret = account_get_package_name(_account, &str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_package_name(account, &comparison_str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(str, comparison_str)==0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(str, comparison_str)==0);
+ }
_account_free_text(str);
_account_free_text(comparison_str);
ret = account_get_user_name(_account, &str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_user_name(account, &comparison_str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(str, comparison_str)==0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(str, comparison_str)==0);
+ }
_account_free_text(str);
_account_free_text(comparison_str);
ret = account_get_display_name(_account, &str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_display_name(account, &comparison_str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(str, comparison_str)==0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(str, comparison_str)==0);
+ }
_account_free_text(str);
_account_free_text(comparison_str);
ret = account_get_icon_path(_account, &str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_icon_path(account, &comparison_str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(str, comparison_str)==0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(str, comparison_str)==0);
+ }
_account_free_text(str);
_account_free_text(comparison_str);
ret = account_get_domain_name(_account, &str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_domain_name(account, &comparison_str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(str, comparison_str)==0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(str, comparison_str)==0);
+ }
_account_free_text(str);
_account_free_text(comparison_str);
ret = account_get_email_address(_account, &str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_email_address(account, &comparison_str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(str, comparison_str)==0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(str, comparison_str)==0);
+ }
_account_free_text(str);
_account_free_text(comparison_str);
ret = account_get_email_address(_account, &str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_email_address(account, &comparison_str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(str, comparison_str)==0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(str, comparison_str)==0);
+ }
_account_free_text(str);
_account_free_text(comparison_str);
ret = account_get_source(_account, &str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_source(account, &comparison_str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(str, comparison_str)==0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(str, comparison_str)==0);
+ }
_account_free_text(str);
_account_free_text(comparison_str);
ret = account_get_custom(_account, key, &str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_custom(account, key, &comparison_str);
- check_fail_eq(ret, ACCOUNT_ERROR_NONE);
- check_fail(strcmp(str, comparison_str)==0);
+ if(is_account_supported) {
+ check_fail_eq(ret, ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(str, comparison_str)==0);
+ }
_account_free_text(str);
_account_free_text(comparison_str);
ret = account_get_capability(_account, contact_capability, &value);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_capability(account, contact_capability, &comparison_value);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(value == comparison_value);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(value == comparison_value);
+ }
ret = account_get_access_token(_account, &str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_access_token(account, &comparison_str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- if (str != NULL && comparison_str != NULL)
- check_fail(strcmp(str, comparison_str)==0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ if (str != NULL && comparison_str != NULL)
+ check_fail(strcmp(str, comparison_str)==0);
+ }
_account_free_text(str);
_account_free_text(comparison_str);
for (i = 0; i < 5; i++){
ret = account_get_user_text(_account, i, &str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_user_text(account, i, &comparison_str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(str, comparison_str)==0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(str, comparison_str)==0);
+ }
_account_free_text(str);
_account_free_text(comparison_str);
}
for (i = 0; i < 5; i++){
ret = account_get_user_int(_account, i, &value);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_user_int(account, i, &comparison_value);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(value == comparison_value);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(value == comparison_value);
+ }
}
ret = account_get_auth_type(_account, &value);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_auth_type(account, &comparison_value);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(value == comparison_value);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(value == comparison_value);
+ }
ret = account_get_secret(_account, &value);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_secret(account, &comparison_value);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(value == comparison_value);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(value == comparison_value);
+ }
ret = account_get_sync_support(_account, &value);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_sync_support(account, &comparison_value);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(value == comparison_value);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(value == comparison_value);
+ }
_is_fail = false;
-// g_main_loop_quit(mainloop);
-// mainloop = NULL;
-
return true;
}
int i = -1;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_display_name(account, display_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_icon_path(account, icon_path);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_domain_name(account, domain_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_email_address(account, email_address);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_source(account, source);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_custom(account, key, value);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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, capability_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_access_token(account, access_token);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
for (i = 0; i < 5; i++){
ret = account_set_user_text(account, i, user_text);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
}
for (i = 0; i < 5; i++){
ret = account_set_user_int(account, i, i*10);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
}
ret = account_set_auth_type(account, auth_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_secret(account, secrecy_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_sync_support(account, sync_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_insert_to_db(account, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-// mainloop = g_main_loop_new(NULL, FALSE);
-// assert(mainloop);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_foreach_account_from_db(account_call_back, &account);
-// assert_eq(_is_fail, false);
- is_callback_fail();
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ is_callback_fail();
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ }
ret = account_foreach_account_from_db(account_call_back_return_false, &account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_delete_from_db_by_id(account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
-// int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-// g_main_loop_run(mainloop);
-// g_source_remove(timeout_id);
_is_fail = true;
return 0;
int ret = ACCOUNT_ERROR_NONE;
ret = account_foreach_account_from_db(NULL, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
account_capability_state_e ret_capability_type = 0;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_insert_to_db(account, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_create(&ret_account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
ret = account_get_user_name(ret_account, &ret_user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
ret = account_get_package_name(ret_account, &ret_package_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
ret = account_get_capability(ret_account, contact_capability, &ret_capability_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- 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);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
+ }
_account_free_text(ret_user_name);
_account_free_text(ret_package_name);
+
ret = account_destroy(ret_account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_delete_from_db_by_id(account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_query_account_by_account_id(100, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_query_account_by_account_id(-999, &account);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int i = -1;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_display_name(account, display_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_icon_path(account, icon_path);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_domain_name(account, domain_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_email_address(account, email_address);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_source(account, source);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_custom(account, key, value);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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, capability_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_access_token(account, access_token);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
for (i = 0; i < 5; i++){
ret = account_set_user_text(account, i, user_text);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
}
for (i = 0; i < 5; i++){
ret = account_set_user_int(account, i, i*10);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
}
ret = account_set_auth_type(account, auth_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_secret(account, secrecy_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_sync_support(account, sync_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_insert_to_db(account, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
-// mainloop = g_main_loop_new(NULL, FALSE);
-// assert(mainloop);
ret = account_query_account_by_user_name(account_call_back, user_name, &account);
-// assert_eq(_is_fail, false);
- is_callback_fail();
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ is_callback_fail();
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ }
ret = account_query_account_by_user_name(account_call_back_return_false, user_name, &account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
-// int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-// g_main_loop_run(mainloop);
-// g_source_remove(timeout_id);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
_is_fail = true;
ret = account_delete_from_db_by_id(account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_query_account_by_user_name(account_call_back, NULL, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_query_account_by_user_name(NULL, user_name, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int i = -1;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_display_name(account, display_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_icon_path(account, icon_path);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_domain_name(account, domain_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_email_address(account, email_address);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_source(account, source);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_custom(account, key, value);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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, capability_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_access_token(account, access_token);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
for (i = 0; i < 5; i++){
ret = account_set_user_text(account, i, user_text);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
}
for (i = 0; i < 5; i++){
ret = account_set_user_int(account, i, i*10);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
}
ret = account_set_auth_type(account, auth_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_secret(account, secrecy_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_sync_support(account, sync_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_insert_to_db(account, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-// mainloop = g_main_loop_new(NULL, FALSE);
-// assert(mainloop);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_query_account_by_package_name(account_call_back, package_name, &account);
-// assert_eq(_is_fail, false);
- is_callback_fail();
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ is_callback_fail();
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ }
ret = account_query_account_by_package_name(account_call_back_return_false, package_name, &account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
-// int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-// g_main_loop_run(mainloop);
-// g_source_remove(timeout_id);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
_is_fail = true;
ret = account_delete_from_db_by_id(account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_query_account_by_package_name(account_call_back, NULL, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_query_account_by_package_name(NULL, package_name, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int i = -1;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_display_name(account, display_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_icon_path(account, icon_path);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_domain_name(account, domain_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_email_address(account, email_address);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_source(account, source);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_custom(account, key, value);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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, capability_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_access_token(account, access_token);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
for (i = 0; i < 5; i++){
ret = account_set_user_text(account, i, user_text);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
}
for (i = 0; i < 5; i++){
ret = account_set_user_int(account, i, i*10);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
}
ret = account_set_auth_type(account, auth_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_secret(account, secrecy_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_sync_support(account, sync_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_insert_to_db(account, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-// mainloop = g_main_loop_new(NULL, FALSE);
-// assert(mainloop);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_query_account_by_capability(account_call_back, contact_capability, capability_state, &account);
-// assert_eq(_is_fail, false);
- is_callback_fail();
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ is_callback_fail();
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ }
ret = account_query_account_by_capability(account_call_back_return_false, contact_capability, capability_state, &account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
-// int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-// g_main_loop_run(mainloop);
-// g_source_remove(timeout_id);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
_is_fail = true;
ret = account_delete_from_db_by_id(account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_query_account_by_capability(NULL, contact_capability, ACCOUNT_CAPABILITY_ENABLED, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_query_account_by_capability(account_call_back, NULL, ACCOUNT_CAPABILITY_ENABLED, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_query_account_by_capability(account_call_back, contact_capability, -1, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
account_h _account = *((account_h*)user_data);
ret = account_get_package_name(_account, &str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_package_name(account, &comparison_str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(str, comparison_str)==0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(str, comparison_str)==0);
+ }
_account_free_text(str);
_account_free_text(comparison_str);
ret = account_get_user_name(_account, &str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_user_name(account, &comparison_str);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(str, comparison_str)==0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(str, comparison_str)==0);
+ }
_account_free_text(str);
_account_free_text(comparison_str);
ret = account_get_capability(_account, contact_capability, &value);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported)
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+
ret = account_get_capability(account, contact_capability, &comparison_value);
- check_fail_eq(ret, ACCOUNT_ERROR_NONE);
- check_fail(value == comparison_value);
+ if(is_account_supported) {
+ check_fail_eq(ret, ACCOUNT_ERROR_NONE);
+ check_fail(value == comparison_value);
+ }
_is_fail = false;
-// g_main_loop_quit(mainloop);
-// mainloop = NULL;
return true;
}
int account_id = -1;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_insert_to_db(account, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-// mainloop = g_main_loop_new(NULL, FALSE);
-// assert(mainloop);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_query_account_by_capability_type(account_cb_func, contact_capability, &account);
-// assert_eq(_is_fail, false);
- is_callback_fail();
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ is_callback_fail();
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ }
ret = account_query_account_by_capability_type(account_cb_func_return_false, contact_capability, &account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
-// int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-// g_main_loop_run(mainloop);
-// g_source_remove(timeout_id);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
_is_fail = true;
ret = account_delete_from_db_by_id(account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
const char* type = "type";
ret = account_query_account_by_capability_type(NULL, type, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_query_account_by_capability_type(account_cb_func, NULL, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
account_capability_state_e capability_state = ACCOUNT_CAPABILITY_ENABLED;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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, capability_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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, capability_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_insert_to_db(account, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-// mainloop = g_main_loop_new(NULL, FALSE);
-// assert(mainloop);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_query_capability_by_account_id(capability_call_back, account_id, &account);
-// assert_eq(_is_fail, false);
- is_callback_fail();
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ is_callback_fail();
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ }
ret = account_query_capability_by_account_id(capability_call_back_return_false, account_id, &account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
-// int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-// g_main_loop_run(mainloop);
-// g_source_remove(timeout_id);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
+
_is_fail = true;
ret = account_delete_from_db_by_id(account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_query_capability_by_account_id(capability_call_back, -1, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_query_capability_by_account_id(NULL, 1, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_get_total_count_from_db(&count);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_get_total_count_from_db(NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
account_sync_state_e sync_state = -1;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_insert_to_db(account, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_update_sync_status_by_id(account_id, ACCOUNT_SYNC_STATUS_IDLE);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_create(&ret_account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_sync_support(ret_account, &sync_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(sync_state, ACCOUNT_SYNC_STATUS_IDLE);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(sync_state, ACCOUNT_SYNC_STATUS_IDLE);
+ }
ret = account_destroy(ret_account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_delete_from_db_by_id(account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_update_sync_status_by_id(-1, ACCOUNT_SYNC_STATUS_IDLE);
- assert_neq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_neq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_insert_to_db(account, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_delete_from_db_by_id(account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_delete_from_db_by_id(-1);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_delete_from_db_by_id(1000000);
- assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_insert_to_db(account, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_delete_from_db_by_user_name(user_name, package_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
char *delete_user_name = "non_registered_user_name";
ret = account_delete_from_db_by_user_name(NULL, package_name);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_delete_from_db_by_user_name(user_name, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_delete_from_db_by_user_name(delete_user_name, delete_package_name);
- assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_insert_to_db(account, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_delete_from_db_by_package_name(package_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
char *delete_package_name = "non_registered_package_name";
ret = account_delete_from_db_by_package_name(NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_delete_from_db_by_package_name(delete_package_name);
- assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);}
return 0;
}
account_h ret_account = NULL;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_insert_to_db(account, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_user_name(account, update_user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_update_to_db_by_id(account, account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_create(&ret_account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_user_name(account, &ret_user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(ret_user_name, update_user_name), 0);
-
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(ret_user_name, update_user_name), 0);
+ }
_account_free_text(ret_user_name);
+
ret = account_destroy(ret_account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_delete_from_db_by_id(account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_update_to_db_by_id(account, -1);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_update_to_db_by_id(account, 1000000);
- assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);}
return 0;
}
account_capability_state_e capability_state = ACCOUNT_CAPABILITY_ENABLED;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_insert_to_db(account, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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, capability_state);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_update_to_db_by_user_name(account, user_name, package_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_create(&ret_account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_user_name(account, &ret_user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(ret_user_name, user_name), 0);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(ret_user_name, user_name), 0);
+ }
_account_free_text(ret_user_name);
ret = account_get_capability(account, contact_capability, &value);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(value, ACCOUNT_CAPABILITY_ENABLED);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(value, ACCOUNT_CAPABILITY_ENABLED);
+ }
ret = account_destroy(ret_account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_delete_from_db_by_id(account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
ret = account_update_to_db_by_user_name(account, user_name, NULL);
assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
-// ret = account_update_to_db_by_user_name(account, user_name, package_name);
-// assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);
-
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_subscribe_create(&account_subscribe);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_subscribe_notification(account_subscribe, NULL, NULL);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_unsubscribe_notification(account_subscribe);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_subscribe_create(NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_subscribe_create(&account_subscribe);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_subscribe_notification(account_subscribe, NULL, NULL);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_unsubscribe_notification(account_subscribe);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_subscribe_create(&account_subscribe);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_subscribe_notification(NULL, NULL, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_subscribe_notification(account_subscribe, NULL, NULL);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_unsubscribe_notification(account_subscribe);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_subscribe_create(&account_subscribe);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_subscribe_notification(account_subscribe, NULL, NULL);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_unsubscribe_notification(account_subscribe);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_unsubscribe_notification(NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_type_create(NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_type_destroy(NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
char* ret_app_id = NULL;
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_query_by_app_id(app_id, &account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_get_app_id(account_type, &ret_app_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(ret_app_id, app_id), 0);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(ret_app_id, app_id), 0);
+ }
_account_free_text(ret_app_id);
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
char* ret_app_id = NULL;
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_get_app_id(NULL, &ret_app_id);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_get_app_id(account_type, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
dlog_print(DLOG_ERROR, "ACCOUNT_TC", "icon_path %s", icon_path);
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_query_by_app_id(app_id, &account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_get_icon_path(account_type, &ret_icon_path);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- dlog_print(DLOG_ERROR, "ACCOUNT_TC", "ret_icon_path %s", ret_icon_path);
-
- assert_eq(strcmp(ret_icon_path, icon_path), 0);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ dlog_print(DLOG_ERROR, "ACCOUNT_TC", "ret_icon_path %s", ret_icon_path);
+ assert_eq(strcmp(ret_icon_path, icon_path), 0);
+ }
_account_free_text(ret_icon_path);
_account_free_text(icon_path);
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
char* ret_icon_path = NULL;
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_get_icon_path(NULL, &ret_icon_path);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_get_icon_path(account_type, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
char* ret_label = NULL;
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_query_by_app_id(app_id, &account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_get_label_by_locale(account_type, locale, &ret_label);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(ret_label, test_label_en_gb), 0);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(ret_label, test_label_en_gb), 0);
+ }
_account_free_text(ret_label);
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
const char* locale = "locale";
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_get_label_by_locale(NULL, locale, &ret_label);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_get_label_by_locale(account_type, locale, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
_is_fail = false;
}
-// g_main_loop_quit(mainloop);
-// mainloop = NULL;
return TRUE;
}
const char* locale = "locale";
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_query_by_app_id(app_id, &account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-// mainloop = g_main_loop_new(NULL, FALSE);
-// assert(mainloop);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_get_label(account_type, account_label_cb_func, (void*)test_label_en_gb);
-// assert_eq(_is_fail, false);
- is_callback_fail();
- assert_eq(ret, ACCOUNT_ERROR_NONE);
-// int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-// g_main_loop_run(mainloop);
-// g_source_remove(timeout_id);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ is_callback_fail();
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ }
+
_is_fail = true;
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_get_label(NULL, account_label_cb_func, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_get_label(account_type, NULL, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
const char *app_id = TEST_PACKAGE_NAME;
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_query_by_app_id(app_id, &account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_get_multiple_account_support(account_type, &ret_val);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(ret_val, true);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(ret_val, true);
+ }
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
bool ret_val = true;
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_get_multiple_account_support(NULL, &ret_val);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_get_multiple_account_support(account_type, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
}
_is_fail = false;
-// g_main_loop_quit(mainloop);
-// mainloop = NULL;
return TRUE;
}
const char* app_id = TEST_PACKAGE_NAME;
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_query_by_app_id(app_id, &account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
-
-// mainloop = g_main_loop_new(NULL, FALSE);
-// assert(mainloop);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
_is_fail = true;
ret = account_type_get_provider_feature_all(account_type, provider_feature_cb_func, (void *)provider_feature);
-// assert_eq(_is_fail, false);
- is_callback_fail();
- assert_eq(ret, ACCOUNT_ERROR_NONE);
-// int timeout_id = g_timeout_add(3000, timeout_cb, mainloop);
-// g_main_loop_run(mainloop);
-// g_source_remove(timeout_id);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ is_callback_fail();
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ }
+
_is_fail = true;
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_get_provider_feature_all(NULL, provider_feature_cb_func, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_get_provider_feature_all(account_type, NULL, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
char* ret_service_provider_id = NULL;
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_query_by_app_id(app_id, &account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_get_service_provider_id(account_type, &ret_service_provider_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(ret_service_provider_id, service_provider_id), 0);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(ret_service_provider_id, service_provider_id), 0);
+ }
+
_account_free_text(ret_service_provider_id);
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
char* ret_service_provider_id = NULL;
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_get_service_provider_id(account_type, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_get_service_provider_id(NULL, &ret_service_provider_id);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
dlog_print(DLOG_ERROR, "ACCOUNT_TC", "small_icon_path %s", small_icon_path);
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_query_by_app_id(app_id, &account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_get_small_icon_path(account_type, &ret_small_icon_path);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- dlog_print(DLOG_ERROR, "ACCOUNT_TC", "ret_small_icon_path %s", ret_small_icon_path);
-
- assert_eq(strcmp(ret_small_icon_path, small_icon_path), 0);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ dlog_print(DLOG_ERROR, "ACCOUNT_TC", "ret_small_icon_path %s", ret_small_icon_path);
+ assert_eq(strcmp(ret_small_icon_path, small_icon_path), 0);
+ }
_account_free_text(ret_small_icon_path);
_account_free_text(small_icon_path);
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
char* ret_small_icon_path = NULL;
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_get_small_icon_path(NULL, &ret_small_icon_path);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_get_small_icon_path(account_type, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int account_type_id = 0;
ret = account_type_create(&ret_account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_query_by_app_id(app_id, &ret_account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_get_app_id(ret_account_type, &ret_app_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(ret_app_id, app_id), 0);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(ret_app_id, app_id), 0);
+ }
+
_account_free_text(ret_app_id);
ret = account_type_destroy(ret_account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
const char* app_id = "account_type_query_by_app_id";
ret = account_type_query_by_app_id(app_id, &account_type);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_query_by_app_id(NULL, &account_type);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_query_by_app_id(app_id, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int a_type_id = -1;
ret = account_type_query_app_id_exist(not_registered_app_id);
- assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);}
ret = account_type_query_app_id_exist(app_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_type_query_app_id_exist(NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
dlog_print(DLOG_ERROR, "ACCOUNT_TC", "test_small_icon_path %s", test_small_icon_path);
ret = account_type_get_app_id(account_type, &app_id);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(package_name, app_id)==0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(package_name, app_id)==0);
+ }
_account_free_text(app_id);
ret = account_type_get_icon_path(account_type, &icon_path);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(test_icon_path, icon_path)==0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(test_icon_path, icon_path)==0);
+ }
_account_free_text(icon_path);
_account_free_text(test_icon_path);
ret = account_type_get_small_icon_path(account_type, &small_icon_path);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(test_small_icon_path, small_icon_path)==0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(test_small_icon_path, small_icon_path)==0);
+ }
_account_free_text(small_icon_path);
_account_free_text(test_small_icon_path);
ret = account_type_get_multiple_account_support(account_type, &multi_account_support);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(test_multi_account_support == multi_account_support);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(test_multi_account_support == multi_account_support);
+ }
ret = account_type_get_label_by_locale(account_type, locale, &label);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(test_label_en_gb, label) == 0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(test_label_en_gb, label) == 0);
+ }
_account_free_text(label);
_is_fail = true;
ret = account_type_get_provider_feature_all(account_type, provider_feature_cb_func, capability);
- check_fail(_is_fail == false);
- check_fail(ret == ACCOUNT_ERROR_NONE);
+ if(is_account_supported) {
+ check_fail(_is_fail == false);
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ }
_is_fail = false;
int a_type_id = -1;
ret = account_type_query_by_provider_feature(account_type_for_query_by_provider_cb, contact_capability, NULL);
- is_callback_fail();
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ is_callback_fail();
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ }
ret = account_type_query_by_provider_feature(account_type_for_query_by_provider_cb_return_false, contact_capability, NULL);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
_is_fail = true;
const char* key = contact_capability;
ret = account_type_query_by_provider_feature(account_type_for_query_by_provider_cb, NULL, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_query_by_provider_feature(NULL, key, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
const char* service_provider_id = TEST_PACKAGE_NAME;
ret = account_type_create(&account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_type_query_label_by_app_id(account_type_for_query_by_app_id_cb, package_name, test_label_en_gb);
- is_callback_fail();
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ is_callback_fail();
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ }
ret = account_type_query_label_by_app_id(account_type_for_query_by_app_id_cb_return_false, package_name, test_label_en_gb);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
_is_fail = true;
account_type_destroy(account_type);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
const char* app_id = "account_type_query_label_by_app_id";
ret = account_type_query_label_by_app_id(NULL, app_id, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_query_label_by_app_id(account_type_for_query_by_app_id_cb, NULL, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
char* ret_label = NULL;
ret = account_type_query_label_by_locale(app_id, locale, &ret_label);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(ret_label, test_label_en_gb), 0);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(ret_label, test_label_en_gb), 0);
+ }
_account_free_text(ret_label);
return 0;
char* ret_label = NULL;
ret = account_type_get_label_by_locale(NULL, locale, &ret_label);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_get_label_by_locale(app_id, locale, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
int account_type_id = -1;
ret = account_type_query_provider_feature_by_app_id(provider_feature_cb_func, app_id, NULL);
- is_callback_fail();
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ is_callback_fail();
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ }
_is_fail = true;
return 0;
const char* provider_feature = "provider_feature";
ret = account_type_query_provider_feature_by_app_id(provider_feature_cb_func, app_id,provider_feature);
- assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);}
ret = account_type_query_provider_feature_by_app_id(NULL, app_id, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_type_query_provider_feature_by_app_id(provider_feature_cb_func, NULL, NULL);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}
const char* capability = "capability";
ret = account_type_query_supported_feature(app_id, capability);
- assert_eq(ret, false);
- assert_eq(get_last_result(), ACCOUNT_ERROR_RECORD_NOT_FOUND);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, true);
+ }
+ else
+ {
+ assert_eq(ret, false);
+ assert_eq(get_last_result(), ACCOUNT_ERROR_RECORD_NOT_FOUND);
+ }
ret = account_type_query_supported_feature(NULL, capability);
- assert_eq(ret, false);
- assert_eq(get_last_result(), ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, true);
+ }
+ else
+ {
+ assert_eq(ret, false);
+ assert_eq(get_last_result(), ACCOUNT_ERROR_INVALID_PARAMETER);
+ }
ret = account_type_query_supported_feature(app_id, NULL);
- assert_eq(ret, FALSE);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, true);
+ }
+ else
+ {
+ assert_eq(ret, FALSE);
+ }
return 0;
}
account_h ret_account = NULL;
ret = account_set_user_name(account, user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_insert_to_db(account, &account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_set_user_name(account, update_user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_update_to_db_by_id_ex(account, account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_create(&ret_account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ 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);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_get_user_name(account, &ret_user_name);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
- assert_eq(strcmp(ret_user_name, update_user_name), 0);
-
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ assert_eq(strcmp(ret_user_name, update_user_name), 0);
+ }
_account_free_text(ret_user_name);
+
ret = account_destroy(ret_account);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
ret = account_delete_from_db_by_id(account_id);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
return 0;
}
int ret = ACCOUNT_ERROR_NONE;
ret = account_update_to_db_by_id_ex(account, -1);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_update_to_db_by_id_ex(NULL, 1);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
ret = account_update_to_db_by_id(account, 1000000);
- assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_RECORD_NOT_FOUND);}
return 0;
}
dlog_print(DLOG_ERROR, "ACCOUNT_TC", "test_small_icon_path %s", test_small_icon_path);
ret = account_type_get_app_id(account_type, &app_id);
- if(ret != ACCOUNT_ERROR_NONE) {
- _is_fail=true;
- _account_free_text(app_id);
- return true;
- }
- if( strcmp(app_id, package_name) != 0 )
- {
- _is_fail=true;
- _account_free_text(app_id);
- return true;
+ if(is_account_supported) {
+ if(ret != ACCOUNT_ERROR_NONE) {
+ _is_fail=true;
+ _account_free_text(app_id);
+ return true;
+ }
+ if( strcmp(app_id, package_name) != 0 )
+ {
+ _is_fail=true;
+ _account_free_text(app_id);
+ return true;
+ }
}
_account_free_text(app_id);
ret = account_type_get_icon_path(account_type, &icon_path);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(test_icon_path, icon_path)==0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(test_icon_path, icon_path)==0);
+ }
_account_free_text(icon_path);
_account_free_text(test_icon_path);
ret = account_type_get_small_icon_path(account_type, &small_icon_path);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(test_small_icon_path, small_icon_path)==0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(test_small_icon_path, small_icon_path)==0);
+ }
_account_free_text(small_icon_path);
_account_free_text(test_small_icon_path);
ret = account_type_get_multiple_account_support(account_type, &multi_account_support);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(test_multi_account_support == multi_account_support);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(test_multi_account_support == multi_account_support);
+ }
ret = account_type_get_label_by_locale(account_type, locale, &label);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(strcmp(test_label_en_gb, label) == 0);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(strcmp(test_label_en_gb, label) == 0);
+ }
_account_free_text(label);
_is_fail = true;
ret = account_type_get_provider_feature_all(account_type, provider_feature_cb_func, (void *)contact_capability);
-
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(_is_fail == false);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(_is_fail == false);
+ }
_is_fail = true;
ret = account_type_get_provider_feature_all(account_type, provider_feature_cb_func_return_false, (void *)contact_capability);
- check_fail(ret == ACCOUNT_ERROR_NONE);
- check_fail(_is_fail == false);
+ if(is_account_supported) {
+ check_fail(ret == ACCOUNT_ERROR_NONE);
+ check_fail(_is_fail == false);
+ }
_is_fail = false;
_is_fail = true;
ret = account_type_foreach_account_type_from_db(account_type_cb_func, NULL);
- is_callback_fail();
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported)
+ {
+ assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);
+ }
+ else
+ {
+ is_callback_fail();
+ assert_eq(ret, ACCOUNT_ERROR_NONE);
+ }
ret = account_type_foreach_account_type_from_db(account_type_cb_func_return_false, NULL);
- assert_eq(ret, ACCOUNT_ERROR_NONE);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_NONE);}
_is_fail = false;
int ret = ACCOUNT_ERROR_NONE;
ret = account_type_foreach_account_type_from_db(NULL, account);
- assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);
+ if(!is_account_supported){assert_eq(ret, ACCOUNT_ERROR_NOT_SUPPORTED);}
+ else{assert_eq(ret, ACCOUNT_ERROR_INVALID_PARAMETER);}
return 0;
}