Lines Matching refs:ae

40 static void create(struct archive_entry *ae, const char *msg)
48 assertEqualIntA(ad, 0, archive_write_header(ad, ae));
56 assert(0 == stat(archive_entry_pathname(ae), &st));
62 if (archive_entry_filetype(ae) == AE_IFDIR)
65 archive_entry_mode(ae) & ~UMASK & MODE_MASK);
69 static void create_reg_file(struct archive_entry *ae, const char *msg)
95 archive_entry_set_size(ae, sizeof(data));
96 archive_entry_set_mtime(ae, 123456789, 0);
97 assertEqualIntA(ad, 0, archive_write_header(ad, ae));
106 assertIsReg(archive_entry_pathname(ae), archive_entry_mode(ae) & 0777);
107 assertFileSize(archive_entry_pathname(ae), sizeof(data));
109 assertFileMtime(archive_entry_pathname(ae), 123456789, 0);
111 assertFileAtimeRecent(archive_entry_pathname(ae));
114 static void create_reg_file2(struct archive_entry *ae, const char *msg)
132 archive_entry_set_size(ae, datasize);
133 assertEqualIntA(ad, 0, archive_write_header(ad, ae));
142 assertIsReg(archive_entry_pathname(ae), archive_entry_mode(ae) & 0777);
143 assertFileSize(archive_entry_pathname(ae), i);
144 assertFileContents(data, datasize, archive_entry_pathname(ae));
148 static void create_reg_file3(struct archive_entry *ae, const char *msg)
158 archive_entry_set_size(ae, 5);
159 assertEqualIntA(ad, 0, archive_write_header(ad, ae));
168 assert(0 == stat(archive_entry_pathname(ae), &st));
169 failure("st.st_mode=%o archive_entry_mode(ae)=%o",
170 st.st_mode, archive_entry_mode(ae));
172 assertEqualInt(st.st_mode, (archive_entry_mode(ae) & ~UMASK));
178 static void create_reg_file4(struct archive_entry *ae, const char *msg)
187 assertEqualIntA(ad, 0, archive_write_header(ad, ae));
197 assert(0 == stat(archive_entry_pathname(ae), &st));
198 failure("st.st_mode=%o archive_entry_mode(ae)=%o",
199 st.st_mode, archive_entry_mode(ae));
201 assertEqualInt(st.st_mode, (archive_entry_mode(ae) & ~UMASK));
208 static void create_reg_file_win(struct archive_entry *ae, const char *msg)
220 archive_entry_set_size(ae, sizeof(data));
221 archive_entry_set_mtime(ae, 123456789, 0);
222 assertEqualIntA(ad, 0, archive_write_header(ad, ae));
231 l = strlen(archive_entry_pathname(ae));
234 strcpy(fname, archive_entry_pathname(ae));
241 failure("st.st_mode=%o archive_entry_mode(ae)=%o",
242 st.st_mode, archive_entry_mode(ae));
253 struct archive_entry *ae;
259 assert((ae = archive_entry_new()) != NULL);
260 archive_entry_copy_pathname(ae, "file");
261 archive_entry_set_mode(ae, S_IFREG | 0755);
262 create_reg_file(ae, "Test creating a regular file");
263 archive_entry_free(ae);
266 assert((ae = archive_entry_new()) != NULL);
267 archive_entry_copy_pathname(ae, "file2");
268 archive_entry_set_mode(ae, S_IFREG | 0755);
269 create_reg_file2(ae, "Test creating another regular file");
270 archive_entry_free(ae);
273 assert((ae = archive_entry_new()) != NULL);
274 archive_entry_copy_pathname(ae, "file3");
275 archive_entry_set_mode(ae, S_IFREG | 0755);
276 create_reg_file3(ae, "Regular file with size restriction");
277 archive_entry_free(ae);
280 assert((ae = archive_entry_new()) != NULL);
281 archive_entry_copy_pathname(ae, "file3");
282 archive_entry_set_mode(ae, S_IFREG | 0755);
283 create_reg_file4(ae, "Regular file with unspecified size");
284 archive_entry_free(ae);
287 assert((ae = archive_entry_new()) != NULL);
288 archive_entry_copy_pathname(ae, "file");
289 archive_entry_set_mode(ae, S_IFREG | 0724);
290 create(ae, "Test creating a file over an existing file.");
291 archive_entry_free(ae);
294 assert((ae = archive_entry_new()) != NULL);
295 archive_entry_copy_pathname(ae, "dir");
296 archive_entry_set_mode(ae, S_IFDIR | 0555);
297 create(ae, "Test creating a regular dir.");
298 archive_entry_free(ae);
301 assert((ae = archive_entry_new()) != NULL);
302 archive_entry_copy_pathname(ae, "file");
303 archive_entry_set_mode(ae, S_IFDIR | 0742);
304 create(ae, "Test creating a dir over an existing file.");
305 archive_entry_free(ae);
308 assert((ae = archive_entry_new()) != NULL);
309 archive_entry_copy_pathname(ae, "file");
310 archive_entry_set_mode(ae, S_IFREG | 0744);
311 create(ae, "Test creating a file over an existing dir.");
312 archive_entry_free(ae);
316 assert((ae = archive_entry_new()) != NULL);
317 archive_entry_copy_pathname(ae, "f:i*l?e\"f<i>l|e");
318 archive_entry_set_mode(ae, S_IFREG | 0755);
319 create_reg_file_win(ae, "Test creating a regular file"
321 archive_entry_free(ae);
324 assert((ae = archive_entry_new()) != NULL);
325 archive_entry_copy_pathname(ae, "d:i*r?e\"c<t>o|ry/file1");
326 archive_entry_set_mode(ae, S_IFREG | 0755);
327 create_reg_file_win(ae, "Test creating a regular file"
329 archive_entry_free(ae);