Implementation fixes corresponding to UTC tests fixes. 02/43002/1 accepted/tizen/mobile/20150707.035110 accepted/tizen/tv/20150707.035120 accepted/tizen/wearable/20150707.035127 submit/tizen/20150707.010930
authorByungWoo Lee <bw1212.lee@samsung.com>
Tue, 7 Jul 2015 00:48:32 +0000 (09:48 +0900)
committerByungWoo Lee <bw1212.lee@samsung.com>
Tue, 7 Jul 2015 00:48:32 +0000 (09:48 +0900)
Modify description of i18n_udate_to_calendar_date_field.

Change-Id: I00dd32d6cb14fb57b4699bc01565d5f8752666a7

src/include/mobile/utils_i18n_udate.h
src/include/wearable/utils_i18n_udate.h
src/utils_i18n_timezone.cpp
src/utils_i18n_ubrk.c
src/utils_i18n_udate.c
src/utils_i18n_ulocale.c
src/utils_i18n_unumber.c
src/utils_i18n_ustring.c

index 911a934..3db5542 100644 (file)
@@ -237,9 +237,10 @@ int i18n_udate_format_date ( const i18n_udate_format_h format, i18n_udate date_t
  * @details Note: since the mapping is many-to-one, there is no inverse mapping.
  * @since_tizen 2.3.1
  *
- * @param[in] field The #i18n_udate_format_h to map.
+ * @param[in] field The #i18n_udate_format_h to map. 
+ *     #I18N_UDATE_FORMAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD, #I18N_UDATE_FORMAT_TIMEZONE_ISO_FIELD, 
+ *     #I18N_UDATE_FORMAT_TIMEZONE_ISO_LOCAL_FIELD and #I18N_UDATE_FORMAT_FIELD_COUNT are not supported.
  * @param[out] date_field_type A pointer to the #i18n_ucalendar_date_fields_e.
- *         This will be #I18N_UCALENDAR_FIELD_COUNT in case of error (e.g. the input field is #I18N_UDATE_FORMAT_FIELD_COUNT).
  *
  * @return Error code.
  * @retval #I18N_ERROR_NONE Successful
index 911a934..3db5542 100644 (file)
@@ -237,9 +237,10 @@ int i18n_udate_format_date ( const i18n_udate_format_h format, i18n_udate date_t
  * @details Note: since the mapping is many-to-one, there is no inverse mapping.
  * @since_tizen 2.3.1
  *
- * @param[in] field The #i18n_udate_format_h to map.
+ * @param[in] field The #i18n_udate_format_h to map. 
+ *     #I18N_UDATE_FORMAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD, #I18N_UDATE_FORMAT_TIMEZONE_ISO_FIELD, 
+ *     #I18N_UDATE_FORMAT_TIMEZONE_ISO_LOCAL_FIELD and #I18N_UDATE_FORMAT_FIELD_COUNT are not supported.
  * @param[out] date_field_type A pointer to the #i18n_ucalendar_date_fields_e.
- *         This will be #I18N_UCALENDAR_FIELD_COUNT in case of error (e.g. the input field is #I18N_UDATE_FORMAT_FIELD_COUNT).
  *
  * @return Error code.
  * @retval #I18N_ERROR_NONE Successful
index 18b09fd..26c77d9 100755 (executable)
@@ -203,7 +203,11 @@ int i18n_timezone_set_default( i18n_timezone_h timezone )
 const char* i18n_timezone_get_tzdata_version(void)
 {
     UErrorCode status = U_ZERO_ERROR;
-    return TimeZone::getTZDataVersion(status);
+    const char* tzver = TimeZone::getTZDataVersion(status);
+
+    set_last_result(_i18n_error_mapping(status));
+
+    return tzver;
 }
 
 int i18n_timezone_get_region(const char *timezone_id, char *region, int32_t *region_len, int32_t region_capacity)
index 77dd4f7..7f222d2 100644 (file)
@@ -168,6 +168,11 @@ int32_t i18n_ubrk_following (i18n_ubreak_iterator_h break_iter, int32_t offset)
 
 const char *i18n_ubrk_get_available (int32_t index)
 {
+    if(index < 0) {
+        set_last_result(I18N_ERROR_INVALID_PARAMETER);
+        return NULL;
+    }
+
     set_last_result(I18N_ERROR_NONE);
     return ubrk_getAvailable(index);
 }
index 17d0dc2..0bdb159 100644 (file)
@@ -177,6 +177,11 @@ int i18n_udate_set_number_format ( i18n_udate_format_h format, const i18n_unumbe
 
 const char *i18n_udate_get_available ( int32_t locale_index )
 {
+    if(locale_index < 0) {
+        set_last_result(I18N_ERROR_INVALID_PARAMETER);
+        return NULL;
+    }
+    set_last_result(I18N_ERROR_NONE);
     return udat_getAvailable(locale_index);
 }
 
index 6a0df9c..aa1973f 100755 (executable)
@@ -65,6 +65,11 @@ int i18n_ulocale_get_display_name (const char *locale_id, const char *in_locale_
 
 const char* i18n_ulocale_get_available (int32_t n)
 {
+    if(n < 0){
+        set_last_result(I18N_ERROR_INVALID_PARAMETER);
+        return NULL;
+    }
+    set_last_result(I18N_ERROR_NONE);
     return uloc_getAvailable(n);
 }
 
index eb22dc7..b6bbf22 100755 (executable)
@@ -250,6 +250,11 @@ int i18n_unumber_apply_pattern (i18n_unumber_format_h format, i18n_ubool localiz
 
 const char *i18n_unumber_get_available (int32_t locale_index)
 {
+    if(locale_index < 0) {
+        set_last_result(I18N_ERROR_INVALID_PARAMETER);
+        return NULL;
+    }
+
     set_last_result(I18N_ERROR_NONE);
     return unum_getAvailable(locale_index);
 }
index cafd076..1ba6126 100644 (file)
@@ -196,7 +196,7 @@ int32_t i18n_ustring_spn ( const i18n_uchar *string, const i18n_uchar *match_set
 
 i18n_uchar* i18n_ustring_tokenizer_r ( i18n_uchar *src, const i18n_uchar *delim, i18n_uchar **save_state )
 {
-    if(src == NULL && save_state == NULL) {
+    if((src == NULL && save_state == NULL) || delim == NULL) {
         set_last_result(I18N_ERROR_INVALID_PARAMETER);
         return NULL;
     }