From: Behdad Esfahbod Date: Thu, 12 May 2011 01:12:44 +0000 (-0400) Subject: [test] Add tests for _get_empty() funcs X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b8477e1da2785708f3232f8f2577f602a5d320d1;p=platform%2Fupstream%2FlibHarfBuzzSharp.git [test] Add tests for _get_empty() funcs --- diff --git a/test/test-blob.c b/test/test-blob.c index 22d40b7..beb23a5 100644 --- a/test/test-blob.c +++ b/test/test-blob.c @@ -52,6 +52,7 @@ test_blob_empty (void) g_assert (hb_blob_is_immutable (hb_blob_get_empty ())); 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 (); g_assert (blob == hb_blob_get_empty ()); diff --git a/test/test-buffer.c b/test/test-buffer.c index 2b1c7b7..0cbb8e0 100644 --- a/test/test-buffer.c +++ b/test/test-buffer.c @@ -711,6 +711,12 @@ test_buffer_utf16_conversion (void) 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 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_validity); hb_test_add (test_buffer_utf16_conversion); + hb_test_add (test_buffer_empty); return hb_test_run(); } diff --git a/test/test-unicode.c b/test/test-unicode.c index f5aae10..2e15e95 100644 --- a/test/test-unicode.c +++ b/test/test-unicode.c @@ -550,6 +550,15 @@ test_unicode_properties_nil (void) 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 test_unicode_chainup (void) @@ -777,6 +786,7 @@ main (int argc, char **argv) hb_test_init (&argc, &argv); 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 ((gconstpointer) script_roundtrip_default, "default", test_unicode_script_roundtrip);