assert_eq(ret, I18N_ERROR_NONE);
assert_neq(num_format, NULL);
- int32_t value = i18n_unumber_parse_int64(num_format, test_variable, 16, NULL);
+ int32_t len = i18n_ustring_get_length(test_variable);
+ int32_t value = i18n_unumber_parse_int64(num_format, test_variable, len, NULL);
ret = get_last_result();
assert_eq(ret, I18N_ERROR_NONE);
assert_eq(ret, I18N_ERROR_NONE);
assert_neq(num_format, NULL);
- int32_t value = i18n_unumber_parse_int64(num_format, test_variable2, 16, NULL);
+ int32_t len = i18n_ustring_get_length(test_variable2);
+ int32_t value = i18n_unumber_parse_int64(num_format, test_variable2, len, NULL);
ret = get_last_result();
assert_eq(ret, I18N_ERROR_NONE);
*/
int utc_capi_base_utils_i18n_unumber_parse_int64_n(void)
{
- i18n_unumber_parse_int64(NULL, test_variable, 16, NULL);
+ int32_t len = i18n_ustring_get_length(test_variable);
+ i18n_unumber_parse_int64(NULL, test_variable, len, NULL);
ret = get_last_result();
assert_eq(ret, I18N_ERROR_INVALID_PARAMETER);
i18n_uchar parse_double[] = { '1', '2', '2', '3', '.', '1', '1', 0 };
- double value = i18n_unumber_parse_double(num_format, parse_double, 8, NULL);
+ int32_t len = i18n_ustring_get_length(parse_double);
+ double value = i18n_unumber_parse_double(num_format, parse_double, len, NULL);
ret = get_last_result();
assert_eq(ret, I18N_ERROR_NONE);
i18n_uchar parse_double[] = { '-', '1', '2', '2', '3', '.', '1', '1', 0 };
- double value = i18n_unumber_parse_double(num_format, parse_double, 8, NULL);
+ int32_t len = i18n_ustring_get_length(parse_double);
+ double value = i18n_unumber_parse_double(num_format, parse_double, len, NULL);
ret = get_last_result();
assert_eq(ret, I18N_ERROR_NONE);
{
i18n_uchar parse_double[] = { '1', '2', '2', '3', '.', '1', '1', 0 };
- i18n_unumber_parse_double(NULL, parse_double, 8, NULL);
+ int32_t len = i18n_ustring_get_length(parse_double);
+ i18n_unumber_parse_double(NULL, parse_double, len, NULL);
ret = get_last_result();
assert_eq(ret, I18N_ERROR_INVALID_PARAMETER);
_text = (i18n_uchar*)calloc(strlen(text) + 1, sizeof(i18n_uchar));
i18n_ustring_copy_ua(_text, text);
- i18n_unumber_parse_decimal(num_format, _text, 10, NULL, result, BUF_SIZE);
+ int32_t _text_length = i18n_ustring_get_length(_text);
+ i18n_unumber_parse_decimal(num_format, _text, _text_length, NULL, result, BUF_SIZE);
ret = get_last_result();
free(_text);
assert_eq(ret, I18N_ERROR_NONE);
_text = (i18n_uchar*)calloc(strlen(text) + 1, sizeof(i18n_uchar));
i18n_ustring_copy_ua(_text, text);
- i18n_unumber_parse_decimal(num_format, _text, 16, NULL, result, BUF_SIZE);
+ int32_t _text_length = i18n_ustring_get_length(_text);
+ i18n_unumber_parse_decimal(num_format, _text, _text_length, NULL, result, BUF_SIZE);
ret = get_last_result();
free(_text);
_text = (i18n_uchar*)calloc(strlen(text) + 1, sizeof(i18n_uchar));
i18n_ustring_copy_ua(_text, text);
- i18n_unumber_parse_decimal(NULL, _text, 16, NULL, result, BUF_SIZE);
+ int32_t _text_length = i18n_ustring_get_length(_text);
+ i18n_unumber_parse_decimal(NULL, _text, _text_length, NULL, result, BUF_SIZE);
ret = get_last_result();
free(_text);
_text = (i18n_uchar*)calloc(strlen(text) + 1, sizeof(i18n_uchar));
i18n_ustring_copy_ua(_text, text);
- i18n_unumber_parse_decimal(num_format, _text, 16, NULL, NULL, BUF_SIZE);
+ int32_t _text_length = i18n_ustring_get_length(_text);
+ i18n_unumber_parse_decimal(num_format, _text, _text_length, NULL, NULL, BUF_SIZE);
ret = get_last_result();
free(_text);
_text = (i18n_uchar*)calloc(strlen(text) + 1, sizeof(i18n_uchar));
i18n_ustring_copy_ua(_text, text);
- i18n_unumber_parse_decimal(num_format, _text, 16, NULL, result, -1);
+ int32_t _text_length = i18n_ustring_get_length(_text);
+ i18n_unumber_parse_decimal(num_format, _text, _text_length, NULL, result, -1);
ret = get_last_result();
free(_text);
assert_eq(ret, I18N_ERROR_NONE);
assert_neq(num_format, NULL);
- i18n_unumber_parse_double_currency(num_format, _text, 16, NULL, currency);
+ int32_t _text_length = i18n_ustring_get_length(_text);
+ i18n_unumber_parse_double_currency(num_format, _text, _text_length, NULL, currency);
ret = get_last_result();
assert_eq(ret, I18N_ERROR_NONE);
assert_eq(ret, I18N_ERROR_NONE);
assert_neq(num_format, NULL);
- i18n_unumber_parse_double_currency(num_format, _text, 16, NULL, currency);
+ int32_t _text_length = i18n_ustring_get_length(_text);
+ i18n_unumber_parse_double_currency(num_format, _text, _text_length, NULL, currency);
ret = get_last_result();
assert_eq(ret, I18N_ERROR_NONE);
i18n_uchar currency[BUF_SIZE] = { 0, };
i18n_uchar _text[] = { 0x0024, 0x0031, 0x0032, 0x002E, 0x0030, 0x0030, 0 };
- i18n_unumber_parse_double_currency(NULL, _text, 16, NULL, currency);
+ int32_t _text_length = i18n_ustring_get_length(_text);
+ i18n_unumber_parse_double_currency(NULL, _text, _text_length, NULL, currency);
ret = get_last_result();
assert_eq(ret, I18N_ERROR_INVALID_PARAMETER);
assert_eq(ret, I18N_ERROR_NONE);
assert_neq(num_format, NULL);
- i18n_unumber_parse_double_currency(num_format, _text, 16, NULL, NULL);
+ int32_t _text_length = i18n_ustring_get_length(_text);
+ i18n_unumber_parse_double_currency(num_format, _text, _text_length, NULL, NULL);
ret = get_last_result();
assert_eq(ret, I18N_ERROR_INVALID_PARAMETER);