From 87ab64d291781d468c55c8dd54dd9182b80921fd Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 6 Jan 2009 15:30:31 +0000 Subject: [PATCH] [tests] Add unit for the ClutterText:password-char property Check that the contents of the Text actor are unaffected by the :password-char property; that the accessors are correct; and finally that the initial value for a newly constructed Text actor is valid. --- tests/conform/test-clutter-text.c | 19 +++++++++++++++++++ tests/conform/test-conform-main.c | 1 + 2 files changed, 20 insertions(+) diff --git a/tests/conform/test-clutter-text.c b/tests/conform/test-clutter-text.c index 20cdb538c..6814013a8 100644 --- a/tests/conform/test-clutter-text.c +++ b/tests/conform/test-clutter-text.c @@ -301,6 +301,25 @@ test_text_delete_text (TestConformSimpleFixture *fixture, clutter_actor_destroy (CLUTTER_ACTOR (text)); } +void +test_text_password_char (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterText *text = CLUTTER_TEXT (clutter_text_new ()); + + g_assert_cmpint (clutter_text_get_password_char (text), ==, 0); + + clutter_text_set_text (text, "hello"); + g_assert_cmpstr (clutter_text_get_text (text), ==, "hello"); + + clutter_text_set_password_char (text, '*'); + g_assert_cmpint (clutter_text_get_password_char (text), ==, '*'); + + g_assert_cmpstr (clutter_text_get_text (text), ==, "hello"); + + clutter_actor_destroy (CLUTTER_ACTOR (text)); +} + static void init_event (ClutterKeyEvent *event) { diff --git a/tests/conform/test-conform-main.c b/tests/conform/test-conform-main.c index abf6280b2..1b8d54c0f 100644 --- a/tests/conform/test-conform-main.c +++ b/tests/conform/test-conform-main.c @@ -82,6 +82,7 @@ main (int argc, char **argv) TEST_CONFORM_SIMPLE ("/text", test_text_event); TEST_CONFORM_SIMPLE ("/text", test_text_get_chars); TEST_CONFORM_SIMPLE ("/text", test_text_cache); + TEST_CONFORM_SIMPLE ("/text", test_text_password_char); TEST_CONFORM_SIMPLE ("/rectangle", test_rect_set_size); TEST_CONFORM_SIMPLE ("/rectangle", test_rect_set_color);