View | Details | Raw Unified | Return to bug 218788 | Differences between
and this patch

Collapse All | Expand All

(-)./Makefile (-4 / +4 lines)
Lines 2-13 Link Here
2
# $FreeBSD: head/devel/icu/Makefile 437961 2017-04-07 22:06:07Z rezny $
2
# $FreeBSD: head/devel/icu/Makefile 437961 2017-04-07 22:06:07Z rezny $
3
3
4
PORTNAME=	icu
4
PORTNAME=	icu
5
DISTVERSION=	58_2
5
DISTVERSION=	59.1
6
PORTREVISION?=	1 # keep for icu-lx
6
#PORTREVISION?=	1 # keep for icu-lx
7
PORTEPOCH?=	1
7
PORTEPOCH?=	1
8
CATEGORIES?=	devel
8
CATEGORIES?=	devel
9
MASTER_SITES=	http://download.icu-project.org/files/icu4c/${PORTVERSION}/
9
MASTER_SITES=	http://download.icu-project.org/files/icu4c/${PORTVERSION}rc/
10
DISTNAME=	icu4c-${DISTVERSION}-src
10
DISTNAME=	icu4c-${DISTVERSION:C/\..*//}rc-src
11
11
12
MAINTAINER=	office@FreeBSD.org
12
MAINTAINER=	office@FreeBSD.org
13
COMMENT?=	International Components for Unicode (from IBM)
13
COMMENT?=	International Components for Unicode (from IBM)
(-)./distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1481218489
1
TIMESTAMP = 1492732189
2
SHA256 (icu4c-58_2-src.tgz) = 2b0a4410153a9b20de0e20c7d8b66049a72aef244b53683d0d7521371683da0c
2
SHA256 (icu4c-59rc-src.tgz) = 2375d4b64d0696bde4f9e73d919f8083609992d890bdece580176bc3b2937c9c
3
SIZE (icu4c-58_2-src.tgz) = 23369902
3
SIZE (icu4c-59rc-src.tgz) = 22711328
(-)./files/patch-r39484 (-148 lines)
Lines 1-148 Link Here
1
https://ssl.icu-project.org/trac/ticket/12827
2
3
Index: test/intltest/apicoll.h
4
===================================================================
5
--- test/intltest/apicoll.h	(revision 39483)
6
+++ test/intltest/apicoll.h	(revision 39484)
7
@@ -35,6 +35,7 @@ class CollationAPITest: public IntlTestCollator {
8
      * - displayable name in the desired locale
9
      */
10
     void TestProperty(/* char* par */);
11
+    void TestKeywordValues();
12
 
13
     /**
14
     * This tests the RuleBasedCollator
15
Index: test/intltest/apicoll.cpp
16
===================================================================
17
--- test/intltest/apicoll.cpp	(revision 39483)
18
+++ test/intltest/apicoll.cpp	(revision 39484)
19
@@ -81,17 +81,10 @@ CollationAPITest::TestProperty(/* char* par */)
20
     logln("Test ctors : ");
21
     col = Collator::createInstance(Locale::getEnglish(), success);
22
     if (U_FAILURE(success)){
23
-        errcheckln(success, "Default Collator creation failed. - %s", u_errorName(success));
24
+        errcheckln(success, "English Collator creation failed. - %s", u_errorName(success));
25
         return;
26
     }
27
 
28
-    StringEnumeration* kwEnum = col->getKeywordValuesForLocale("", Locale::getEnglish(),true,success);
29
-    if (U_FAILURE(success)){
30
-        errcheckln(success, "Get Keyword Values for Locale failed. - %s", u_errorName(success));
31
-        return;
32
-    }
33
-    delete kwEnum;
34
-
35
     col->getVersion(versionArray);
36
     // Check for a version greater than some value rather than equality
37
     // so that we need not update the expected version each time.
38
@@ -231,6 +224,29 @@ CollationAPITest::TestProperty(/* char* par */)
39
     delete junk;
40
 }
41
 
42
+void CollationAPITest::TestKeywordValues() {
43
+    IcuTestErrorCode errorCode(*this, "TestKeywordValues");
44
+    LocalPointer<Collator> col(Collator::createInstance(Locale::getEnglish(), errorCode));
45
+    if (errorCode.logIfFailureAndReset("English Collator creation failed")) {
46
+        return;
47
+    }
48
+
49
+    LocalPointer<StringEnumeration> kwEnum(
50
+        col->getKeywordValuesForLocale("collation", Locale::getEnglish(), TRUE, errorCode));
51
+    if (errorCode.logIfFailureAndReset("Get Keyword Values for English Collator failed")) {
52
+        return;
53
+    }
54
+    assertTrue("expect at least one collation tailoring for English", kwEnum->count(errorCode) > 0);
55
+    const char *kw;
56
+    UBool hasStandard = FALSE;
57
+    while ((kw = kwEnum->next(NULL, errorCode)) != NULL) {
58
+        if (strcmp(kw, "standard") == 0) {
59
+            hasStandard = TRUE;
60
+        }
61
+    }
62
+    assertTrue("expect at least the 'standard' collation tailoring for English", hasStandard);
63
+}
64
+
65
 void 
66
 CollationAPITest::TestRuleBasedColl()
67
 {
68
@@ -2466,6 +2482,7 @@ void CollationAPITest::runIndexedTest( int32_t ind
69
     if (exec) logln("TestSuite CollationAPITest: ");
70
     TESTCASE_AUTO_BEGIN;
71
     TESTCASE_AUTO(TestProperty);
72
+    TESTCASE_AUTO(TestKeywordValues);
73
     TESTCASE_AUTO(TestOperators);
74
     TESTCASE_AUTO(TestDuplicate);
75
     TESTCASE_AUTO(TestCompare);
76
Index: i18n/ucol_res.cpp
77
===================================================================
78
--- i18n/ucol_res.cpp	(revision 39483)
79
+++ i18n/ucol_res.cpp	(revision 39484)
80
@@ -680,6 +680,7 @@ ucol_getKeywordValuesForLocale(const char* /*key*/
81
         return NULL;
82
     }
83
     memcpy(en, &defaultKeywordValues, sizeof(UEnumeration));
84
+    ulist_resetList(sink.values);  // Initialize the iterator.
85
     en->context = sink.values;
86
     sink.values = NULL;  // Avoid deletion in the sink destructor.
87
     return en;
88
Index: common/ulist.c
89
===================================================================
90
--- common/ulist.c	(revision 39483)
91
+++ common/ulist.c	(revision 39484)
92
@@ -29,7 +29,6 @@ struct UList {
93
     UListNode *tail;
94
     
95
     int32_t size;
96
-    int32_t currentIndex;
97
 };
98
 
99
 static void ulist_addFirstItem(UList *list, UListNode *newItem);
100
@@ -51,7 +50,6 @@ U_CAPI UList *U_EXPORT2 ulist_createEmptyList(UErr
101
     newList->head = NULL;
102
     newList->tail = NULL;
103
     newList->size = 0;
104
-    newList->currentIndex = -1;
105
     
106
     return newList;
107
 }
108
@@ -80,8 +78,9 @@ static void ulist_removeItem(UList *list, UListNod
109
     } else {
110
         p->next->previous = p->previous;
111
     }
112
-    list->curr = NULL;
113
-    list->currentIndex = 0;
114
+    if (p == list->curr) {
115
+        list->curr = p->next;
116
+    }
117
     --list->size;
118
     if (p->forceDelete) {
119
         uprv_free(p->data);
120
@@ -150,7 +149,6 @@ U_CAPI void U_EXPORT2 ulist_addItemBeginList(UList
121
         newItem->next = list->head;
122
         list->head->previous = newItem;
123
         list->head = newItem;
124
-        list->currentIndex++;
125
     }
126
     
127
     list->size++;
128
@@ -193,7 +191,6 @@ U_CAPI void *U_EXPORT2 ulist_getNext(UList *list)
129
     
130
     curr = list->curr;
131
     list->curr = curr->next;
132
-    list->currentIndex++;
133
     
134
     return curr->data;
135
 }
136
@@ -209,7 +206,6 @@ U_CAPI int32_t U_EXPORT2 ulist_getListSize(const U
137
 U_CAPI void U_EXPORT2 ulist_resetList(UList *list) {
138
     if (list != NULL) {
139
         list->curr = list->head;
140
-        list->currentIndex = 0;
141
     }
142
 }
143
 
144
@@ -272,4 +268,3 @@ U_CAPI void U_EXPORT2 ulist_reset_keyword_values_i
145
 U_CAPI UList * U_EXPORT2 ulist_getListFromEnum(UEnumeration *en) {
146
     return (UList *)(en->context);
147
 }
148
-
(-)./pkg-plist (+4 lines)
Lines 1-3 Link Here
1
sbin/escapesrc
1
sbin/icupkg
2
sbin/icupkg
2
sbin/gensprep
3
sbin/gensprep
3
sbin/gennorm2
4
sbin/gennorm2
Lines 44-49 include/unicode/bytestrie.h Link Here
44
include/unicode/bytestriebuilder.h
45
include/unicode/bytestriebuilder.h
45
include/unicode/calendar.h
46
include/unicode/calendar.h
46
include/unicode/caniter.h
47
include/unicode/caniter.h
48
include/unicode/casemap.h
49
include/unicode/char16ptr.h
47
include/unicode/chariter.h
50
include/unicode/chariter.h
48
include/unicode/choicfmt.h
51
include/unicode/choicfmt.h
49
include/unicode/coleitr.h
52
include/unicode/coleitr.h
Lines 63-68 include/unicode/dtitvfmt.h Link Here
63
include/unicode/dtitvinf.h
66
include/unicode/dtitvinf.h
64
include/unicode/dtptngen.h
67
include/unicode/dtptngen.h
65
include/unicode/dtrule.h
68
include/unicode/dtrule.h
69
include/unicode/edits.h
66
include/unicode/enumset.h
70
include/unicode/enumset.h
67
include/unicode/errorcode.h
71
include/unicode/errorcode.h
68
include/unicode/fieldpos.h
72
include/unicode/fieldpos.h

Return to bug 218788