Lines Matching refs:buf

93   char buf[256];  in TEST()  local
98 ASSERT_STREQ("Success", strerror_r(0, buf, sizeof(buf))); in TEST()
100 ASSERT_STREQ("Success", buf); in TEST()
102 ASSERT_STREQ("Operation not permitted", strerror_r(1, buf, sizeof(buf))); in TEST()
104 ASSERT_STREQ("Operation not permitted", buf); in TEST()
108 ASSERT_STREQ("Unknown error -1", strerror_r(-1, buf, sizeof(buf))); in TEST()
109 ASSERT_STREQ("Unknown error -1", buf); in TEST()
110 ASSERT_STREQ("Unknown error 1234", strerror_r(1234, buf, sizeof(buf))); in TEST()
111 ASSERT_STREQ("Unknown error 1234", buf); in TEST()
115 memset(buf, 0, sizeof(buf)); in TEST()
116 ASSERT_EQ(buf, strerror_r(4567, buf, 2)); in TEST()
117 ASSERT_STREQ("U", buf); in TEST()
277 char buf[1]; in TEST() local
279 ASSERT_EQ(buf, strcpy(buf, orig)); in TEST()
280 ASSERT_EQ('\0', buf[0]); in TEST()
286 char buf[10]; in TEST() local
288 memset(buf, 'A', sizeof(buf)); in TEST()
289 ASSERT_EQ(buf, strcpy(buf, orig)); in TEST()
290 ASSERT_STREQ("12345", buf); in TEST()
291 ASSERT_EQ('A', buf[6]); in TEST()
292 ASSERT_EQ('A', buf[7]); in TEST()
293 ASSERT_EQ('A', buf[8]); in TEST()
294 ASSERT_EQ('A', buf[9]); in TEST()
300 char buf[10]; in TEST() local
302 memset(buf, 'A', sizeof(buf)); in TEST()
303 ASSERT_EQ(buf, strcpy(buf, orig)); in TEST()
304 ASSERT_STREQ("123456789", buf); in TEST()
310 char buf[1]; in TEST() local
312 ASSERT_EQ(buf, stpcpy(buf, orig)); in TEST()
313 ASSERT_EQ('\0', buf[0]); in TEST()
319 char buf[10]; in TEST() local
321 memset(buf, 'A', sizeof(buf)); in TEST()
322 ASSERT_EQ(buf+strlen(orig), stpcpy(buf, orig)); in TEST()
323 ASSERT_STREQ("12345", buf); in TEST()
324 ASSERT_EQ('A', buf[6]); in TEST()
325 ASSERT_EQ('A', buf[7]); in TEST()
326 ASSERT_EQ('A', buf[8]); in TEST()
327 ASSERT_EQ('A', buf[9]); in TEST()
333 char buf[10]; in TEST() local
335 memset(buf, 'A', sizeof(buf)); in TEST()
336 ASSERT_EQ(buf+strlen(orig), stpcpy(buf, orig)); in TEST()
337 ASSERT_STREQ("123456789", buf); in TEST()
342 char buf[10]; in TEST() local
343 memset(buf, 'A', sizeof(buf)); in TEST()
344 buf[0] = 'a'; in TEST()
345 buf[1] = '\0'; in TEST()
346 char* res = strcat(buf, "01234"); in TEST()
347 ASSERT_EQ(buf, res); in TEST()
348 ASSERT_STREQ("a01234", buf); in TEST()
349 ASSERT_EQ('A', buf[7]); in TEST()
350 ASSERT_EQ('A', buf[8]); in TEST()
351 ASSERT_EQ('A', buf[9]); in TEST()
355 char buf[10]; in TEST() local
356 memset(buf, 'A', sizeof(buf)); in TEST()
357 buf[0] = 'a'; in TEST()
358 buf[1] = '\0'; in TEST()
359 char* res = strcat(buf, "01234567"); in TEST()
360 ASSERT_EQ(buf, res); in TEST()
361 ASSERT_STREQ("a01234567", buf); in TEST()
365 char buf[10]; in TEST() local
366 memset(buf, 'A', sizeof(buf)); in TEST()
367 buf[0] = 'a'; in TEST()
368 buf[1] = '\0'; in TEST()
369 char* res = strncat(buf, "01234", sizeof(buf) - strlen(buf) - 1); in TEST()
370 ASSERT_EQ(buf, res); in TEST()
371 ASSERT_STREQ("a01234", buf); in TEST()
372 ASSERT_EQ('A', buf[7]); in TEST()
373 ASSERT_EQ('A', buf[8]); in TEST()
374 ASSERT_EQ('A', buf[9]); in TEST()
378 char buf[10]; in TEST() local
379 memset(buf, 'A', sizeof(buf)); in TEST()
380 buf[0] = 'a'; in TEST()
381 buf[1] = '\0'; in TEST()
382 char* res = strncat(buf, "0123456789", 5); in TEST()
383 ASSERT_EQ(buf, res); in TEST()
384 ASSERT_STREQ("a01234", buf); in TEST()
385 ASSERT_EQ('A', buf[7]); in TEST()
386 ASSERT_EQ('A', buf[8]); in TEST()
387 ASSERT_EQ('A', buf[9]); in TEST()
391 char buf[10]; in TEST() local
392 memset(buf, 'A', sizeof(buf)); in TEST()
393 buf[0] = 'a'; in TEST()
394 buf[1] = '\0'; in TEST()
395 char* res = strncat(buf, "01234567", 8); in TEST()
396 ASSERT_EQ(buf, res); in TEST()
397 ASSERT_STREQ("a01234567", buf); in TEST()
401 char buf[10]; in TEST() local
402 memset(buf, 'A', sizeof(buf)); in TEST()
403 buf[0] = 'a'; in TEST()
404 buf[1] = '\0'; in TEST()
405 char* res = strncat(buf, "01234567", 9); in TEST()
406 ASSERT_EQ(buf, res); in TEST()
407 ASSERT_STREQ("a01234567", buf); in TEST()
411 char buf[10]; in TEST() local
413 memcpy(buf, s, strlen(s) + 1); in TEST()
414 EXPECT_TRUE(strchr(buf, '\0') == (buf + strlen(s))); in TEST()
1075 static void DoMemsetTest(uint8_t* buf, size_t len) { in DoMemsetTest() argument
1077 buf[i] = 0; in DoMemsetTest()
1080 ASSERT_EQ(buf, memset(buf, value, len)); in DoMemsetTest()
1082 ASSERT_EQ(value, buf[i]); in DoMemsetTest()
1090 static void DoStrlenTest(uint8_t* buf, size_t len) { in DoStrlenTest() argument
1092 memset(buf, (32 + (len % 96)), len - 1); in DoStrlenTest()
1093 buf[len-1] = '\0'; in DoStrlenTest()
1094 ASSERT_EQ(len-1, strlen(reinterpret_cast<char*>(buf))); in DoStrlenTest()
1375 static void DoMemchrTest(uint8_t* buf, size_t len) { in DoMemchrTest() argument
1379 memset(buf, value, len); in DoMemchrTest()
1381 ASSERT_EQ(nullptr, memchr(buf, search_value, len)); in DoMemchrTest()
1383 buf[0] = search_value; in DoMemchrTest()
1385 ASSERT_EQ(&buf[0], memchr(buf, search_value, len)); in DoMemchrTest()
1387 buf[0] = value; in DoMemchrTest()
1388 buf[len - 1] = search_value; in DoMemchrTest()
1390 ASSERT_EQ(&buf[len - 1], memchr(buf, search_value, len)); in DoMemchrTest()
1403 static void DoStrchrTest(uint8_t* buf, size_t len) { in DoStrchrTest() argument
1407 memset(buf, value, len - 1); in DoStrchrTest()
1408 buf[len - 1] = '\0'; in DoStrchrTest()
1410 ASSERT_EQ(nullptr, strchr(reinterpret_cast<char*>(buf), search_value)); in DoStrchrTest()
1412 ASSERT_EQ(reinterpret_cast<char*>(&buf[len - 1]), strchr(reinterpret_cast<char*>(buf), '\0')); in DoStrchrTest()
1414 buf[0] = search_value; in DoStrchrTest()
1416 ASSERT_EQ(reinterpret_cast<char*>(&buf[0]), strchr(reinterpret_cast<char*>(buf), in DoStrchrTest()
1419 buf[0] = value; in DoStrchrTest()
1420 buf[len - 2] = search_value; in DoStrchrTest()
1423 ASSERT_EQ(reinterpret_cast<char*>(&buf[len - 2]), strchr(reinterpret_cast<char*>(buf), in DoStrchrTest()
1437 static void DoStrrchrTest(uint8_t* buf, size_t len) { in DoStrrchrTest() argument
1441 memset(buf, value, len - 1); in DoStrrchrTest()
1442 buf[len - 1] = '\0'; in DoStrrchrTest()
1444 ASSERT_EQ(nullptr, strrchr(reinterpret_cast<char*>(buf), search_value)); in DoStrrchrTest()
1446 ASSERT_EQ(reinterpret_cast<char*>(&buf[len - 1]), strrchr(reinterpret_cast<char*>(buf), '\0')); in DoStrrchrTest()
1448 buf[0] = search_value; in DoStrrchrTest()
1450 ASSERT_EQ(reinterpret_cast<char*>(&buf[0]), strrchr(reinterpret_cast<char*>(buf), in DoStrrchrTest()
1453 buf[0] = value; in DoStrrchrTest()
1454 buf[len - 2] = search_value; in DoStrrchrTest()
1457 ASSERT_EQ(reinterpret_cast<char*>(&buf[len - 2]), strrchr(reinterpret_cast<char*>(buf), in DoStrrchrTest()