library/test/area_test.cpp

24 lines
594 B
C++
Raw Normal View History

#include "../src/vkvm.hpp"
#include <catch2/catch.hpp>
TEST_CASE("AREA") {
vkvm::initialize(0);
vkvm::setMode(vkvm::RGB);
vkvm::setWidth(200);
vkvm::setHeight(200);
SECTION("inside bounds") {
REQUIRE(vkvm::setPixel(100, 100, vkvm::white));
REQUIRE(vkvm::getPixel(100, 100) == vkvm::white);
}
SECTION("Out of bounds") {
REQUIRE(!vkvm::setPixel(400, 400, vkvm::white));
REQUIRE(vkvm::getPixel(400, 400) == vkvm::black);
vkvm::setBackgroundColor(vkvm::blue);
REQUIRE(vkvm::getPixel(400, 400) == vkvm::blue);
}
}