Lines Matching refs:buf

110 	char buf[20];
114 memset(buf, 0xff, sizeof(buf));
115 sprintf(buf, "%8.6ls", c2);
116 ut_asserteq(' ', buf[1]);
117 ut_assert(!strncmp(&buf[2], d2, 7));
118 ut_assert(!buf[9]);
120 memset(buf, 0xff, sizeof(buf));
121 sprintf(buf, "%8.6ls", c4);
122 ut_asserteq(' ', buf[4]);
123 ut_assert(!strncmp(&buf[5], d4, 12));
124 ut_assert(!buf[17]);
126 memset(buf, 0xff, sizeof(buf));
127 sprintf(buf, "%-8.2ls", c4);
128 ut_asserteq(' ', buf[8]);
129 ut_assert(!strncmp(buf, d4, 8));
130 ut_assert(!buf[14]);
133 memset(buf, 0xff, sizeof(buf));
134 sprintf(buf, "%ls", i1);
135 ut_asserteq_str("i1?l", buf);
137 memset(buf, 0xff, sizeof(buf));
138 sprintf(buf, "%ls", i2);
139 ut_asserteq_str("i2?l", buf);
141 memset(buf, 0xff, sizeof(buf));
142 sprintf(buf, "%ls", i3);
143 ut_asserteq_str("i3?", buf);
145 memset(buf, 0xff, sizeof(buf));
146 ret = snprintf(buf, 4, "%ls", c1);
148 ut_asserteq_str("U-B", buf);
150 memset(buf, 0xff, sizeof(buf));
151 ret = snprintf(buf, 6, "%ls", c2);
152 ut_asserteq_str("kafb", buf);
155 memset(buf, 0xff, sizeof(buf));
156 ret = snprintf(buf, 7, "%ls", c2);
157 ut_asserteq_str("kafb\xC3\xA1", buf);
160 memset(buf, 0xff, sizeof(buf));
161 ret = snprintf(buf, 8, "%ls", c3);
162 ut_asserteq_str("\xE6\xBD\x9C\xE6\xB0\xB4", buf);
165 memset(buf, 0xff, sizeof(buf));
166 ret = snprintf(buf, 11, "%ls", c4);
167 ut_asserteq_str("\xF0\x90\x92\x8D\xF0\x90\x92\x96", buf);
170 memset(buf, 0xff, sizeof(buf));
171 ret = snprintf(buf, 4, "%ls", c4);
172 ut_asserteq_str("", buf);
317 u16 buf[16];
320 pos = buf;
322 ut_asserteq(6, pos - buf);
323 ut_assert(!unicode_test_u16_strcmp(buf, c1, SIZE_MAX));
325 pos = buf;
327 ut_asserteq(8, pos - buf);
328 ut_assert(!unicode_test_u16_strcmp(buf, c2, SIZE_MAX));
330 pos = buf;
332 ut_asserteq(3, pos - buf);
333 ut_assert(!unicode_test_u16_strcmp(buf, c3, SIZE_MAX));
335 pos = buf;
337 ut_asserteq(6, pos - buf);
338 ut_assert(!unicode_test_u16_strcmp(buf, c4, SIZE_MAX));
341 pos = buf;
343 ut_asserteq(4, pos - buf);
344 ut_assert(!unicode_test_u16_strcmp(buf, u"j1?l", SIZE_MAX));
346 pos = buf;
348 ut_asserteq(4, pos - buf);
349 ut_assert(!unicode_test_u16_strcmp(buf, u"j2?l", SIZE_MAX));
351 pos = buf;
353 ut_asserteq(3, pos - buf);
354 ut_assert(!unicode_test_u16_strcmp(buf, u"j3?", SIZE_MAX));
362 u16 buf[16];
365 pos = buf;
366 memset(buf, 0, sizeof(buf));
368 ut_asserteq(4, pos - buf);
369 ut_assert(!buf[4]);
370 ut_assert(!unicode_test_u16_strcmp(buf, c1, 4));
372 pos = buf;
373 memset(buf, 0, sizeof(buf));
375 ut_asserteq(8, pos - buf);
376 ut_assert(buf[4]);
377 ut_assert(!unicode_test_u16_strcmp(buf, c2, SIZE_MAX));
379 pos = buf;
380 memset(buf, 0, sizeof(buf));
382 ut_asserteq(2, pos - buf);
383 ut_assert(!buf[2]);
384 ut_assert(!unicode_test_u16_strcmp(buf, c3, 2));
386 pos = buf;
387 memset(buf, 0, sizeof(buf));
389 ut_asserteq(4, pos - buf);
390 ut_assert(!buf[4]);
391 ut_assert(!unicode_test_u16_strcmp(buf, c4, 4));
393 pos = buf;
394 memset(buf, 0, sizeof(buf));
396 ut_asserteq(6, pos - buf);
397 ut_assert(buf[5]);
398 ut_assert(!unicode_test_u16_strcmp(buf, c4, SIZE_MAX));
506 char buf[16];
509 pos = buf;
511 ut_asserteq(6, pos - buf);
512 ut_asserteq_str(d1, buf);
514 pos = buf;
516 ut_asserteq(9, pos - buf);
517 ut_asserteq_str(d2, buf);
519 pos = buf;
521 ut_asserteq(9, pos - buf);
522 ut_asserteq_str(d3, buf);
524 pos = buf;
526 ut_asserteq(12, pos - buf);
527 ut_asserteq_str(d4, buf);
530 pos = buf;
532 ut_asserteq(4, pos - buf);
533 ut_asserteq_str("i1?l", buf);
535 pos = buf;
537 ut_asserteq(4, pos - buf);
538 ut_asserteq_str("i2?l", buf);
540 pos = buf;
542 ut_asserteq(3, pos - buf);
543 ut_asserteq_str("i3?", buf);
551 char buf[16];
554 pos = buf;
555 memset(buf, 0, sizeof(buf));
557 ut_asserteq(4, pos - buf);
558 ut_assert(!buf[4]);
559 ut_assert(!strncmp(buf, d1, 4));
561 pos = buf;
562 memset(buf, 0, sizeof(buf));
564 ut_asserteq(9, pos - buf);
565 ut_assert(buf[4]);
566 ut_assert(!strncmp(buf, d2, SIZE_MAX));
568 pos = buf;
569 memset(buf, 0, sizeof(buf));
571 ut_asserteq(6, pos - buf);
572 ut_assert(!buf[6]);
573 ut_assert(!strncmp(buf, d3, 6));
575 pos = buf;
576 memset(buf, 0, sizeof(buf));
578 ut_asserteq(8, pos - buf);
579 ut_assert(!buf[8]);
580 ut_assert(!strncmp(buf, d4, 8));
582 pos = buf;
583 memset(buf, 0, sizeof(buf));
585 ut_asserteq(12, pos - buf);
586 ut_assert(buf[5]);
587 ut_assert(!strncmp(buf, d4, SIZE_MAX));
720 char buf[16];
722 utf8_to_cp437_stream_helper(d1, buf);
723 ut_asserteq_str("U-Boot", buf);
724 utf8_to_cp437_stream_helper(d2, buf);
725 ut_asserteq_str("kafb\xa0tur", buf);
726 utf8_to_cp437_stream_helper(d5, buf);
727 ut_asserteq_str("? is not B", buf);
728 utf8_to_cp437_stream_helper(j2, buf);
729 ut_asserteq_str("j2l", buf);
751 s32 buf[16];
760 memset(buf, 0, sizeof(buf));
761 utf8_to_utf32_stream_helper(d1, buf);
762 ut_asserteq_mem(u1, buf, sizeof(u1));
764 memset(buf, 0, sizeof(buf));
765 utf8_to_utf32_stream_helper(d2, buf);
766 ut_asserteq_mem(u2, buf, sizeof(u2));
768 memset(buf, 0, sizeof(buf));
769 utf8_to_utf32_stream_helper(d3, buf);
770 ut_asserteq_mem(u3, buf, sizeof(u3));
772 memset(buf, 0, sizeof(buf));
773 utf8_to_utf32_stream_helper(d5, buf);
774 ut_asserteq_mem(u5, buf, sizeof(u5));
776 memset(buf, 0, sizeof(buf));
777 utf8_to_utf32_stream_helper(j2, buf);
778 ut_asserteq_mem(u4, buf, sizeof(u4));
787 u16 buf[16];
791 memset(buf, 0xeb, sizeof(buf));
792 pos = efi_create_indexed_name(buf, sizeof(buf), "Capsule", 0x0af9);
794 ut_asserteq_mem(expected, buf, sizeof(expected));
795 ut_asserteq(pos - buf, u16_strnlen(buf, SIZE_MAX));
804 u16 buf[40];
814 memset(buf, 0, sizeof(buf));
815 ret = u16_strlcat(buf, &null_src, ARRAY_SIZE(buf));
819 memset(buf, 0, sizeof(buf));
820 ret = u16_strlcat(buf, src, ARRAY_SIZE(buf));
822 ut_assert(!unicode_test_u16_strcmp(buf, src, 40));
825 memset(buf, 0xCD, (sizeof(buf) - sizeof(u16)));
826 buf[39] = 0;
827 memcpy(buf, dest, sizeof(dest));
828 ret = u16_strlcat(buf, &null_src, ARRAY_SIZE(buf));
830 ut_assert(!unicode_test_u16_strcmp(buf, dest, 40));
833 memset(buf, 0xCD, (sizeof(buf) - sizeof(u16)));
834 buf[39] = 0;
835 memcpy(buf, dest, sizeof(dest));
837 ret = u16_strlcat(buf, src, i);
840 ut_assert(!unicode_test_u16_strcmp(buf, dest, 40));
842 ut_assert(!unicode_test_u16_strcmp(buf, concat_str, i - 1));
844 ut_assert(!unicode_test_u16_strcmp(buf, concat_str, 40));