2023-10-23 16:48:15 -04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2023, Tim Ledbetter <timledbetter@gmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
2024-07-22 07:03:58 -04:00
|
|
|
#include <LibGfx/Font/WOFF/Loader.h>
|
2023-10-23 16:48:15 -04:00
|
|
|
#include <LibTest/TestCase.h>
|
|
|
|
|
2024-07-04 17:39:15 -04:00
|
|
|
#define TEST_INPUT(x) ("test-inputs/" x)
|
2023-10-23 16:48:15 -04:00
|
|
|
|
|
|
|
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));
|
2024-07-22 07:03:58 -04:00
|
|
|
auto font_or_error = WOFF::try_load_from_externally_owned_memory(file->bytes());
|
2023-10-23 16:48:15 -04:00
|
|
|
EXPECT(font_or_error.is_error());
|
|
|
|
}
|
|
|
|
}
|