diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-02-09 21:56:55 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-02-09 21:57:11 -0800 |
commit | f3f6bc3f0142dcf06874523e9ac280234d89b501 (patch) | |
tree | 0c1bbfc6f81f7432a50fdc00d5c9e299b1fd7840 /baremetal/502test.mu | |
parent | dfa61e6299ef88aa9cb9a62fc114337a6a057f8a (diff) | |
download | mu-f3f6bc3f0142dcf06874523e9ac280234d89b501.tar.gz |
7706
Diffstat (limited to 'baremetal/502test.mu')
-rw-r--r-- | baremetal/502test.mu | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/baremetal/502test.mu b/baremetal/502test.mu index 3431bfa3..89d9b0e9 100644 --- a/baremetal/502test.mu +++ b/baremetal/502test.mu @@ -14,3 +14,27 @@ fn check-ints-equal _a: int, b: int, msg: (addr array byte) { fn test-check-ints-equal { check-ints-equal 0, 0, "abc" } + +fn check _a: boolean, msg: (addr array byte) { + var a/eax: int <- copy _a + compare a, 0/false + { + break-if-= + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ".", 3/fg/cyan, 0/bg + return + } + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, msg, 3/fg/cyan, 0/bg + count-test-failure +} + +fn check-not _a: boolean, msg: (addr array byte) { + var a/eax: int <- copy _a + compare a, 0/false + { + break-if-!= + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, ".", 3/fg/cyan, 0/bg + return + } + draw-text-wrapping-right-then-down-from-cursor-over-full-screen 0/screen, msg, 3/fg/cyan, 0/bg + count-test-failure +} |