Lines Matching refs:buffer
589 const int32_t limit = len<0 ? buflen : len; /* buflen is long enough to hit the buffer limit */
648 UChar buffer[100];
664 length=uloc_getDisplayLanguage(NULL, NULL, buffer, LENGTHOF(buffer), &errorCode);
665 if(U_FAILURE(errorCode) || (length<=3 && buffer[0]<=0x7f)) {
672 length=uloc_getDisplayLanguage("qq", "rr", buffer, LENGTHOF(buffer), &errorCode);
673 if(errorCode!=U_USING_DEFAULT_WARNING || length!=2 || buffer[0]!=0x71 || buffer[1]!=0x71) {
679 length=uloc_getDisplayName("qq_US_POSIX", "en_US", buffer, LENGTHOF(buffer), &errorCode);
699 uloc_getDisplayName(aLocale, testL[i], buffer, LENGTHOF(buffer), &errorCode);
704 if(u_strcmp(buffer,expectBuffer)) {
705 log_data_err("FAIL in uloc_getDisplayName(%s,%s,..) expected '%s' got '%s' (Are you missing data?)\n", aLocale, testL[i], expect[i], austrdup(buffer));
758 /* test all buffer sizes */
765 log_err("using buffer of length %d returned error %s", i, u_errorName(ec));
769 log_err("with buffer of length %d, expected length %d but got %d", i, expectedLen, len);
772 /* There's no guarantee about what's in the buffer if we've overflowed, in particular,
1628 char buffer[256];
1636 *buffer = 0;
1668 resultLen = uloc_getName(testCases[i].localeID, buffer, 256, &status);
1669 if (uprv_strcmp(testCases[i].expectedLocaleID, buffer) != 0) {
1671 testCases[i].localeID, testCases[i].expectedLocaleID, buffer);
1673 resultLen = uloc_canonicalize(testCases[i].localeID, buffer, 256, &status);
1674 if (uprv_strcmp(testCases[i].expectedCanonicalID, buffer) != 0) {
1676 testCases[i].localeID, testCases[i].expectedCanonicalID, buffer);
1699 char buffer[256];
1702 *buffer = 0;
1703 resultLen = uloc_getKeywordValue(testCases[i].localeID, testCases[i].keyword, buffer, 256, &status);
1704 if(uprv_strcmp(testCases[i].expectedValue, buffer) != 0) {
1706 testCases[i].expectedValue, testCases[i].localeID, testCases[i].keyword, buffer);
1767 char buffer[1024];
1773 memset(buffer,'%',1023);
1774 strcpy(buffer, kwSetTestCases[i].l);
1777 if(strcmp(buffer,cbuffer)) {
1778 log_verbose("note: [%d] wasn't canonical, should be: '%s' not '%s'. Won't check for canonicity in output.\n", i, cbuffer, buffer);
1786 resultLen = uloc_setKeywordValue(kwSetTestCases[i].k, kwSetTestCases[i].v, buffer, 1023, &status);
1791 if(strcmp(buffer,kwSetTestCases[i].x) || ((int32_t)strlen(buffer)!=resultLen)) {
1793 kwSetTestCases[i].v, buffer, resultLen, kwSetTestCases[i].x, strlen(buffer));
1795 log_verbose("pass: #%d: %s + [%s=%s] -> %s\n", i, kwSetTestCases[i].l, kwSetTestCases[i].k, kwSetTestCases[i].v,buffer);
1802 char buffer[1024];
1808 /* 0-test whether an error condition modifies the buffer at all */
1811 memset(buffer,'%',1023);
1813 res = uloc_setKeywordValue(kwSetTestCases[i].k, kwSetTestCases[i].v, buffer, blen, &status);
1822 if(buffer[blen]!='%') {
1823 log_err("Buffer byte %d was modified: now %c\n", blen, buffer[blen]);
1826 log_verbose("0-buffer modify OK\n");
1829 /* 1- test a short buffer with growing text */
1831 memset(buffer,'%',1023);
1832 strcpy(buffer,kwSetTestCases[i].l);
1834 res = uloc_setKeywordValue(kwSetTestCases[i].k, kwSetTestCases[i].v, buffer, blen, &status);
1836 log_err("expected buffer overflow on buffer %d got %s, len %d (%s + [%s=%s])\n", blen, u_errorName(status), res, kwSetTestCases[i].l, kwSetTestCases[i].k, kwSetTestCases[i].v);
1843 if(buffer[blen]!='%') {
1844 log_err("Buffer byte %d was modified: now %c\n", blen, buffer[blen]);
1847 log_verbose("1/%d-buffer modify OK\n",i);
1851 /* 2- test a short buffer - text the same size or shrinking */
1853 memset(buffer,'%',1023);
1854 strcpy(buffer,kwSetTestCases[i].l);
1856 res = uloc_setKeywordValue(kwSetTestCases[i].k, kwSetTestCases[i].v, buffer, blen, &status);
1861 if(buffer[blen+1]!='%') {
1862 log_err("Buffer byte %d was modified: now %c\n", blen+1, buffer[blen+1]);
1869 if(strcmp(buffer,kwSetTestCases[i].x) || ((int32_t)strlen(buffer)!=res)) {
1871 kwSetTestCases[i].v, buffer, res, kwSetTestCases[i].x, strlen(buffer));
1874 buffer);
1876 log_verbose("2/%d-buffer modify OK\n",i);
1991 char buffer[256];
1996 *buffer = 0;
2011 resultLen = _canonicalize(j, testCases[i].localeID, buffer, sizeof(buffer), &status);
2017 if(uprv_strcmp(expected, buffer) != 0) {
2019 label[j], testCases[i].localeID, buffer, expected);
2022 label[j], testCases[i].localeID, buffer);
2024 if (resultLen != (int32_t)strlen(buffer)) {
2026 label[j], testCases[i].localeID, resultLen, strlen(buffer));
2278 UChar buffer[128]; /* sufficient for this test */
2283 len = uloc_getDisplayName(localeId, localeId, buffer, 128, &status);
2285 log_err("buffer too small");
2290 if (buffer[i] == 0) {
3003 log_err(" unexpected result from uloc_getLocaleForLCID with small buffer: %s\n", u_errorName(status));
5378 char buffer[ULOC_FULLNAME_CAPACITY + ULOC_KEYWORD_AND_VALUES_CAPACITY + 1];
5390 buffer,
5391 sizeof(buffer),
5398 if (uprv_stricmp(minimal, buffer) != 0) {
5399 log_err(" unexpected maximal value \"%s\" in uloc_addLikelySubtags(), minimal \"%s\" = \"%s\"\n", maximal, minimal, buffer);
5402 else if (uprv_stricmp(maximal, buffer) != 0) {
5403 log_err(" maximal doesn't match expected %s in uloc_addLikelySubtags(), minimal \"%s\" = %s\n", maximal, minimal, buffer);
5416 buffer,
5417 sizeof(buffer),
5425 if (uprv_stricmp(maximal, buffer) != 0) {
5426 log_err(" unexpected minimal value \"%s\" in uloc_minimizeSubtags(), maximal \"%s\" = \"%s\"\n", minimal, maximal, buffer);
5429 else if (uprv_stricmp(minimal, buffer) != 0) {
5430 log_err(" minimal doesn't match expected %s in uloc_MinimizeSubtags(), maximal \"%s\" = %s\n", minimal, maximal, buffer);
5443 buffer,
5444 sizeof(buffer),
5451 if (uprv_stricmp(minimal, buffer) != 0) {
5452 log_err(" unexpected maximal value \"%s\" in uloc_addLikelySubtags(), minimal \"%s\" = \"%s\"\n", maximal, minimal, buffer);
5455 else if (uprv_stricmp(maximal, buffer) != 0) {
5456 log_err(" maximal doesn't match expected \"%s\" in uloc_addLikelySubtags(), minimal \"%s\" = \"%s\"\n", maximal, minimal, buffer);
5471 buffer,
5472 sizeof(buffer),
5480 if (uprv_stricmp(maximal, buffer) != 0) {
5481 log_err(" unexpected minimal value \"%s\" in uloc_minimizeSubtags(), maximal \"%s\" = \"%s\"\n", minimal, maximal, buffer);
5484 else if (uprv_stricmp(minimal, buffer) != 0) {
5485 log_err(" minimal doesn't match expected %s in uloc_MinimizeSubtags(), maximal \"%s\" = %s\n", minimal, maximal, buffer);
5497 const int32_t bufferSize = getBufferSize(&maximizeErrors[i], sizeof(buffer));
5502 buffer,
5517 if (uprv_strnicmp(maximal, buffer, bufferSize) != 0) {
5519 maximal, minimal, (int)sizeof(buffer), buffer);
5531 const int32_t bufferSize = getBufferSize(&minimizeErrors[i], sizeof(buffer));
5536 buffer,
5551 if (uprv_strnicmp(minimal, buffer, bufferSize) != 0) {
5553 minimal, maximal, (int)sizeof(buffer), buffer);