X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=ut%2Fhildon-widgets_tests.c;h=6e8846ac5d8b183108308a24484268249b105af3;hb=4b651d572b5b1007d0578bd14ec188e19c2850ec;hp=a423dc3092051fc5939935992be7ea25fc1316e3;hpb=79b4e8a6e6363ecf1dc0c867f33735aed41e0f97;p=hildon diff --git a/ut/hildon-widgets_tests.c b/ut/hildon-widgets_tests.c index a423dc3..6e8846a 100644 --- a/ut/hildon-widgets_tests.c +++ b/ut/hildon-widgets_tests.c @@ -1,14 +1,14 @@ /* * This file is part of hildon-libs * - * Copyright (C) 2005 Nokia Corporation. + * Copyright (C) 2005, 2006 Nokia Corporation, all rights reserved. * - * Contact: Luc Pionchon + * Contact: Michael Dominic Kostrzewa * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. + * as published by the Free Software Foundation; version 2.1 of + * the License or any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -54,7 +53,7 @@ #include /* Icon which must exist (HildonGridItem). */ -#define VALID_ICON "Help" +#define VALID_ICON "qgn_list_gene_default_app" /*prototypes to keep the compiler happy*/ testcase *get_tests(void); @@ -340,6 +339,10 @@ int test41a(void); #endif int test42 (void); +int test43 (void); +int test44 (void); +int test45 (void); +int test46 (void); /* this has to be like this (not static). outo calls for this! */ @@ -2047,35 +2050,6 @@ int fsd_get_pretext(void) assert( str!=NULL ); return 1; } -/* insert object dialog: new */ -int test27a(void){ - GtkWidget *dialog; - dialog = hildon_insert_object_dialog_new(NULL); - g_assert(dialog); - return 1; -} - -/* insert object dialog: get_name */ -int test27b(void){ - const gchar *string; - GtkWidget *dialog; - - dialog = hildon_insert_object_dialog_new(NULL); - string = hildon_insert_object_dialog_get_name(HILDON_INSERT_OBJECT_DIALOG(dialog)); - g_assert(string); - return 1; -} - -/* insert object dialog: get_mime_type */ -int test27c(void){ - const gchar *string; - GtkWidget *dialog; - - dialog = hildon_insert_object_dialog_new(NULL); - string = hildon_insert_object_dialog_get_mime_type(HILDON_INSERT_OBJECT_DIALOG(dialog)); - g_assert(string); - return 1; -} /* hildon_number_editor_new */ int test28a(void){ @@ -2931,6 +2905,61 @@ int test42 () return 1; } +int test43 () +{ + GtkWidget *dialog; + + dialog = hildon_get_password_dialog_new (NULL, TRUE); + g_assert (dialog); + + dialog = hildon_get_password_dialog_new (NULL, FALSE); + g_assert (dialog); + + return 1; +} + +int test44 () +{ + GtkWidget *dialog; + + dialog = hildon_get_password_dialog_new_with_default (NULL, "seekrit", + TRUE); + g_assert (dialog); + + dialog = hildon_get_password_dialog_new_with_default (NULL, "seekrit", + FALSE); + g_assert (dialog); + + return 1; +} + +int test45 () +{ + GtkWidget *dialog; + + dialog = hildon_calendar_popup_new (NULL, 1973, 5, 11); + + g_assert (dialog); + + return 1; +} + +int test46 () +{ + GtkWidget *dialog; + + dialog = hildon_add_home_dialog_new (NULL, "oldname", "newname"); + + g_assert (dialog); + + dialog = hildon_add_home_dialog_new (NULL, "oldname", NULL); + + g_assert (dialog); + + return 1; +} + + testcase tcases[] = { {*test1a, "hildon_controlbar_new", EXPECT_OK}, @@ -3071,9 +3100,6 @@ testcase tcases[] = #endif {*fsd_set_pretext, "FontSelectionDialog Set preview text", EXPECT_OK}, {*fsd_get_pretext, "FontSelectionDialog Get preview text", EXPECT_OK}, - {*test27a, "hildon_insert_object: new", EXPECT_OK}, - {*test27b, "hildon_insert_object: get_name", EXPECT_OK}, - {*test27c, "hildon_insert_object: get_mime_type", EXPECT_ASSERT}, {*test28a, "hildon_number_editor_new", EXPECT_OK}, {*test28b, "hildon_number_editor_get_value", EXPECT_OK}, {*test28c, "hildon_number_editor_set_range", EXPECT_OK}, @@ -3089,11 +3115,11 @@ testcase tcases[] = {*test32a, "hildon_rename_dialog: ok", EXPECT_OK}, {*test32b, "hildon_rename_dialog: NULL(ok)", EXPECT_OK}, {*test33a1, "grid_item_new (\"foo\")", EXPECT_OK}, - {*test33a2, "grid_item_new (NULL)", EXPECT_ASSERT}, + {*test33a2, "grid_item_new (NULL)", EXPECT_OK}, {*test33b1, "grid_item_new_label (\"foo\", \"bar\")", EXPECT_OK}, {*test33b2, "grid_item_new_label (\"foo\", NULL)", EXPECT_OK}, - {*test33b3, "grid_item_new_label (NULL, \"bar\")", EXPECT_ASSERT}, - {*test33b4, "grid_item_new_label (NULL, NULL)", EXPECT_ASSERT}, + {*test33b3, "grid_item_new_label (NULL, \"bar\")", EXPECT_OK}, + {*test33b4, "grid_item_new_label (NULL, NULL)", EXPECT_OK}, {*test33c1, "grid_item_set_emblem (foo, \"bar\")", EXPECT_OK}, {*test33c2, "grid_item_set_emblem (foo, NULL)", EXPECT_OK}, {*test33c3, "grid_item_set_emblem (NULL, \"bar\")", EXPECT_ASSERT}, @@ -3155,6 +3181,10 @@ testcase tcases[] = {*test38a, "gtk_confirmation_banner (NULL)", EXPECT_OK},*/ { test42, "hildon_caption_new", EXPECT_OK }, + { test43, "hildon_get_password_dialog_new", EXPECT_OK }, + { test44, "hildon_get_password_dialog_new_with_default", EXPECT_OK }, + { test45, "hildon_calendor_popup_new", EXPECT_OK }, + { test46, "hildon_add_home_dialog_new", EXPECT_OK }, {0} /*REMEMBER THE TERMINATING NULL*/ }; @@ -3168,5 +3198,3 @@ testcase* get_tests() g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING); return tcases; } - -