authorgravatar for 1@tse.gratisTse <1@tse.gratis> 2019-10-31 19:24:26+03:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-10-31 13:53:32-04:00
log00382f6dae83291468f0ba792f2cefc0216098da
treef4900c8e51005a655cd96e931bdde70eface3027
parent790d439ce22888145e5a2c33052fe114b56049d4

DragonFlyBSD tidyup


14 files changed, 9 insertions(+), 42 deletions(-)

lib/std/atomic/queue.zig-3
......@@ -152,9 +152,6 @@ const puts_per_thread = 500;
152152const put_thread_count = 3;
153153
154154test "std.atomic.Queue" {
155 // https://github.com/ziglang/zig/issues/3563
156 if (builtin.os == .dragonfly) return error.SkipZigTest;
157
158155 var plenty_of_memory = try std.heap.direct_allocator.alloc(u8, 300 * 1024);
159156 defer std.heap.direct_allocator.free(plenty_of_memory);
160157
lib/std/atomic/stack.zig-3
......@@ -86,9 +86,6 @@ const puts_per_thread = 500;
8686const put_thread_count = 3;
8787
8888test "std.atomic.stack" {
89 // https://github.com/ziglang/zig/issues/3563
90 if (builtin.os == .dragonfly) return error.SkipZigTest;
91
9289 var plenty_of_memory = try std.heap.direct_allocator.alloc(u8, 300 * 1024);
9390 defer std.heap.direct_allocator.free(plenty_of_memory);
9491
lib/std/event/channel.zig-3
......@@ -263,9 +263,6 @@ pub fn Channel(comptime T: type) type {
263263}
264264
265265test "std.event.Channel" {
266 // https://github.com/ziglang/zig/issues/3563
267 if (builtin.os == .dragonfly) return error.SkipZigTest;
268
269266 // https://github.com/ziglang/zig/issues/1908
270267 if (builtin.single_threaded) return error.SkipZigTest;
271268
lib/std/event/group.zig-3
......@@ -81,9 +81,6 @@ pub fn Group(comptime ReturnType: type) type {
8181}
8282
8383test "std.event.Group" {
84 // https://github.com/ziglang/zig/issues/3563
85 if (builtin.os == .dragonfly) return error.SkipZigTest;
86
8784 // https://github.com/ziglang/zig/issues/1908
8885 if (builtin.single_threaded) return error.SkipZigTest;
8986
lib/std/event/lock.zig-3
......@@ -117,9 +117,6 @@ pub const Lock = struct {
117117};
118118
119119test "std.event.Lock" {
120 // https://github.com/ziglang/zig/issues/3563
121 if (builtin.os == .dragonfly) return error.SkipZigTest;
122
123120 // TODO https://github.com/ziglang/zig/issues/1908
124121 if (builtin.single_threaded) return error.SkipZigTest;
125122
lib/std/fs.zig+3-3
......@@ -424,7 +424,7 @@ pub const Dir = struct {
424424 self.end_index = @intCast(usize, rc);
425425 }
426426 const darwin_entry = @ptrCast(*align(1) os.dirent, &self.buf[self.index]);
427 const next_index = self.index + darwin_entry.d_reclen;
427 const next_index = self.index + darwin_entry.reclen();
428428 self.index = next_index;
429429
430430 const name = @ptrCast([*]u8, &darwin_entry.d_name)[0..darwin_entry.d_namlen];
......@@ -473,7 +473,7 @@ pub const Dir = struct {
473473 self.end_index = @intCast(usize, rc);
474474 }
475475 const freebsd_entry = @ptrCast(*align(1) os.dirent, &self.buf[self.index]);
476 const next_index = self.index + freebsd_entry.d_reclen;
476 const next_index = self.index + freebsd_entry.reclen();
477477 self.index = next_index;
478478
479479 const name = @ptrCast([*]u8, &freebsd_entry.d_name)[0..freebsd_entry.d_namlen];
......@@ -529,7 +529,7 @@ pub const Dir = struct {
529529 self.end_index = rc;
530530 }
531531 const linux_entry = @ptrCast(*align(1) os.dirent64, &self.buf[self.index]);
532 const next_index = self.index + linux_entry.d_reclen;
532 const next_index = self.index + linux_entry.reclen();
533533 self.index = next_index;
534534
535535 const name = mem.toSlice(u8, @ptrCast([*]u8, &linux_entry.d_name));
lib/std/mutex.zig-3
......@@ -130,9 +130,6 @@ const TestContext = struct {
130130};
131131
132132test "std.Mutex" {
133 // https://github.com/ziglang/zig/issues/3563
134 if (builtin.os == .dragonfly) return error.SkipZigTest;
135
136133 var plenty_of_memory = try std.heap.direct_allocator.alloc(u8, 300 * 1024);
137134 defer std.heap.direct_allocator.free(plenty_of_memory);
138135
lib/std/os/bits/darwin.zig+1-1
......@@ -128,7 +128,7 @@ pub const dirent = extern struct {
128128 d_type: u8,
129129 d_name: u8, // field address is address of first byte of name
130130
131 pub fn reclen(self: dirent) usize {
131 pub fn reclen(self: dirent) u16 {
132132 return self.d_reclen;
133133 }
134134};
lib/std/os/bits/dragonfly.zig+2-2
......@@ -314,8 +314,8 @@ pub const dirent = extern struct {
314314 d_unused2: u32,
315315 d_name: [256]u8,
316316
317 pub fn reclen(self: dirent) usize {
318 return (@byteOffsetOf(dirent, "d_name") + self.d_namlen + 1 + 7) & ~usize(7);
317 pub fn reclen(self: dirent) u16 {
318 return (@byteOffsetOf(dirent, "d_name") + self.d_namlen + 1 + 7) & ~u16(7);
319319 }
320320};
321321
lib/std/os/bits/freebsd.zig+1-1
......@@ -133,7 +133,7 @@ pub const dirent = extern struct {
133133 d_pad1: u16,
134134 d_name: [256]u8,
135135
136 pub fn reclen(self: dirent) usize {
136 pub fn reclen(self: dirent) u16 {
137137 return self.d_reclen;
138138 }
139139};
lib/std/os/bits/linux.zig+1-1
......@@ -988,7 +988,7 @@ pub const dirent64 = extern struct {
988988 d_type: u8,
989989 d_name: u8, // field address is the address of first byte of name https://github.com/ziglang/zig/issues/173
990990
991 pub fn reclen(self: dirent) usize {
991 pub fn reclen(self: dirent) u16 {
992992 return self.d_reclen;
993993 }
994994};
lib/std/os/bits/netbsd.zig+1-1
......@@ -129,7 +129,7 @@ pub const dirent = extern struct {
129129 d_off: i64,
130130 d_name: [512]u8,
131131
132 pub fn reclen(self: dirent) usize {
132 pub fn reclen(self: dirent) u16 {
133133 return self.d_reclen;
134134 }
135135};
lib/std/os/test.zig-12
......@@ -16,9 +16,6 @@ const AtomicRmwOp = builtin.AtomicRmwOp;
1616const AtomicOrder = builtin.AtomicOrder;
1717
1818test "makePath, put some files in it, deleteTree" {
19 // https://github.com/ziglang/zig/issues/3563
20 if (builtin.os == .dragonfly) return error.SkipZigTest;
21
2219 try fs.makePath(a, "os_test_tmp" ++ fs.path.sep_str ++ "b" ++ fs.path.sep_str ++ "c");
2320 try io.writeFile("os_test_tmp" ++ fs.path.sep_str ++ "b" ++ fs.path.sep_str ++ "c" ++ fs.path.sep_str ++ "file.txt", "nonsense");
2421 try io.writeFile("os_test_tmp" ++ fs.path.sep_str ++ "b" ++ fs.path.sep_str ++ "file2.txt", "blah");
......@@ -31,9 +28,6 @@ test "makePath, put some files in it, deleteTree" {
3128}
3229
3330test "access file" {
34 // https://github.com/ziglang/zig/issues/3563
35 if (builtin.os == .dragonfly) return error.SkipZigTest;
36
3731 try fs.makePath(a, "os_test_tmp");
3832 if (File.access("os_test_tmp" ++ fs.path.sep_str ++ "file.txt")) |ok| {
3933 @panic("expected error");
......@@ -101,9 +95,6 @@ test "cpu count" {
10195}
10296
10397test "AtomicFile" {
104 // https://github.com/ziglang/zig/issues/3563
105 if (builtin.os == .dragonfly) return error.SkipZigTest;
106
10798 var buffer: [1024]u8 = undefined;
10899 const allocator = &std.heap.FixedBufferAllocator.init(buffer[0..]).allocator;
109100 const test_out_file = "tmp_atomic_file_test_dest.txt";
......@@ -124,9 +115,6 @@ test "AtomicFile" {
124115}
125116
126117test "thread local storage" {
127 // https://github.com/ziglang/zig/issues/3563
128 if (builtin.os == .dragonfly) return error.SkipZigTest;
129
130118 if (builtin.single_threaded) return error.SkipZigTest;
131119 const thread1 = try Thread.spawn({}, testTls);
132120 const thread2 = try Thread.spawn({}, testTls);
lib/std/statically_initialized_mutex.zig-3
......@@ -61,9 +61,6 @@ pub const StaticallyInitializedMutex = switch (builtin.os) {
6161};
6262
6363test "std.StaticallyInitializedMutex" {
64 // https://github.com/ziglang/zig/issues/3563
65 if (builtin.os == .dragonfly) return error.SkipZigTest;
66
6764 const TestContext = struct {
6865 data: i128,
6966