Lines Matching refs:buf
146 print_buf(const char *prefix, char *buf, uint32_t len)
153 putchar(buf[i]);
174 uint8_t byte, buf[10], small[5], i;
183 run_test(NULL, 0, buf, sizeof buf, 0x00);
184 run_test(NULL, 0, buf, sizeof buf, 0xFF);
189 memset(buf, 'x', sizeof buf);
190 run_test(buf, sizeof buf, NULL, 0, 'a');
198 memset(buf, 'x', sizeof buf);
199 for (i = 0; i <= sizeof buf; ++i)
200 run_test(buf, i, buf, sizeof buf, 'a');
204 memset(buf, 'b', sizeof buf);
206 run_test(buf, sizeof buf, small, sizeof small, 'a');
210 memset(buf, 'b', sizeof buf);
212 run_test(small, sizeof small, buf, sizeof buf, 'a');
216 memcpy(buf, "0123456789", 10);
217 run_test(buf, sizeof buf, buf + 5, 5, 'x');
221 memcpy(buf, "0123456789", 10);
222 run_test(buf, 5, buf + 4, 3, 'x');
227 memcpy(buf, "0123456789", 10);
228 run_test(buf + 3, 1, buf, 10, 'x'); // non-destructive
229 memcpy(buf, "0123456789", 10);
230 run_test(buf + 3, 2, buf, 10, 'x'); // non-destructive
231 memcpy(buf, "0123456789", 10);
232 run_test(buf + 3, 3, buf, 10, 'x'); // non-destructive
233 memcpy(buf, "0123456789", 10);
234 run_test(buf + 3, 4, buf, 10, 'x'); // destructive
235 memcpy(buf, "0123456789", 10);
236 run_test(buf + 3, 5, buf, 10, 'x'); // destructive
237 memcpy(buf, "0123456789", 10);
238 run_test(buf + 3, 6, buf, 10, 'x'); // destructive
239 memcpy(buf, "0123456789", 10);
240 run_test(buf + 3, 7, buf, 10, 'x'); // destructive
245 memcpy(buf, "0123456789", 10);
246 run_test(buf + 3, 1, buf, 0, 'x'); // non-destructive
247 memcpy(buf, "0123456789", 10);
248 run_test(buf + 3, 2, buf, 0, 'x'); // non-destructive
249 memcpy(buf, "0123456789", 10);
250 run_test(buf + 3, 3, buf, 0, 'x'); // non-destructive
251 memcpy(buf, "0123456789", 10);
252 run_test(buf + 3, 4, buf, 0, 'x'); // non-destructive
253 memcpy(buf, "0123456789", 10);
254 run_test(buf + 3, 4, buf, 0, 'x'); // non-destructive
255 memcpy(buf, "0123456789", 10);
256 run_test(buf + 3, 5, buf, 0, 'x'); // non-destructive
257 memcpy(buf, "0123456789", 10);
258 run_test(buf + 3, 6, buf, 0, 'x'); // non-destructive
259 memcpy(buf, "0123456789", 10);
260 run_test(buf + 3, 7, buf, 0, 'x'); // non-destructive
264 for (dst_offset = 0; dst_offset < sizeof buf; ++dst_offset)
265 for (dst_len = 0; dst_len <= sizeof buf - dst_offset; ++dst_len)
266 for (src_offset = 0; src_offset < sizeof buf; ++src_offset)
267 for (src_len = 0; src_len <= sizeof buf - src_offset; ++src_len)
268 run_test(buf + dst_offset, dst_len, buf + src_offset, src_len, 'x');