2019-11-29 11:39:40 +01:00
|
|
|
#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") {
|
|
|
|
|
2019-12-04 10:14:31 +01:00
|
|
|
REQUIRE_FALSE(vkvm::setPixel(400, 400, vkvm::white));
|
2019-11-29 11:39:40 +01:00
|
|
|
REQUIRE(vkvm::getPixel(400, 400) == vkvm::black);
|
|
|
|
|
|
|
|
vkvm::setBackgroundColor(vkvm::blue);
|
|
|
|
|
|
|
|
REQUIRE(vkvm::getPixel(400, 400) == vkvm::blue);
|
|
|
|
}
|
|
|
|
}
|