summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2018-11-25 01:14:40 -0500
committerBehdad Esfahbod <behdad@behdad.org>2018-11-25 01:16:02 -0500
commit926f512f354835f8323bb2c2e58789dd918a9b65 (patch)
tree74f6f7a424c25beb86aa7df8211a4dc1a2bfebe8 /test
parent84dacbca7ea54a3ca2d5d711d50272a7f3baf456 (diff)
[aat.feat] Rework API and implementation
Fixes https://github.com/harfbuzz/harfbuzz/pull/1346
Diffstat (limited to 'test')
-rw-r--r--test/api/test-aat-layout.c58
1 files changed, 30 insertions, 28 deletions
diff --git a/test/api/test-aat-layout.c b/test/api/test-aat-layout.c
index 516b4619..358fac87 100644
--- a/test/api/test-aat-layout.c
+++ b/test/api/test-aat-layout.c
@@ -52,51 +52,53 @@ test_aat_get_feature_types (void)
static void
test_aat_get_feature_selectors (void)
{
- hb_aat_layout_feature_selector_t default_selector;
- hb_aat_layout_feature_selector_t settings[3];
+ unsigned int default_index;
+ hb_aat_layout_feature_selector_info_t settings[3];
unsigned int count = 3;
- g_assert_cmpuint (4, ==, hb_aat_layout_feature_type_get_selectors (face, HB_AAT_LAYOUT_FEATURE_TYPE_DESIGN_COMPLEXITY_TYPE,
- &default_selector, 0, &count, settings));
+ g_assert_cmpuint (4, ==, hb_aat_layout_feature_type_get_selector_infos (face,
+ HB_AAT_LAYOUT_FEATURE_TYPE_DESIGN_COMPLEXITY_TYPE,
+ 0, &count, settings,
+ &default_index));
g_assert_cmpuint (3, ==, count);
- g_assert_cmpuint (0, ==, default_selector);
+ g_assert_cmpuint (0, ==, default_index);
- g_assert_cmpuint (0, ==, settings[0]);
- g_assert_cmpuint (294, ==, hb_aat_layout_feature_selector_get_name_id (face, HB_AAT_LAYOUT_FEATURE_TYPE_DESIGN_COMPLEXITY_TYPE, settings[0]));
+ g_assert_cmpuint (0, ==, settings[0].enable);
+ g_assert_cmpuint (294, ==, settings[0].name_id);
- g_assert_cmpuint (1, ==, settings[1]);
- g_assert_cmpuint (295, ==, hb_aat_layout_feature_selector_get_name_id (face, HB_AAT_LAYOUT_FEATURE_TYPE_DESIGN_COMPLEXITY_TYPE, settings[1]));
+ g_assert_cmpuint (1, ==, settings[1].enable);
+ g_assert_cmpuint (295, ==, settings[1].name_id);
- g_assert_cmpuint (2, ==, settings[2]);
- g_assert_cmpuint (296, ==, hb_aat_layout_feature_selector_get_name_id (face, HB_AAT_LAYOUT_FEATURE_TYPE_DESIGN_COMPLEXITY_TYPE, settings[2]));
-
- g_assert_cmpuint (HB_OT_NAME_ID_INVALID, ==, hb_aat_layout_feature_selector_get_name_id (face, HB_AAT_LAYOUT_FEATURE_TYPE_DESIGN_COMPLEXITY_TYPE, HB_AAT_LAYOUT_FEATURE_SELECTOR_INVALID));
+ g_assert_cmpuint (2, ==, settings[2].enable);
+ g_assert_cmpuint (296, ==, settings[2].name_id);
count = 3;
- g_assert_cmpuint (4, ==, hb_aat_layout_feature_type_get_selectors (face, HB_AAT_LAYOUT_FEATURE_TYPE_DESIGN_COMPLEXITY_TYPE,
- &default_selector, 3, &count, settings));
+ g_assert_cmpuint (4, ==, hb_aat_layout_feature_type_get_selector_infos (face,
+ HB_AAT_LAYOUT_FEATURE_TYPE_DESIGN_COMPLEXITY_TYPE,
+ 3, &count, settings,
+ &default_index));
g_assert_cmpuint (1, ==, count);
- g_assert_cmpuint (0, ==, default_selector);
+ g_assert_cmpuint (0, ==, default_index);
- g_assert_cmpuint (3, ==, settings[0]);
- g_assert_cmpuint (297, ==, hb_aat_layout_feature_selector_get_name_id (face, HB_AAT_LAYOUT_FEATURE_TYPE_DESIGN_COMPLEXITY_TYPE, settings[0]));
+ g_assert_cmpuint (3, ==, settings[0].enable);
+ g_assert_cmpuint (297, ==, settings[0].name_id);
count = 1;
- g_assert_cmpuint (1, ==, hb_aat_layout_feature_type_get_selectors (face, HB_AAT_LAYOUT_FEATURE_TYPE_TYPOGRAPHIC_EXTRAS,
- &default_selector, 0, &count, settings));
+ g_assert_cmpuint (1, ==, hb_aat_layout_feature_type_get_selector_infos (face,
+ HB_AAT_LAYOUT_FEATURE_TYPE_TYPOGRAPHIC_EXTRAS,
+ 0, &count, settings,
+ &default_index));
g_assert_cmpuint (1, ==, count);
- g_assert_cmpuint (HB_AAT_LAYOUT_FEATURE_TYPE_INVALID, ==, default_selector);
+ g_assert_cmpuint (HB_AAT_LAYOUT_NO_SELECTOR_INDEX, ==, default_index);
- g_assert_cmpuint (8, ==, settings[0]);
- g_assert_cmpuint (308, ==, hb_aat_layout_feature_selector_get_name_id (face, HB_AAT_LAYOUT_FEATURE_TYPE_TYPOGRAPHIC_EXTRAS, settings[0]));
+ g_assert_cmpuint (8, ==, settings[0].enable);
+ g_assert_cmpuint (308, ==, settings[0].name_id);
count = 100;
- g_assert_cmpuint (0, ==, hb_aat_layout_feature_type_get_selectors (face, HB_AAT_LAYOUT_FEATURE_TYPE_INVALID,
- NULL, 0, &count, settings));
+ g_assert_cmpuint (0, ==, hb_aat_layout_feature_type_get_selector_infos (face, HB_AAT_LAYOUT_FEATURE_TYPE_INVALID,
+ 0, &count, settings,
+ NULL));
g_assert_cmpuint (0, ==, count);
-
- g_assert_cmpuint (HB_OT_NAME_ID_INVALID, ==, hb_aat_layout_feature_selector_get_name_id (sbix, HB_AAT_LAYOUT_FEATURE_TYPE_INVALID,
- (hb_aat_layout_feature_selector_t) 0));
}
int