98
98
assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
99
99
assertEqualInt(1, archive_entry_uid(ae));
100
100
assertEqualInt(2, archive_entry_gid(ae));
101
} else if (strcmp("hardlink", archive_entry_pathname(ae)) == 0) {
101
} else if (strcmp("file", archive_entry_pathname(ae)) == 0) {
102
102
/* A regular file. */
103
assertEqualString("hardlink", archive_entry_pathname(ae));
103
assertEqualString("file", archive_entry_pathname(ae));
104
104
assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
105
105
assertEqualInt(12345684, archive_entry_size(ae));
106
106
assertEqualInt(0,
112
112
assertEqualInt(2, archive_entry_stat(ae)->st_nlink);
113
113
assertEqualInt(1, archive_entry_uid(ae));
114
114
assertEqualInt(2, archive_entry_gid(ae));
115
} else if (strcmp("file", archive_entry_pathname(ae)) == 0) {
115
} else if (strcmp("hardlink", archive_entry_pathname(ae)) == 0) {
116
116
/* A hardlink to the regular file. */
117
117
/* Note: If "hardlink" gets returned before "file",
118
118
* then "hardlink" will get returned as a regular file
119
119
* and "file" will get returned as the hardlink.
120
120
* This test should tolerate that, since it's a
121
121
* perfectly permissible thing for libarchive to do. */
122
assertEqualString("file", archive_entry_pathname(ae));
122
assertEqualString("hardlink", archive_entry_pathname(ae));
123
123
assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
124
assertEqualString("hardlink", archive_entry_hardlink(ae));
124
assertEqualString("file", archive_entry_hardlink(ae));
125
125
assertEqualInt(0, archive_entry_size_is_set(ae));
126
126
assertEqualInt(0, archive_entry_size(ae));
127
127
assertEqualInt(86401, archive_entry_mtime(ae));