diff options
| author | 2025-04-30 20:30:39 -0400 | |
|---|---|---|
| committer | 2025-04-30 20:30:39 -0400 | |
| commit | 10048b0d31d0db923ae39c6bbd67139ed6252f6f (patch) | |
| tree | 65df1666aacd102f59b4ac0844ccc7f7ddda91db /src/Normalize.zig | |
| parent | Setup variants for all allocating modules (diff) | |
| download | zg-10048b0d31d0db923ae39c6bbd67139ed6252f6f.tar.gz zg-10048b0d31d0db923ae39c6bbd67139ed6252f6f.tar.xz zg-10048b0d31d0db923ae39c6bbd67139ed6252f6f.zip | |
Allocation Failure Tests
These turned up an excessive amount of allocations in CanonData and
CompatData, which have been reduced to two through the somewhat
squirrely use of 'magic numbers'.
There are now allocation tests for every allocated structure in the
library, and they run to completion in a reasonable amount of time.
So, that's nice.
Diffstat (limited to 'src/Normalize.zig')
| -rw-r--r-- | src/Normalize.zig | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/Normalize.zig b/src/Normalize.zig index 1500b4c..989ec29 100644 --- a/src/Normalize.zig +++ b/src/Normalize.zig | |||
| @@ -657,21 +657,6 @@ test "isLatin1Only" { | |||
| 657 | try testing.expect(!isLatin1Only(not_latin1_only)); | 657 | try testing.expect(!isLatin1Only(not_latin1_only)); |
| 658 | } | 658 | } |
| 659 | 659 | ||
| 660 | // NOTE: These tests take way waaaaay too long to run, because | ||
| 661 | // the amount of allocations in a couple of the inflators is | ||
| 662 | // completely excessive and is also costing memory for metadata. | ||
| 663 | // I'm leaving this here for when I fix that. | ||
| 664 | // | ||
| 665 | // fn testAllocations(allocator: Allocator) !void { | ||
| 666 | // const norm = try Normalize.init(allocator); | ||
| 667 | // norm.deinit(allocator); | ||
| 668 | // } | ||
| 669 | // | ||
| 670 | // test "allocation failures" { | ||
| 671 | // if (true) return error.SkipZigTest; | ||
| 672 | // try testing.checkAllAllocationFailures(testing.allocator, testAllocations, .{}); | ||
| 673 | // } | ||
| 674 | |||
| 675 | const std = @import("std"); | 660 | const std = @import("std"); |
| 676 | const debug = std.debug; | 661 | const debug = std.debug; |
| 677 | const assert = debug.assert; | 662 | const assert = debug.assert; |