Tests: Set a default font in BenchmarkGfxPainter to prevent crashes
After the changes to LibGfx to make default font management handled in WindowServer instead of each GUI application to allow for global font broadcasts, the two LibGfx tests broke. The non-benchmark was fixed in 8f96d2, but the benchmark was left in the dust because nobody really runs it manually :^(
This commit is contained in:
parent
ad0b8b42eb
commit
e4013f6cc6
Notes:
sideshowbarker
2024-07-18 10:17:50 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/e4013f6cc68 Pull-request: https://github.com/SerenityOS/serenity/pull/8351 Reviewed-by: https://github.com/bgianfo ✅
1 changed files with 10 additions and 0 deletions
|
@ -7,9 +7,19 @@
|
|||
#include <LibTest/TestCase.h>
|
||||
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/FontDatabase.h>
|
||||
#include <LibGfx/Painter.h>
|
||||
#include <stdio.h>
|
||||
|
||||
// Make sure that no matter what order tests are run in, we've got some
|
||||
// default fonts for the application to use without talking to WindowServer
|
||||
static struct FontDatabaseSpoofer {
|
||||
FontDatabaseSpoofer()
|
||||
{
|
||||
Gfx::FontDatabase::the().set_default_font_query("Katica 10 400"sv);
|
||||
}
|
||||
} g_spoof;
|
||||
|
||||
BENCHMARK_CASE(diagonal_lines)
|
||||
{
|
||||
const int run_count = 50;
|
||||
|
|
Loading…
Add table
Reference in a new issue