2019-11-29 11:39:40 +01:00
|
|
|
#include "../src/vkvm.hpp"
|
|
|
|
#include <catch2/catch.hpp>
|
|
|
|
|
|
|
|
TEST_CASE("AREA") {
|
|
|
|
vkvm::initialize(0);
|
|
|
|
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);
|
|
|
|
|
2019-12-05 09:49:54 +01:00
|
|
|
REQUIRE_FALSE(vkvm::setPixel(-5, -5, vkvm::white));
|
|
|
|
REQUIRE(vkvm::getPixel(-5, -5) == vkvm::black);
|
|
|
|
|
2019-11-29 11:39:40 +01:00
|
|
|
vkvm::setBackgroundColor(vkvm::blue);
|
|
|
|
|
|
|
|
REQUIRE(vkvm::getPixel(400, 400) == vkvm::blue);
|
|
|
|
}
|
|
|
|
}
|