diff --git a/main/main.cpp b/main/main.cpp index a5541a8..da3cfe1 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1,9 +1,9 @@ -#include - #include "add.h" #include "Bitmap.h" #include "Font.h" +#include + /** * @author: Julian Hinxlage * @since: v0.0.0 @@ -33,4 +33,4 @@ int main() { } return 0; -} \ No newline at end of file +} diff --git a/test/test_bitmap.cpp b/test/test_bitmap.cpp index a902711..b234e9d 100644 --- a/test/test_bitmap.cpp +++ b/test/test_bitmap.cpp @@ -1,9 +1,26 @@ #include -#include +#include "Bitmap.h" +#include "Font.h" TEST_CASE("default values") { Bitmap bitmap = Bitmap(); REQUIRE(bitmap.getWidth() == 0); REQUIRE(bitmap.getHeight() == 0); REQUIRE(bitmap.getBitsPerPixel() == 0); -} \ No newline at end of file +} + +TEST_CASE("load Bitmap") { + Bitmap bitmap = Bitmap("../res/font.bmp"); + REQUIRE(bitmap.getWidth() == 128); + REQUIRE(bitmap.getHeight() == 64); + REQUIRE(bitmap.getBitsPerPixel() == 24); +} + +TEST_CASE("Font") { + Font font("../res/font.bmp"); + REQUIRE(font.width() == 5); + REQUIRE(font.height() == 7); + REQUIRE(!font.getPixel('a', 1,1)); + REQUIRE(font.getPixel('a', 1,2)); +} +