1 source: http://bugs.icu-project.org/trac/changeset/39484/
4 Index: icu/common/ulist.c
5 ===================================================================
6 --- icu/common/ulist.c (revision 39483)
7 +++ icu/common/ulist.c (revision 39484)
11 - int32_t currentIndex;
17 - newList->currentIndex = -1;
21 p->next->previous = p->previous;
24 - list->currentIndex = 0;
25 + if (p == list->curr) {
26 + list->curr = p->next;
31 list->head->previous = newItem;
33 - list->currentIndex++;
38 list->curr = curr->next;
39 - list->currentIndex++;
44 list->curr = list->head;
45 - list->currentIndex = 0;
49 return (UList *)(en->context);
52 Index: icu/i18n/ucol_res.cpp
53 ===================================================================
54 --- icu/i18n/ucol_res.cpp (revision 39483)
55 +++ icu/i18n/ucol_res.cpp (revision 39484)
58 memcpy(en, &defaultKeywordValues, sizeof(UEnumeration));
59 + ulist_resetList(sink.values); // Initialize the iterator.
60 en->context = sink.values;
61 sink.values = NULL; // Avoid deletion in the sink destructor.
62 Index: icu/test/intltest/apicoll.cpp
63 ===================================================================
64 --- icu/test/intltest/apicoll.cpp (revision 39483)
65 +++ icu/test/intltest/apicoll.cpp (revision 39484)
67 col = Collator::createInstance(Locale::getEnglish(), success);
68 if (U_FAILURE(success)){
69 - errcheckln(success, "Default Collator creation failed. - %s", u_errorName(success));
73 - StringEnumeration* kwEnum = col->getKeywordValuesForLocale("", Locale::getEnglish(),true,success);
74 - if (U_FAILURE(success)){
75 - errcheckln(success, "Get Keyword Values for Locale failed. - %s", u_errorName(success));
79 + errcheckln(success, "English Collator creation failed. - %s", u_errorName(success));
83 col->getVersion(versionArray);
89 +void CollationAPITest::TestKeywordValues() {
90 + IcuTestErrorCode errorCode(*this, "TestKeywordValues");
91 + LocalPointer<Collator> col(Collator::createInstance(Locale::getEnglish(), errorCode));
92 + if (errorCode.logIfFailureAndReset("English Collator creation failed")) {
96 + LocalPointer<StringEnumeration> kwEnum(
97 + col->getKeywordValuesForLocale("collation", Locale::getEnglish(), TRUE, errorCode));
98 + if (errorCode.logIfFailureAndReset("Get Keyword Values for English Collator failed")) {
101 + assertTrue("expect at least one collation tailoring for English", kwEnum->count(errorCode) > 0);
103 + UBool hasStandard = FALSE;
104 + while ((kw = kwEnum->next(NULL, errorCode)) != NULL) {
105 + if (strcmp(kw, "standard") == 0) {
106 + hasStandard = TRUE;
109 + assertTrue("expect at least the 'standard' collation tailoring for English", hasStandard);
112 @@ -2467,4 +2483,5 @@
114 TESTCASE_AUTO(TestProperty);
115 + TESTCASE_AUTO(TestKeywordValues);
116 TESTCASE_AUTO(TestOperators);
117 TESTCASE_AUTO(TestDuplicate);
118 Index: icu/test/intltest/apicoll.h
119 ===================================================================
120 --- icu/test/intltest/apicoll.h (revision 39483)
121 +++ icu/test/intltest/apicoll.h (revision 39484)
124 void TestProperty(/* char* par */);
125 + void TestKeywordValues();