authorgravatar for rb.lymn@gmail.comRobbie Lyman <rb.lymn@gmail.com> 2026-08-06 23:44:45-04:00
committergravatar for rb.lymn@gmail.comRobbie Lyman <rb.lymn@gmail.com> 2026-08-06 23:46:49-04:00
log16fbd314dc9590077267fc373b76b7c7b977977a
treefa3cb969251cb284e8b08b44011af632d7c40f83
parent89069b54d9f3a83ac675c6a18df2c4a52d019835

fix(Allocator): test style fixes


1 files changed, 13 insertions(+), 13 deletions(-)

lib/std/mem/Allocator.zig+13-13
......@@ -602,32 +602,32 @@ test failing {
602602test "free single-pointer to array" {
603603 const allocator = std.testing.allocator;
604604 {
605 const slice = allocator.alloc(u32, 128) catch return error.SkipZigTest;
606 slice[127] = 0;
607 const ptr = slice[0..127 :0];
605 const allocation = try allocator.alloc(u32, 128);
606 allocation[127] = 0;
607 const ptr: *[127:0]u32 = allocation[0..127 :0];
608608 allocator.free(ptr);
609609 }
610610 {
611 const slice = allocator.alloc(u32, 128) catch return error.SkipZigTest;
612 slice[127] = 0;
613 const ptr = slice[0..127 :0];
611 const allocation = try allocator.alloc(u32, 128);
612 allocation[127] = 0;
613 const ptr: *[127:0]u32 = allocation[0..127 :0];
614614 if (allocator.resize(ptr, 16)) {
615615 allocator.free(ptr[0..16]);
616616 } else allocator.free(ptr);
617617 }
618618 {
619 const slice = allocator.alloc(u32, 128) catch return error.SkipZigTest;
620 slice[127] = 0;
621 const ptr = slice[0..127 :0];
619 const allocation = try allocator.alloc(u32, 128);
620 allocation[127] = 0;
621 const ptr: *[127:0]u32 = allocation[0..127 :0];
622622 if (allocator.remap(ptr, 16)) |new| {
623623 allocator.free(new);
624624 } else allocator.free(ptr);
625625 }
626626 {
627 const slice = allocator.alloc(u32, 128) catch return error.SkipZigTest;
628 slice[127] = 0;
629 const ptr = slice[0..127 :0];
630 const new = allocator.realloc(ptr, 16) catch return error.SkipZigTest;
627 const allocation = try allocator.alloc(u32, 128);
628 allocation[127] = 0;
629 const ptr: *[127:0]u32 = allocation[0..127 :0];
630 const new = try allocator.realloc(ptr, 16);
631631 allocator.free(new);
632632 }
633633}