Home | History | Annotate | Download | only in intltest

Lines Matching refs:buffer

201         UChar buffer[10]={ 0x61, 0x62, 0x20ac, 0xd900, 0xdc05, 0,   0x62, 0xffff, 0xdbff, 0xdfff };
202 UnicodeString s, t(buffer, -1, LENGTHOF(buffer));
204 if(s.setTo(buffer, -1, LENGTHOF(buffer)).length()!=u_strlen(buffer)) {
205 errln("UnicodeString.setTo(buffer, length, capacity) does not work with length==-1");
207 if(t.length()!=u_strlen(buffer)) {
208 errln("UnicodeString(buffer, length, capacity) does not work with length==-1");
211 if(0!=s.caseCompare(buffer, -1, U_FOLD_CASE_DEFAULT)) {
214 if(0!=s.caseCompare(0, s.length(), buffer, U_FOLD_CASE_DEFAULT)) {
218 buffer[u_strlen(buffer)]=0xe4;
219 UnicodeString u(buffer, -1, LENGTHOF(buffer));
220 if(s.setTo(buffer, -1, LENGTHOF(buffer)).length()!=LENGTHOF(buffer)) {
221 errln("UnicodeString.setTo(buffer without NUL, length, capacity) does not work with length==-1");
223 if(u.length()!=LENGTHOF(buffer)) {
224 errln("UnicodeString(buffer without NUL, length, capacity) does not work with length==-1");
250 char buffer[16];
251 int32_t length8=from16.extract(0, 0x7fffffff, buffer, (uint32_t)sizeof(buffer));
252 if(length8!=((int32_t)sizeof(utf8)-1) || 0!=uprv_memcmp(buffer, utf8, sizeof(utf8))) {
255 length8=from16.extract(1, 2, buffer, (uint32_t)sizeof(buffer));
256 if(length8!=4 || buffer[length8]!=0 || 0!=uprv_memcmp(buffer, utf8+1, length8)) {
336 // test compare() etc. with strings that share a buffer but are not equal
337 test2=test1; // share the buffer, length() too large for the stackBuffer
338 test2.truncate(1); // change only the length, not the buffer
347 errln("UnicodeStrings that share a buffer but have different lengths compare as equal");
476 errln("UnicodeString.extract(char *) failed to return the correct size of destination buffer.");
487 errln("UnicodeString.extract() failed to return the correct size of destination buffer for end of buffer.");
490 errln("UnicodeString.extract() failed to return the correct size of destination buffer.");
497 errln("UnicodeString.extract(NULL) failed to return the correct size of destination buffer.");
582 char buffer[32];
602 if( (length=s.extract(buffer, 2, cnv, errorCode))!=13 ||
621 if( (length=s.extract(buffer, sizeof(buffer), cnv, errorCode))!=13 ||
622 uprv_memcmp(buffer, expect, 13)!=0 ||
623 buffer[13]!=0 ||
630 if( (length=s.extract(0, s.length(), buffer, sizeof(buffer), "UTF-8"))!=13 ||
631 uprv_memcmp(buffer, expect, 13)!=0 ||
632 buffer[13]!=0 ||
1080 errln("UnicodeString::getBuffer(const) does not return a usable buffer pointer");
1083 // test releaseBuffer() with a NUL-terminated buffer
1090 // test releaseBuffer() with a non-NUL-terminated buffer
1093 p[i]=(UChar)1; // fill the buffer with all non-NUL code units
1112 errln("UnicodeString(u[3]).getTerminatedBuffer() returns a bad buffer");
1118 errln("UnicodeString(u[-1]).getTerminatedBuffer() returns a bad buffer");
1150 test2=test1; // share the buffer
1153 errln("UnicodeString(shared buffer).truncate() failed");
1156 errln("UnicodeString(shared buffer).truncate().getTerminatedBuffer() "
1161 test2=test1; // share the buffer
1164 errln("UnicodeString(shared buffer).remove() failed");
1167 errln("UnicodeString(shared buffer).remove().getTerminatedBuffer() "
1230 errln("Change to UnicodeString after overflow are still affecting original buffer");
1247 errln("UnicodeString.setTo(readonly alias) made a copy: did not see change in buffer");
1251 errln("clone(alias) did not copy the buffer");
1268 UChar buffer[]={0x0061, 0x0062, 0x20ac, 0x0043, 0x0042, 0x0000};
1269 test->setTo(buffer, 4, 10);
1370 // NUL-terminate the string buffer and test u_countChar32(length=-1)
1371 const UChar *buffer=s.getTerminatedBuffer();
1373 u_countChar32(buffer, -1)!=4 ||
1374 u_countChar32(buffer+1, -1)!=4 ||
1375 u_countChar32(buffer+2, -1)!=3 ||
1376 u_countChar32(buffer+3, -1)!=3 ||
1377 u_countChar32(buffer+4, -1)!=2 ||
1378 u_countChar32(buffer+5, -1)!=1 ||
1379 u_countChar32(buffer+6, -1)!=0
1385 if(u_countChar32(NULL, 5)!=0 || u_countChar32(buffer, -2)!=0) {
1545 // writable alias to another string's buffer: very bad idea, just convenient for this test
1643 "this is a long string which helps us test some buffer limits",
1898 char buffer[64];
1899 TestCheckedArrayByteSink sink(buffer, (int32_t)sizeof(buffer));
1902 0 != uprv_memcmp(buffer, expected_utf8, sizeof(expected_utf8))
1944 "modified the original buffer.");
1948 "does not return a buffer terminated at the proper length.");
1966 "modified the original buffer.");
1970 "does not return a buffer terminated at length 0.");
2040 UChar *buffer=app.getAppendBuffer(3, 3, scratch, 3, &capacity);
2046 u_memcpy(buffer, hij, 3);
2047 app.appendString(buffer, 3);
2051 buffer=app.getAppendBuffer(0, 3, scratch, 3, &capacity);
2052 if(buffer!=NULL || capacity!=0) {
2056 buffer=app.getAppendBuffer(3, 3, scratch, 2, &capacity);
2057 if(buffer!=NULL || capacity!=0) {