From a9b77ec4948dd2db2b3aef808e29c97aaa782589 Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Tue, 31 Jul 2012 15:26:50 +0200 Subject: tests: test the creation of a EphyEncoding object We should make the test-elided and collation-key properties be computed automatically from the other parameters. --- tests/ephy-encodings-test.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'tests') diff --git a/tests/ephy-encodings-test.c b/tests/ephy-encodings-test.c index d89c7b96e..791b99066 100644 --- a/tests/ephy-encodings-test.c +++ b/tests/ephy-encodings-test.c @@ -32,6 +32,24 @@ /* TODO: don't hardcode the number of encodings in ephy-encodings.c here! */ #define NUM_ENCODINGS 78 +static void +test_ephy_encodings_create () +{ + EphyEncoding *encoding; + + encoding = ephy_encoding_new ("UTF-8", "Unicode (UTF-8)", + "0xDEADBEEF", "0xDEADBEEF", + LG_UNICODE); + g_assert (encoding); + g_assert_cmpstr (ephy_encoding_get_encoding (encoding), ==, "UTF-8"); + g_assert_cmpstr (ephy_encoding_get_title (encoding), ==, "Unicode (UTF-8)"); + g_assert_cmpstr (ephy_encoding_get_title_elided (encoding), ==, "0xDEADBEEF"); + g_assert_cmpstr (ephy_encoding_get_collation_key (encoding), ==, "0xDEADBEEF"); + g_assert_cmpint (ephy_encoding_get_language_groups (encoding), ==, LG_UNICODE); + + g_object_unref (encoding); +} + static void test_ephy_encodings_get () { @@ -74,6 +92,9 @@ main (int argc, char *argv[]) _ephy_shell_create_instance (EPHY_EMBED_SHELL_MODE_TEST); g_assert (ephy_shell); + g_test_add_func ("/src/ephy-encodings/create", + test_ephy_encodings_create); + g_test_add_func ("/src/ephy-encodings/get", test_ephy_encodings_get); -- cgit v1.2.3