Lines Matching refs:buf
49 char buf[100]; in printf_encode_decode_tests() local
58 printf_encode(buf, sizeof(buf), test->data, test->len); in printf_encode_decode_tests()
59 wpa_printf(MSG_INFO, "%d: -> \"%s\"", i, buf); in printf_encode_decode_tests()
61 binlen = printf_decode(bin, sizeof(bin), buf); in printf_encode_decode_tests()
78 buf[5] = 'A'; in printf_encode_decode_tests()
79 printf_encode(buf, 5, (const u8 *) "abcde", 5); in printf_encode_decode_tests()
80 if (buf[5] != 'A') { in printf_encode_decode_tests()
86 buf[i] = 'A'; in printf_encode_decode_tests()
87 printf_encode(buf, i, (const u8 *) "\xdd\xdd\xdd\xdd\xdd", 5); in printf_encode_decode_tests()
88 if (buf[i] != 'A') { in printf_encode_decode_tests()
361 char buf[3], longbuf[100]; in common_tests() local
372 if (hwaddr_mask_txt(buf, 3, addr, addr) != -1) in common_tests()
375 if (wpa_scnprintf(buf, 0, "hello") != 0 || in common_tests()
376 wpa_scnprintf(buf, 3, "hello") != 2) in common_tests()
379 if (wpa_snprintf_hex(buf, 0, addr, ETH_ALEN) != 0 || in common_tests()
380 wpa_snprintf_hex(buf, 3, addr, ETH_ALEN) != 2) in common_tests()
399 if (utf8_unescape(NULL, 0, buf, sizeof(buf)) != 0 || in common_tests()
401 utf8_unescape("a\\", 2, buf, sizeof(buf)) != 0 || in common_tests()
402 utf8_unescape("abcde", 5, buf, sizeof(buf)) != 0 || in common_tests()
403 utf8_unescape("abc", 3, buf, 3) != 3) in common_tests()
406 if (utf8_unescape("a", 0, buf, sizeof(buf)) != 1 || buf[0] != 'a') in common_tests()
409 if (utf8_unescape("\\b", 2, buf, sizeof(buf)) != 1 || buf[0] != 'b') in common_tests()
412 if (utf8_escape(NULL, 0, buf, sizeof(buf)) != 0 || in common_tests()
414 utf8_escape("abcde", 5, buf, sizeof(buf)) != 0 || in common_tests()
415 utf8_escape("a\\bcde", 6, buf, sizeof(buf)) != 0 || in common_tests()
416 utf8_escape("ab\\cde", 6, buf, sizeof(buf)) != 0 || in common_tests()
417 utf8_escape("abc\\de", 6, buf, sizeof(buf)) != 0 || in common_tests()
418 utf8_escape("abc", 3, buf, 3) != 3) in common_tests()
421 if (utf8_escape("a", 0, buf, sizeof(buf)) != 1 || buf[0] != 'a') in common_tests()
517 struct wpabuf *buf; in wpabuf_tests() local
523 buf = wpabuf_alloc_ext_data(ptr, 100); in wpabuf_tests()
524 if (buf) { in wpabuf_tests()
525 if (wpabuf_resize(&buf, 100) < 0) in wpabuf_tests()
528 wpabuf_put(buf, 100); in wpabuf_tests()
529 wpabuf_free(buf); in wpabuf_tests()
538 buf = wpabuf_alloc(100); in wpabuf_tests()
539 if (buf) { in wpabuf_tests()
542 wpabuf_put(buf, 100); in wpabuf_tests()
543 if (wpabuf_resize(&buf, 100) < 0) in wpabuf_tests()
546 wpabuf_put(buf, 100); in wpabuf_tests()
547 buf2 = wpabuf_concat(buf, NULL); in wpabuf_tests()
548 if (buf2 != buf) in wpabuf_tests()
555 buf = NULL; in wpabuf_tests()
556 buf = wpabuf_zeropad(buf, 10); in wpabuf_tests()
557 if (buf != NULL) in wpabuf_tests()
573 char buf[100]; in ip_addr_tests() local
579 hostapd_ip_txt(NULL, buf, sizeof(buf)) != NULL || in ip_addr_tests()
580 hostapd_ip_txt(&addr, buf, 1) != buf || buf[0] != '\0' || in ip_addr_tests()
581 hostapd_ip_txt(&addr, buf, 0) != NULL || in ip_addr_tests()
582 hostapd_ip_txt(&addr, buf, sizeof(buf)) != buf) in ip_addr_tests()
587 hostapd_ip_txt(&addr, buf, 1) != buf || buf[0] != '\0' || in ip_addr_tests()
588 hostapd_ip_txt(&addr, buf, sizeof(buf)) != buf) in ip_addr_tests()
615 char buf[10]; in eloop_test_read_2() local
629 res = read(sock, buf, sizeof(buf)); in eloop_test_read_2()
697 char buf[10]; in eloop_test_read_1() local
711 res = read(sock, buf, sizeof(buf)); in eloop_test_read_1()
893 char buf[1000]; in json_tests() local
906 json_print_tree(root, buf, sizeof(buf)); in json_tests()
907 if (os_strcmp(buf, test->tree) != 0) { in json_tests()
910 i, buf, test->tree); in json_tests()