diff options
| author | Rami Ali <flowergrass@users.noreply.github.com> | 2016-12-13 15:47:58 +1100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2016-12-13 16:29:21 +1100 |
| commit | 9112b0b62b4bd0139e0c94971fdb89dab61b1668 (patch) | |
| tree | 36915c66b63a3f78bacefc4355d65b59e73a5312 /tests/extmod/framebuf1.py | |
| parent | 0f408bc1ff9585ec66431176c993c369cd686a2e (diff) | |
tests/extmod: Improve modframebuf test coverage.
Diffstat (limited to 'tests/extmod/framebuf1.py')
| -rw-r--r-- | tests/extmod/framebuf1.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/extmod/framebuf1.py b/tests/extmod/framebuf1.py index 7f09050b0..cdc7e5b18 100644 --- a/tests/extmod/framebuf1.py +++ b/tests/extmod/framebuf1.py @@ -48,11 +48,21 @@ fbuf.fill(0) fbuf.rect(1, 1, 3, 3, 1) print('rect', buf) +#fill rect +fbuf.fill(0) +fbuf.fill_rect(1, 1, 3, 3, 1) +print('fill_rect', buf) + # line fbuf.fill(0) fbuf.line(1, 1, 3, 3, 1) print('line', buf) +# line steep negative gradient +fbuf.fill(0) +fbuf.line(3, 3, 2, 1, 1) +print('line', buf) + # scroll fbuf.fill(0) fbuf.pixel(2, 7, 1) @@ -78,6 +88,12 @@ print(buf) fbuf.text(str(chr(31)), 0, 0) print(buf) +# test invalid constructor +try: + fbuf = framebuf.FrameBuffer(buf, w, h, 2, framebuf.MVLSB) +except ValueError: + print("ValueError") + # test legacy constructor fbuf = framebuf.FrameBuffer1(buf, w, h) fbuf = framebuf.FrameBuffer1(buf, w, h, w) |
