Home | History | Annotate | Download | only in cintltst

Lines Matching defs:set

26 static void expect(const USet* set,
30 static void expectContainment(const USet* set,
34 static void expectItems(const USet* set,
81 USet* set;
86 set = uset_openEmpty();
87 expect(set, "", "abc{ab}", NULL);
88 uset_close(set);
90 set = uset_open(1, 0);
91 expect(set, "", "abc{ab}", NULL);
92 uset_close(set);
94 set = uset_open(1, 1);
95 uset_clear(set);
96 expect(set, "", "abc{ab}", NULL);
97 uset_close(set);
100 set = uset_open(0x0041, 0x0043);
101 expect(set, "ABC", "DEF{ab}", NULL);
102 uset_close(set);
106 set = uset_openPattern(PAT, PAT_LEN, &ec);
114 expect(set, "abc{ab}", "def{bc}", &ec);
117 uset_add(set, 0x64);
118 expect(set, "abcd{ab}", "ef{bc}", NULL);
121 uset_remove(set, 0x62);
122 uset_addString(set, STR_bc, STR_bc_LEN);
123 expect(set, "acd{ab}{bc}", "bef{cd}", NULL);
126 uset_removeString(set, STR_ab, STR_ab_LEN);
127 expect(set, "acd{bc}", "bfg{ab}", NULL);
130 uset_complement(set);
131 expect(set, "bef{bc}", "acd{ac}", NULL);
134 uset_complement(set);
135 uset_addRange(set, 0x0062, 0x0065);
136 expect(set, "abcde{bc}", "fg{ab}", NULL);
139 uset_removeRange(set, 0x0050, 0x0063);
140 expect(set, "de{bc}", "bcfg{ab}", NULL);
143 uset_set(set, 0x0067, 0x006C);
144 expect(set, "ghijkl", "de{bc}", NULL);
146 if (uset_indexOf(set, 0x0067) != 0) {
150 if (uset_charAt(set, 0) != 0x0067) {
155 uset_compact(set);
158 uset_retain(set, 0x0067, 0x0069);
159 expect(set, "ghi", "dejkl{bc}", NULL);
162 uset_applyIntPropertyValue(set, UCHAR_ASCII_HEX_DIGIT, 1, &ec);
167 expect(set, "0123456789ABCDEFabcdef", "GHIjkl{bc}", NULL);
170 uset_clear(set);
171 uset_addAllCodePoints(set, STR_ab, STR_ab_LEN);
172 expect(set, "ab", "def{ab}", NULL);
173 if (uset_containsAllCodePoints(set, STR_bc, STR_bc_LEN)){
174 log_err("set should not conatin all characters of \"bc\" \n");
188 uset_set(set, 0x0067, 0x0069);
191 if (uset_containsSome(set, set2)) {
192 log_err("set should not contain some of set2 yet\n");
194 uset_complementAll(set, set2);
195 if (!uset_containsSome(set, set2)) {
196 log_err("set should contain some of set2\n");
198 expect(set, "abcghi", "def{bc}", NULL);
201 uset_removeAll(set, set2);
202 expect(set, "ghi", "abcdef{bc}", NULL);
205 uset_addAll(set2, set);
209 uset_retainAll(set2, set);
212 uset_close(set);
221 * Verifies that the given set contains the characters and strings in
223 * 'set' is not NULL and that 'ec' succeeds.
224 * @param set the set to test, or NULL (on error)
225 * @param inList list of set contents, in iteration order. Format is
230 * @param outList list of things not in the set. Same format as
235 static void expect(const USet* set,
243 if (set == NULL) {
247 expectContainment(set, inList, TRUE);
248 expectContainment(set, outList, FALSE);
249 expectItems(set, inList);
252 static void expectContainment(const USet* set,
262 length = uset_toPattern(set, ustr, sizeof(ustr), TRUE, &ec);
283 if (uset_containsString(set, ustr, stringLength) == isIn) {
300 if (uset_contains(set, c) == isIn) {
315 if (uset_containsRange(set, rangeStart, rangeEnd) == isIn) {
333 if (uset_containsRange(set, rangeStart, rangeEnd) == isIn) {
354 static void expectItems(const USet* set,
362 int32_t itemCount = uset_getItemCount(set);
368 length = uset_toPattern(set, ustr, sizeof(ustr), TRUE, &ec);
375 if (uset_isEmpty(set) != (strlen(items)==0)) {
397 itemLen = uset_getItem(set, itemIndex, &start, &end,
466 if (uset_size(set) == expectedSize) {
470 pat, uset_size(set), expectedSize);
478 USet *set;
488 set=uset_openPattern(pattern, -1, &errorCode);
494 length=uset_serialize(set, buffer, UPRV_LENGTHOF(buffer), &errorCode);
497 uset_close(set);
503 if(uset_contains(set, c)!=uset_serializedContains(&sset, c)) {
509 uset_close(set);
528 USet *set = uset_openPattern(buf, len, &ec);
529 uset_close(set);