true, true, true, false, false};
+extern bool phn_support_telephony_feature(void);
+
static int _startup_err;
static int _phn_tc_add_blocking_rules(phn_blocking_rule_s *rules, int length)
{
_startup_err = PHONE_NUMBER_ERROR_NONE;
_startup_err = phone_number_connect();
+ if (PHONE_NUMBER_ERROR_NOT_SUPPORTED == _startup_err
+ && false == phn_support_telephony_feature())
+ _startup_err = PHONE_NUMBER_ERROR_NONE;
}
/**
assert_eq(_startup_err, PHONE_NUMBER_ERROR_NONE);
int ret = 0;
phone_number_blocking_rule_h rule = NULL;
+
+ if (false == phn_support_telephony_feature()) {
+ ret = phone_number_blocking_rule_create(&rule);
+ assert_eq(ret, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
do {
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_blocking_rule_create(&rule))) break;
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_blocking_rule_destroy(rule))) break;
assert_eq(_startup_err, PHONE_NUMBER_ERROR_NONE);
int ret = 0;
phone_number_blocking_rule_h rule = NULL;
+
+ if (false == phn_support_telephony_feature()) {
+ ret = phone_number_blocking_rule_destroy(rule);
+ assert_eq(ret, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
do {
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_blocking_rule_create(&rule))) break;
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_blocking_rule_destroy(rule))) break;
int ret = 0;
char *number = NULL;
phone_number_blocking_rule_h rule = NULL;
+
+ if (false == phn_support_telephony_feature()) {
+ ret = phone_number_blocking_rule_get_number(rule, &number);
+ assert_eq(ret, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
do {
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_blocking_rule_create(&rule))) break;
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_blocking_rule_set_number(rule, blocking_rules[0].number))) break;
int ret = 0;
phone_number_blocking_rule_match_type_e match_type = -1;
phone_number_blocking_rule_h rule = NULL;
+
+ if (false == phn_support_telephony_feature()) {
+ ret = phone_number_blocking_rule_get_match_type(rule, &match_type);
+ assert_eq(ret, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
do {
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_blocking_rule_create(&rule))) break;
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_blocking_rule_set_match_type(rule, blocking_rules[0].match_type))) break;
int ret = 0;
char *number = NULL;
phone_number_blocking_rule_h rule = NULL;
+
+ if (false == phn_support_telephony_feature()) {
+ ret = phone_number_blocking_rule_set_number(rule, blocking_rules[0].number);
+ assert_eq(ret, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
do {
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_blocking_rule_create(&rule))) break;
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_blocking_rule_set_number(rule, blocking_rules[0].number))) break;
int ret = 0;
phone_number_blocking_rule_match_type_e match_type = -1;
phone_number_blocking_rule_h rule = NULL;
+
+ if (false == phn_support_telephony_feature()) {
+ ret = phone_number_blocking_rule_set_match_type(rule, blocking_rules[0].match_type);
+ assert_eq(ret, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
do {
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_blocking_rule_create(&rule))) break;
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_blocking_rule_set_match_type(rule, blocking_rules[0].match_type))) break;
int length = 0;
int idx = 0;
+ if (false == phn_support_telephony_feature()) {
+ phone_number_blocking_rule_h rule = NULL;
+
+ ret = phone_number_add_blocking_rule(rule);
+ assert_eq(ret, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
do {
if (PHONE_NUMBER_ERROR_NONE != (ret = _phn_tc_add_blocking_rules(blocking_rules, test_rules_count))) break;
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_get_blocking_rules(0, 0, &rules, &length))) break;
phone_number_blocking_rule_h *rules = NULL;
int length = 0;
+ if (false == phn_support_telephony_feature()) {
+ phone_number_blocking_rule_h rule = NULL;
+
+ ret = phone_number_remove_blocking_rule(rule);
+ assert_eq(ret, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
do {
if (PHONE_NUMBER_ERROR_NONE != (ret = _phn_tc_add_blocking_rules(blocking_rules, test_rules_count))) break;
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_get_blocking_rules(0, 0, &rules, &length))) break;
phone_number_blocking_rule_h *rules = NULL;
int length = 0;
+ if (false == phn_support_telephony_feature()) {
+ ret = phone_number_get_blocking_rules(0, limit, &rules, &length);
+ assert_eq(ret, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
do {
if (PHONE_NUMBER_ERROR_NONE != (ret = _phn_tc_add_blocking_rules(blocking_rules, test_rules_count))) break;
phone_number_blocking_rule_h *rules = NULL;
int length = 0;
+ if (false == phn_support_telephony_feature()) {
+ ret = phone_number_get_blocking_rules(offset, 0, &rules, &length);
+ assert_eq(ret, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
do {
if (PHONE_NUMBER_ERROR_NONE != (ret = _phn_tc_add_blocking_rules(blocking_rules, test_rules_count))) break;
int length = 0;
int idx = 0;
+ if (false == phn_support_telephony_feature()) {
+ ret = phone_number_get_blocking_rules(0, 0, &rules, &length);
+ assert_eq(ret, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
do {
if (PHONE_NUMBER_ERROR_NONE != (ret = _phn_tc_add_blocking_rules(blocking_rules, test_rules_count))) break;
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_get_blocking_rules(0, 0, &rules, &length))) break;
phone_number_blocking_rule_h *rules = NULL;
int length = 0;
+ if (false == phn_support_telephony_feature()) {
+ ret = phone_number_get_blocking_rules_related("070-1500-1500", &rules, &length);
+ assert_eq(ret, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
do {
if (PHONE_NUMBER_ERROR_NONE != (ret = _phn_tc_add_blocking_rules(blocking_rules, test_rules_count))) break;
char *normalized_number = NULL;
const bool *result = blocking_result;
+ if (false == phn_support_telephony_feature()) {
+ bool is_blocked = false;
+
+ ret = phone_number_check_blocking(test_number[idx], &is_blocked);
+ assert_eq(ret, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
phone_number_get_normalized_number(test_number[0], &normalized_number);
if (normalized_number) {
if (0 == strncmp(normalized_number, "+82", 3))
int ret = 0;
ret = phone_number_blocking_rule_create(NULL);
- assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
-
+ if (phn_support_telephony_feature())
+ assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ else
+ assert_eq(PHONE_NUMBER_ERROR_NOT_SUPPORTED, ret);
return 0;
}
int ret = 0;
ret = phone_number_blocking_rule_destroy(NULL);
- assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
-
+ if (phn_support_telephony_feature())
+ assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ else
+ assert_eq(PHONE_NUMBER_ERROR_NOT_SUPPORTED, ret);
return 0;
}
int ret = 0;
char *number = NULL;
phone_number_blocking_rule_h rule = NULL;
+
+ if (false == phn_support_telephony_feature()) {
+ ret = phone_number_blocking_rule_get_number(NULL, &number);
+ assert_eq(ret, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
do {
if (PHONE_NUMBER_ERROR_INVALID_PARAMETER != (ret = phone_number_blocking_rule_get_number(NULL, &number))) break;
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_blocking_rule_create(&rule))) break;
int ret = 0;
phone_number_blocking_rule_match_type_e match_type = 0;
phone_number_blocking_rule_h rule = NULL;
+
+ if (false == phn_support_telephony_feature()) {
+ ret = phone_number_blocking_rule_get_match_type(NULL, &match_type);
+ assert_eq(ret, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
do {
if (PHONE_NUMBER_ERROR_INVALID_PARAMETER != (ret = phone_number_blocking_rule_get_match_type(NULL, &match_type))) break;
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_blocking_rule_create(&rule))) break;
assert_eq(_startup_err, PHONE_NUMBER_ERROR_NONE);
int ret = 0;
phone_number_blocking_rule_h rule = NULL;
+
+ if (false == phn_support_telephony_feature()) {
+ ret = phone_number_blocking_rule_set_number(rule, NULL);
+ assert_eq(ret, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
do {
if (PHONE_NUMBER_ERROR_INVALID_PARAMETER != (ret = phone_number_blocking_rule_set_number(NULL, blocking_rules[0].number))) break;
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_blocking_rule_create(&rule))) break;
assert_eq(_startup_err, PHONE_NUMBER_ERROR_NONE);
int ret = 0;
phone_number_blocking_rule_h rule = NULL;
+
+ if (false == phn_support_telephony_feature()) {
+ ret = phone_number_blocking_rule_set_match_type(NULL, blocking_rules[0].match_type);
+ assert_eq(ret, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
+ return 0;
+ }
+
do {
if (PHONE_NUMBER_ERROR_INVALID_PARAMETER != (ret = phone_number_blocking_rule_set_match_type(NULL, blocking_rules[0].match_type))) break;
if (PHONE_NUMBER_ERROR_NONE != (ret = phone_number_blocking_rule_create(&rule))) break;
ret = phone_number_add_blocking_rule(NULL);
- assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ if (phn_support_telephony_feature())
+ assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ else
+ assert_eq(PHONE_NUMBER_ERROR_NOT_SUPPORTED, ret);
return 0;
}
int ret = 0;
ret = phone_number_remove_blocking_rule(NULL);
- assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ if (phn_support_telephony_feature())
+ assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ else
+ assert_eq(PHONE_NUMBER_ERROR_NOT_SUPPORTED, ret);
return 0;
}
int length = 0;
ret = phone_number_get_blocking_rules(-1, 0, &rules, &length);
- assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ if (phn_support_telephony_feature())
+ assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ else
+ assert_eq(PHONE_NUMBER_ERROR_NOT_SUPPORTED, ret);
+
ret = phone_number_get_blocking_rules(0, -1, &rules, &length);
- assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ if (phn_support_telephony_feature())
+ assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ else
+ assert_eq(PHONE_NUMBER_ERROR_NOT_SUPPORTED, ret);
+
ret = phone_number_get_blocking_rules(0, 0, NULL, &length);
- assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ if (phn_support_telephony_feature())
+ assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ else
+ assert_eq(PHONE_NUMBER_ERROR_NOT_SUPPORTED, ret);
+
ret = phone_number_get_blocking_rules(0, 0, &rules, NULL);
- assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ if (phn_support_telephony_feature())
+ assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ else
+ assert_eq(PHONE_NUMBER_ERROR_NOT_SUPPORTED, ret);
return 0;
}
int length = 0;
ret = phone_number_get_blocking_rules_related(NULL, &rules, &length);
- assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ if (phn_support_telephony_feature())
+ assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ else
+ assert_eq(PHONE_NUMBER_ERROR_NOT_SUPPORTED, ret);
+
ret = phone_number_get_blocking_rules_related(test_number[0], NULL, &length);
- assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ if (phn_support_telephony_feature())
+ assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ else
+ assert_eq(PHONE_NUMBER_ERROR_NOT_SUPPORTED, ret);
+
ret = phone_number_get_blocking_rules_related(test_number[0], &rules, NULL);
- assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ if (phn_support_telephony_feature())
+ assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ else
+ assert_eq(PHONE_NUMBER_ERROR_NOT_SUPPORTED, ret);
return 0;
}
bool is_blocked = false;
ret = phone_number_check_blocking(NULL, &is_blocked);
- assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ if (phn_support_telephony_feature())
+ assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ else
+ assert_eq(PHONE_NUMBER_ERROR_NOT_SUPPORTED, ret);
+
ret = phone_number_check_blocking(test_number[0], NULL);
- assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ if (phn_support_telephony_feature())
+ assert_eq(PHONE_NUMBER_ERROR_INVALID_PARAMETER, ret);
+ else
+ assert_eq(PHONE_NUMBER_ERROR_NOT_SUPPORTED, ret);
return 0;
}
#define PHONE_NUMBER_TEST_NUMBER "13112345678"
static int _startup_err;
+#define PHN_FEATURE_TELEPHONY "http://tizen.org/feature/network.telephony"
+
+bool phn_support_telephony_feature(void)
+{
+ int ret;
+ static bool feature_checked = false;
+ static bool telephony_feature = false;
+
+ if (feature_checked)
+ return telephony_feature;
+
+ ret = system_info_get_platform_bool(PHN_FEATURE_TELEPHONY, &telephony_feature);
+ if (SYSTEM_INFO_ERROR_NONE != ret) {
+ return telephony_feature;
+ }
+
+ feature_checked = true;
+ return telephony_feature;
+}
+
/**
* @function utc_phonenumber_utils_service_startup
* @description Called before each test
{
_startup_err = PHONE_NUMBER_ERROR_NONE;
_startup_err = phone_number_connect();
+ if (PHONE_NUMBER_ERROR_NOT_SUPPORTED == _startup_err
+ && false == phn_support_telephony_feature())
+ _startup_err = PHONE_NUMBER_ERROR_NONE;
}
/**
phone_number_disconnect();
}
-#define API_NAME_PHONENUMBER_UTILS_GET_LOCATION_FROM_NUMBER "phone_number_get_location_from_number"
-#define API_NAME_PHONENUMBER_UTILS_GET_FORMATTED_NUMBER "phone_number_get_formatted_number"
-
-#define PHN_FEATURE_TELEPHONY "http://tizen.org/feature/network.telephony"
-#define PHN_FEATURE_TELEPHONY_INIT_STATE -1
-#define PHN_FEATURE_TELEPHONY_NOT_SUPPORTED 0
-#define PHN_FEATURE_TELEPHONY_SUPPORTED 1
-
-static int _phn_have_telephony_feature = -1;
-
-static int _phn_get_telephony_feature(void)
-{
- int ret;
- bool telephony_feature = false;
-
- if (PHN_FEATURE_TELEPHONY_INIT_STATE != _phn_have_telephony_feature)
- return _phn_have_telephony_feature;
-
- ret = system_info_get_platform_bool(PHN_FEATURE_TELEPHONY, &telephony_feature);
- if (SYSTEM_INFO_ERROR_NONE != ret) {
- return PHN_FEATURE_TELEPHONY_INIT_STATE;
- }
-
- if (false == telephony_feature)
- _phn_have_telephony_feature = PHN_FEATURE_TELEPHONY_NOT_SUPPORTED;
- else
- _phn_have_telephony_feature = PHN_FEATURE_TELEPHONY_SUPPORTED;
-
- return _phn_have_telephony_feature;
-}
/**
* @testcase utc_phonenumber_utils_service_phone_number_disconnect_p
int err;
err = phone_number_disconnect();
- assert_eq(err, PHONE_NUMBER_ERROR_NONE);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_NONE);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
return 0;
}
char *location = NULL;
err = phone_number_get_location_from_number(PHONE_NUMBER_TEST_NUMBER, i, j, &location);
free(location);
- assert_eq(err, PHONE_NUMBER_ERROR_NONE);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_NONE);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
}
}
return 0;
char *location = NULL;
err = phone_number_get_location_from_number(PHONE_NUMBER_TEST_NUMBER, i, j, &location);
free(location);
- assert_eq(err, PHONE_NUMBER_ERROR_NONE);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_NONE);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
}
}
return 0;
err = phone_number_get_location_from_number(NULL, PHONE_NUMBER_REGION_REPUBLIC_OF_KOREA, PHONE_NUMBER_LANG_KOREAN, &location);
free(location);
- assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
err = phone_number_get_location_from_number(PHONE_NUMBER_TEST_NUMBER, -1, PHONE_NUMBER_LANG_KOREAN, &location);
free(location);
- assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
err = phone_number_get_location_from_number(PHONE_NUMBER_TEST_NUMBER, PHONE_NUMBER_REGION_REPUBLIC_OF_KOREA, -1, &location);
free(location);
- assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
err = phone_number_get_location_from_number(PHONE_NUMBER_TEST_NUMBER, PHONE_NUMBER_REGION_REPUBLIC_OF_KOREA, PHONE_NUMBER_LANG_KOREAN, NULL);
- assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
return 0;
}
char *formatted_number = NULL;
err = phone_number_get_formatted_number(PHONE_NUMBER_TEST_NUMBER, i, &formatted_number);
free(formatted_number);
- assert_eq(err, PHONE_NUMBER_ERROR_NONE);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_NONE);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
}
return 0;
}
err = phone_number_get_formatted_number(NULL, PHONE_NUMBER_REGION_REPUBLIC_OF_KOREA, &formatted_number);
free(formatted_number);
- assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
err = phone_number_get_formatted_number(PHONE_NUMBER_TEST_NUMBER, -1, &formatted_number);
free(formatted_number);
- assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
err = phone_number_get_formatted_number(PHONE_NUMBER_TEST_NUMBER, PHONE_NUMBER_REGION_REPUBLIC_OF_KOREA, NULL);
- assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
return 0;
}
int err;
char *normalized_number = NULL;
- if(PHN_FEATURE_TELEPHONY_NOT_SUPPORTED == _phn_get_telephony_feature()) {
- err = phone_number_get_normalized_number(PHONE_NUMBER_TEST_NUMBER, &normalized_number);
- free(normalized_number);
- assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
err = phone_number_get_normalized_number(PHONE_NUMBER_TEST_NUMBER, &normalized_number);
free(normalized_number);
- assert_eq(err, PHONE_NUMBER_ERROR_NONE);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_NONE);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
return 0;
}
int err;
char *normalized_number = NULL;
- if(PHN_FEATURE_TELEPHONY_NOT_SUPPORTED == _phn_get_telephony_feature()) {
- err = phone_number_get_normalized_number(NULL, &normalized_number);
- free(normalized_number);
- assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
-
- err = phone_number_get_normalized_number(PHONE_NUMBER_TEST_NUMBER, NULL);
- assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
- return 0;
- }
-
err = phone_number_get_normalized_number(NULL, &normalized_number);
free(normalized_number);
- assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
err = phone_number_get_normalized_number(PHONE_NUMBER_TEST_NUMBER, NULL);
- assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
return 0;
}
//& set: PhonenumberUtils
#define PHONE_NUMBER_TEST_NUMBER "13112345678"
+extern bool phn_support_telephony_feature(void);
/**
* @function utc_phonenumber_utils_startup
{
}
-#define API_NAME_PHONENUMBER_UTILS_GET_LOCATION_FROM_NUMBER "phone_number_get_location_from_number"
-#define API_NAME_PHONENUMBER_UTILS_GET_FORMATTED_NUMBER "phone_number_get_formatted_number"
-
/**
* @testcase utc_phonenumber_utils_phone_number_get_location_from_number_p
* @since_tizen 2.4
char *location = NULL;
err = phone_number_get_location_from_number(PHONE_NUMBER_TEST_NUMBER, i, j, &location);
free(location);
- assert_eq(err, PHONE_NUMBER_ERROR_NONE);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_NONE);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
}
}
return 0;
char *location = NULL;
err = phone_number_get_location_from_number(PHONE_NUMBER_TEST_NUMBER, i, j, &location);
free(location);
- assert_eq(err, PHONE_NUMBER_ERROR_NONE);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_NONE);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
}
}
return 0;
err = phone_number_get_location_from_number(NULL, PHONE_NUMBER_REGION_REPUBLIC_OF_KOREA, PHONE_NUMBER_LANG_KOREAN, &location);
free(location);
- assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
err = phone_number_get_location_from_number(PHONE_NUMBER_TEST_NUMBER, -1, PHONE_NUMBER_LANG_KOREAN, &location);
free(location);
- assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
err = phone_number_get_location_from_number(PHONE_NUMBER_TEST_NUMBER, PHONE_NUMBER_REGION_REPUBLIC_OF_KOREA, -1, &location);
free(location);
- assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
err = phone_number_get_location_from_number(PHONE_NUMBER_TEST_NUMBER, PHONE_NUMBER_REGION_REPUBLIC_OF_KOREA, PHONE_NUMBER_LANG_KOREAN, NULL);
- assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
return 0;
}
char *formatted_number = NULL;
err = phone_number_get_formatted_number(PHONE_NUMBER_TEST_NUMBER, i, &formatted_number);
free(formatted_number);
- assert_eq(err, PHONE_NUMBER_ERROR_NONE);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_NONE);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
}
return 0;
}
err = phone_number_get_formatted_number(NULL, PHONE_NUMBER_REGION_REPUBLIC_OF_KOREA, &formatted_number);
free(formatted_number);
- assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
err = phone_number_get_formatted_number(PHONE_NUMBER_TEST_NUMBER, -1, &formatted_number);
free(formatted_number);
- assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
err = phone_number_get_formatted_number(PHONE_NUMBER_TEST_NUMBER, PHONE_NUMBER_REGION_REPUBLIC_OF_KOREA, NULL);
- assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ if (phn_support_telephony_feature())
+ assert_eq(err, PHONE_NUMBER_ERROR_INVALID_PARAMETER);
+ else
+ assert_eq(err, PHONE_NUMBER_ERROR_NOT_SUPPORTED);
return 0;
}