diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-12-14 16:46:08 -0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-12-23 22:15:09 -0800 |
| commit | 4458e423bf2d2cf485031d1f527e407bfc9113df (patch) | |
| tree | 346c1463c8bbf76bf690a056e2851754e8661dae /lib/std/testing.zig | |
| parent | 2a40c1b556d7ed7811d3d2432dce8ba5d7c2e753 (diff) | |
| download | zig-4458e423bf2d2cf485031d1f527e407bfc9113df.tar.gz zig-4458e423bf2d2cf485031d1f527e407bfc9113df.zip | |
link.MappedFile: update statx usage
Diffstat (limited to 'lib/std/testing.zig')
| -rw-r--r-- | lib/std/testing.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/std/testing.zig b/lib/std/testing.zig index 64ea3d1a4d..be6f316804 100644 --- a/lib/std/testing.zig +++ b/lib/std/testing.zig @@ -1148,9 +1148,10 @@ pub fn checkAllAllocationFailures(backing_allocator: std.mem.Allocator, comptime break :x failing_allocator_inst.alloc_index; }; - var fail_index: usize = 0; - while (fail_index < needed_alloc_count) : (fail_index += 1) { - var failing_allocator_inst = std.testing.FailingAllocator.init(backing_allocator, .{ .fail_index = fail_index }); + for (0..needed_alloc_count) |fail_index| { + var failing_allocator_inst = std.testing.FailingAllocator.init(backing_allocator, .{ + .fail_index = fail_index, + }); args.@"0" = failing_allocator_inst.allocator(); if (@call(.auto, test_fn, args)) |_| { |
