Lines Matching refs:extract
102 test1.extract(0, 15, temp);
108 errln("extract() failed: expected \"" + expectedValue + "\"\n,got \"" + test2 + "\"");
251 int32_t length8=from16.extract(0, 0x7fffffff, buffer, (uint32_t)sizeof(buffer));
253 errln("UnicodeString::extract(char * U_CHARSET_IS_UTF8) failed");
255 length8=from16.extract(1, 2, buffer, (uint32_t)sizeof(buffer));
257 errln("UnicodeString::extract(substring to char * U_CHARSET_IS_UTF8) failed");
473 test1.extract(11, 12, test2);
474 test1.extract(11, 12, test3);
475 if (test1.extract(11, 12, test4) != 12 || test4[12] != 0) {
476 errln("UnicodeString.extract(char *) failed to return the correct size of destination buffer.");
486 if (test1.extract(60, 71, test6) != 9) {
487 errln("UnicodeString.extract() failed to return the correct size of destination buffer for end of buffer.");
489 if (test1.extract(11, 12, test6) != 12) {
490 errln("UnicodeString.extract() failed to return the correct size of destination buffer.");
496 if (test1.extract(11, 12, (char *)NULL) != 12) {
497 errln("UnicodeString.extract(NULL) failed to return the correct size of destination buffer.");
499 if (test1.extract(11, -1, test6) != 0) {
500 errln("UnicodeString.extract(-1) failed to stop reading the string.");
523 if (test1.extract(0, 10, (char *)NULL, "") != 10) {
524 errln("UnicodeString.extract(0, 10, (char *)NULL, \"\") != 10");
528 if (test1.extract(0, 10, test4, 2, "") != 10) {
529 errln("UnicodeString.extract(0, 10, test4, 2, \"\") != 10");
532 errln("UnicodeString.extract(0, 10, test4, 2, \"\") overwrote test4[2]");
536 // test new, NUL-terminating extract() function
546 length=s.extract((UChar *)NULL, 0, errorCode);
548 errln("UnicodeString.extract(NULL, 0)==%d (%s) expected %d (U_BUFFER_OVERFLOW_ERROR)", length, s.length(), u_errorName(errorCode));
552 length=s.extract(dest, s.length()-1, errorCode);
554 errln("UnicodeString.extract(dest too short)==%d (%s) expected %d (U_BUFFER_OVERFLOW_ERROR)",
559 length=s.extract(dest, s.length(), errorCode);
561 errln("UnicodeString.extract(dest just right without NUL)==%d (%s) expected %d (U_STRING_NOT_TERMINATED_WARNING)",
565 errln("UnicodeString.extract(dest just right without NUL) did not extract the string correctly");
569 length=s.extract(dest, s.length()+1, errorCode);
571 errln("UnicodeString.extract(dest large enough)==%d (%s) expected %d (U_ZERO_ERROR)",
575 errln("UnicodeString.extract(dest large enough) did not extract the string correctly");
580 // test new UConverter extract() and constructor
595 if( (length=s.extract(NULL, 0, cnv, errorCode))!=13 ||
598 errln("UnicodeString::extract(NULL, UConverter) preflighting failed (length=%ld, %s)",
602 if( (length=s.extract(buffer, 2, cnv, errorCode))!=13 ||
605 errln("UnicodeString::extract(too small, UConverter) preflighting failed (length=%ld, %s)",
611 if( s.extract(NULL, 2, cnv, errorCode)==13 || U_SUCCESS(errorCode)) {
612 errln("UnicodeString::extract(UConverter) succeeded with an illegal destination");
615 if( s.extract(NULL, 0, cnv, errorCode)==13 || U_SUCCESS(errorCode)) {
616 errln("UnicodeString::extract(UConverter) succeeded with a previous error code");
620 // extract for real
621 if( (length=s.extract(buffer, sizeof(buffer), cnv, errorCode))!=13 ||
626 errln("UnicodeString::extract(UConverter) conversion failed (length=%ld, %s)",
630 if( (length=s.extract(0, s.length(), buffer, sizeof(buffer), "UTF-8"))!=13 ||
635 errln("UnicodeString::extract(\"UTF-8\") conversion failed (length=%ld, %s)",