Skip to content

Commit

Permalink
Leave a less strict version of the zeropage-max test
Browse files Browse the repository at this point in the history
  • Loading branch information
mysterymath committed Dec 18, 2024
1 parent 0efb4d4 commit 8cdb7ce
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions test/atari2600-common/zeropage-max.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,13 @@

// 128 bytes PIA RAM
// 32 bytes for registers
// 16 bytes for stack
// 16 bytes for stack (overestimate)
// 8 bytes for test result
char buf[128 - 32 - 16 - 8];

void test_recurse(int n) {
if (n == 0) {
return;
}
buf[0]++;
test_recurse(n - 1);
buf[0]--;
}

void test_zp_max() {
// set memory
memset(buf, 0x55, sizeof(buf));
// test 10 layers of recursion
test_recurse(10);
// compare memory
for (int i = 0; i < sizeof(buf); i++) {
if (buf[i] != 0x55) {
Expand Down

0 comments on commit 8cdb7ce

Please sign in to comment.