commit 15b2ec3e27920522fb32e26c8b18eb6728960d5a
Author: Jon Bell <jondbell@protonmail.com>
AuthorDate: Tue Apr 14 17:21:05 2020 -0600
Commit: Jon Bell <jondbell@protonmail.com>
CommitDate: Tue Apr 14 17:21:05 2020 -0600
Get full cart text test working
---
source/tests/cart_test.cpp | 105 +++++++++++++++++++++++++++++++++++++++++++--
source/tests/test_switch.h | 2 +-
2 files changed, 102 insertions(+), 5 deletions(-)
diff --git a/source/tests/cart_test.cpp b/source/tests/cart_test.cpp
index d45e368..9bd9bbd 100644
--- a/source/tests/cart_test.cpp
+++ b/source/tests/cart_test.cpp
@@ -1,12 +1,109 @@
#include <stdio.h>
-#include <3ds.h>
#include <string>
#include "cart_test.h"
+const char* full_cart_text = R"(pico-8 cartridge // http://www.pico-8.com
+version 18
+__lua__
+local r1x0 = 10
+local r1y0 = 10
+local r1x1 = 50
+local r1y1 = 50
+local r1c = 2
+
+local r2x0 = 60
+local r2y0 = 60
+local r2x1 = 100
+local r2y1 = 100
+local r2c = 3
+
+local r1dx = .5
+local r1dy = 2
+
+local r2dx = 2
+local r2dy = 2
+
+function _draw()
+ cls()
+
+ rectfill(0, 0, 127, 127, 0)
+
+ print("abcdefghijklmnopqrstuvwxyz", 0, 0, 7)
+
+ rectfill(50, -1, 60, 10, 11)
+
+ rectfill(r1x0, r1y0, r1x1, r1y1, r1c)
+
+ rect(r2x0, r2y0, r2x1, r2y1, r2c)
+
+ pset(40, 10, 13)
+
+ line(120, 10, 120, 120, 14)
+
+ line(0, 0, 20, 20, 15)
+
+ line(0, 20, 20, 0, 15)
+
+ line(20, 30, 0, 20, 12)
+
+ line(0, 30, 20, 20, 12)
+
+ circ(90, 90, 30, 8)
+
+ circfill(100, 100, 15, 9)
+
+ print("test str", 64, 64, 7)
+
+ spr(7, 40, 40, 1, 1, false, false)
+end
+
+function _update()
+ if (r1x0 < 0 or r1x1 > 127) then
+ r1dx = -1 * r1dx;
+ end
+ if (r1y0 < 0 or r1y1 > 127) then
+ r1dy = -1 * r1dy;
+ end
+ if (r2x0 < 0 or r2x1 > 127) then
+ r2dx = -1 * r2dx;
+ end
+ if (r2y0 < 0 or r2y1 > 127) then
+ r2dy = -1 * r2dy;
+ end
+ r1x0 = r1dx + r1x0
+ r1x1 = r1dx + r1x1
+ r1y0 = r1dy + r1y0
+ r1y1 = r1dy + r1y1
+end
+__gfx__
+e0000000000000000000000007700770000770000000000000000000000660005000000500000000000000000000000000000000000000000000000000000000
+00000000000000067000000078877887077777700500000000000050800660085005500500000000000000000000000000000000000000000000000000000000
+0070070000000006600000007888888707bbbb700500000000000050600550065055550500000000000000000000000000000000000000000000000000000000
+000770000000000660000000078888707bbbbbb70500000000000050600550065550055500000000000000000000000000000000000000000000000000000000
+000770000000000660000000078888707bbbbbb70500000550000050600660065555555500000000000000000000000000000000000000000000000000000000
+0070070000000066670000000078870007bbbb700500005555000050666cc66650b55b0500000000000000000000000000000000000000000000000000000000
+00000000008000666600080000077000077777700550055555500050666cc6665006600500000000000000000000000000000000000000000000000000000000
+0000000080d00065d6000d0800000000000770000555555555555550000660005000000500000000000000000000000000000000000000000000000000000000
+0b00080060d0006556000d0600000000000000000550055665500550000000000000000000000000000000000000000000000000000000000000000000000000
+0b00080060ddd065560ddd0600000000000000000500005555000050000000000000000000000000000000000000000000000000000000000000000000000000
+0b000800600ddd6556ddd00600000000000000000500008558000050000000000000000000000000000000000000000000000000000000000000000000000000
+0b000800666666666666666600000000000000000500000000000050000000000000000000000000000000000000000000000000000000000000000000000000
+00000000666866666666666600000000000000000500000000000050000000000000000000000000000000000000000000000000000000000000000000000000
+000000000666666cc666666000000000000000000500000000000050000000000000000000000000000000000000000000000000000000000000000000000000
+000000000006666cc666600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000666600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+)";
+
bool verifyFullCartText(std::string cartText){
- printf("test printing from cart_test.cpp\n");
- printf(cartText.c_str());
- return true;
+ bool equal = cartText == full_cart_text;
+ if (equal) {
+ printf("Full Cart Text: PASS;\n");
+ }
+ else {
+ printf("Full Cart Text: FAIL;\n");
+ }
+
+ return equal;
}
diff --git a/source/tests/test_switch.h b/source/tests/test_switch.h
index 609931e..1774f75 100644
--- a/source/tests/test_switch.h
+++ b/source/tests/test_switch.h
@@ -1,4 +1,4 @@
#pragma once
//if this is set to 1, test cases will be run on the test cart
-#define _TEST 1
\ No newline at end of file
+#define _TEST 1