MCPcopy Index your code
hub / github.com/endbasic/endbasic / test_present_canvas

Function test_present_canvas

std/src/gfx/lcd/buffered/tests.rs:218–233  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

216
217#[test]
218fn test_present_canvas() {
219 Tester::new(size(10, 20))
220 .op(|l| {
221 l.set_sync(false);
222 l.set_draw_color((1, 2, 3));
223 l.draw_pixel(PixelsXY::new(5, 6)).unwrap();
224 l.present_canvas().unwrap();
225 l.set_draw_color((7, 8, 9));
226 l.draw_pixel(PixelsXY::new(0, 0)).unwrap();
227 })
228 .expect_pixel(xy(5, 6), (1, 2, 3))
229 .expect_pixel(xy(0, 0), (7, 8, 9))
230 .expect_damage(xy(0, 0), xy(0, 0))
231 .expect_op("set_data: from=(5, 6), to=(5, 6), data=[1, 2, 3]")
232 .check();
233}
234
235#[derive(Clone, Copy)]
236struct LossyPixel([u8; 1]);

Callers

nothing calls this directly

Calls 11

expect_opMethod · 0.80
expect_damageMethod · 0.80
expect_pixelMethod · 0.80
opMethod · 0.80
sizeFunction · 0.70
xyFunction · 0.70
checkMethod · 0.45
set_syncMethod · 0.45
set_draw_colorMethod · 0.45
draw_pixelMethod · 0.45
present_canvasMethod · 0.45

Tested by

no test coverage detected