aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-07-31 21:26:50 +0800
committerXan Lopez <xan@igalia.com>2012-07-31 21:27:27 +0800
commita9b77ec4948dd2db2b3aef808e29c97aaa782589 (patch)
treebd483a51402ea1845cfb8a037ccda841b64d275d
parent174d04e8e9d530d8b19eb47af23e1fcfb8f26a5c (diff)
downloadgsoc2013-epiphany-a9b77ec4948dd2db2b3aef808e29c97aaa782589.tar.gz
gsoc2013-epiphany-a9b77ec4948dd2db2b3aef808e29c97aaa782589.tar.zst
gsoc2013-epiphany-a9b77ec4948dd2db2b3aef808e29c97aaa782589.zip
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.
-rw-r--r--tests/ephy-encodings-test.c21
1 files changed, 21 insertions, 0 deletions
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
@@ -33,6 +33,24 @@
#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 ()
{
EphyEncodings *encodings;
@@ -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);