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()
214 uset_close(set); in TestAPI()
237 static void expect(const USet* set, in expect() argument
245 if (set == NULL) { in expect()
249 expectContainment(set, inList, TRUE); in expect()
250 expectContainment(set, outList, FALSE); in expect()
251 expectItems(set, inList); in expect()
254 static void expectContainment(const USet* set, in expectContainment() argument
264 length = uset_toPattern(set, ustr, sizeof(ustr), TRUE, &ec); in expectContainment()
285 if (uset_containsString(set, ustr, stringLength) == isIn) { in expectContainment()
302 if (uset_contains(set, c) == isIn) { in expectContainment()
317 if (uset_containsRange(set, rangeStart, rangeEnd) == isIn) { in expectContainment()
335 if (uset_containsRange(set, rangeStart, rangeEnd) == isIn) { in expectContainment()
356 static void expectItems(const USet* set, in expectItems() argument
364 int32_t itemCount = uset_getItemCount(set); in expectItems()
370 length = uset_toPattern(set, ustr, sizeof(ustr), TRUE, &ec); in expectItems()
377 if (uset_isEmpty(set) != (strlen(items)==0)) { in expectItems()
399 itemLen = uset_getItem(set, itemIndex, &start, &end, in expectItems()
468 if (uset_size(set) == expectedSize) { in expectItems()
472 pat, uset_size(set), expectedSize); in expectItems()
480 USet *set; in TestSerialized() local
490 set=uset_openPattern(pattern, -1, &errorCode); in TestSerialized()
496 length=uset_serialize(set, buffer, UPRV_LENGTHOF(buffer), &errorCode); in TestSerialized()
499 uset_close(set); in TestSerialized()
505 if(uset_contains(set, c)!=uset_serializedContains(&sset, c)) { in TestSerialized()
511 uset_close(set); in TestSerialized()
530 USet *set = uset_openPattern(buf, len, &ec); in TestNonInvariantPattern() local
531 uset_close(set); in TestNonInvariantPattern()