[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.
This commit is contained in:
Emmanuele Bassi 2009-01-06 15:30:31 +00:00
parent c4475c6bfc
commit 87ab64d291
2 changed files with 20 additions and 0 deletions

View File

@ -301,6 +301,25 @@ test_text_delete_text (TestConformSimpleFixture *fixture,
clutter_actor_destroy (CLUTTER_ACTOR (text)); 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 static void
init_event (ClutterKeyEvent *event) init_event (ClutterKeyEvent *event)
{ {

View File

@ -82,6 +82,7 @@ main (int argc, char **argv)
TEST_CONFORM_SIMPLE ("/text", test_text_event); TEST_CONFORM_SIMPLE ("/text", test_text_event);
TEST_CONFORM_SIMPLE ("/text", test_text_get_chars); TEST_CONFORM_SIMPLE ("/text", test_text_get_chars);
TEST_CONFORM_SIMPLE ("/text", test_text_cache); 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_size);
TEST_CONFORM_SIMPLE ("/rectangle", test_rect_set_color); TEST_CONFORM_SIMPLE ("/rectangle", test_rect_set_color);