summaryrefslogtreecommitdiff
path: root/src/Normalize.zig
diff options
context:
space:
mode:
authorGravatar Sam Atman2025-04-30 20:30:39 -0400
committerGravatar Sam Atman2025-04-30 20:30:39 -0400
commit10048b0d31d0db923ae39c6bbd67139ed6252f6f (patch)
tree65df1666aacd102f59b4ac0844ccc7f7ddda91db /src/Normalize.zig
parentSetup variants for all allocating modules (diff)
downloadzg-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.zig15
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
675const std = @import("std"); 660const std = @import("std");
676const debug = std.debug; 661const debug = std.debug;
677const assert = debug.assert; 662const assert = debug.assert;