[test] Add tests for _get_empty() funcs

This commit is contained in:
Behdad Esfahbod 2011-05-11 21:12:44 -04:00
parent 3994be3ded
commit b8477e1da2
3 changed files with 18 additions and 0 deletions

View File

@ -52,6 +52,7 @@ test_blob_empty (void)
g_assert (hb_blob_is_immutable (hb_blob_get_empty ())); g_assert (hb_blob_is_immutable (hb_blob_get_empty ()));
g_assert (hb_blob_get_empty () != NULL); g_assert (hb_blob_get_empty () != NULL);
g_assert (hb_blob_get_empty () == hb_blob_create (NULL, 0, HB_MEMORY_MODE_READONLY, NULL, NULL));
blob = hb_blob_get_empty (); blob = hb_blob_get_empty ();
g_assert (blob == hb_blob_get_empty ()); g_assert (blob == hb_blob_get_empty ());

View File

@ -711,6 +711,12 @@ test_buffer_utf16_conversion (void)
hb_buffer_destroy (b); hb_buffer_destroy (b);
} }
static void
test_buffer_empty (void)
{
g_assert (hb_buffer_get_empty ());
g_assert (hb_buffer_create (-1) == hb_buffer_get_empty ());
}
int int
main (int argc, char **argv) main (int argc, char **argv)
@ -734,6 +740,7 @@ main (int argc, char **argv)
hb_test_add (test_buffer_utf8_conversion); hb_test_add (test_buffer_utf8_conversion);
hb_test_add (test_buffer_utf8_validity); hb_test_add (test_buffer_utf8_validity);
hb_test_add (test_buffer_utf16_conversion); hb_test_add (test_buffer_utf16_conversion);
hb_test_add (test_buffer_empty);
return hb_test_run(); return hb_test_run();
} }

View File

@ -550,6 +550,15 @@ test_unicode_properties_nil (void)
hb_unicode_funcs_destroy (uf); hb_unicode_funcs_destroy (uf);
} }
static void
test_unicode_properties_empty (void)
{
hb_unicode_funcs_t *uf = hb_unicode_funcs_get_empty ();
g_assert (hb_unicode_funcs_is_immutable (uf));
_test_unicode_properties_nil (uf);
}
static void static void
test_unicode_chainup (void) test_unicode_chainup (void)
@ -777,6 +786,7 @@ main (int argc, char **argv)
hb_test_init (&argc, &argv); hb_test_init (&argc, &argv);
hb_test_add (test_unicode_properties_nil); hb_test_add (test_unicode_properties_nil);
hb_test_add (test_unicode_properties_empty);
hb_test_add_data_flavor (hb_unicode_funcs_get_default (), "default", test_unicode_properties); hb_test_add_data_flavor (hb_unicode_funcs_get_default (), "default", test_unicode_properties);
hb_test_add_data_flavor ((gconstpointer) script_roundtrip_default, "default", test_unicode_script_roundtrip); hb_test_add_data_flavor ((gconstpointer) script_roundtrip_default, "default", test_unicode_script_roundtrip);