27 lines
680 B
C++
27 lines
680 B
C++
#include "Bitmap.hpp"
|
|
#include "Font.hpp"
|
|
#include <catch2/catch.hpp>
|
|
|
|
TEST_CASE("default values") {
|
|
Bitmap bitmap = Bitmap();
|
|
REQUIRE(bitmap.getWidth() == 0);
|
|
REQUIRE(bitmap.getHeight() == 0);
|
|
REQUIRE(bitmap.getBitsPerPixel() == 0);
|
|
}
|
|
|
|
TEST_CASE("load Bitmap") {
|
|
Bitmap bitmap = Bitmap("../res/font1.bmp");
|
|
REQUIRE(bitmap.getWidth() == 128);
|
|
REQUIRE(bitmap.getHeight() == 64);
|
|
REQUIRE(bitmap.getBitsPerPixel() == 24);
|
|
}
|
|
|
|
TEST_CASE("Font") {
|
|
Font font("../res/font1.bmp", "../res/font1.toml");
|
|
REQUIRE(font.width() == 5);
|
|
REQUIRE(font.height() == 7);
|
|
REQUIRE_FALSE(font.getPixel('a', 1,1));
|
|
REQUIRE(font.getPixel('a', 1,2));
|
|
}
|
|
|