Lines Matching refs:buf
36 static void BufWriteTest(void *buf, int start, int end)
39 ((char *)buf)[i] = 'a';
43 static void BufReadTest(void *buf, int start, int end)
47 tmp = ((char *)buf)[i];
55 char *buf = (char *)malloc(TEST_SIZE);
56 if (buf == NULL) {
60 BufReadTest(buf, -1, TEST_SIZE);
62 BufWriteTest(buf, 0, TEST_SIZE);
64 free(buf);
73 char *buf = (char *)malloc(TEST_SIZE);
75 BufReadTest(buf, -1, TEST_SIZE);
76 char *buf1 = (char *)realloc(buf, TEST_SIZE_MIN);
78 free(buf);
81 buf = NULL;
92 char *buf = (char *)calloc(4, 4); /* 4: test size */
93 if (buf == NULL) {
97 BufReadTest(buf, -1, TEST_SIZE);
98 free(buf);
106 char *buf = (char *)valloc(TEST_SIZE);
107 if (buf == NULL) {
111 BufReadTest(buf, -1, TEST_SIZE);
112 free(buf);
121 char *buf = (char *)aligned_alloc(TEST_ALIGN_SIZE, TEST_SIZE);
122 if (buf == NULL) {
126 BufReadTest(buf, -1, 128);
127 free(buf);
135 char *buf = (char *)malloc(TEST_SIZE);
136 if (buf == NULL) {
140 memset(buf, 0, TEST_SIZE + 1);
141 free(buf);
149 char *buf = (char *)malloc(TEST_SIZE);
150 if (buf == NULL) {
155 memcpy(buf, localBuf, TEST_SIZE + 1);
156 free(buf);
164 char *buf = (char *)malloc(TEST_SIZE);
165 if (buf == NULL) {
169 memmove(buf + 12, buf, 10); /* 12 and 10: test size */
170 free(buf);
178 char *buf = (char *)malloc(TEST_SIZE);
179 if (buf == NULL) {
183 printf("[LmsStrcpyTest] strcpy overflow error should be triggered, src string buf size:%d\n",
185 strcpy(buf, testStr);
186 free(buf);
194 char *buf = (char *)malloc(TEST_SIZE);
195 if (buf == NULL) {
198 buf[0] = 'a';
199 buf[1] = 'b';
200 buf[2] = 0;
203 "total buf size:%d\n",
204 testStr, buf, strlen(testStr) + strlen(buf) + 1);
205 strcat(buf, testStr);
206 free(buf);
214 char *buf = (char *)malloc(TEST_SIZE);
215 if (buf == NULL) {
219 free(buf);
221 BufReadTest(buf, 1, 1);
223 free(buf);