initial upload

This commit is contained in:
Rosia E Evans 2025-03-30 18:46:31 +01:00 committed by GitHub
parent 3e1e8b073b
commit a31d83cbc5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 312 additions and 0 deletions

View file

@ -0,0 +1,32 @@
#include <catch2/catch_test_macros.hpp>
#include "../../../src/screens/VirtualScreen/BufferIterator.h"
TEST_CASE("BufferIterator correctly steps through byte") {
UBYTE buffer = 0b00001111;
BufferIterator* iter = new BufferIterator(&buffer, 0);
int results[8] = {0, 0, 0, 0, 1, 1, 1, 1};
for (int i=0; i<8; i++)
{
REQUIRE(iter->next() == results[i]);
}
}
TEST_CASE("BufferIterator correctly steps up a byte") {
UBYTE buffer[2] = {0b00001111, 0b00001111};
BufferIterator* iter = new BufferIterator(buffer,0 );
int results[8] = {0, 0, 0, 0, 1, 1, 1, 1};
for (int i=0; i<8; i++)
{
iter->next();
}
for (int i=0; i<8; i++)
{
REQUIRE(iter->next() == results[i]);
}
}