commit bf0881b1647fe7977ba3a590eb67ca1874d1274b
Author: jtothebell <j.to.the.bell@gmail.com>
AuthorDate: Tue Sep 1 21:46:01 2020 -0600
Commit: jtothebell <j.to.the.bell@gmail.com>
CommitDate: Tue Sep 15 17:09:08 2020 -0600
add first basic spr test
---
test/graphicstests.cpp | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/test/graphicstests.cpp b/test/graphicstests.cpp
index 84a63a5..250e5f1 100644
--- a/test/graphicstests.cpp
+++ b/test/graphicstests.cpp
@@ -593,6 +593,26 @@ TEST_CASE("graphics class behaves as expected") {
CHECK(picoRam._gfxState_text_y == 18);
CHECK(picoRam._gfxState_color == 14);
}
+ SUBCASE("spr(...) draws to screen at location") {
+ graphics->cls();
+ for(uint8_t i = 0; i < 16; i++) {
+ graphics->sset(i % 8, i / 8, i%2 == 0 ? i : 0 );
+ }
+
+ graphics->spr(0, 101, 33, 1.0, 1.0, false, false);
+
+ std::vector<coloredPoint> expectedPoints = {
+ {103, 33, 2},
+ {105, 33, 4},
+ {107, 33, 6},
+ {101, 34, 8},
+ {103, 34, 10},
+ {105, 34, 12},
+ {107, 34, 14},
+ };
+
+ checkPoints(graphics, expectedPoints);
+ }