Home | History | Annotate | Download | only in iotest

Lines Matching refs:buffer

432     UChar buffer[2048];
453 u_memset(buffer, 0xBEEF, sizeof(buffer)/sizeof(buffer[0]));
455 u_uastrncpy(buffer, testStr, expectedSize+1);
457 u_file_write(buffer, expectedSize, myFile);
458 u_strcat(expectedBuffer, buffer);
462 u_memset(buffer, 0xBEEF, sizeof(buffer)/sizeof(buffer[0]));
470 if (u_fgets(buffer, sizeof(buffer)/sizeof(buffer[0]), myFile) != buffer) {
471 log_err("Didn't get the buffer back\n");
474 readSize = u_strlen(buffer);
476 log_err("Buffer is the wrong size. Got %d Expected %d\n", u_strlen(buffer), expectedSize*repetitions);
478 if (buffer[(expectedSize*repetitions) + 1] != 0xBEEF) {
481 if (u_strcmp(buffer, expectedBuffer) != 0) {
495 u_memset(buffer, 0xBEEF, sizeof(buffer)/sizeof(buffer[0]));
497 u_uastrncpy(buffer, testStr, expectedSize+1);
499 u_file_write(buffer, expectedSize, myFile);
500 u_strcat(expectedBuffer, buffer);
504 u_memset(buffer, 0xBEEF, sizeof(buffer)/sizeof(buffer[0]));
515 if (u_fgets(buffer, sizeof(buffer)/sizeof(buffer[0]), myFile) != buffer) {
516 log_err("Didn't get the buffer back\n");
519 readSize = u_strlen(buffer);
521 log_err("Buffer is the wrong size. Got %d Expected %d\n", u_strlen(buffer), expectedSize*repetitions);
523 if (buffer[(expectedSize*repetitions) + 1] != 0xBEEF) {
526 if (u_strcmp(buffer, expectedBuffer) != 0) {
532 log_verbose("Now trying a multi-byte encoding (UTF-8) with a really small buffer.\n");
537 u_memset(buffer, 0xBEEF, sizeof(buffer)/sizeof(buffer[0]));
539 u_uastrncpy(buffer, testStr, expectedSize+1);
541 u_file_write(buffer, expectedSize, myFile);
542 u_strcat(expectedBuffer, buffer);
546 u_memset(buffer, 0xBEEF, sizeof(buffer)/sizeof(buffer[0]));
548 if (u_fgets(buffer, 2, myFile) != buffer) {
549 log_err("Didn't get the buffer back\n");
552 readSize = u_strlen(buffer);
554 log_err("Buffer is the wrong size. Got %d Expected %d\n", u_strlen(buffer), 1);
556 if (buffer[0] != 0xFF41 || buffer[1] != 0) {
559 if (buffer[2] != 0xBEEF) {
567 UChar buffer[1024];
572 u_memset(buffer, 0xBEEF, sizeof(buffer)/sizeof(buffer[0]));
574 u_file_write(buffer, sizeof(buffer)/sizeof(buffer[0]), myFile);
578 u_memset(buffer, 0xDEAD, sizeof(buffer)/sizeof(buffer[0]));
580 how_many = u_file_read(buffer, 1024, myFile);
581 if (how_many != 1024 || buffer[1023] != 0xBEEF) {
588 UChar buffer[2048];
619 u_memset(buffer, 0xBEEF, sizeof(buffer)/sizeof(buffer[0]));
621 returnedUCharBuffer = u_fgets(buffer, sizeof(buffer)/sizeof(buffer[0]), myFile);
632 if (returnedUCharBuffer != buffer) {
633 log_err("Didn't get the buffer back\n");
636 if (u_strcmp(buffer, expectedBuffer) != 0) {
639 if (buffer[u_strlen(buffer)+1] != 0xBEEF) {
648 UChar buffer[256];
699 u_memset(buffer, 0xBEEF, sizeof(buffer)/sizeof(buffer[0]));
700 returnedUCharBuffer = u_fgets(buffer, sizeof(buffer)/sizeof(buffer[0]), myFile);
706 if (u_strcmp(buffer, testUStr[lineIdx]) != 0) {
709 if (buffer[u_strlen(buffer)+1] != 0xBEEF) {
716 if (u_fgets(buffer, sizeof(buffer)/sizeof(buffer[0]), myFile) != NULL) {
723 UChar buffer[64];
750 returnedUCharBuffer = u_fgets(buffer, sizeof(buffer)/sizeof(buffer[0]), myFile);
752 log_err("prefix buffer is different. prefix=\"%s\"\n", prefixLine);
758 u_memset(buffer, 0xBEEF, sizeof(buffer)/sizeof(buffer[0]));
759 returnedUCharBuffer = u_fgets(buffer, sizeof(buffer)/sizeof(buffer[0]), myFile);
765 if (u_strcmp(buffer, expectedBuffer) != 0) {
768 if (buffer[u_strlen(buffer)+1] != 0xBEEF) {
779 /* This makes sure that lines are correctly handled between buffer boundaries. */
789 UChar buffer[2003]; /* Use a non-power of 2 or 10 */
799 u_memset(buffer, 0xBEEF, sizeof(buffer)/sizeof(buffer[0]));
802 for (repetitions = 0; repetitions < ((sizeof(buffer)/sizeof(buffer[0]))*2); repetitions++) {
814 returnedUCharBuffer = u_fgets(buffer, (sizeof(buffer)/sizeof(buffer[0]))-1, myFile);
815 if (u_strlen(returnedUCharBuffer) != ((sizeof(buffer)/sizeof(buffer[0]))-2)) {
817 u_strlen(returnedUCharBuffer), ((sizeof(buffer)/sizeof(buffer[0]))-2));
820 if (buffer[(sizeof(buffer)/sizeof(buffer[0]))-1] != 0xBEEF) {
1054 /* Reinitialize the buffer to verify null termination works. */\
1056 memset(buffer, '*', sizeof(buffer)/sizeof(*buffer));\
1064 cNumPrinted = sprintf(buffer, cFormat, cValue);\
1065 if (strcmp(buffer, compBuffer) != 0) {\
1066 log_err("%" uFormat " Got: \"%s\", Expected: \"%s\"\n", compBuffer, buffer);\
1071 if (buffer[uNumPrinted+1] != '*') {\
1080 char buffer[256];
1192 /* Reinitialize the buffer to verify null termination works. */
1194 memset(buffer, '*', sizeof(buffer)/sizeof(*buffer));
1202 cNumPrinted = sprintf(buffer, "%d % d %d", -1234, 1234, 1234);
1203 if (strcmp(buffer, compBuffer) != 0) {
1204 log_err("%%d %% d %%d Got: \"%s\", Expected: \"%s\"\n", compBuffer, buffer);
1209 if (buffer[uNumPrinted+1] != '*') {
1221 char buffer[256];
1231 /* Reinitialize the buffer to verify null termination works. */
1234 memset(buffer, '*', sizeof(buffer)/sizeof(*buffer));
1235 buffer[sizeof(buffer)/sizeof(*buffer)-1] = 0;
1244 cNumScanned = sscanf(cValue, format, buffer);
1245 if (strncmp(buffer, compBuffer, sizeof(buffer)/sizeof(*buffer)) != 0) {
1246 log_err("%s Got: \"%s\", Expected: \"%s\"\n", format, compBuffer, buffer);
1318 /* Reinitialize the buffer to verify null termination works. */
1439 UChar * buffer;
1442 int32_t expected = 10000; /* test with large data to test internal buffer looping */
1449 buffer = (UChar*) malloc(expected * sizeof(UChar));
1450 if (!buffer) {
1458 free(buffer);
1462 u_memset(buffer, testChar, expected);
1463 count = u_file_write(buffer, expected, myFile);
1466 free(buffer);
1471 free(buffer);
1472 buffer = NULL;