Skip to content

Commit

Permalink
Add a few more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Grazfather committed Jan 25, 2025
1 parent 2e3b742 commit 63de581
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/base/Clock_Device.zig
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,15 @@ test Test_Device {
try std.testing.expect(!td.is_reached(@enumFromInt(4)));
ttd.elapse_time(2);
try std.testing.expect(td.is_reached(@enumFromInt(4)));

// Timeouts
try std.testing.expectEqual(
54,
@intFromEnum(td.make_timeout(mdf.time.Duration.from_us(50))),
);
ttd.elapse_time(50);
try std.testing.expectEqual(
104,
@intFromEnum(td.make_timeout_us(50)),
);
}

0 comments on commit 63de581

Please sign in to comment.