[clutter] conform/color: Test hsla() format



commit 889a1f44f422224c4d652256197b6358d2b74fc4
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Thu Nov 10 12:56:47 2011 +0000

    conform/color: Test hsla() format

 tests/conform/test-color.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/tests/conform/test-color.c b/tests/conform/test-color.c
index a0eab95..a6f4327 100644
--- a/tests/conform/test-color.c
+++ b/tests/conform/test-color.c
@@ -205,6 +205,20 @@ test_color_from_string (TestConformSimpleFixture *fixture,
   g_assert_cmpint (color.green, ==, 0);
   g_assert_cmpint (color.blue, ==, 0);
   g_assert_cmpint (color.alpha, ==, 255);
+
+  g_assert (clutter_color_from_string (&color, "hsla( 0, 100%, 50%, 0.5 )"));
+  if (g_test_verbose ())
+    {
+      g_print ("color = { %x, %x, %x, %x }, expected = { 255, 0, 0, 127 }\n",
+               color.red,
+               color.green,
+               color.blue,
+               color.alpha);
+    }
+  g_assert_cmpint (color.red, ==, 255);
+  g_assert_cmpint (color.green, ==, 0);
+  g_assert_cmpint (color.blue, ==, 0);
+  g_assert_cmpint (color.alpha, ==, 127);
 }
 
 void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]