1 /********************************************************************
3 * Copyright (c) 1997-2008, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 ********************************************************************/
6 /********************************************************************************
10 * Modification History:
12 * Madhu Katragadda Creation
13 *********************************************************************************/
14 /*C API TEST FOR BREAKITERATOR */
16 * This is an API test. It doesn't test very many cases, and doesn't
17 * try to test the full functionality. It just calls each function in the class and
18 * verifies that it works on a basic level.
21 #include "unicode/utypes.h"
23 #if !UCONFIG_NO_BREAK_ITERATION
27 #include "unicode/uloc.h"
28 #include "unicode/ubrk.h"
29 #include "unicode/ustring.h"
30 #include "unicode/ucnv.h"
31 #include "unicode/utext.h"
35 #define TEST_ASSERT_SUCCESS(status) {if (U_FAILURE(status)) { \
36 log_err("Failure at file %s, line %d, error = %s\n", __FILE__, __LINE__, u_errorName(status));}}
38 #define TEST_ASSERT(expr) {if ((expr)==FALSE) { \
39 log_err("Test Failure at file %s, line %d\n", __FILE__, __LINE__);}}
41 static void TestBreakIteratorSafeClone(void);
42 static void TestBreakIteratorRules(void);
43 static void TestBreakIteratorRuleError(void);
44 static void TestBreakIteratorStatusVec(void);
45 static void TestBreakIteratorUText(void);
47 void addBrkIterAPITest(TestNode
** root
);
49 void addBrkIterAPITest(TestNode
** root
)
51 addTest(root
, &TestBreakIteratorCAPI
, "tstxtbd/cbiapts/TestBreakIteratorCAPI");
52 addTest(root
, &TestBreakIteratorSafeClone
, "tstxtbd/cbiapts/TestBreakIteratorSafeClone");
53 addTest(root
, &TestBreakIteratorRules
, "tstxtbd/cbiapts/TestBreakIteratorRules");
54 addTest(root
, &TestBreakIteratorRuleError
, "tstxtbd/cbiapts/TestBreakIteratorRuleError");
55 addTest(root
, &TestBreakIteratorStatusVec
, "tstxtbd/cbiapts/TestBreakIteratorStatusVec");
56 addTest(root
, &TestBreakIteratorUText
, "tstxtbd/cbiapts/TestBreakIteratorUText");
59 #define CLONETEST_ITERATOR_COUNT 2
62 * Utility function for converting char * to UChar * strings, to
63 * simplify the test code. Converted strings are put in heap allocated
64 * storage. A hook (probably a local in the caller's code) allows all
65 * strings converted with that hook to be freed with a single call.
67 typedef struct StringStruct
{
68 struct StringStruct
*link
;
73 static UChar
* toUChar(const char *src
, void **freeHook
) {
74 /* Structure of the memory that we allocate on the heap */
78 UChar stackBuf
[2000 + sizeof(void *)/sizeof(UChar
)];
82 UErrorCode status
= U_ZERO_ERROR
;
87 cnv
= ucnv_open(NULL
, &status
);
88 if(U_FAILURE(status
) || cnv
== NULL
) {
92 numUChars
= ucnv_toUChars(cnv
,
98 destSize
= (numUChars
+1) * sizeof(UChar
) + sizeof(struct StringStruct
);
99 dest
= (StringStruct
*)malloc(destSize
);
101 if (status
== U_BUFFER_OVERFLOW_ERROR
|| status
== U_STRING_NOT_TERMINATED_WARNING
) {
102 ucnv_toUChars(cnv
, dest
->str
, numUChars
+1, src
, -1, &status
);
103 } else if (status
== U_ZERO_ERROR
) {
104 u_strcpy(dest
->str
, stackBuf
);
111 ucnv_reset(cnv
); /* be good citizens */
117 dest
->link
= (StringStruct
*)(*freeHook
);
122 static void freeToUCharStrings(void **hook
) {
123 StringStruct
*s
= *(StringStruct
**)hook
;
125 StringStruct
*next
= s
->link
;
132 static void TestBreakIteratorCAPI()
134 UErrorCode status
= U_ZERO_ERROR
;
135 UBreakIterator
*word
, *sentence
, *line
, *character
, *b
, *bogus
;
136 int32_t start
,pos
,end
,to
;
142 /* Note: the adjacent "" are concatenating strings, not adding a \" to the
143 string, which is probably what whoever wrote this intended. Don't fix,
144 because it would throw off the hard coded break positions in the following
146 u_uastrcpy(text
, "He's from Africa. ""Mr. Livingston, I presume?"" Yeah");
150 log_verbose("\nTesting BreakIterator open functions\n");
152 /* Use french for fun */
153 word
= ubrk_open(UBRK_WORD
, "en_US", text
, u_strlen(text
), &status
);
154 if(status
== U_FILE_ACCESS_ERROR
) {
155 log_data_err("Check your data - it doesn't seem to be around\n");
157 } else if(U_FAILURE(status
)){
158 log_err("FAIL: Error in ubrk_open() for word breakiterator: %s\n", myErrorName(status
));
161 log_verbose("PASS: Successfully opened word breakiterator\n");
164 sentence
= ubrk_open(UBRK_SENTENCE
, "en_US", text
, u_strlen(text
), &status
);
165 if(U_FAILURE(status
)){
166 log_err("FAIL: Error in ubrk_open() for sentence breakiterator: %s\n", myErrorName(status
));
170 log_verbose("PASS: Successfully opened sentence breakiterator\n");
173 line
= ubrk_open(UBRK_LINE
, "en_US", text
, u_strlen(text
), &status
);
174 if(U_FAILURE(status
)){
175 log_err("FAIL: Error in ubrk_open() for line breakiterator: %s\n", myErrorName(status
));
179 log_verbose("PASS: Successfully opened line breakiterator\n");
182 character
= ubrk_open(UBRK_CHARACTER
, "en_US", text
, u_strlen(text
), &status
);
183 if(U_FAILURE(status
)){
184 log_err("FAIL: Error in ubrk_open() for character breakiterator: %s\n", myErrorName(status
));
188 log_verbose("PASS: Successfully opened character breakiterator\n");
190 /*trying to open an illegal iterator*/
191 bogus
= ubrk_open((UBreakIteratorType
)5, "en_US", text
, u_strlen(text
), &status
);
192 if(U_SUCCESS(status
)){
193 log_err("FAIL: Error in ubrk_open() for BOGUS breakiterator. Expected U_ILLEGAL_ARGUMENT_ERROR\n");
195 if(U_FAILURE(status
)){
196 if(status
!= U_ILLEGAL_ARGUMENT_ERROR
){
197 log_err("FAIL: Error in ubrk_open() for BOGUS breakiterator. Expected U_ILLEGAL_ARGUMENT_ERROR\n Got %s\n", myErrorName(status
));
203 /* ======= Test ubrk_countAvialable() and ubrk_getAvialable() */
205 log_verbose("\nTesting ubrk_countAvailable() and ubrk_getAvailable()\n");
206 count
=ubrk_countAvailable();
207 /* use something sensible w/o hardcoding the count */
209 log_err("FAIL: Error in ubrk_countAvialable() returned %d\n", count
);
212 log_verbose("PASS: ubrk_countAvialable() successful returned %d\n", count
);
216 log_verbose("%s\n", ubrk_getAvailable(i
));
217 if (ubrk_getAvailable(i
) == 0)
218 log_err("No locale for which breakiterator is applicable\n");
220 log_verbose("A locale %s for which breakiterator is applicable\n",ubrk_getAvailable(i
));
223 /*========Test ubrk_first(), ubrk_last()...... and other functions*/
225 log_verbose("\nTesting the functions for word\n");
226 start
= ubrk_first(word
);
228 log_err("error ubrk_start(word) did not return 0\n");
229 log_verbose("first (word = %d\n", (int32_t)start
);
232 log_err("error ubrk_next(word) did not return 4\n");
233 log_verbose("next (word = %d\n", (int32_t)pos
);
234 pos
=ubrk_following(word
, 4);
236 log_err("error ubrl_following(word,4) did not return 6\n");
237 log_verbose("next (word = %d\n", (int32_t)pos
);
240 log_err("error ubrk_last(word) did not return 49\n");
241 log_verbose("last (word = %d\n", (int32_t)end
);
243 pos
=ubrk_previous(word
);
244 log_verbose("%d %d\n", end
, pos
);
246 pos
=ubrk_previous(word
);
247 log_verbose("%d \n", pos
);
249 if (ubrk_isBoundary(word
, 2) != FALSE
) {
250 log_err("error ubrk_isBoundary(word, 2) did not return FALSE\n");
252 pos
=ubrk_current(word
);
254 log_err("error ubrk_current() != 4 after ubrk_isBoundary(word, 2)\n");
256 if (ubrk_isBoundary(word
, 4) != TRUE
) {
257 log_err("error ubrk_isBoundary(word, 4) did not return TRUE\n");
262 log_verbose("\nTesting the functions for character\n");
263 ubrk_first(character
);
264 pos
= ubrk_following(character
, 5);
266 log_err("error ubrk_following(character,5) did not return 6\n");
267 log_verbose("Following (character,5) = %d\n", (int32_t)pos
);
268 pos
=ubrk_following(character
, 18);
270 log_err("error ubrk_following(character,18) did not return 19\n");
271 log_verbose("Followingcharacter,18) = %d\n", (int32_t)pos
);
272 pos
=ubrk_preceding(character
, 22);
274 log_err("error ubrk_preceding(character,22) did not return 21\n");
275 log_verbose("preceding(character,22) = %d\n", (int32_t)pos
);
278 log_verbose("\nTesting the functions for line\n");
279 pos
=ubrk_first(line
);
281 log_err("error ubrk_first(line) returned %d, expected 0\n", (int32_t)pos
);
282 pos
= ubrk_next(line
);
283 pos
=ubrk_following(line
, 18);
285 log_err("error ubrk_following(line) did not return 22\n");
286 log_verbose("following (line) = %d\n", (int32_t)pos
);
289 log_verbose("\nTesting the functions for sentence\n");
290 ubrk_first(sentence
);
291 pos
= ubrk_current(sentence
);
292 log_verbose("Current(sentence) = %d\n", (int32_t)pos
);
293 pos
= ubrk_last(sentence
);
295 log_err("error ubrk_last for sentence did not return 49\n");
296 log_verbose("Last (sentence) = %d\n", (int32_t)pos
);
297 ubrk_first(sentence
);
298 to
= ubrk_following( sentence
, 0 );
299 if (to
== 0) log_err("ubrk_following returned 0\n");
300 to
= ubrk_preceding( sentence
, to
);
301 if (to
!= 0) log_err("ubrk_preceding didn't return 0\n");
302 if (ubrk_first(sentence
)!=ubrk_current(sentence
)) {
303 log_err("error in ubrk_first() or ubrk_current()\n");
308 /*Testing ubrk_open and ubrk_close()*/
309 log_verbose("\nTesting open and close for us locale\n");
310 b
= ubrk_open(UBRK_WORD
, "fr_FR", text
, u_strlen(text
), &status
);
311 if (U_FAILURE(status
)) {
312 log_err("ubrk_open for word returned NULL: %s\n", myErrorName(status
));
316 /* Test setText and setUText */
318 UChar s1
[] = {0x41, 0x42, 0x20, 0};
319 UChar s2
[] = {0x41, 0x42, 0x43, 0x44, 0x45, 0};
324 log_verbose("\nTesting ubrk_setText() and ubrk_setUText()\n");
325 status
= U_ZERO_ERROR
;
326 bb
= ubrk_open(UBRK_WORD
, "en_US", NULL
, 0, &status
);
327 TEST_ASSERT_SUCCESS(status
);
328 ubrk_setText(bb
, s1
, -1, &status
);
329 TEST_ASSERT_SUCCESS(status
);
333 ut
= utext_openUChars(ut
, s2
, -1, &status
);
334 ubrk_setUText(bb
, ut
, &status
);
335 TEST_ASSERT_SUCCESS(status
);
344 ubrk_close(sentence
);
346 ubrk_close(character
);
349 static void TestBreakIteratorSafeClone(void)
351 UChar text
[51]; /* Keep this odd to test for 64-bit memory alignment */
352 /* NOTE: This doesn't reliably force mis-alignment of following items. */
353 uint8_t buffer
[CLONETEST_ITERATOR_COUNT
] [U_BRK_SAFECLONE_BUFFERSIZE
];
354 int32_t bufferSize
= U_BRK_SAFECLONE_BUFFERSIZE
;
356 UBreakIterator
* someIterators
[CLONETEST_ITERATOR_COUNT
];
357 UBreakIterator
* someClonedIterators
[CLONETEST_ITERATOR_COUNT
];
359 UBreakIterator
* brk
;
360 UErrorCode status
= U_ZERO_ERROR
;
364 /*Testing ubrk_safeClone */
366 /* Note: the adjacent "" are concatenating strings, not adding a \" to the
367 string, which is probably what whoever wrote this intended. Don't fix,
368 because it would throw off the hard coded break positions in the following
370 u_uastrcpy(text
, "He's from Africa. ""Mr. Livingston, I presume?"" Yeah");
372 /* US & Thai - rule-based & dictionary based */
373 someIterators
[0] = ubrk_open(UBRK_WORD
, "en_US", text
, u_strlen(text
), &status
);
374 if(!someIterators
[0] || U_FAILURE(status
)) {
375 log_data_err("Couldn't open en_US word break iterator - %s\n", u_errorName(status
));
379 someIterators
[1] = ubrk_open(UBRK_WORD
, "th_TH", text
, u_strlen(text
), &status
);
380 if(!someIterators
[1] || U_FAILURE(status
)) {
381 log_data_err("Couldn't open th_TH word break iterator - %s\n", u_errorName(status
));
385 /* test each type of iterator */
386 for (i
= 0; i
< CLONETEST_ITERATOR_COUNT
; i
++)
389 /* Check the various error & informational states */
391 /* Null status - just returns NULL */
392 if (0 != ubrk_safeClone(someIterators
[i
], buffer
[i
], &bufferSize
, 0))
394 log_err("FAIL: Cloned Iterator failed to deal correctly with null status\n");
396 /* error status - should return 0 & keep error the same */
397 status
= U_MEMORY_ALLOCATION_ERROR
;
398 if (0 != ubrk_safeClone(someIterators
[i
], buffer
[i
], &bufferSize
, &status
) || status
!= U_MEMORY_ALLOCATION_ERROR
)
400 log_err("FAIL: Cloned Iterator failed to deal correctly with incoming error status\n");
402 status
= U_ZERO_ERROR
;
404 /* Null buffer size pointer - just returns NULL & set error to U_ILLEGAL_ARGUMENT_ERROR*/
405 if (0 != ubrk_safeClone(someIterators
[i
], buffer
[i
], 0, &status
) || status
!= U_ILLEGAL_ARGUMENT_ERROR
)
407 log_err("FAIL: Cloned Iterator failed to deal correctly with null bufferSize pointer\n");
409 status
= U_ZERO_ERROR
;
411 /* buffer size pointer is 0 - fill in pbufferSize with a size */
413 if (0 != ubrk_safeClone(someIterators
[i
], buffer
[i
], &bufferSize
, &status
) || U_FAILURE(status
) || bufferSize
<= 0)
415 log_err("FAIL: Cloned Iterator failed a sizing request ('preflighting')\n");
417 /* Verify our define is large enough */
418 if (U_BRK_SAFECLONE_BUFFERSIZE
< bufferSize
)
420 log_err("FAIL: Pre-calculated buffer size is too small\n");
422 /* Verify we can use this run-time calculated size */
423 if (0 == (brk
= ubrk_safeClone(someIterators
[i
], buffer
[i
], &bufferSize
, &status
)) || U_FAILURE(status
))
425 log_err("FAIL: Iterator can't be cloned with run-time size\n");
429 /* size one byte too small - should allocate & let us know */
431 if (0 == (brk
= ubrk_safeClone(someIterators
[i
], 0, &bufferSize
, &status
)) || status
!= U_SAFECLONE_ALLOCATED_WARNING
)
433 log_err("FAIL: Cloned Iterator failed to deal correctly with too-small buffer size\n");
437 status
= U_ZERO_ERROR
;
438 bufferSize
= U_BRK_SAFECLONE_BUFFERSIZE
;
440 /* Null buffer pointer - return Iterator & set error to U_SAFECLONE_ALLOCATED_ERROR */
441 if (0 == (brk
= ubrk_safeClone(someIterators
[i
], 0, &bufferSize
, &status
)) || status
!= U_SAFECLONE_ALLOCATED_WARNING
)
443 log_err("FAIL: Cloned Iterator failed to deal correctly with null buffer pointer\n");
447 status
= U_ZERO_ERROR
;
449 /* Mis-aligned buffer pointer. */
451 char stackBuf
[U_BRK_SAFECLONE_BUFFERSIZE
+sizeof(void *)];
455 brk
= ubrk_safeClone(someIterators
[i
], &stackBuf
[1], &bufferSize
, &status
);
456 if (U_FAILURE(status
) || brk
== 0) {
457 log_err("FAIL: Cloned Iterator failed with misaligned buffer pointer\n");
459 if (status
== U_SAFECLONE_ALLOCATED_WARNING
) {
460 log_err("FAIL: Cloned Iterator allocated when using a mis-aligned buffer.\n");
462 offset
= (int32_t)((char *)&p
-(char*)brk
);
466 if (offset
% sizeof(void *) != 0) {
467 log_err("FAIL: Cloned Iterator failed to align correctly with misaligned buffer pointer\n");
474 /* Null Iterator - return NULL & set U_ILLEGAL_ARGUMENT_ERROR */
475 if (0 != ubrk_safeClone(0, buffer
[i
], &bufferSize
, &status
) || status
!= U_ILLEGAL_ARGUMENT_ERROR
)
477 log_err("FAIL: Cloned Iterator failed to deal correctly with null Iterator pointer\n");
479 status
= U_ZERO_ERROR
;
481 /* Do these cloned Iterators work at all - make a first & next call */
482 bufferSize
= U_BRK_SAFECLONE_BUFFERSIZE
;
483 someClonedIterators
[i
] = ubrk_safeClone(someIterators
[i
], buffer
[i
], &bufferSize
, &status
);
485 start
= ubrk_first(someClonedIterators
[i
]);
487 log_err("error ubrk_start(clone) did not return 0\n");
488 pos
=ubrk_next(someClonedIterators
[i
]);
490 log_err("error ubrk_next(clone) did not return 4\n");
492 ubrk_close(someClonedIterators
[i
]);
493 ubrk_close(someIterators
[i
]);
499 // Open a break iterator from char * rules. Take care of conversion
500 // of the rules and error checking.
502 static UBreakIterator
* testOpenRules(char *rules
) {
503 UErrorCode status
= U_ZERO_ERROR
;
504 UChar
*ruleSourceU
= NULL
;
505 void *strCleanUp
= NULL
;
506 UParseError parseErr
;
509 ruleSourceU
= toUChar(rules
, &strCleanUp
);
511 bi
= ubrk_openRules(ruleSourceU
, -1, /* The rules */
512 NULL
, -1, /* The text to be iterated over. */
515 if (U_FAILURE(status
)) {
516 log_err("FAIL: ubrk_openRules: ICU Error \"%s\"\n", u_errorName(status
));
519 freeToUCharStrings(&strCleanUp
);
525 * TestBreakIteratorRules - Verify that a break iterator can be created from
526 * a set of source rules.
528 static void TestBreakIteratorRules() {
529 /* Rules will keep together any run of letters not including 'a', OR
530 * keep together 'abc', but only when followed by 'def', OTHERWISE
531 * just return one char at a time.
533 char rules
[] = "abc{666}/def;\n [\\p{L} - [a]]* {2}; . {1};";
534 /* 0123456789012345678 */
535 char data
[] = "abcdex abcdefgh-def"; /* the test data string */
536 char breaks
[] = "** ** * ** *"; /* * the expected break positions */
537 char tags
[] = "01 21 6 21 2"; /* expected tag values at break positions */
538 int32_t tagMap
[] = {0, 1, 2, 3, 4, 5, 666};
541 void *freeHook
= NULL
;
542 UErrorCode status
= U_ZERO_ERROR
;
546 UBreakIterator
*bi
= testOpenRules(rules
);
547 if (bi
== NULL
) {return;}
548 uData
= toUChar(data
, &freeHook
);
549 ubrk_setText(bi
, uData
, -1, &status
);
551 pos
= ubrk_first(bi
);
552 for (i
=0; i
<sizeof(breaks
); i
++) {
553 if (pos
== i
&& breaks
[i
] != '*') {
554 log_err("FAIL: unexpected break at position %d found\n", pos
);
557 if (pos
!= i
&& breaks
[i
] == '*') {
558 log_err("FAIL: expected break at position %d not found.\n", i
);
562 int32_t tag
, expectedTag
;
563 tag
= ubrk_getRuleStatus(bi
);
564 expectedTag
= tagMap
[tags
[i
]&0xf];
565 if (tag
!= expectedTag
) {
566 log_err("FAIL: incorrect tag value. Position = %d; expected tag %d, got %d",
567 pos
, expectedTag
, tag
);
574 freeToUCharStrings(&freeHook
);
578 static void TestBreakIteratorRuleError() {
580 * TestBreakIteratorRuleError - Try to create a BI from rules with syntax errors,
581 * check that the error is reported correctly.
583 char rules
[] = " # This is a rule comment on line 1\n"
584 "[:L:]; # this rule is OK.\n"
585 "abcdefg); # Error, mismatched parens\n";
587 void *freeHook
= NULL
;
588 UErrorCode status
= U_ZERO_ERROR
;
589 UParseError parseErr
;
592 uRules
= toUChar(rules
, &freeHook
);
593 bi
= ubrk_openRules(uRules
, -1, /* The rules */
594 NULL
, -1, /* The text to be iterated over. */
596 if (U_SUCCESS(status
)) {
597 log_err("FAIL: construction of break iterator succeeded when it should have failed.\n");
600 if (parseErr
.line
!= 3 || parseErr
.offset
!= 8) {
601 log_err("FAIL: incorrect error position reported. Got line %d, char %d, expected line 3, char 7\n",
602 parseErr
.line
, parseErr
.offset
);
605 freeToUCharStrings(&freeHook
);
610 * TestsBreakIteratorStatusVals() Test the ubrk_getRuleStatusVec() funciton
612 static void TestBreakIteratorStatusVec() {
613 #define RULE_STRING_LENGTH 200
614 UChar rules
[RULE_STRING_LENGTH
];
616 #define TEST_STRING_LENGTH 25
617 UChar testString
[TEST_STRING_LENGTH
];
618 UBreakIterator
*bi
= NULL
;
622 UErrorCode status
= U_ZERO_ERROR
;
624 u_uastrncpy(rules
, "[A-N]{100}; \n"
629 "!.*;\n", RULE_STRING_LENGTH
);
630 u_uastrncpy(testString
, "ABC", TEST_STRING_LENGTH
);
633 bi
= ubrk_openRules(rules
, -1, testString
, -1, NULL
, &status
);
634 TEST_ASSERT_SUCCESS(status
);
635 TEST_ASSERT(bi
!= NULL
);
637 /* The TEST_ASSERT above should change too... */
640 TEST_ASSERT(pos
== 1);
642 memset(vals
, -1, sizeof(vals
));
643 numVals
= ubrk_getRuleStatusVec(bi
, vals
, 10, &status
);
644 TEST_ASSERT_SUCCESS(status
);
645 TEST_ASSERT(numVals
== 2);
646 TEST_ASSERT(vals
[0] == 100);
647 TEST_ASSERT(vals
[1] == 300);
648 TEST_ASSERT(vals
[2] == -1);
650 numVals
= ubrk_getRuleStatusVec(bi
, vals
, 0, &status
);
651 TEST_ASSERT(status
== U_BUFFER_OVERFLOW_ERROR
);
652 TEST_ASSERT(numVals
== 2);
660 * static void TestBreakIteratorUText(void);
662 * Test that ubrk_setUText() is present and works for a simple case.
664 static void TestBreakIteratorUText(void) {
665 const char *UTF8Str
= "\x41\xc3\x85\x5A\x20\x41\x52\x69\x6E\x67"; /* c3 85 is utf-8 for A with a ring on top */
668 UErrorCode status
= U_ZERO_ERROR
;
669 UBreakIterator
*bi
= NULL
;
673 UText
*ut
= utext_openUTF8(NULL
, UTF8Str
, -1, &status
);
674 TEST_ASSERT_SUCCESS(status
);
676 bi
= ubrk_open(UBRK_WORD
, "en_US", NULL
, 0, &status
);
677 if (U_FAILURE(status
)) {
678 log_err("Failure at file %s, line %d, error = %s\n", __FILE__
, __LINE__
, u_errorName(status
));
682 ubrk_setUText(bi
, ut
, &status
);
683 if (U_FAILURE(status
)) {
684 log_err("Failure at file %s, line %d, error = %s\n", __FILE__
, __LINE__
, u_errorName(status
));
688 pos
= ubrk_first(bi
);
689 TEST_ASSERT(pos
== 0);
692 TEST_ASSERT(pos
== 4);
695 TEST_ASSERT(pos
== 5);
698 TEST_ASSERT(pos
== 10);
701 TEST_ASSERT(pos
== UBRK_DONE
);
708 #endif /* #if !UCONFIG_NO_BREAK_ITERATION */