fix a couple test failures

This commit is contained in:
Qwerasd
2024-05-08 14:47:01 -04:00
parent d4a7549222
commit 3156df261f
2 changed files with 5 additions and 5 deletions

View File

@ -42,8 +42,8 @@ fn getValue(ptr_raw: *anyopaque, value: anytype) bool {
ptr.* = @intCast(value); ptr.* = @intCast(value);
}, },
f32, f64 => { f32, f64 => |Float| {
const ptr: *f64 = @ptrCast(@alignCast(ptr_raw)); const ptr: *Float = @ptrCast(@alignCast(ptr_raw));
ptr.* = @floatCast(value); ptr.* = @floatCast(value);
}, },
@ -102,9 +102,9 @@ test "u8" {
defer c.deinit(); defer c.deinit();
c.@"font-size" = 24; c.@"font-size" = 24;
var cval: c_uint = undefined; var cval: f32 = undefined;
try testing.expect(get(&c, .@"font-size", &cval)); try testing.expect(get(&c, .@"font-size", &cval));
try testing.expectEqual(@as(c_uint, 24), cval); try testing.expectEqual(@as(f32, 24), cval);
} }
test "enum" { test "enum" {

View File

@ -125,7 +125,7 @@ pub const Descriptor = struct {
} }
if (self.size > 0) assert(pat.add( if (self.size > 0) assert(pat.add(
.size, .size,
.{ .integer = @round(self.size) }, .{ .integer = @intFromFloat(@round(self.size)) },
false, false,
)); ));
if (self.bold) assert(pat.add( if (self.bold) assert(pat.add(