From 674f0194a3d33ba192bef875cbb91bec6d008fe3 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Fri, 29 Jul 2022 17:59:50 +0000 Subject: [PATCH] [repacker] add extension pairpos split test. --- src/test-repacker.cc | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/test-repacker.cc b/src/test-repacker.cc index affc416ee..053c0c603 100644 --- a/src/test-repacker.cc +++ b/src/test-repacker.cc @@ -1500,6 +1500,29 @@ static void test_resolve_with_basic_pair_pos_1_split () free (expected_buffer); } +static void test_resolve_with_extension_pair_pos_1_split () +{ + size_t buffer_size = 200000; + void* buffer = malloc (buffer_size); + assert (buffer); + hb_serialize_context_t c (buffer, buffer_size); + populate_serializer_with_large_pair_pos_1 <1, 4>(&c, true); + + void* expected_buffer = malloc (buffer_size); + assert (expected_buffer); + hb_serialize_context_t e (expected_buffer, buffer_size); + populate_serializer_with_large_pair_pos_1 <2, 2>(&e, true); + + run_resolve_overflow_test ("test_resolve_with_extension_pair_pos_1_split", + c, + e, + 20, + true, + HB_TAG('G', 'P', 'O', 'S')); + free (buffer); + free (expected_buffer); +} + static void test_resolve_overflows_via_splitting_spaces () { @@ -1649,9 +1672,7 @@ main (int argc, char **argv) test_shared_node_with_virtual_links (); test_resolve_with_extension_promotion (); test_resolve_with_basic_pair_pos_1_split (); - - // TODO: - // - splitting with extensions. + test_resolve_with_extension_pair_pos_1_split (); // TODO(grieger): test with extensions already mixed in as well. // TODO(grieger): test two layer ext promotion setup.