Lines Matching refs:buf
1128 static int _string_check(int linenumber, char *buf, const char *buf2) in _string_check() argument
1130 if(strcmp(buf, buf2)) { in _string_check()
1133 linenumber, buf, buf2); in _string_check()
1140 static int _strlen_check(int linenumber, char *buf, size_t len) in _strlen_check() argument
1142 size_t buflen = strlen(buf); in _strlen_check()
1161 char buf[256]; in test_string_formatting() local
1162 curl_msnprintf(buf, sizeof(buf), "%0*d%s", 2, 9, "foo"); in test_string_formatting()
1163 errors += string_check(buf, "09foo"); in test_string_formatting()
1165 curl_msnprintf(buf, sizeof(buf), "%*.*s", 5, 2, "foo"); in test_string_formatting()
1166 errors += string_check(buf, " fo"); in test_string_formatting()
1168 curl_msnprintf(buf, sizeof(buf), "%*.*s", 2, 5, "foo"); in test_string_formatting()
1169 errors += string_check(buf, "foo"); in test_string_formatting()
1171 curl_msnprintf(buf, sizeof(buf), "%*.*s", 0, 10, "foo"); in test_string_formatting()
1172 errors += string_check(buf, "foo"); in test_string_formatting()
1174 curl_msnprintf(buf, sizeof(buf), "%-10s", "foo"); in test_string_formatting()
1175 errors += string_check(buf, "foo "); in test_string_formatting()
1177 curl_msnprintf(buf, sizeof(buf), "%10s", "foo"); in test_string_formatting()
1178 errors += string_check(buf, " foo"); in test_string_formatting()
1180 curl_msnprintf(buf, sizeof(buf), "%*.*s", -10, -10, "foo"); in test_string_formatting()
1181 errors += string_check(buf, "foo "); in test_string_formatting()
1194 char buf[256]; in test_pos_arguments() local
1196 curl_msnprintf(buf, sizeof(buf), "%3$d %2$d %1$d", 500, 501, 502); in test_pos_arguments()
1197 errors += string_check(buf, "502 501 500"); in test_pos_arguments()
1199 curl_msnprintf(buf, sizeof(buf), "%3$d %1$d %2$d", 500, 501, 502); in test_pos_arguments()
1200 errors += string_check(buf, "502 500 501"); in test_pos_arguments()
1204 curl_msnprintf(buf, sizeof(buf), "%3$d %d %2$d", 500, 501, 502); in test_pos_arguments()
1205 errors += string_check(buf, ""); in test_pos_arguments()
1213 char buf[256]; in test_weird_arguments() local
1217 rc = curl_msnprintf(buf, sizeof(buf), "%-20d%% right? %%", 500); in test_weird_arguments()
1218 errors += string_check(buf, "500 % right? %"); in test_weird_arguments()
1221 rc = curl_msnprintf(buf, sizeof(buf), "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" in test_weird_arguments()
1225 errors += string_check(buf, "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" in test_weird_arguments()
1228 rc = curl_msnprintf(buf, sizeof(buf), "%2 AA %d %K", 500, 501, 502); in test_weird_arguments()
1229 errors += string_check(buf, "%2 AA 500 %K"); in test_weird_arguments()
1231 rc = curl_msnprintf(buf, sizeof(buf), "%2 %d %K", 500, 501, 502); in test_weird_arguments()
1232 errors += string_check(buf, "%2 500 %K"); in test_weird_arguments()
1235 rc = curl_msnprintf(buf, sizeof(buf), in test_weird_arguments()
1269 errors += string_check(buf, in test_weird_arguments()
1286 buf[0] = 0; in test_weird_arguments()
1287 rc = curl_msnprintf(buf, sizeof(buf), in test_weird_arguments()
1321 errors += string_check(buf, ""); in test_weird_arguments()
1335 char buf[512]; /* larger than max float size */ in test_float_formatting() local
1336 curl_msnprintf(buf, sizeof(buf), "%f", 9.0); in test_float_formatting()
1337 errors += string_check(buf, "9.000000"); in test_float_formatting()
1339 curl_msnprintf(buf, sizeof(buf), "%.1f", 9.1); in test_float_formatting()
1340 errors += string_check(buf, "9.1"); in test_float_formatting()
1342 curl_msnprintf(buf, sizeof(buf), "%.2f", 9.1); in test_float_formatting()
1343 errors += string_check(buf, "9.10"); in test_float_formatting()
1345 curl_msnprintf(buf, sizeof(buf), "%.0f", 9.1); in test_float_formatting()
1346 errors += string_check(buf, "9"); in test_float_formatting()
1348 curl_msnprintf(buf, sizeof(buf), "%0f", 9.1); in test_float_formatting()
1349 errors += string_check(buf, "9.100000"); in test_float_formatting()
1351 curl_msnprintf(buf, sizeof(buf), "%10f", 9.1); in test_float_formatting()
1352 errors += string_check(buf, " 9.100000"); in test_float_formatting()
1354 curl_msnprintf(buf, sizeof(buf), "%10.3f", 9.1); in test_float_formatting()
1355 errors += string_check(buf, " 9.100"); in test_float_formatting()
1357 curl_msnprintf(buf, sizeof(buf), "%-10.3f", 9.1); in test_float_formatting()
1358 errors += string_check(buf, "9.100 "); in test_float_formatting()
1360 curl_msnprintf(buf, sizeof(buf), "%-10.3f", 9.123456); in test_float_formatting()
1361 errors += string_check(buf, "9.123 "); in test_float_formatting()
1363 curl_msnprintf(buf, sizeof(buf), "%.-2f", 9.1); in test_float_formatting()
1364 errors += string_check(buf, "9.100000"); in test_float_formatting()
1366 curl_msnprintf(buf, sizeof(buf), "%*f", 10, 9.1); in test_float_formatting()
1367 errors += string_check(buf, " 9.100000"); in test_float_formatting()
1369 curl_msnprintf(buf, sizeof(buf), "%*f", 3, 9.1); in test_float_formatting()
1370 errors += string_check(buf, "9.100000"); in test_float_formatting()
1372 curl_msnprintf(buf, sizeof(buf), "%*f", 6, 9.2987654); in test_float_formatting()
1373 errors += string_check(buf, "9.298765"); in test_float_formatting()
1375 curl_msnprintf(buf, sizeof(buf), "%*f", 6, 9.298765); in test_float_formatting()
1376 errors += string_check(buf, "9.298765"); in test_float_formatting()
1378 curl_msnprintf(buf, sizeof(buf), "%*f", 6, 9.29876); in test_float_formatting()
1379 errors += string_check(buf, "9.298760"); in test_float_formatting()
1381 curl_msnprintf(buf, sizeof(buf), "%.*f", 6, 9.2987654); in test_float_formatting()
1382 errors += string_check(buf, "9.298765"); in test_float_formatting()
1383 curl_msnprintf(buf, sizeof(buf), "%.*f", 5, 9.2987654); in test_float_formatting()
1384 errors += string_check(buf, "9.29877"); in test_float_formatting()
1385 curl_msnprintf(buf, sizeof(buf), "%.*f", 4, 9.2987654); in test_float_formatting()
1386 errors += string_check(buf, "9.2988"); in test_float_formatting()
1387 curl_msnprintf(buf, sizeof(buf), "%.*f", 3, 9.2987654); in test_float_formatting()
1388 errors += string_check(buf, "9.299"); in test_float_formatting()
1389 curl_msnprintf(buf, sizeof(buf), "%.*f", 2, 9.2987654); in test_float_formatting()
1390 errors += string_check(buf, "9.30"); in test_float_formatting()
1391 curl_msnprintf(buf, sizeof(buf), "%.*f", 1, 9.2987654); in test_float_formatting()
1392 errors += string_check(buf, "9.3"); in test_float_formatting()
1393 curl_msnprintf(buf, sizeof(buf), "%.*f", 0, 9.2987654); in test_float_formatting()
1394 errors += string_check(buf, "9"); in test_float_formatting()
1399 curl_msnprintf(buf, sizeof(buf), "%.*f", (1 << 30), 9.2987654); in test_float_formatting()
1400 errors += strlen_check(buf, 325); in test_float_formatting()
1402 curl_msnprintf(buf, sizeof(buf), "%10000.10000f", 9.2987654); in test_float_formatting()
1403 errors += strlen_check(buf, 325); in test_float_formatting()
1405 curl_msnprintf(buf, sizeof(buf), "%240.10000f", in test_float_formatting()
1407 errors += strlen_check(buf, 325); in test_float_formatting()
1411 curl_msnprintf(buf, sizeof(buf), "%*f", INT_MIN, 9.1); in test_float_formatting()
1412 …errors += string_check(buf, "9.100000 … in test_float_formatting()
1416 curl_msnprintf(buf, sizeof(buf), "%*f", (1 << 30), 9.1); in test_float_formatting()
1417 …errors += string_check(buf, " … in test_float_formatting()
1418 curl_msnprintf(buf, sizeof(buf), "%100000f", 9.1); in test_float_formatting()
1419 …errors += string_check(buf, " … in test_float_formatting()
1421 curl_msnprintf(buf, sizeof(buf), "%f", MAXIMIZE); in test_float_formatting()
1422 errors += strlen_check(buf, 317); in test_float_formatting()
1424 curl_msnprintf(buf, 2, "%f", MAXIMIZE); in test_float_formatting()
1425 errors += strlen_check(buf, 1); in test_float_formatting()
1426 curl_msnprintf(buf, 3, "%f", MAXIMIZE); in test_float_formatting()
1427 errors += strlen_check(buf, 2); in test_float_formatting()
1428 curl_msnprintf(buf, 4, "%f", MAXIMIZE); in test_float_formatting()
1429 errors += strlen_check(buf, 3); in test_float_formatting()
1430 curl_msnprintf(buf, 5, "%f", MAXIMIZE); in test_float_formatting()
1431 errors += strlen_check(buf, 4); in test_float_formatting()
1432 curl_msnprintf(buf, 6, "%f", MAXIMIZE); in test_float_formatting()
1433 errors += strlen_check(buf, 5); in test_float_formatting()
1446 char buf[256]; in test_oct_hex_formatting() local
1448 curl_msnprintf(buf, sizeof(buf), "%ho %hx %hX", 0xFA10U, 0xFA10U, 0xFA10U); in test_oct_hex_formatting()
1449 errors += string_check(buf, "175020 fa10 FA10"); in test_oct_hex_formatting()
1452 curl_msnprintf(buf, sizeof(buf), "%o %x %X", 0xFA10U, 0xFA10U, 0xFA10U); in test_oct_hex_formatting()
1453 errors += string_check(buf, "175020 fa10 FA10"); in test_oct_hex_formatting()
1455 curl_msnprintf(buf, sizeof(buf), "%o %x %X", in test_oct_hex_formatting()
1457 errors += string_check(buf, "37257011060 fabc1230 FABC1230"); in test_oct_hex_formatting()
1459 curl_msnprintf(buf, sizeof(buf), "%o %x %X", in test_oct_hex_formatting()
1461 errors += string_check(buf, "1752746757044321263600 fabcdef123456780 FABCDEF123456780"); in test_oct_hex_formatting()
1465 curl_msnprintf(buf, sizeof(buf), "%lo %lx %lX", 0xFA10UL, 0xFA10UL, 0xFA10UL); in test_oct_hex_formatting()
1466 errors += string_check(buf, "175020 fa10 FA10"); in test_oct_hex_formatting()
1468 curl_msnprintf(buf, sizeof(buf), "%lo %lx %lX", in test_oct_hex_formatting()
1470 errors += string_check(buf, "37257011060 fabc1230 FABC1230"); in test_oct_hex_formatting()
1472 curl_msnprintf(buf, sizeof(buf), "%lo %lx %lX", in test_oct_hex_formatting()
1474 errors += string_check(buf, "1752746757044321263600 fabcdef123456780 FABCDEF123456780"); in test_oct_hex_formatting()
1488 char buf[128]; in test_return_codes() local
1491 rc = curl_msnprintf(buf, 100, "%d", 9999); in test_return_codes()
1495 rc = curl_msnprintf(buf, 100, "%d", 99999); in test_return_codes()
1500 rc = curl_msnprintf(buf, 5, "%d", 99999); in test_return_codes()
1505 rc = curl_msnprintf(buf, 5, "%s", "helloooooooo"); in test_return_codes()
1510 rc = curl_msnprintf(buf, 6, "%s", "helloooooooo"); in test_return_codes()