pkg/pixman: add more types

This commit is contained in:
Mitchell Hashimoto
2022-11-23 20:56:24 -08:00
parent ac4a45bdf3
commit 433d41fa9a
3 changed files with 19 additions and 1 deletions

View File

@ -108,3 +108,11 @@ test "bpp" {
try testing.expectEqual(@as(u32, 4), FormatCode.g4.bpp()); try testing.expectEqual(@as(u32, 4), FormatCode.g4.bpp());
try testing.expectEqual(@as(u32, 8), FormatCode.g8.bpp()); try testing.expectEqual(@as(u32, 8), FormatCode.g8.bpp());
} }
test "stride" {
const testing = std.testing;
try testing.expectEqual(@as(c_int, 4), FormatCode.g1.strideForWidth(10));
try testing.expectEqual(@as(c_int, 8), FormatCode.g4.strideForWidth(10));
try testing.expectEqual(@as(c_int, 12), FormatCode.g8.strideForWidth(10));
}

View File

@ -56,7 +56,7 @@ test "create and destroy" {
try testing.expect(img.unref()); try testing.expect(img.unref());
} }
test "fill boxes" { test "fill boxes a1" {
const testing = std.testing; const testing = std.testing;
const alloc = testing.allocator; const alloc = testing.allocator;

View File

@ -74,3 +74,13 @@ pub const Box32 = extern struct {
x2: i32, x2: i32,
y2: i32, y2: i32,
}; };
pub const Indexed = extern struct {
color: bool,
rgba: [256]u32,
ent: [32768]u8,
};
test {
std.testing.refAllDecls(@This());
}