summaryrefslogtreecommitdiff
path: root/tests/testcolor.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-06-28 04:15:40 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-06-28 04:15:40 +0000
commit249615a89cc1594e7c16b5cc5004f63ca9eb36b6 (patch)
treec8d0e13454759394355c16ec94b31d14f3f671f1 /tests/testcolor.c
parentc463e096e119abb9b65b74c078ee1f2b1aae8c30 (diff)
parent034273de5cbe867348fa687845c8e63dc44a7148 (diff)
downloadpango-249615a89cc1594e7c16b5cc5004f63ca9eb36b6.tar.gz
Merge branch 'test-coverage' into 'master'
Add better attribute test infrastructure See merge request GNOME/pango!346
Diffstat (limited to 'tests/testcolor.c')
-rw-r--r--tests/testcolor.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/testcolor.c b/tests/testcolor.c
index 62bbe4bf..b32eb6ee 100644
--- a/tests/testcolor.c
+++ b/tests/testcolor.c
@@ -122,12 +122,42 @@ test_color (void)
test_one_color (spec);
}
+static void
+test_color_copy (void)
+{
+ PangoColor orig = { 0, 200, 5000 };
+ PangoColor *copy;
+
+ copy = pango_color_copy (&orig);
+
+ g_assert_cmpint (orig.red, ==, copy->red);
+ g_assert_cmpint (orig.green, ==, copy->green);
+ g_assert_cmpint (orig.blue, ==, copy->blue);
+
+ pango_color_free (copy);
+}
+
+static void
+test_color_serialize (void)
+{
+ PangoColor orig = { 0, 200, 5000 };
+ char *string;
+
+ string = pango_color_to_string (&orig);
+
+ g_assert_cmpstr (string, ==, "#000000c81388");
+
+ g_free (string);
+}
+
int
main (int argc, char *argv[])
{
g_test_init (&argc, &argv, NULL);
g_test_add_func ("/color/parse", test_color);
+ g_test_add_func ("/color/copy", test_color_copy);
+ g_test_add_func ("/color/serialize", test_color_serialize);
return g_test_run ();
}