commit d45f5e55c08e5c3333232437a2fb99591508aa3a
Author: jtothebell <j.to.the.bell@gmail.com>
AuthorDate: Sat Sep 5 06:39:30 2020 -0600
Commit: jtothebell <j.to.the.bell@gmail.com>
CommitDate: Tue Sep 15 17:09:08 2020 -0600
add tests to verify camera() sets vals in memory
---
test/graphicstests.cpp | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/test/graphicstests.cpp b/test/graphicstests.cpp
index e7f6807..28f3ee9 100644
--- a/test/graphicstests.cpp
+++ b/test/graphicstests.cpp
@@ -964,6 +964,24 @@ TEST_CASE("graphics class behaves as expected") {
CHECK_EQ(result, 192);
}
+ SUBCASE("camera({x}, {y}) sets values in memory")
+ {
+ uint8_t x = 33;
+ uint8_t y = 120;
+ graphics->camera(x, y);
+
+ CHECK_EQ(picoRam._gfxState_camera_x, x);
+ CHECK_EQ(picoRam._gfxState_camera_y, y);
+ }
+ SUBCASE("camera() sets values in memory to 0")
+ {
+ picoRam._gfxState_camera_x = 33;
+ picoRam._gfxState_camera_y = 120;
+ graphics->camera();
+
+ CHECK_EQ(picoRam._gfxState_camera_x, 0);
+ CHECK_EQ(picoRam._gfxState_camera_y, 0);
+ }