/freebsd/contrib/libarchive/libarchive/test/ |
H A D | test_read_format_rar.c | 49 char buff[64]; in DEFINE_TEST() local 70 assertA(size == archive_read_data(a, buff, size)); in DEFINE_TEST() 71 assertEqualMem(buff, test_txt, size); in DEFINE_TEST() 84 assertEqualIntA(a, 0, archive_read_data(a, buff, sizeof(buff))); in DEFINE_TEST() 96 assertA(size == archive_read_data(a, buff, size)); in DEFINE_TEST() 97 assertEqualMem(buff, test_txt, size); in DEFINE_TEST() 132 char buff[64]; in DEFINE_TEST() local 153 assertA(size == archive_read_data(a, buff, size)); in DEFINE_TEST() 154 assertEqualMem(buff, test_tx in DEFINE_TEST() 167 char buff[64]; DEFINE_TEST() local 202 char buff[30]; DEFINE_TEST() local 333 char buff[30]; DEFINE_TEST() local 552 char buff[64]; DEFINE_TEST() local 701 char buff[64]; DEFINE_TEST() local 802 char buff[441]; DEFINE_TEST() local 893 char buff[64]; DEFINE_TEST() local 1130 char buff[441]; DEFINE_TEST() local 1301 char buff[64]; DEFINE_TEST() local 1435 char buff[64]; DEFINE_TEST() local 1576 char buff[64]; test_read_format_rar_multivolume_uncompressed_files_helper() local 1643 char buff[64]; DEFINE_TEST() local [all...] |
H A D | test_write_disk_sparse.c | 40 char *buff, *p; in verify_write_data() 44 buff = malloc(buff_size); in verify_write_data() 45 assert(buff != NULL); in verify_write_data() 46 if (buff == NULL) in verify_write_data() 59 memset(buff, 0, buff_size); in verify_write_data() 60 memcpy(buff, data, sizeof(data)); in verify_write_data() 62 assertEqualInt(buff_size, archive_write_data(a, buff, buff_size)); in verify_write_data() 65 memset(buff, 0, buff_size); in verify_write_data() 66 memcpy(buff + buff_size / 2 - 3, data, sizeof(data)); in verify_write_data() 68 assertEqualInt(buff_size, archive_write_data(a, buff, buff_siz in verify_write_data() 41 char *buff, *p; verify_write_data() local 138 char *buff, *p; verify_write_data_block() local [all...] |
H A D | test_zip_filename_encoding.c | 33 char buff[4096]; in DEFINE_TEST() local 54 archive_write_open_memory(a, buff, sizeof(buff), &used)); in DEFINE_TEST() 67 assertEqualInt(0x08, buff[7]); in DEFINE_TEST() 68 assertEqualMem(buff + 30, "\xD0\xBF\xD1\x80\xD0\xB8", 6); in DEFINE_TEST() 79 archive_write_open_memory(a, buff, sizeof(buff), &used)); in DEFINE_TEST() 92 assertEqualInt(0x08, buff[7]); in DEFINE_TEST() 93 assertEqualMem(buff + 30, "\xD0\xBF\xD1\x80\xD0\xB8", 6); in DEFINE_TEST() 103 archive_write_open_memory(a, buff, sizeof(buff), &used)); in DEFINE_TEST() 116 assertEqualInt(0, buff[7]); in DEFINE_TEST() 117 assertEqualMem(buff + 30, "abcABC", 6); in DEFINE_TEST() [all …]
|
H A D | test_write_format_iso9660_boot.c | 95 unsigned char *buff; in _test_write_format_iso9660_boot() local 101 buff = malloc(buffsize); in _test_write_format_iso9660_boot() 102 assert(buff != NULL); in _test_write_format_iso9660_boot() 112 assertA(0 == archive_write_open_memory(a, buff, buffsize, &used)); in _test_write_format_iso9660_boot() 138 assertEqualMem(buff+i, nullb, 2048); in _test_write_format_iso9660_boot() 143 assertEqualMem(buff+2048*16, primary_id, 8); in _test_write_format_iso9660_boot() 144 assertEqualMem(buff+2048*16+0x28, in _test_write_format_iso9660_boot() 146 assertEqualMem(buff+2048*16+0x50, volumesize, 8); in _test_write_format_iso9660_boot() 150 assertEqualMem(buff+2048*17, boot_id, sizeof(boot_id)); in _test_write_format_iso9660_boot() 153 assert(buff[2048*17+i] == 0); in _test_write_format_iso9660_boot() [all …]
|
H A D | test_gnutar_filename_encoding.c | 32 char buff[4096]; in DEFINE_TEST() local 53 archive_write_open_memory(a, buff, sizeof(buff), &used)); in DEFINE_TEST() 66 assertEqualMem(buff, "\xAF\xE0\xA8", 3); in DEFINE_TEST() 73 char buff[4096]; in DEFINE_TEST() local 94 archive_write_open_memory(a, buff, sizeof(buff), &used)); in DEFINE_TEST() 107 assertEqualMem(buff, "\xD0\xBF\xD1\x80\xD0\xB8", 6); in DEFINE_TEST() 114 char buff[4096]; in DEFINE_TEST() local 135 archive_write_open_memory(a, buff, sizeof(buff), &used)); in DEFINE_TEST() 148 assertEqualMem(buff, "\xAF\xE0\xA8", 3); in DEFINE_TEST() 155 char buff[4096]; in DEFINE_TEST() local [all …]
|
H A D | test_ustar_filename_encoding.c | 33 char buff[4096]; in DEFINE_TEST() local 54 archive_write_open_memory(a, buff, sizeof(buff), &used)); in DEFINE_TEST() 67 assertEqualMem(buff, "\xAF\xE0\xA8", 3); in DEFINE_TEST() 74 char buff[4096]; in DEFINE_TEST() local 95 archive_write_open_memory(a, buff, sizeof(buff), &used)); in DEFINE_TEST() 108 assertEqualMem(buff, "\xD0\xBF\xD1\x80\xD0\xB8", 6); in DEFINE_TEST() 115 char buff[4096]; in DEFINE_TEST() local 136 archive_write_open_memory(a, buff, sizeof(buff), &used)); in DEFINE_TEST() 149 assertEqualMem(buff, "\xAF\xE0\xA8", 3); in DEFINE_TEST() 156 char buff[4096]; in DEFINE_TEST() local [all …]
|
H A D | test_write_format_iso9660_zisofs.c | 100 unsigned char *buff; in test_write_format_iso9660_zisofs_1() local 107 buff = malloc(buffsize); in test_write_format_iso9660_zisofs_1() 108 assert(buff != NULL); in test_write_format_iso9660_zisofs_1() 109 if (buff == NULL) in test_write_format_iso9660_zisofs_1() 120 free(buff); in test_write_format_iso9660_zisofs_1() 124 assertEqualIntA(a, 0, archive_write_open_memory(a, buff, buffsize, &used)); in test_write_format_iso9660_zisofs_1() 197 assertEqualInt(buff[i], 0); in test_write_format_iso9660_zisofs_1() 202 assertEqualMem(buff+2048*16, primary_id, 8); in test_write_format_iso9660_zisofs_1() 203 assertEqualMem(buff+2048*16+0x28, in test_write_format_iso9660_zisofs_1() 205 assertEqualMem(buff+2048*16+0x50, volumesize, 8); in test_write_format_iso9660_zisofs_1() [all …]
|
H A D | test_read_format_7zip.c | 45 char buff[128]; in test_copy() local 69 assertEqualInt(60, archive_read_data(a, buff, sizeof(buff))); in test_copy() 70 assertEqualMem(buff, " ", 4); in test_copy() 169 char buff[128]; in test_plain_header() local 186 assertEqualInt(sizeof(buff), archive_read_data(a, buff, sizeof(buff))); in test_plain_header() 187 assertEqualMem(buff, "The libarchive distribution ", 28); in test_plain_header() 212 char buff[128]; in test_extract_all_files() local 229 assertEqualInt(13, archive_read_data(a, buff, sizeof(buff))); in test_extract_all_files() 230 assertEqualMem(buff, "aaaaaaaaaaaa\n", 13); in test_extract_all_files() 240 assertEqualInt(26, archive_read_data(a, buff, sizeof(buff))); in test_extract_all_files() [all …]
|
H A D | test_write_disk_secure744.c | 42 char *buff = malloc(buff_size); in DEFINE_TEST() 43 char *p = buff; in DEFINE_TEST() 47 assert(buff != NULL); in DEFINE_TEST() 56 while (p + 500 < buff + buff_size) { in DEFINE_TEST() 61 buff[0] = ((n / 1000) % 10) + '0'; in DEFINE_TEST() 62 buff[1] = ((n / 100) % 10)+ '0'; in DEFINE_TEST() 63 buff[2] = ((n / 10) % 10)+ '0'; in DEFINE_TEST() 64 buff[3] = ((n / 1) % 10)+ '0'; in DEFINE_TEST() 65 buff[4] = '_'; in DEFINE_TEST() 70 archive_entry_copy_pathname(ae, buff); in DEFINE_TEST() [all...] |
H A D | test_read_format_zip_winzip_aes_large.c | 33 char buff[512]; in DEFINE_TEST() local 71 assertEqualInt(ARCHIVE_FAILED, archive_read_data(a, buff, sizeof(buff))); in DEFINE_TEST() 81 assertEqualInt(ARCHIVE_FAILED, archive_read_data(a, buff, sizeof(buff))); in DEFINE_TEST() 91 assertEqualInt(ARCHIVE_FAILED, archive_read_data(a, buff, sizeof(buff))); in DEFINE_TEST() 101 assertEqualInt(ARCHIVE_FAILED, archive_read_data(a, buff, sizeof(buff))); in DEFINE_TEST() 140 assertEqualInt(512, archive_read_data(a, buff, sizeof(buff))); in DEFINE_TEST() 143 archive_read_data(a, buff, sizeof(buff))); in DEFINE_TEST() 158 assertEqualInt(512, archive_read_data(a, buff, sizeof(buff))); in DEFINE_TEST() 161 archive_read_data(a, buff, sizeof(buff))); in DEFINE_TEST() 176 assertEqualInt(512, archive_read_data(a, buff, sizeof(buff))); in DEFINE_TEST() [all …]
|
H A D | test_write_format_iso9660_empty.c | 54 unsigned char *buff; in DEFINE_TEST() local 59 buff = malloc(buffsize); in DEFINE_TEST() 60 assert(buff != NULL); in DEFINE_TEST() 61 if (buff == NULL) in DEFINE_TEST() 70 assertA(0 == archive_write_open_memory(a, buff, buffsize, &used)); in DEFINE_TEST() 140 assert(buff[i] == 0); in DEFINE_TEST() 145 assertEqualMem(buff+2048*16, primary_id, 8); in DEFINE_TEST() 146 assertEqualMem(buff+2048*16+0x28, in DEFINE_TEST() 148 assertEqualMem(buff+2048*16+0x50, volumesize, 8); in DEFINE_TEST() 153 assertEqualMem(buff+2048*17, supplementary_id, 8); in DEFINE_TEST() [all …]
|
H A D | test_tar_large.c | 54 void *buff; member 64 void *buff; member 76 static ssize_t memory_read(struct archive *, void *, const void **buff); 81 memory_write(struct archive *a, void *_private, const void *buff, size_t size) in memory_write() argument 95 if ((const char *)filedata <= (const char *)buff in memory_write() 96 && (const char *)buff < (const char *)filedata + filedatasize) { in memory_write() 105 block->buff = malloc(size); in memory_write() 106 memcpy(block->buff, buff, size); in memory_write() 119 memory_read(struct archive *a, void *_private, const void **buff) in memory_read() argument 127 free(private->buff); in memory_read() [all …]
|
H A D | test_write_format_zip_large.c | 45 void *buff; member 53 void *buff; member 66 static ssize_t memory_read(struct archive *, void *, const void **buff); 85 memory_write(struct archive *a, void *_private, const void *buff, size_t size) in memory_write() argument 92 if ((const char *)nulldata <= (const char *)buff in memory_write() 93 && (const char *)buff < (const char *)nulldata + nullsize) { in memory_write() 102 block->buff = malloc(size); in memory_write() 103 memcpy(block->buff, buff, size); in memory_write() 117 memory_read(struct archive *a, void *_private, const void **buff) in memory_read() argument 124 while (private->current != NULL && private->buff == NULL && private->gap_remaining == 0) { in memory_read() [all …]
|
H A D | test_write_format_iso9660_filename.c | 141 verify(unsigned char *buff, size_t used, enum vtype type, struct fns *fns) in verify() argument 159 assertEqualIntA(a, 0, archive_read_open_memory(a, buff, used)); in verify() 201 create_iso_image(unsigned char *buff, size_t buffsize, size_t *used, in create_iso_image() argument 227 assertA(0 == archive_write_open_memory(a, buff, buffsize, used)); in create_iso_image() 307 unsigned char *buff; in DEFINE_TEST() local 313 buff = malloc(buffsize); in DEFINE_TEST() 314 assert(buff != NULL); in DEFINE_TEST() 315 if (buff == NULL) in DEFINE_TEST() 322 fcnt = create_iso_image(buff, buffsize, &used, NULL); in DEFINE_TEST() 327 free(buff); in DEFINE_TEST() [all …]
|
/freebsd/contrib/lua/src/ |
H A D | lzio.h | 29 #define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0) argument 31 #define luaZ_buffer(buff) ((buff)->buffer) argument 32 #define luaZ_sizebuffer(buff) ((buff)->buffsize) argument 33 #define luaZ_bufflen(buff) ((buff)->n) argument 35 #define luaZ_buffremove(buff,i) ((buff)->n -= (i)) argument 36 #define luaZ_resetbuffer(buff) ((buff)->n = 0) argument 39 #define luaZ_resizebuffer(L, buff, size) \ argument 40 ((buff)->buffer = luaM_reallocvchar(L, (buff)->buffer, \ 41 (buff)->buffsize, size), \ 42 (buff)->buffsize = size) [all …]
|
H A D | lobject.c | 259 char buff[L_MAXLENNUM + 1]; in l_str2d() local 263 strcpy(buff, s); /* copy string to buffer */ in l_str2d() 264 buff[pdot - s] = lua_getlocaledecpoint(); /* correct decimal point */ in l_str2d() 265 endptr = l_str2dloc(buff, result, mode); /* try again */ in l_str2d() 267 endptr = s + (endptr - buff); /* make relative to 's' */ in l_str2d() 323 int luaO_utf8esc (char *buff, unsigned long x) { in luaO_utf8esc() argument 327 buff[UTF8BUFFSZ - 1] = cast_char(x); in luaO_utf8esc() 331 buff[UTF8BUFFSZ - (n++)] = cast_char(0x80 | (x & 0x3f)); in luaO_utf8esc() 335 buff[UTF8BUFFSZ - n] = cast_char((~mfb << 1) | x); /* add first byte */ in luaO_utf8esc() 355 static int tostringbuff (TValue *obj, char *buff) { in tostringbuff() argument [all …]
|
/freebsd/sys/contrib/openzfs/module/lua/ |
H A D | lzio.h | 29 #define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0) argument 31 #define luaZ_buffer(buff) ((buff)->buffer) argument 32 #define luaZ_sizebuffer(buff) ((buff)->buffsize) argument 33 #define luaZ_bufflen(buff) ((buff)->n) argument 35 #define luaZ_resetbuffer(buff) ((buff)->n = 0) argument 38 #define luaZ_resizebuffer(L, buff, size) \ argument 39 (luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \ 40 (buff)->buffsize = size) 42 #define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0) argument 45 LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n);
|
/freebsd/contrib/libarchive/tar/test/ |
H A D | test_print_longpath.c | 12 char buff[2048]; in DEFINE_TEST() local 19 memset(buff, 0, sizeof(buff)); in DEFINE_TEST() 23 strncat(buff, "0123456789", in DEFINE_TEST() 24 sizeof(buff) - strlen(buff) -1); in DEFINE_TEST() 25 strncat(buff, "/", sizeof(buff) - strlen(buff) -1); in DEFINE_TEST() 27 strncat(buff, "\n", sizeof(buff) - strlen(buff) -1); in DEFINE_TEST() 29 buff[sizeof(buff)-1] = '\0'; in DEFINE_TEST() 33 assertTextFileContents(buff, "test.out"); in DEFINE_TEST()
|
H A D | test_copy.c | 90 char buff[250]; in compute_filenames() local 99 buff[j] = 'a' + (j % 26); in compute_filenames() 100 buff[j--] = '\0'; in compute_filenames() 102 buff[j--] = '0' + (i % 10); in compute_filenames() 104 buff[j--] = '0' + ((i / 10) % 10); in compute_filenames() 106 buff[j--] = '0' + (char)(i / 100); in compute_filenames() 108 buff[j] = '_'; in compute_filenames() 110 assertEqualInt(strlen(buff), i); in compute_filenames() 111 filenames[i] = strdup(buff); in compute_filenames() 118 char buff[260]; in create_tree() local [all …]
|
H A D | test_option_r.c | 14 char *buff; in DEFINE_TEST() local 20 buff = NULL; in DEFINE_TEST() 44 buff = malloc(buff_size); in DEFINE_TEST() 45 assert(buff != NULL); in DEFINE_TEST() 46 if (buff == NULL) in DEFINE_TEST() 50 buff[i] = "abcdefghijklmnopqrstuvwxyz"[rand() % 26]; in DEFINE_TEST() 51 buff[buff_size - 1] = '\0'; in DEFINE_TEST() 52 assertMakeFile("f1", 0644, buff); in DEFINE_TEST() 69 assertEqualMem(p1 + 1536, buff, buff_size); in DEFINE_TEST() 110 assertFileContents(buff, (int)strlen(buff), "f1"); in DEFINE_TEST() [all …]
|
/freebsd/tests/sys/audit/ |
H A D | file-read.c | 32 static char buff[1024]; variable 47 memset(buff, 0, sizeof(buff)); in ATF_TC_BODY() 50 ATF_REQUIRE(readlink(path, buff, sizeof(buff)-1) != -1); in ATF_TC_BODY() 69 memset(buff, 0, sizeof(buff)); in ATF_TC_BODY() 72 ATF_REQUIRE_EQ(-1, readlink(path, buff, sizeof(buff)-1)); in ATF_TC_BODY() 91 memset(buff, 0, sizeof(buff)); in ATF_TC_BODY() 94 ATF_REQUIRE(readlinkat(AT_FDCWD, path, buff, sizeof(buff)-1) != -1); in ATF_TC_BODY() 113 memset(buff, 0, sizeof(buff)); in ATF_TC_BODY() 116 ATF_REQUIRE_EQ(-1, readlinkat(AT_FDCWD, path, buff, sizeof(buff)-1)); in ATF_TC_BODY()
|
/freebsd/contrib/llvm-project/compiler-rt/lib/sanitizer_common/ |
H A D | sanitizer_printf.cpp | 30 static int AppendChar(char **buff, const char *buff_end, char c) { in AppendChar() argument 31 if (*buff < buff_end) { in AppendChar() 32 **buff = c; in AppendChar() 33 (*buff)++; in AppendChar() 41 static int AppendNumber(char **buff, const char *buff_end, u64 absolute_value, in AppendNumber() argument 53 result += AppendChar(buff, buff_end, '-'); in AppendNumber() 71 result += AppendChar(buff, buff_end, c); in AppendNumber() 73 if (negative && !pad_with_zero) result += AppendChar(buff, buff_end, '-'); in AppendNumber() 77 result += AppendChar(buff, buff_end, digit); in AppendNumber() 82 static int AppendUnsigned(char **buff, const char *buff_end, u64 num, u8 base, in AppendUnsigned() argument [all …]
|
/freebsd/lib/libcam/ |
H A D | scsi_cmdparse.c | 103 do_buff_decode(uint8_t *buff, size_t len, in do_buff_decode() argument 191 bits = buff[ind++]; in do_buff_decode() 219 ARG_PUT(buff[ind]); in do_buff_decode() 224 ARG_PUT(buff[ind] << 8 | buff[ind + 1]); in do_buff_decode() 229 ARG_PUT(buff[ind] << 16 | in do_buff_decode() 230 buff[ind + 1] << 8 | buff[ind + 2]); in do_buff_decode() 235 ARG_PUT(buff[ind] << 24 | buff[ind + 1] << 16 | in do_buff_decode() 236 buff[ind + 2] << 8 | buff[ind + 3]); in do_buff_decode() 261 &buff[ind], width, field_name); in do_buff_decode() 265 bcopy(&buff[ind], dest, width); in do_buff_decode() [all …]
|
/freebsd/usr.sbin/ppp/ |
H A D | auth.c | 174 char *vector[6], buff[LINE_LEN]; in auth_SetPhoneList() local 181 while (fgets(buff, sizeof buff, fp)) { in auth_SetPhoneList() 183 if (buff[0] == '#') in auth_SetPhoneList() 185 buff[strlen(buff) - 1] = '\0'; in auth_SetPhoneList() 187 if ((n = MakeArgs(buff, vector, VECSIZE(vector), PARSE_REDUCE)) < 0) in auth_SetPhoneList() 219 char *vector[5], buff[LINE_LEN]; in auth_Select() local 242 while (fgets(buff, sizeof buff, fp)) { in auth_Select() 244 if (buff[0] == '#') in auth_Select() 246 buff[strlen(buff) - 1] = '\0'; in auth_Select() 248 if ((n = MakeArgs(buff, vector, VECSIZE(vector), PARSE_REDUCE)) < 0) in auth_Select() [all …]
|
/freebsd/tools/test/stress2/misc/ |
H A D | unix_socket.sh | 60 char buff[8192]; 78 strcpy (buff, "1234567890"); 79 if (send(fd, buff, strlen(buff)+1, 0) == -1) 83 if ((len = recv(fd, buff, 8192, 0)) < 0) 85 printf ("receive %d %s\n", len, buff); 101 char buff[8192]; 115 while ((len = recvfrom(fd, buff, 8192, 0, (struct sockaddr *)&from, 117 printf ("recvfrom: %s\n", buff); 118 strcpy (buff, "transmit good!"); 119 ret = sendto(fd, buff, strlen(buff)+1, 0,
|