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

Function test_read_pixels_sync

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

Source from the content-addressed store, hash-verified

307
308#[test]
309fn test_read_pixels_sync() {
310 Tester::new(size(10, 12))
311 .op(|l| l.set_draw_color((120, 40, 180)))
312 .op(|l| l.fill(xy(4, 2), xy(5, 4)).unwrap())
313 .op(|l| {
314 let size = SizeInPixels::new(2, 3);
315 let data = l.read_pixels(PixelsXY { x: 3, y: 1 }, size).unwrap();
316 let exp_pixels = vec![0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 40, 180, 0, 0, 0, 120, 40, 180];
317 assert_eq!((exp_pixels, size), data);
318 })
319 .expect_op("set_data: from=(4, 2), to=(5, 4), data=[120, 40, 180, 120, 40, 180, 120, 40, 180, 120, 40, 180, 120, 40, 180, 120, 40, 180]")
320 .ignore_pixels()
321 .check();
322}
323
324#[test]
325fn test_read_pixels_no_sync() {

Callers

nothing calls this directly

Calls 9

ignore_pixelsMethod · 0.80
expect_opMethod · 0.80
opMethod · 0.80
fillMethod · 0.80
sizeFunction · 0.70
xyFunction · 0.70
checkMethod · 0.45
set_draw_colorMethod · 0.45
read_pixelsMethod · 0.45

Tested by

no test coverage detected