Add option to insert a sorted arrays of values to sets.

This commit is contained in:
Andy John authored and Behdad Esfahbod committed 2022-03-21 15:32:59 -06:00
1 parent 7a1e79c3ba
commit ef588ea97b
4 files changed
+44 -2

No files matched your search

+19
View File
@@ -1067,6 +1067,23 @@ test_set_inverted_operations (void)
g_assert (all_succeeded);
}
static void
test_hb_set_add_sorted_array (void)
{
hb_set_t *set = hb_set_create ();
hb_codepoint_t array[7] = {1, 2, 3, 1000, 2000, 2001, 2002};
hb_set_add_sorted_array (set, array, 7);
g_assert_cmpint (hb_set_get_population (set), ==, 7);
g_assert (hb_set_has (set, 1));
g_assert (hb_set_has (set, 2));
g_assert (hb_set_has (set, 3));
g_assert (hb_set_has (set, 1000));
g_assert (hb_set_has (set, 2000));
g_assert (hb_set_has (set, 2001));
g_assert (hb_set_has (set, 2002));
hb_set_destroy (set);
}
int
main (int argc, char **argv)
{
@@ -1090,5 +1107,7 @@ main (int argc, char **argv)
hb_test_add (test_set_inverted_equality);
hb_test_add (test_set_inverted_operations);
hb_test_add (test_hb_set_add_sorted_array);
return hb_test_run();
}