Lines Matching refs:set
28 static void expect(const USet* set,
32 static void expectContainment(const USet* set,
36 static void expectItems(const USet* set,
83 USet* set; in TestAPI() local
88 set = uset_openEmpty(); in TestAPI()
89 expect(set, "", "abc{ab}", NULL); in TestAPI()
90 uset_close(set); in TestAPI()
92 set = uset_open(1, 0); in TestAPI()
93 expect(set, "", "abc{ab}", NULL); in TestAPI()
94 uset_close(set); in TestAPI()
96 set = uset_open(1, 1); in TestAPI()
97 uset_clear(set); in TestAPI()
98 expect(set, "", "abc{ab}", NULL); in TestAPI()
99 uset_close(set); in TestAPI()
102 set = uset_open(0x0041, 0x0043); in TestAPI()
103 expect(set, "ABC", "DEF{ab}", NULL); in TestAPI()
104 uset_close(set); in TestAPI()
108 set = uset_openPattern(PAT, PAT_LEN, &ec); in TestAPI()
116 expect(set, "abc{ab}", "def{bc}", &ec); in TestAPI()
119 uset_add(set, 0x64); in TestAPI()
120 expect(set, "abcd{ab}", "ef{bc}", NULL); in TestAPI()
123 uset_remove(set, 0x62); in TestAPI()
124 uset_addString(set, STR_bc, STR_bc_LEN); in TestAPI()
125 expect(set, "acd{ab}{bc}", "bef{cd}", NULL); in TestAPI()
128 uset_removeString(set, STR_ab, STR_ab_LEN); in TestAPI()
129 expect(set, "acd{bc}", "bfg{ab}", NULL); in TestAPI()
132 uset_complement(set); in TestAPI()
133 expect(set, "bef{bc}", "acd{ac}", NULL); in TestAPI()
136 uset_complement(set); in TestAPI()
137 uset_addRange(set, 0x0062, 0x0065); in TestAPI()
138 expect(set, "abcde{bc}", "fg{ab}", NULL); in TestAPI()
141 uset_removeRange(set, 0x0050, 0x0063); in TestAPI()
142 expect(set, "de{bc}", "bcfg{ab}", NULL); in TestAPI()
145 uset_set(set, 0x0067, 0x006C); in TestAPI()
146 expect(set, "ghijkl", "de{bc}", NULL); in TestAPI()
148 if (uset_indexOf(set, 0x0067) != 0) { in TestAPI()
152 if (uset_charAt(set, 0) != 0x0067) { in TestAPI()
157 uset_compact(set); in TestAPI()
160 uset_retain(set, 0x0067, 0x0069); in TestAPI()
161 expect(set, "ghi", "dejkl{bc}", NULL); in TestAPI()
164 uset_applyIntPropertyValue(set, UCHAR_ASCII_HEX_DIGIT, 1, &ec); in TestAPI()
169 expect(set, "0123456789ABCDEFabcdef", "GHIjkl{bc}", NULL); in TestAPI()
172 uset_clear(set); in TestAPI()
173 uset_addAllCodePoints(set, STR_ab, STR_ab_LEN); in TestAPI()
174 expect(set, "ab", "def{ab}", NULL); in TestAPI()
175 if (uset_containsAllCodePoints(set, STR_bc, STR_bc_LEN)){ in TestAPI()
190 uset_set(set, 0x0067, 0x0069); in TestAPI()
193 if (uset_containsSome(set, set2)) { in TestAPI()
196 uset_complementAll(set, set2); in TestAPI()
197 if (!uset_containsSome(set, set2)) { in TestAPI()
200 expect(set, "abcghi", "def{bc}", NULL); in TestAPI()
203 uset_removeAll(set, set2); in TestAPI()
204 expect(set, "ghi", "abcdef{bc}", NULL); in TestAPI()
207 uset_addAll(set2, set); in TestAPI()
211 uset_retainAll(set2, set); in TestAPI()
215 uset_applyPattern(set, u"[abcdef{ch}{sch}]", -1, 0, &ec); in TestAPI()
220 expect(set, "abcdef{ch}{sch}", "", NULL); in TestAPI()
222 uset_removeAllCodePoints(set, u"ce", 2); in TestAPI()
223 expect(set, "abdf{ch}{sch}", "ce", NULL); in TestAPI()
225 uset_complementRange(set, u'b', u'f'); in TestAPI()
226 expect(set, "ace{ch}{sch}", "bdf", NULL); in TestAPI()
228 uset_complementString(set, u"ch", -1); in TestAPI()
229 expect(set, "ace{sch}", "bdf{ch}", NULL); in TestAPI()
231 uset_complementString(set, u"xy", -1); in TestAPI()
232 expect(set, "ace{sch}{xy}", "bdf{ch}", NULL); in TestAPI()
234 uset_complementAllCodePoints(set, u"abef", 4); in TestAPI()
235 expect(set, "bcf{sch}{xy}", "ade{ch}", NULL); in TestAPI()
237 uset_retainAllCodePoints(set, u"abef", -1); in TestAPI()
238 expect(set, "bf", "acde{ch}{sch}{xy}", NULL); in TestAPI()
240 uset_applyPattern(set, u"[abcdef{ch}{sch}]", -1, 0, &ec); in TestAPI()
245 expect(set, "abcdef{ch}{sch}", "", NULL); in TestAPI()
247 uset_retainString(set, u"sch", 3); in TestAPI()
248 expect(set, "{sch}", "abcdef{ch}", NULL); in TestAPI()
250 uset_retainString(set, u"ch", 3); in TestAPI()
251 expect(set, "", "abcdef{ch}{sch}", NULL); in TestAPI()
253 uset_close(set); in TestAPI()
276 static void expect(const USet* set, in expect() argument
284 if (set == NULL) { in expect()
288 expectContainment(set, inList, TRUE); in expect()
289 expectContainment(set, outList, FALSE); in expect()
290 expectItems(set, inList); in expect()
293 static void expectContainment(const USet* set, in expectContainment() argument
303 length = uset_toPattern(set, ustr, sizeof(ustr), TRUE, &ec); in expectContainment()
324 if (uset_containsString(set, ustr, stringLength) == isIn) { in expectContainment()
341 if (uset_contains(set, c) == isIn) { in expectContainment()
356 if (uset_containsRange(set, rangeStart, rangeEnd) == isIn) { in expectContainment()
374 if (uset_containsRange(set, rangeStart, rangeEnd) == isIn) { in expectContainment()
395 static void expectItems(const USet* set, in expectItems() argument
403 int32_t itemCount = uset_getItemCount(set); in expectItems()
409 length = uset_toPattern(set, ustr, sizeof(ustr), TRUE, &ec); in expectItems()
416 if (uset_isEmpty(set) != (strlen(items)==0)) { in expectItems()
438 itemLen = uset_getItem(set, itemIndex, &start, &end, in expectItems()
507 if (uset_size(set) == expectedSize) { in expectItems()
511 pat, uset_size(set), expectedSize); in expectItems()
519 USet *set; in TestSerialized() local
529 set=uset_openPattern(pattern, -1, &errorCode); in TestSerialized()
535 length=uset_serialize(set, buffer, UPRV_LENGTHOF(buffer), &errorCode); in TestSerialized()
538 uset_close(set); in TestSerialized()
544 if(uset_contains(set, c)!=uset_serializedContains(&sset, c)) { in TestSerialized()
550 uset_close(set); in TestSerialized()
569 USet *set = uset_openPattern(buf, len, &ec); in TestNonInvariantPattern() local
570 uset_close(set); in TestNonInvariantPattern()