Removed hildon-insert-object-dialog NB#8015
[hildon] / ut / hildon-widgets_tests.c
index c6ff3a2..cdcf882 100644 (file)
@@ -41,7 +41,6 @@
 #include <hildon-widgets/hildon-hvolumebar.h>
 #include <hildon-widgets/hildon-vvolumebar.h>
 #include <hildon-widgets/hildon-font-selection-dialog.h>
-#include <hildon-widgets/hildon-insert-object-dialog.h>
 #include <hildon-widgets/hildon-number-editor.h>
 #include <hildon-widgets/hildon-color-selector.h>
 #include <hildon-widgets/hildon-file-handling-note.h>
 #include <hildon-widgets/hildon-grid.h>
 #include <hildon-widgets/hildon-time-editor.h>
 #include <hildon-widgets/hildon-name-password-dialog.h>
+#include <hildon-widgets/hildon-caption.h>
 #include <outo.h>
 
 /* 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);
@@ -337,6 +337,13 @@ int test39b(void);
 #ifndef HILDON_DISABLE_DEPRECATED
 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! */
 testcase *get_tests(void);
@@ -2043,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){
@@ -2913,6 +2891,75 @@ int test39b()
    return 1;
 }
 
+int test42 ()
+{
+  GtkWidget *entry, *caption;
+
+  entry = gtk_entry_new ();
+  caption = hildon_caption_new (NULL /* group */,
+                               "caption text",
+                               GTK_WIDGET(entry), NULL,
+                               HILDON_CAPTION_OPTIONAL /* flag */);
+
+  g_assert (caption);
+  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},
@@ -3053,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},
@@ -3071,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},
@@ -3135,7 +3179,13 @@ testcase tcases[] =
     {*test39b, "namepassword dialog get_password", EXPECT_OK},
 /*    {*test38a, "gtk_confirmation_banner (sometext)", EXPECT_OK},
     {*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*/
 };
 
@@ -3148,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;
 }
-
-