unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob ddedc56deead0466c85d853ea6bb3dbaa7e471e1 4111 bytes (raw)
name: gnu/packages/patches/icu4c-reset-keyword-list-iterator.patch 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
 
Copied from upstream: http://bugs.icu-project.org/trac/changeset/39484/.

Paths and line endings have been adapted.

Index: icu/source/common/ulist.c
===================================================================
--- icu/source/common/ulist.c	(revision 39483)
+++ icu/source/common/ulist.c	(revision 39484)
@@ -30,5 +30,4 @@
     
     int32_t size;
-    int32_t currentIndex;
 };
 
@@ -52,5 +51,4 @@
     newList->tail = NULL;
     newList->size = 0;
-    newList->currentIndex = -1;
     
     return newList;
@@ -81,6 +79,7 @@
         p->next->previous = p->previous;
     }
-    list->curr = NULL;
-    list->currentIndex = 0;
+    if (p == list->curr) {
+        list->curr = p->next;
+    }
     --list->size;
     if (p->forceDelete) {
@@ -151,5 +150,4 @@
         list->head->previous = newItem;
         list->head = newItem;
-        list->currentIndex++;
     }
     
@@ -194,5 +192,4 @@
     curr = list->curr;
     list->curr = curr->next;
-    list->currentIndex++;
     
     return curr->data;
@@ -210,5 +207,4 @@
     if (list != NULL) {
         list->curr = list->head;
-        list->currentIndex = 0;
     }
 }
@@ -273,3 +269,2 @@
     return (UList *)(en->context);
 }
-
Index: icu/source/i18n/ucol_res.cpp
===================================================================
--- icu/source/i18n/ucol_res.cpp	(revision 39483)
+++ icu/source/i18n/ucol_res.cpp	(revision 39484)
@@ -681,4 +681,5 @@
     }
     memcpy(en, &defaultKeywordValues, sizeof(UEnumeration));
+    ulist_resetList(sink.values);  // Initialize the iterator.
     en->context = sink.values;
     sink.values = NULL;  // Avoid deletion in the sink destructor.
Index: icu/source/test/intltest/apicoll.cpp
===================================================================
--- icu/source/test/intltest/apicoll.cpp	(revision 39483)
+++ icu/source/test/intltest/apicoll.cpp	(revision 39484)
@@ -82,14 +82,7 @@
     col = Collator::createInstance(Locale::getEnglish(), success);
     if (U_FAILURE(success)){
-        errcheckln(success, "Default Collator creation failed. - %s", u_errorName(success));
-        return;
-    }
-
-    StringEnumeration* kwEnum = col->getKeywordValuesForLocale("", Locale::getEnglish(),true,success);
-    if (U_FAILURE(success)){
-        errcheckln(success, "Get Keyword Values for Locale failed. - %s", u_errorName(success));
-        return;
-    }
-    delete kwEnum;
+        errcheckln(success, "English Collator creation failed. - %s", u_errorName(success));
+        return;
+    }
 
     col->getVersion(versionArray);
@@ -230,4 +223,27 @@
     delete aFrCol;
     delete junk;
+}
+
+void CollationAPITest::TestKeywordValues() {
+    IcuTestErrorCode errorCode(*this, "TestKeywordValues");
+    LocalPointer<Collator> col(Collator::createInstance(Locale::getEnglish(), errorCode));
+    if (errorCode.logIfFailureAndReset("English Collator creation failed")) {
+        return;
+    }
+
+    LocalPointer<StringEnumeration> kwEnum(
+        col->getKeywordValuesForLocale("collation", Locale::getEnglish(), TRUE, errorCode));
+    if (errorCode.logIfFailureAndReset("Get Keyword Values for English Collator failed")) {
+        return;
+    }
+    assertTrue("expect at least one collation tailoring for English", kwEnum->count(errorCode) > 0);
+    const char *kw;
+    UBool hasStandard = FALSE;
+    while ((kw = kwEnum->next(NULL, errorCode)) != NULL) {
+        if (strcmp(kw, "standard") == 0) {
+            hasStandard = TRUE;
+        }
+    }
+    assertTrue("expect at least the 'standard' collation tailoring for English", hasStandard);
 }
 
@@ -2467,4 +2483,5 @@
     TESTCASE_AUTO_BEGIN;
     TESTCASE_AUTO(TestProperty);
+    TESTCASE_AUTO(TestKeywordValues);
     TESTCASE_AUTO(TestOperators);
     TESTCASE_AUTO(TestDuplicate);
Index: icu/source/test/intltest/apicoll.h
===================================================================
--- icu/source/test/intltest/apicoll.h	(revision 39483)
+++ icu/source/test/intltest/apicoll.h	(revision 39484)
@@ -36,4 +36,5 @@
      */
     void TestProperty(/* char* par */);
+    void TestKeywordValues();
 
     /**

debug log:

solving ddedc56de ...
found ddedc56de in https://yhetil.org/guix-patches/20170412105325.8099-1-clement@lassieur.org/ ||
	https://yhetil.org/guix-patches/20170414145117.27880-1-clement@lassieur.org/

applying [1/1] https://yhetil.org/guix-patches/20170412105325.8099-1-clement@lassieur.org/
diff --git a/gnu/packages/patches/icu4c-reset-keyword-list-iterator.patch b/gnu/packages/patches/icu4c-reset-keyword-list-iterator.patch
new file mode 100644
index 000000000..ddedc56de

1:16: trailing whitespace.
     
1:20: trailing whitespace.
 
1:25: trailing whitespace.
     
1:42: trailing whitespace.
     
1:47: trailing whitespace.
     
Checking patch gnu/packages/patches/icu4c-reset-keyword-list-iterator.patch...
Applied patch gnu/packages/patches/icu4c-reset-keyword-list-iterator.patch cleanly.
warning: squelched 3 whitespace errors
warning: 8 lines add whitespace errors.

skipping https://yhetil.org/guix-patches/20170414145117.27880-1-clement@lassieur.org/ for ddedc56de
index at:
100644 ddedc56deead0466c85d853ea6bb3dbaa7e471e1	gnu/packages/patches/icu4c-reset-keyword-list-iterator.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).