Home | History | Annotate | Download | only in tests

Lines Matching refs:buf

401   char buf[10];
403 ASSERT_EXIT(strcpy(buf, orig), testing::KilledBySignal(SIGABRT), "");
414 char buf[0];
416 ASSERT_EXIT(strcpy(buf, orig), testing::KilledBySignal(SIGABRT), "");
427 char buf[0];
429 ASSERT_EXIT(strcpy(buf, orig), testing::KilledBySignal(SIGABRT), "");
440 char buf[1];
442 ASSERT_EXIT(strcpy(buf, orig), testing::KilledBySignal(SIGABRT), "");
452 char buf[10];
453 memcpy(buf, "0123456789", sizeof(buf));
454 ASSERT_EXIT(printf("%zd", strlen(buf)), testing::KilledBySignal(SIGABRT), "");
463 char buf[10];
464 memcpy(buf, "0123456789", sizeof(buf));
465 ASSERT_EXIT(printf("%s", strchr(buf, 'a')), testing::KilledBySignal(SIGABRT), "");
474 char buf[10];
475 memcpy(buf, "0123456789", sizeof(buf));
476 ASSERT_EXIT(printf("%s", strrchr(buf, 'a')), testing::KilledBySignal(SIGABRT), "");
511 char buf[10];
514 ASSERT_EXIT(sprintf(buf, "%s", source_buf), testing::KilledBySignal(SIGABRT), "");
522 char* buf = (char *) malloc(10);
525 ASSERT_EXIT(sprintf(buf, "%s", source_buf), testing::KilledBySignal(SIGABRT), "");
526 free(buf);
532 char buf[5];
533 ASSERT_EXIT(sprintf(buf, "aaaaa"), testing::KilledBySignal(SIGABRT), "");
537 char buf[10];
542 result = vsprintf(buf, fmt, va); // should crash here
558 char buf[10];
564 result = vsnprintf(buf, size, fmt, va); // should crash here
581 char buf[10];
583 strncpy(buf, "012345678", n);
584 ASSERT_EXIT(strncat(buf, "9", n), testing::KilledBySignal(SIGABRT), "");
589 char buf[10];
590 buf[0] = '\0';
592 ASSERT_EXIT(strncat(buf, "0123456789", n), testing::KilledBySignal(SIGABRT), "");
599 char buf[10];
600 buf[0] = '\0';
601 ASSERT_EXIT(strcat(buf, src), testing::KilledBySignal(SIGABRT), "");
606 char buf[20];
607 strcpy(buf, "0123456789");
609 ASSERT_EXIT(memmove(buf + 11, buf, n), testing::KilledBySignal(SIGABRT), "");
667 char buf[10];
668 memcpy(buf, "0123456789", sizeof(buf));
670 ASSERT_EXIT(bzero(buf, n), testing::KilledBySignal(SIGABRT), "");
682 char buf[10];
683 ASSERT_EXIT(recv(0, buf, data_len, 0), testing::KilledBySignal(SIGABRT), "");
697 char buf[1];
698 fd_set* set = (fd_set*) buf;
707 char buf[1];
708 fd_set* set = (fd_set*) buf;
714 char buf[1];
717 ASSERT_EXIT(read(fd, buf, ct), testing::KilledBySignal(SIGABRT), "");
725 char buf[10];
726 memset(buf, 'A', sizeof(buf));
727 buf[0] = 'a';
728 buf[1] = '\0';
729 char* res = __strncat_chk(buf, "01234", sizeof(buf) - strlen(buf) - 1, sizeof(buf));
730 ASSERT_EQ(buf, res);
731 ASSERT_EQ('a', buf[0]);
732 ASSERT_EQ('0', buf[1]);
733 ASSERT_EQ('1', buf[2]);
734 ASSERT_EQ('2', buf[3]);
735 ASSERT_EQ('3', buf[4]);
736 ASSERT_EQ('4', buf[5]);
737 ASSERT_EQ('\0', buf[6]);
738 ASSERT_EQ('A', buf[7]);
739 ASSERT_EQ('A', buf[8]);
740 ASSERT_EQ('A', buf[9]);
744 char buf[10];
745 memset(buf, 'A', sizeof(buf));
746 buf[0] = 'a';
747 buf[1] = '\0';
748 char* res = __strncat_chk(buf, "0123456789", 5, sizeof(buf));
749 ASSERT_EQ(buf, res);
750 ASSERT_EQ('a', buf[0]);
751 ASSERT_EQ('0', buf[1]);
752 ASSERT_EQ('1', buf[2]);
753 ASSERT_EQ('2', buf[3]);
754 ASSERT_EQ('3', buf[4]);
755 ASSERT_EQ('4', buf[5]);
756 ASSERT_EQ('\0', buf[6]);
757 ASSERT_EQ('A', buf[7]);
758 ASSERT_EQ('A', buf[8]);
759 ASSERT_EQ('A', buf[9]);
763 char buf[10];
764 memset(buf, 'A', sizeof(buf));
765 buf[0] = '\0';
766 char* res = __strncat_chk(buf, "0123456789", 5, sizeof(buf));
767 ASSERT_EQ(buf, res);
768 ASSERT_EQ('0', buf[0]);
769 ASSERT_EQ('1', buf[1]);
770 ASSERT_EQ('2', buf[2]);
771 ASSERT_EQ('3', buf[3]);
772 ASSERT_EQ('4', buf[4]);
773 ASSERT_EQ('\0', buf[5]);
774 ASSERT_EQ('A', buf[6]);
775 ASSERT_EQ('A', buf[7]);
776 ASSERT_EQ('A', buf[8]);
777 ASSERT_EQ('A', buf[9]);
781 char buf[10];
782 memset(buf, 'A', sizeof(buf));
783 buf[9] = '\0';
784 char* res = __strncat_chk(buf, "", 5, sizeof(buf));
785 ASSERT_EQ(buf, res);
786 ASSERT_EQ('A', buf[0]);
787 ASSERT_EQ('A', buf[1]);
788 ASSERT_EQ('A', buf[2]);
789 ASSERT_EQ('A', buf[3]);
790 ASSERT_EQ('A', buf[4]);
791 ASSERT_EQ('A', buf[5]);
792 ASSERT_EQ('A', buf[6]);
793 ASSERT_EQ('A', buf[7]);
794 ASSERT_EQ('A', buf[8]);
795 ASSERT_EQ('\0', buf[9]);
799 char buf[10];
800 memset(buf, 'A', sizeof(buf));
801 buf[0] = 'a';
802 buf[1] = '\0';
803 char* res = __strncat_chk(buf, "01234567", 8, sizeof(buf));
804 ASSERT_EQ(buf, res);
805 ASSERT_EQ('a', buf[0]);
806 ASSERT_EQ('0', buf[1]);
807 ASSERT_EQ('1', buf[2]);
808 ASSERT_EQ('2', buf[3]);
809 ASSERT_EQ('3', buf[4]);
810 ASSERT_EQ('4', buf[5]);
811 ASSERT_EQ('5', buf[6]);
812 ASSERT_EQ('6', buf[7]);
813 ASSERT_EQ('7', buf[8]);
814 ASSERT_EQ('\0', buf[9]);
818 char buf[10];
819 memset(buf, 'A', sizeof(buf));
820 buf[0] = 'a';
821 buf[1] = '\0';
822 char* res = __strncat_chk(buf, "01234567", 9, sizeof(buf));
823 ASSERT_EQ(buf, res);
824 ASSERT_EQ('a', buf[0]);
825 ASSERT_EQ('0', buf[1]);
826 ASSERT_EQ('1', buf[2]);
827 ASSERT_EQ('2', buf[3]);
828 ASSERT_EQ('3', buf[4]);
829 ASSERT_EQ('4', buf[5]);
830 ASSERT_EQ('5', buf[6]);
831 ASSERT_EQ('6', buf[7]);
832 ASSERT_EQ('7', buf[8]);
833 ASSERT_EQ('\0', buf[9]);
838 char buf[10];
839 memset(buf, 'A', sizeof(buf));
840 buf[0] = 'a';
841 buf[1] = '\0';
842 char* res = __strcat_chk(buf, "01234", sizeof(buf));
843 ASSERT_EQ(buf, res);
844 ASSERT_EQ('a', buf[0]);
845 ASSERT_EQ('0', buf[1]);
846 ASSERT_EQ('1', buf[2]);
847 ASSERT_EQ('2', buf[3]);
848 ASSERT_EQ('3', buf[4]);
849 ASSERT_EQ('4', buf[5]);
850 ASSERT_EQ('\0', buf[6]);
851 ASSERT_EQ('A', buf[7]);
852 ASSERT_EQ('A', buf[8]);
853 ASSERT_EQ('A', buf[9]);
857 char buf[10];
858 memset(buf, 'A', sizeof(buf));
859 buf[0] = 'a';
860 buf[1] = '\0';
861 char* res = __strcat_chk(buf, "01234567", sizeof(buf));
862 ASSERT_EQ(buf, res);
863 ASSERT_EQ('a', buf[0]);
864 ASSERT_EQ('0', buf[1]);
865 ASSERT_EQ('1', buf[2]);
866 ASSERT_EQ('2', buf[3]);
867 ASSERT_EQ('3', buf[4]);
868 ASSERT_EQ('4', buf[5]);
869 ASSERT_EQ('5', buf[6]);
870 ASSERT_EQ('6', buf[7]);
871 ASSERT_EQ('7', buf[8]);
872 ASSERT_EQ('\0', buf[9]);
954 char buf[10];
955 memset(buf, 'A', sizeof(buf));
956 buf[0] = 'a';
957 buf[1] = '\0';
958 char* res = __strcat_chk(buf, "01234567", (size_t)-1);
959 ASSERT_EQ(buf, res);
960 ASSERT_EQ('a', buf[0]);
961 ASSERT_EQ('0', buf[1]);
962 ASSERT_EQ('1', buf[2]);
963 ASSERT_EQ('2', buf[3]);
964 ASSERT_EQ('3', buf[4]);
965 ASSERT_EQ('4', buf[5]);
966 ASSERT_EQ('5', buf[6]);
967 ASSERT_EQ('6', buf[7]);
968 ASSERT_EQ('7', buf[8]);
969 ASSERT_EQ('\0', buf[9]);
975 char buf[10];
976 char* res = __stpcpy_chk(buf, "012345678", (size_t)-1);
977 ASSERT_EQ(buf + strlen("012345678"), res);
978 ASSERT_STREQ("012345678", buf);
984 char buf[10];
985 char* res = __strcpy_chk(buf, "012345678", (size_t)-1);
986 ASSERT_EQ(buf, res);
987 ASSERT_STREQ("012345678", buf);
993 char buf[10];
994 void* res = __memcpy_chk(buf, "012345678", sizeof(buf), (size_t)-1);
995 ASSERT_EQ((void*)buf, res);
996 ASSERT_EQ('0', buf[0]);
997 ASSERT_EQ('1', buf[1]);
998 ASSERT_EQ('2', buf[2]);
999 ASSERT_EQ('3', buf[3]);
1000 ASSERT_EQ('4', buf[4]);
1001 ASSERT_EQ('5', buf[5]);
1002 ASSERT_EQ('6', buf[6]);
1003 ASSERT_EQ('7', buf[7]);
1004 ASSERT_EQ('8', buf[8]);
1005 ASSERT_EQ('\0', buf[9]);
1015 char buf[BUFSIZ];
1016 snprintf(BUF_AND_SIZE(buf), CONTENTS);
1017 EXPECT_STREQ(CONTENTS, buf);
1019 snprintf(BUF_AND_SIZE_AND_CONTENTS(buf));
1020 EXPECT_STREQ(CONTENTS, buf);
1022 sprintf(BUF_AND_CONTENTS(buf));
1023 EXPECT_STREQ(CONTENTS, buf);