mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:07:36 +00:00
LibGfx/WOFF: Ensure header totalSfntSize
matches expected value
This commit is contained in:
parent
7ee09ca49d
commit
c2112cde76
4 changed files with 37 additions and 0 deletions
27
Tests/LibGfx/TestWOFF.cpp
Normal file
27
Tests/LibGfx/TestWOFF.cpp
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Tim Ledbetter <timledbetter@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibGfx/Font/WOFF/Font.h>
|
||||
#include <LibTest/TestCase.h>
|
||||
|
||||
#ifdef AK_OS_SERENITY
|
||||
# define TEST_INPUT(x) ("/usr/Tests/LibGfx/test-inputs/" x)
|
||||
#else
|
||||
# define TEST_INPUT(x) ("test-inputs/" x)
|
||||
#endif
|
||||
|
||||
TEST_CASE(malformed_woff)
|
||||
{
|
||||
Array test_inputs = {
|
||||
TEST_INPUT("woff/invalid_sfnt_size.woff"sv)
|
||||
};
|
||||
|
||||
for (auto test_input : test_inputs) {
|
||||
auto file = MUST(Core::MappedFile::map(test_input));
|
||||
auto font_or_error = WOFF::Font::try_load_from_externally_owned_memory(file->bytes());
|
||||
EXPECT(font_or_error.is_error());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue