diff options
author | thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> | 2021-09-09 07:46:42 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-19 00:58:59 +0200 |
commit | 41ce6d0cd02c4adec9295eaf1bd13d76a5c845d8 (patch) | |
tree | 3647e4ee718f48b26e1677e57a136898d5e1f0ab /Tests | |
parent | dc65535b7c7cc1cd960f5133f1e3487c2d01c758 (diff) | |
download | serenity-41ce6d0cd02c4adec9295eaf1bd13d76a5c845d8.zip |
Tests: Conform font tests to new font format
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/LibGfx/TestFontHandling.cpp | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/Tests/LibGfx/TestFontHandling.cpp b/Tests/LibGfx/TestFontHandling.cpp index d856886e4e..a49f6648ba 100644 --- a/Tests/LibGfx/TestFontHandling.cpp +++ b/Tests/LibGfx/TestFontHandling.cpp @@ -40,7 +40,7 @@ TEST_CASE(test_clone) { u8 glyph_height = 1; u8 glyph_width = 1; - auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, Gfx::FontTypes::Default); + auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, 256); auto new_font = font->clone(); EXPECT(!new_font->name().is_null()); @@ -53,7 +53,7 @@ TEST_CASE(test_set_name) { u8 glyph_height = 1; u8 glyph_width = 1; - auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, Gfx::FontTypes::Default); + auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, 256); const char* name = "my newly created font"; font->set_name(name); @@ -66,7 +66,7 @@ TEST_CASE(test_set_family) { u8 glyph_height = 1; u8 glyph_width = 1; - auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, Gfx::FontTypes::Default); + auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, 256); const char* family = "my newly created font family"; font->set_family(family); @@ -79,7 +79,7 @@ TEST_CASE(test_set_glyph_width) { u8 glyph_height = 1; u8 glyph_width = 1; - auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, Gfx::FontTypes::Default); + auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, 256); size_t ch = 123; font->set_glyph_width(ch, glyph_width); @@ -91,7 +91,7 @@ TEST_CASE(test_set_glyph_spacing) { u8 glyph_height = 1; u8 glyph_width = 1; - auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, Gfx::FontTypes::Default); + auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, 256); u8 glyph_spacing = 8; font->set_glyph_spacing(glyph_spacing); @@ -99,23 +99,11 @@ TEST_CASE(test_set_glyph_spacing) EXPECT(font->glyph_spacing() == glyph_spacing); } -TEST_CASE(test_set_type) -{ - u8 glyph_height = 1; - u8 glyph_width = 1; - auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, Gfx::FontTypes::Default); - - auto type = Gfx::FontTypes::Default; - font->set_type(type); - - EXPECT(font->type() == type); -} - TEST_CASE(test_width) { u8 glyph_height = 1; u8 glyph_width = 1; - auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, Gfx::FontTypes::Default); + auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, 256); EXPECT(font->width("A") == glyph_width); } @@ -124,8 +112,7 @@ TEST_CASE(test_glyph_or_emoji_width) { u8 glyph_height = 1; u8 glyph_width = 1; - auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, Gfx::FontTypes::Default); - font->set_type(Gfx::FontTypes::Default); + auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, 256); EXPECT(font->glyph_or_emoji_width(0)); } @@ -140,7 +127,7 @@ TEST_CASE(test_write_to_file) { u8 glyph_height = 1; u8 glyph_width = 1; - auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, Gfx::FontTypes::Default); + auto font = Gfx::BitmapFont::create(glyph_height, glyph_width, true, 256); char path[] = "/tmp/new.font.XXXXXX"; EXPECT(mkstemp(path) != -1); |