foxygit / fake-08-xbox360 Log in
commit 8209fc57c5c8bff265aeb0316194271ef6e12373
Author:     jtothebell <j.to.the.bell@gmail.com>
AuthorDate: Tue Sep 8 08:02:54 2020 -0600
Commit:     jtothebell <j.to.the.bell@gmail.com>
CommitDate: Tue Sep 15 17:09:08 2020 -0600

    add cursor tests
---
 test/graphicstests.cpp | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/test/graphicstests.cpp b/test/graphicstests.cpp
index 452ecc2..860aaa8 100644
--- a/test/graphicstests.cpp
+++ b/test/graphicstests.cpp
@@ -1572,6 +1572,27 @@ TEST_CASE("graphics class behaves as expected") {

         checkPoints(graphics, expectedPoints);
     }
+    SUBCASE("cursor({x}, {y}) sets cursor loc in memory"){
+        graphics->cursor(4, 13);
+
+        CHECK_EQ(picoRam._gfxState_text_x, 4);
+        CHECK_EQ(picoRam._gfxState_text_y, 13);
+    }
+    SUBCASE("cursor({x}, {y}, {c}) sets cursor loc in memory and color"){
+        graphics->cursor(42, 99, 3);
+
+        CHECK_EQ(picoRam._gfxState_text_x, 42);
+        CHECK_EQ(picoRam._gfxState_text_y, 99);
+        CHECK_EQ(picoRam._gfxState_color, 3);
+    }
+    SUBCASE("cursor() resets cursor but not color"){
+        graphics->cursor(42, 99, 3);
+        graphics->cursor();
+
+        CHECK_EQ(picoRam._gfxState_text_x, 0);
+        CHECK_EQ(picoRam._gfxState_text_y, 0);
+        CHECK_EQ(picoRam._gfxState_color, 3);
+    }


     //general teardown