fix(tests): correctly deinit font faces
parent
cfedd477b2
commit
5319d38366
|
|
@ -714,15 +714,18 @@ test "add full" {
|
|||
) });
|
||||
}
|
||||
|
||||
try testing.expectError(error.CollectionFull, c.add(
|
||||
alloc,
|
||||
.regular,
|
||||
.{ .loaded = try Face.init(
|
||||
lib,
|
||||
testFont,
|
||||
.{ .size = .{ .points = 12 } },
|
||||
) },
|
||||
));
|
||||
var face = try Face.init(
|
||||
lib,
|
||||
testFont,
|
||||
.{ .size = .{ .points = 12 } },
|
||||
);
|
||||
// We have to deinit it manually since the
|
||||
// collection doesn't do it if adding fails.
|
||||
defer face.deinit();
|
||||
try testing.expectError(
|
||||
error.CollectionFull,
|
||||
c.add(alloc, .regular, .{ .loaded = face }),
|
||||
);
|
||||
}
|
||||
|
||||
test "add deferred without loading options" {
|
||||
|
|
|
|||
|
|
@ -425,7 +425,8 @@ test "fontconfig" {
|
|||
try testing.expect(n.len > 0);
|
||||
|
||||
// Load it and verify it works
|
||||
const face = try def.load(lib, .{ .size = .{ .points = 12 } });
|
||||
var face = try def.load(lib, .{ .size = .{ .points = 12 } });
|
||||
defer face.deinit();
|
||||
try testing.expect(face.glyphIndex(' ') != null);
|
||||
}
|
||||
|
||||
|
|
@ -456,6 +457,7 @@ test "coretext" {
|
|||
try testing.expect(n.len > 0);
|
||||
|
||||
// Load it and verify it works
|
||||
const face = try def.load(lib, .{ .size = .{ .points = 12 } });
|
||||
var face = try def.load(lib, .{ .size = .{ .points = 12 } });
|
||||
defer face.deinit();
|
||||
try testing.expect(face.glyphIndex(' ') != null);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue