2 * This file is part of hildon-libs
4 * Copyright (C) 2005 Nokia Corporation.
6 * Contact: Luc Pionchon <luc.pionchon@nokia.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
31 #include "hildon-controlbar.h"
32 #include "hildon-seekbar.h"
33 #include "hildon-note.h"
34 #include <hildon-widgets/gtk-infoprint.h>
35 #include <hildon-widgets/hildon-weekday-picker.h>
36 #include <hildon-widgets/hildon-telephone-editor.h>
37 #include <hildon-widgets/hildon-range-editor.h>
38 #include <hildon-widgets/hildon-sort-dialog.h>
39 #include <hildon-widgets/hildon-get-password-dialog.h>
40 #include <hildon-widgets/hildon-set-password-dialog.h>
41 #include <hildon-widgets/hildon-hvolumebar.h>
42 #include <hildon-widgets/hildon-vvolumebar.h>
43 #include <hildon-widgets/hildon-font-selection-dialog.h>
44 #include <hildon-widgets/hildon-insert-object-dialog.h>
45 #include <hildon-widgets/hildon-number-editor.h>
46 #include <hildon-widgets/hildon-color-selector.h>
47 #include <hildon-widgets/hildon-file-handling-note.h>
48 #include <hildon-widgets/hildon-add-home-dialog.h>
49 #include <hildon-widgets/hildon-grid-item.h>
50 #include <hildon-widgets/hildon-grid.h>
51 #include <hildon-widgets/hildon-time-editor.h>
52 #include <hildon-widgets/hildon-name-password-dialog.h>
53 #include <hildon-widgets/hildon-file-details-dialog.h>
56 /* Icon which must exist (HildonGridItem). */
57 #define VALID_ICON "Help"
59 /*prototypes to keep the compiler happy*/
60 testcase *get_tests(void);
144 /* telephone editor */
171 /* find object dialog */
177 /* find object options dialog */
213 /* get / get old password dialog */
219 /* set / change password dialog */
226 /*FontSelectionDialog*/
227 #ifndef HILDON_DISABLE_DEPRECATED
228 int fsd_set_font(void);
229 int fsd_get_font(void);
231 int fsd_set_pretext(void);
232 int fsd_get_pretext(void);
248 /* FontHandlingNote */
254 /* Add to Home / Rename dialog */
309 /* Time/Duration Editor */
323 /* New infoprint/banner functionalities. */
328 /* namepassworddialog */
332 /* file details dialog */
333 #ifndef HILDON_DISABLE_DEPRECATED
336 /* this has to be like this (not static). outo
338 testcase *get_tests(void);
339 void init_test( void )
342 gtk_init (&plop, NULL);
347 HildonControlbar *controlBar;
348 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
356 HildonControlbar *controlBar;
359 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
360 hildon_controlbar_set_max(controlBar, max);
361 assert(hildon_controlbar_get_max(controlBar) == max);
367 HildonControlbar *controlBar;
371 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
372 hildon_controlbar_set_max(controlBar, max);
373 hildon_controlbar_set_value(controlBar, value);
374 assert(hildon_controlbar_get_value(controlBar) == value);
380 HildonControlbar *controlBar;
382 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
383 gtk_widget_destroy(GTK_WIDGET(controlBar));
390 HildonControlbar *controlBar;
392 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
393 hildon_controlbar_set_min(controlBar, 5);
394 getmin = hildon_controlbar_get_min (controlBar);
395 assert (getmin == 5);
404 HildonControlbar *controlBar;
406 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
407 hildon_controlbar_set_range (controlBar, min, max);
416 HildonControlbar *controlBar;
418 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
419 hildon_controlbar_set_range (controlBar, 57, 219);
420 minval = hildon_controlbar_get_min (controlBar);
421 maxval = hildon_controlbar_get_max (controlBar);
422 assert (minval == 57);
423 assert (maxval == 219);
431 HildonControlbar *controlBar;
433 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
434 hildon_controlbar_set_range (controlBar, 250, 550);
435 hildon_controlbar_set_value (controlBar, 100);
437 value = hildon_controlbar_get_value (controlBar);
439 assert (value == 250);
447 HildonControlbar *controlBar;
449 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
450 hildon_controlbar_set_range (controlBar, 250, 550);
451 hildon_controlbar_set_value (controlBar, 650);
453 value = hildon_controlbar_get_value (controlBar);
455 assert (value == 550);
463 seekBar = hildon_seekbar_new();
473 seekBar = hildon_seekbar_new();
474 hildon_seekbar_set_total_time(HILDON_SEEKBAR(seekBar), totalTime);
475 assert(hildon_seekbar_get_total_time(HILDON_SEEKBAR(seekBar)) == totalTime);
485 seekBar = hildon_seekbar_new();
486 hildon_seekbar_set_total_time(HILDON_SEEKBAR(seekBar), totalTime);
487 hildon_seekbar_set_position(HILDON_SEEKBAR(seekBar), position);
488 assert(hildon_seekbar_get_position(HILDON_SEEKBAR(seekBar)) == position);
496 seekBar = hildon_seekbar_new();
497 gtk_widget_destroy(GTK_WIDGET(seekBar));
506 seekBar = hildon_seekbar_new();
507 hildon_seekbar_set_total_time(HILDON_SEEKBAR(seekBar), totalTime);
508 hildon_seekbar_set_fraction(HILDON_SEEKBAR(seekBar), 200);
509 assert(hildon_seekbar_get_fraction(HILDON_SEEKBAR(seekBar)) == 200);
516 gtk_infoprint(NULL,"infoprint");
523 gtk_infoprint(NULL, NULL);
530 gtk_infoprint_with_icon_stock(NULL, "infoprint", GTK_STOCK_DIALOG_QUESTION);
537 gtk_infoprint_with_icon_stock(NULL, "infoprint", "");
544 gtk_infoprint_with_icon_stock(NULL, "infoprint", NULL);
551 gtk_infoprintf (NULL, "mambo %d", 2+3);
558 gtk_infoprintf (NULL, NULL);
565 gtk_confirmation_banner (NULL, "Insert our favourite testing text here.", NULL);
571 gtk_confirmation_banner (NULL, NULL, NULL);
577 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
578 gtk_banner_show_animation (win, "Insert our favourite testing text here.");
579 gtk_banner_set_text (win, "Insert our second favourite testing text here.");
580 gtk_banner_set_text (win, "");
581 gtk_banner_set_text (win, NULL);
582 gtk_banner_close (win);
583 gtk_widget_destroy (GTK_WIDGET (win));
589 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
590 gtk_banner_show_animation (win, "Insert our favourite testing text here.");
591 gtk_banner_set_fraction (win, 0.5);
592 gtk_banner_set_fraction (win, -0.5);
593 gtk_banner_set_fraction (win, 1.5);
594 gtk_banner_close (win);
595 gtk_widget_destroy (GTK_WIDGET (win));
601 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
602 gtk_banner_show_animation (win, "Insert our favourite testing text here.");
603 gtk_banner_close (win);
604 gtk_banner_close (win);
605 gtk_widget_destroy (GTK_WIDGET (win));
611 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
612 gtk_banner_show_animation (win, "Insert our favourite testing text here.");
613 gtk_widget_destroy (GTK_WIDGET (win));
619 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
620 gtk_banner_show_bar (win, "Insert our favourite testing text here.");
621 gtk_banner_set_text (win, "Insert our second favourite testing text here.");
622 gtk_banner_set_text (win, "");
623 gtk_banner_set_text (win, NULL);
624 gtk_banner_set_fraction (win, 0.5);
625 gtk_banner_close (win);
631 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
632 gtk_banner_show_bar (win, "Insert our favourite testing text here.");
633 gtk_banner_set_text (win, "Insert our second favourite testing text here.");
634 gtk_banner_set_text (win, "");
635 gtk_banner_set_text (win, NULL);
636 gtk_banner_set_fraction (win, 0.5);
637 gtk_widget_destroy (GTK_WIDGET (win));
643 gtk_banner_show_bar (NULL, "Insert our favourite testing text here.");
644 gtk_banner_close (NULL);
650 gtk_banner_set_text (NULL, "Insert our second favourite testing text here.");
656 gtk_banner_set_fraction (NULL, 0.5);
662 gtk_banner_close (NULL);
668 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
669 gtk_banner_show_bar (win, "Insert our favourite testing text here.");
670 gtk_banner_set_fraction (win, -0.5);
671 gtk_banner_close (win);
677 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
678 gtk_banner_show_bar (win, "Insert our favourite testing text here.");
679 gtk_banner_set_fraction (win, 1.5);
680 gtk_banner_close (win);
686 gtk_banner_show_animation (NULL, "Insert our favourite testing text here.");
687 gtk_banner_close (NULL);
692 /* note: confirmation note */
695 HildonNote *note = HILDON_NOTE( hildon_note_new_confirmation( NULL,
696 "Delete the presentation?\nHildon Slides" ));
700 /* note: confirmation note with icon stock */
704 note = HILDON_NOTE( hildon_note_new_confirmation_with_icon_stock(NULL,
705 "Delete the presentation?\nHildon Slides", GTK_STOCK_OPEN));
709 /* note: confirmation note with 10 additional buttons */
713 HildonNote *note = HILDON_NOTE( hildon_note_new_confirmation_add_buttons( NULL,
714 "Delete the presentation?\nHildon Slides",
715 "add 1", 12345, "add 2", 13579,
716 "add 3", 12345, "add 4", 13579,
717 "add 5", 12345, "add 6", 13579,
718 "add 7", 12345, "add 8", 13579,
719 "add 9", 24680, "add 9", 24680, NULL) );
724 /* note: confirmation note: Set button text*/
728 note = HILDON_NOTE( hildon_note_new_confirmation(NULL,
729 "Delete the presentation?\nHildon Slides"));
730 hildon_note_set_button_text( HILDON_NOTE( note ) , "Remove" );
734 /* note: information note */
738 note = HILDON_NOTE( hildon_note_new_information(NULL,
739 "Only one button present\nin this information note"));
743 /* note: information note with icon stock */
747 note = HILDON_NOTE( hildon_note_new_information_with_icon_stock(NULL,
748 "Only one button present\nin this information note", GTK_STOCK_HARDDISK));
752 /* note: information note: Set button text*/
756 note = HILDON_NOTE( hildon_note_new_information(NULL,
757 "Only one button present\nin this information note"));
758 hildon_note_set_button_text( HILDON_NOTE( note ) , "Continue" );
767 note = HILDON_NOTE( hildon_note_new_cancel( NULL,
768 "Deleting files.." ));
773 /* note: new cancel: set button text
778 note = HILDON_NOTE( hildon_note_new_cancel( NULL,
779 "Deleting files.." ));
780 hildon_note_set_button_text( HILDON_NOTE( note ) , "Stop" );
784 /* note: new cancel with progress bar*/
788 GtkWidget *progress_note;
790 progbar = gtk_progress_bar_new();
792 gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR( progbar ), 0.7 );
794 progress_note = hildon_note_new_cancel_with_progress_bar(
795 NULL, "Deleting files..",
796 GTK_PROGRESS_BAR( progbar ));
798 assert(progress_note);
802 /* note: new cancel with progress bar: set button text*/
806 GtkWidget *progress_note;
808 progbar = gtk_progress_bar_new();
810 gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR( progbar ), 0.7 );
812 progress_note = hildon_note_new_cancel_with_progress_bar(
813 NULL, "Deleting files..",
814 GTK_PROGRESS_BAR( progbar ));
816 hildon_note_set_button_text( HILDON_NOTE( progress_note ) , "Stop" );
819 /* destroy note widgets */
824 /* GtkWidget *cancel;*/
827 GtkWidget *conf_button;
829 conf = hildon_note_new_confirmation(NULL, NULL);
831 gtk_widget_destroy(conf);
833 inf = hildon_note_new_information(NULL, NULL);
835 gtk_widget_destroy(inf);
838 cancel = hildon_note_new_cancel( NULL, NULL );
840 gtk_widget_destroy(cancel);
843 progbar = gtk_progress_bar_new();
844 progress = hildon_note_new_cancel_with_progress_bar(
845 NULL, NULL, GTK_PROGRESS_BAR( progbar ));
847 gtk_widget_destroy(progress);
849 conf_button = hildon_note_new_confirmation_add_buttons( NULL, NULL, NULL );
851 gtk_widget_destroy(conf_button);
858 HildonHVolumebar *volumeBar;
860 volumeBar = HILDON_HVOLUMEBAR(hildon_hvolumebar_new());
867 HildonVVolumebar *volumeBar;
869 volumeBar = HILDON_VVOLUMEBAR(hildon_vvolumebar_new());
876 HildonHVolumebar *volumeBar;
877 gdouble volumeLevel = 0.5;
879 volumeBar = HILDON_HVOLUMEBAR(hildon_hvolumebar_new());
880 hildon_volumebar_set_level(HILDON_VOLUMEBAR(volumeBar), volumeLevel);
881 assert(hildon_volumebar_get_level(HILDON_VOLUMEBAR(volumeBar)) == volumeLevel);
887 HildonHVolumebar *volumeBar;
888 gboolean mute = FALSE;
890 volumeBar = HILDON_HVOLUMEBAR(hildon_hvolumebar_new());
891 hildon_volumebar_set_mute(HILDON_VOLUMEBAR(volumeBar), mute);
892 assert(hildon_volumebar_get_mute(HILDON_VOLUMEBAR(volumeBar)) == mute);
898 HildonVVolumebar *volumeBar;
900 volumeBar = HILDON_VVOLUMEBAR(hildon_vvolumebar_new());
901 gtk_widget_destroy(GTK_WIDGET(volumeBar));
905 /* weekday_picker: new: ok */
911 picker = hildon_weekday_picker_new();
916 /* weekday_picker: set/unset/isset: ok */
920 HildonWeekdayPicker *picker;
923 picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
926 /* set all one by one */
927 for( i = 1; i < 8; ++i )
928 hildon_weekday_picker_set_day( picker, i );
930 /* check that the proper days are set */
931 for( j = 1; j < 8; ++j )
932 assert( hildon_weekday_picker_isset_day( picker, j ) );
934 /* unset all one by one */
935 for( i = 1; i < 8; ++i )
936 hildon_weekday_picker_unset_day( picker, i );
938 /* check that the proper days are unset */
939 for( j = 1; j < 8; ++j )
940 assert( !hildon_weekday_picker_isset_day( picker, j ) );
945 /* weekday_picker: set_day: null */
949 hildon_weekday_picker_set_day( NULL, 0 );
953 /* weekday_picker: unset_day: null */
957 hildon_weekday_picker_unset_day( NULL, 0 );
961 /* weekday_picker: isset_day: null */
965 hildon_weekday_picker_isset_day( NULL, 0 );
969 /* weekday_picker: toggle: ok */
973 HildonWeekdayPicker *picker;
975 picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
978 /* set all one by one */
979 for( i = 1; i < 8; i++ )
980 hildon_weekday_picker_toggle_day( picker, i );
982 /* check that the proper days are set */
983 for( j = 1; j < 8; j++ )
984 assert ( hildon_weekday_picker_isset_day( picker, j ) );
986 /* unset all one by one */
987 for( i = 1; i < 8; ++i )
988 hildon_weekday_picker_toggle_day( picker, i );
990 /* check that the proper days are unset */
991 for( j = 1; j < 8; ++j )
992 assert( !hildon_weekday_picker_isset_day( picker, j ) );
997 /* weekday_picker: toggle_day: null */
1000 HildonWeekdayPicker *picker;
1001 picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
1002 hildon_weekday_picker_toggle_day( NULL, 0 );
1006 /* weekday_picker: set_all/unset_all*/
1009 HildonWeekdayPicker *picker;
1010 picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
1011 hildon_weekday_picker_set_all( picker );
1012 hildon_weekday_picker_unset_all( picker );
1016 /* telephone editor: new: ok */
1023 editor = hildon_telephone_editor_new( HILDON_TELEPHONE_EDITOR_FORMAT_FREE );
1026 editor = hildon_telephone_editor_new
1027 ( HILDON_TELEPHONE_EDITOR_FORMAT_COERCE );
1030 editor = hildon_telephone_editor_new
1031 ( HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY );
1034 editor = hildon_telephone_editor_new
1035 ( HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA );
1041 /* telephone editor: new: inv */
1048 editor = hildon_telephone_editor_new( 17 );
1054 /* telephone editor: set_editable: ok */
1058 HildonTelephoneEditorFormat fmt[4] = {
1059 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1060 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1061 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1062 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1067 for( i = 0; i < 4; ++i )
1069 editor = hildon_telephone_editor_new( fmt[i] );
1070 hildon_telephone_editor_set_editable( HILDON_TELEPHONE_EDITOR( editor ),
1072 hildon_telephone_editor_set_editable( HILDON_TELEPHONE_EDITOR( editor ),
1073 FALSE, FALSE, FALSE );
1074 gtk_widget_destroy( editor );
1080 /* telephone editor: set_editable: null */
1084 hildon_telephone_editor_set_editable( NULL, TRUE, TRUE, TRUE );
1088 /* telephone editor: set_show_plus: ok */
1092 HildonTelephoneEditorFormat fmt[4] = {
1093 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1094 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1095 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1096 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1101 for( i = 0; i < 4; ++i )
1103 editor = hildon_telephone_editor_new( fmt[i] );
1107 hildon_telephone_editor_set_show_plus( HILDON_TELEPHONE_EDITOR( editor ),
1110 /* only check if not in free mode (no plus there) */
1112 assert( hildon_telephone_editor_get_show_plus( HILDON_TELEPHONE_EDITOR( editor ) )
1114 hildon_telephone_editor_set_show_plus( HILDON_TELEPHONE_EDITOR( editor ),
1117 assert( hildon_telephone_editor_get_show_plus( HILDON_TELEPHONE_EDITOR( editor ) )
1119 gtk_widget_destroy( editor );
1125 /* telephone editor: set_show_plus: null */
1129 hildon_telephone_editor_set_show_plus( NULL, TRUE );
1134 /* telephone editor: get_show_plus: null */
1138 hildon_telephone_editor_get_show_plus( NULL );
1143 /* telephone editor: set_show_border: ok */
1147 HildonTelephoneEditorFormat fmt[4] = {
1148 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1149 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1150 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1151 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1156 for( i = 0; i < 4; ++i )
1158 editor = hildon_telephone_editor_new( fmt[i] );
1162 hildon_telephone_editor_set_show_border( HILDON_TELEPHONE_EDITOR( editor ),
1164 assert( hildon_telephone_editor_get_show_border
1165 ( HILDON_TELEPHONE_EDITOR( editor ) ) == TRUE );
1167 hildon_telephone_editor_set_show_border( HILDON_TELEPHONE_EDITOR( editor ),
1169 assert( hildon_telephone_editor_get_show_border( HILDON_TELEPHONE_EDITOR( editor ) )
1172 gtk_widget_destroy( editor );
1178 /* telephone editor: set_show_border: null */
1182 hildon_telephone_editor_set_show_border( NULL, TRUE );
1187 /* telephone editor: get_show_border: null */
1191 hildon_telephone_editor_get_show_border( NULL );
1196 /* telephone editor: set_widths: ok */
1200 HildonTelephoneEditorFormat fmt[4] = {
1201 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1202 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1203 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1204 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1209 for( i = 0; i < 4; ++i )
1211 editor = hildon_telephone_editor_new( fmt[i] );
1212 hildon_telephone_editor_set_widths( HILDON_TELEPHONE_EDITOR( editor ),
1214 hildon_telephone_editor_set_widths( HILDON_TELEPHONE_EDITOR( editor ),
1216 hildon_telephone_editor_set_widths( HILDON_TELEPHONE_EDITOR( editor ),
1218 gtk_widget_destroy( editor );
1224 /* telephone editor: set_widths: null */
1228 hildon_telephone_editor_set_widths( NULL, 1, 1, 1 );
1233 /* telephone editor: set/get_country: ok */
1238 gchar teststr[] = "123456";
1239 HildonTelephoneEditorFormat fmt[4] = {
1240 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1241 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1242 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1243 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1248 for( i = 0; i < 4; ++i )
1250 editor = hildon_telephone_editor_new( fmt[i] );
1251 hildon_telephone_editor_set_country( HILDON_TELEPHONE_EDITOR( editor ),
1253 c = hildon_telephone_editor_get_country
1254 ( HILDON_TELEPHONE_EDITOR( editor ) );
1256 /* format != FREE */
1260 g_assert( strcmp( teststr, c ) == 0 );
1263 gtk_widget_destroy( editor );
1269 /* telephone editor: set/get_country: inv */
1274 gchar teststr[] = "123456p";
1278 editor = hildon_telephone_editor_new(
1279 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY );
1280 hildon_telephone_editor_set_country( HILDON_TELEPHONE_EDITOR( editor ),
1282 c = hildon_telephone_editor_get_country
1283 ( HILDON_TELEPHONE_EDITOR( editor ) );
1286 g_assert( strcmp( teststr, c ) != 0 );
1288 gtk_widget_destroy( editor );
1293 /* telephone editor: set_country: null */
1297 hildon_telephone_editor_set_country( NULL, "123" );
1302 /* telephone editor: get_country: null */
1306 hildon_telephone_editor_get_country( NULL );
1311 /* telephone editor: set/get_area: ok */
1316 gchar teststr[] = "123456";
1317 HildonTelephoneEditorFormat fmt[4] = {
1318 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1319 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1320 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1321 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1326 for( i = 0; i < 4; ++i )
1328 editor = hildon_telephone_editor_new( fmt[i] );
1329 hildon_telephone_editor_set_area( HILDON_TELEPHONE_EDITOR( editor ),
1331 c = hildon_telephone_editor_get_area
1332 ( HILDON_TELEPHONE_EDITOR( editor ) );
1334 /* format != FREE nor COUNTRY */
1339 g_assert( strncmp( teststr, c, strlen( c ) ) == 0 );
1342 gtk_widget_destroy( editor );
1348 /* telephone editor: set/get_area: inv */
1353 gchar teststr[] = "123456p";
1357 editor = hildon_telephone_editor_new(
1358 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA );
1359 hildon_telephone_editor_set_area( HILDON_TELEPHONE_EDITOR( editor ),
1361 c = hildon_telephone_editor_get_area
1362 ( HILDON_TELEPHONE_EDITOR( editor ) );
1365 g_assert( strcmp( teststr, c ) != 0 );
1367 gtk_widget_destroy( editor );
1372 /* telephone editor: set_area: null */
1376 hildon_telephone_editor_set_area( NULL, "123" );
1381 /* telephone editor: get_area: null */
1385 hildon_telephone_editor_get_area( NULL );
1390 /* telephone editor: set/get_number: ok */
1395 gchar teststr[] = "123456";
1396 HildonTelephoneEditorFormat fmt[4] = {
1397 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1398 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1399 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1400 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1405 for( i = 0; i < 4; ++i )
1407 editor = hildon_telephone_editor_new( fmt[i] );
1408 hildon_telephone_editor_set_number( HILDON_TELEPHONE_EDITOR( editor ),
1410 c = hildon_telephone_editor_get_number
1411 ( HILDON_TELEPHONE_EDITOR( editor ) );
1413 /* free != COUNTRY nor AREA */
1414 if( i != 2 && i != 3 )
1417 g_assert( strcmp( teststr, c ) == 0 );
1420 gtk_widget_destroy( editor );
1426 /* telephone editor: set/get_number: ok in FREE format */
1431 gchar teststr[] = "()+?*pw1234567890";
1433 editor = hildon_telephone_editor_new(
1434 HILDON_TELEPHONE_EDITOR_FORMAT_FREE );
1435 hildon_telephone_editor_set_number( HILDON_TELEPHONE_EDITOR( editor ),
1437 c = hildon_telephone_editor_get_number
1438 ( HILDON_TELEPHONE_EDITOR( editor ) );
1441 g_assert( strncmp( teststr, c, strlen(c) ) == 0 );
1443 gtk_widget_destroy( editor );
1448 /* telephone editor: set/get_number: inv */
1453 gchar teststr[] = "123456f";
1457 editor = hildon_telephone_editor_new(
1458 HILDON_TELEPHONE_EDITOR_FORMAT_FREE );
1459 hildon_telephone_editor_set_number( HILDON_TELEPHONE_EDITOR( editor ),
1461 c = hildon_telephone_editor_get_number
1462 ( HILDON_TELEPHONE_EDITOR( editor ) );
1465 g_assert( strcmp( teststr, c ) != 0 );
1467 gtk_widget_destroy( editor );
1472 /* telephone editor: set_number: null */
1475 hildon_telephone_editor_set_number( NULL, "123" );
1480 /* telephone editor: get_number: null */
1483 hildon_telephone_editor_get_number( NULL );
1488 /* find object options dialog: new */
1489 /*int test21a(void){
1491 dialog = hildon_find_object_options_dialog_new(NULL);
1496 /* find object options dialog: hide_location */
1497 /*int test21b(void){
1499 dialog = hildon_find_object_options_dialog_new(NULL);
1500 hildon_find_object_options_dialog_hide_location(
1501 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1502 gtk_widget_destroy(dialog);
1507 /* find object options dialog: hide_find_in */
1508 /*int test21c(void){
1510 dialog = hildon_find_object_options_dialog_new(NULL);
1511 hildon_find_object_options_dialog_hide_find_in(
1512 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1517 /* find object options dialog: get_location */
1518 /*int test21d(void){
1519 const gchar *retString;
1521 dialog = hildon_find_object_options_dialog_new(NULL);
1522 retString = hildon_find_object_options_dialog_get_location(
1523 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1525 g_assert(retString);
1530 /* find object options dialog: get_find_type */
1531 /*int test21e(void){
1532 HildonFindInType find_type;
1534 dialog = hildon_find_object_options_dialog_new(NULL);
1536 find_type = hildon_find_object_options_dialog_get_find_type(
1537 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1542 /* find object options dialog: get_time_period_type */
1543 /*int test21f(void){
1544 HildonTimePeriodType type;
1546 dialog = hildon_find_object_options_dialog_new(NULL);
1547 type = hildon_find_object_options_dialog_get_time_period_type(
1548 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1552 /* find object options dialog: get_start_date */
1553 /*int test21g(void){
1555 gint year, month, day;
1557 dialog = hildon_find_object_options_dialog_new(NULL);
1559 hildon_find_object_options_dialog_get_start_date(HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog),
1560 &year, &month, &day);
1569 /* find object options dialog: get_end_date */
1570 /*int test21h(void){
1572 gint year, month, day;
1574 dialog = hildon_find_object_options_dialog_new(NULL);
1576 hildon_find_object_options_dialog_get_end_date(HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog),
1577 &year, &month, &day);
1586 /* find object options dialog: add_custom_options */
1587 /*int test21i(void){
1589 GtkWidget *widget = gtk_entry_new();
1591 dialog = hildon_find_object_options_dialog_new(NULL);
1593 hildon_find_object_options_dialog_add_custom_option(
1594 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog), "New widget", widget);
1599 /* find object options dialog: date_matches */
1600 /*int test21j(void){
1602 dialog = hildon_find_object_options_dialog_new(NULL);
1604 g_assert(hildon_find_object_dialog_date_matches(HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog),
1610 /* range editor: new range editor: ok parameters */
1613 HildonRangeEditor *range_editor;
1615 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1616 assert(range_editor);
1620 /* range editor: new range editor with separator: ok parameters */
1623 HildonRangeEditor *range_editor;
1625 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new_with_separator(
1627 assert(range_editor);
1631 /* range editor: new range editor with separator: NULL parameters */
1634 HildonRangeEditor *range_editor;
1636 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new_with_separator(NULL));
1637 assert(range_editor);
1641 /* range editor: get range: ok parameters */
1644 HildonRangeEditor *range_editor;
1647 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1648 hildon_range_editor_get_range (range_editor, &start, &end);
1650 assert (start == -999);
1651 assert (end == 999);
1656 /* range editor: get range: null range editor */
1659 HildonRangeEditor *range_editor = NULL;
1662 hildon_range_editor_get_range (range_editor, &start, &end);
1667 /* range editor: get range: null end */
1670 HildonRangeEditor *range_editor = NULL;
1673 hildon_range_editor_get_range (range_editor, &start, NULL);
1678 /* range editor: get range: null start */
1681 HildonRangeEditor *range_editor = NULL;
1684 hildon_range_editor_get_range (range_editor, NULL, &end);
1689 /* range editor: get range: null start, end */
1692 HildonRangeEditor *range_editor = NULL;
1694 hildon_range_editor_get_range (range_editor, NULL, NULL);
1699 /* range editor: set range: ok parameters */
1702 HildonRangeEditor *range_editor;
1703 gint start = 5, end = 6;
1705 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1707 hildon_range_editor_set_range (range_editor, start, end);
1708 hildon_range_editor_get_range (range_editor, &start, &end);
1710 assert (start == 5);
1716 /* range editor: set range: null range editor*/
1719 HildonRangeEditor *range_editor = NULL;
1720 gint start = 5, end = 6;
1722 hildon_range_editor_set_range (range_editor, start, end);
1727 /* range editor: set limits: ok parameters */
1730 HildonRangeEditor *range_editor;
1731 gint start = 0, end = 0;
1733 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1735 hildon_range_editor_set_limits (range_editor, start, end);
1736 hildon_range_editor_get_range (range_editor, &start, &end);
1738 assert (start == 0);
1744 /* range editor: set limits: set range over start minimum and end maximum */
1747 HildonRangeEditor *range_editor;
1748 gint start = -1, end = 1;
1750 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1752 hildon_range_editor_set_limits (range_editor, 0, 0);
1753 hildon_range_editor_set_range (range_editor, start, end);
1754 hildon_range_editor_get_range (range_editor, &start, &end);
1756 assert (start == 0);
1762 /* range editor: set limits: NULL editor */
1765 HildonRangeEditor *range_editor = NULL;
1766 gint start = 0, end = 0;
1768 hildon_range_editor_set_limits (range_editor, start, end);
1778 HildonSortDialog *sort_dialog;
1780 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1781 assert(sort_dialog);
1785 /* sort dialog: Get sort key. '0' is the default index value */
1789 HildonSortDialog *sort_dialog;
1790 gint default_key = 0;
1792 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1793 assert(hildon_sort_dialog_get_sort_key( sort_dialog ) == default_key );
1797 /* sort dialog: Set sort key */
1801 HildonSortDialog *sort_dialog;
1804 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1805 hildon_sort_dialog_set_sort_key( sort_dialog, key );
1806 assert(hildon_sort_dialog_get_sort_key( sort_dialog ) == 1 );
1810 /* sort dialog: add sort key */
1814 HildonSortDialog *sort_dialog;
1816 gint added_key_index = 0;
1818 sort_dialog = HILDON_SORT_DIALOG (hildon_sort_dialog_new(NULL));
1819 hildon_sort_dialog_add_sort_key (sort_dialog, "Random");
1820 added_key_index = hildon_sort_dialog_add_sort_key (sort_dialog,
1823 hildon_sort_dialog_set_sort_key( sort_dialog, added_key_index );
1824 assert(hildon_sort_dialog_get_sort_key( sort_dialog ) == key );
1828 /* sort dialog: get sort order. '0' is the default index value */
1832 HildonSortDialog *sort_dialog;
1833 GtkSortType type = 0;
1835 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1836 assert(hildon_sort_dialog_get_sort_order( sort_dialog ) == type);
1840 /* sort dialog: set sort order */
1844 HildonSortDialog *sort_dialog;
1845 GtkSortType type = 1;
1847 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1848 hildon_sort_dialog_set_sort_order( sort_dialog , type);
1849 assert(hildon_sort_dialog_get_sort_order( sort_dialog ) == 1);
1853 /* sort dialog: gtk_widget_destroy */
1856 GtkWidget *sort_dialog;
1858 sort_dialog = hildon_sort_dialog_new(FALSE);
1859 gtk_widget_destroy(GTK_WIDGET(sort_dialog));
1864 /* Get password dialog */
1868 HildonGetPasswordDialog *get_dialog;
1870 get_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1876 /* Get Old password dialog */
1880 HildonGetPasswordDialog *get_old_dialog;
1882 get_old_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1884 assert(get_old_dialog);
1888 /* Get / Get Old password dialog: get password */
1891 HildonGetPasswordDialog *get_dialog;
1892 HildonGetPasswordDialog *get_old_dialog;
1893 const gchar *get_string;
1894 const gchar *get_old_string;
1896 get_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1898 get_string = hildon_get_password_dialog_get_password( get_dialog);
1901 get_old_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1903 get_old_string = hildon_get_password_dialog_get_password( get_old_dialog);
1904 assert(get_old_string);
1908 /* get / get old password dialog: gtk_widget_destroy */
1911 GtkWidget *get_dialog;
1912 GtkWidget *get_old_dialog;
1914 get_dialog = hildon_get_password_dialog_new(NULL, FALSE);
1915 gtk_widget_destroy(GTK_WIDGET(get_dialog));
1917 get_old_dialog = hildon_get_password_dialog_new(NULL, TRUE);
1918 gtk_widget_destroy(GTK_WIDGET(get_old_dialog));
1923 /* set password dialog */
1927 HildonSetPasswordDialog *set_dialog;
1929 set_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(NULL,
1935 /* change password dialog */
1939 HildonSetPasswordDialog *change_dialog;
1941 change_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1943 assert(change_dialog);
1947 /* set / change password dialog: get password */
1950 HildonSetPasswordDialog *set_dialog;
1951 HildonSetPasswordDialog *change_dialog;
1952 const gchar *set_string;
1953 const gchar *change_string;
1955 set_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1957 set_string = hildon_set_password_dialog_get_password( set_dialog);
1960 change_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1962 change_string = hildon_set_password_dialog_get_password( change_dialog);
1963 assert(change_string);
1967 /* set / change password dialog: get protected */
1970 HildonSetPasswordDialog *set_dialog;
1971 HildonSetPasswordDialog *change_dialog;
1975 set_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1977 set = hildon_set_password_dialog_get_protected(set_dialog);
1980 change_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1982 change = hildon_set_password_dialog_get_protected(change_dialog);
1986 /* set / change password dialog: gtk_widget_destroy */
1989 GtkWidget *set_dialog;
1990 GtkWidget *change_dialog;
1992 set_dialog = hildon_set_password_dialog_new(NULL, FALSE);
1993 gtk_widget_destroy(GTK_WIDGET(set_dialog));
1995 change_dialog = hildon_set_password_dialog_new(NULL, TRUE);
1996 gtk_widget_destroy(GTK_WIDGET(change_dialog));
2001 #ifndef HILDON_DISABLE_DEPRECATED
2002 int fsd_get_font(void)
2005 PangoAttrList *list = NULL;
2006 fsd = hildon_font_selection_dialog_new( NULL, "fsd" );
2007 list = hildon_font_selection_dialog_get_font(HILDON_FONT_SELECTION_DIALOG(fsd));
2008 assert( list!=NULL );
2012 int fsd_set_font(void)
2015 PangoAttrList *list = NULL;
2016 fsd = hildon_font_selection_dialog_new( NULL, "fsd" );
2017 list = hildon_font_selection_dialog_get_font(HILDON_FONT_SELECTION_DIALOG(fsd));
2018 hildon_font_selection_dialog_set_font(HILDON_FONT_SELECTION_DIALOG(fsd), list);
2022 int fsd_set_pretext(void)
2025 char *str = "Mopo karkas käsistä";
2026 fsd = hildon_font_selection_dialog_new( NULL, "fsd" );
2027 hildon_font_selection_dialog_set_preview_text(HILDON_FONT_SELECTION_DIALOG(fsd),str);
2031 int fsd_get_pretext(void)
2035 fsd = hildon_font_selection_dialog_new( NULL, "fsd" );
2036 str = (char*)hildon_font_selection_dialog_get_preview_text(
2037 HILDON_FONT_SELECTION_DIALOG(fsd));
2039 assert( str!=NULL );
2042 /* insert object dialog: new */
2045 dialog = hildon_insert_object_dialog_new(NULL);
2050 /* insert object dialog: get_name */
2052 const gchar *string;
2055 dialog = hildon_insert_object_dialog_new(NULL);
2056 string = hildon_insert_object_dialog_get_name(HILDON_INSERT_OBJECT_DIALOG(dialog));
2061 /* insert object dialog: get_mime_type */
2063 const gchar *string;
2066 dialog = hildon_insert_object_dialog_new(NULL);
2067 string = hildon_insert_object_dialog_get_mime_type(HILDON_INSERT_OBJECT_DIALOG(dialog));
2072 /* hildon_number_editor_new */
2078 editor = hildon_number_editor_new (min, max);
2084 /* hildon_number_editor_get_value */
2091 editor = hildon_number_editor_new (min, max);
2092 value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2093 g_assert (value == max);
2098 /* hildon_number_editor_set_range */
2105 editor = hildon_number_editor_new (min, max);
2106 hildon_number_editor_set_range (HILDON_NUMBER_EDITOR (editor), 30, 80);
2107 value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2108 g_assert (value == 80);
2113 /* hildon_number_editor_set_value */
2120 editor = hildon_number_editor_new (min, max);
2121 hildon_number_editor_set_value (HILDON_NUMBER_EDITOR (editor), 3450);
2122 value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2123 g_assert (value == 3450);
2128 /* Hildon-Color-Selector:
2129 hildon_color_selector_new()
2133 GtkWidget *colselector;
2134 GdkColor redcolor = {0, 65535, 0, 0 };
2137 colselector = hildon_color_selector_new( NULL );
2139 hildon_color_selector_set_color( HILDON_COLOR_SELECTOR(colselector), &(redcolor) );
2140 color = hildon_color_selector_get_color( HILDON_COLOR_SELECTOR(colselector) );
2142 g_assert( colselector );
2143 g_assert( redcolor.pixel == color->pixel );
2144 g_assert( redcolor.red == color->red );
2145 g_assert( redcolor.green == color->green );
2146 g_assert( redcolor.blue == color->blue );
2149 gtk_widget_destroy ( colselector );
2153 /* Hildon-Color-Selector:
2154 HildonColorSelector with non-base color
2158 HildonColorSelector *colorsel;
2159 GtkWidget *obj_self;
2160 GdkColor mixedcolor = { 0, 7281, 21845, 65535 };
2163 obj_self = hildon_color_selector_new( NULL );
2164 colorsel = HILDON_COLOR_SELECTOR ( obj_self );
2166 hildon_color_selector_set_color( colorsel, &mixedcolor );
2167 color = hildon_color_selector_get_color( colorsel );
2169 g_assert( colorsel );
2170 g_assert( color->pixel == 0 );
2171 g_assert( color->red == 7281 );
2172 g_assert( color->green == 21845 );
2173 g_assert( color->blue == 65535 );
2176 g_object_unref ( obj_self );
2177 gtk_widget_destroy( GTK_WIDGET(colorsel) );
2182 /* hildon_file_handling_note_new_moving */
2185 GtkWidget *file_note;
2187 file_note = hildon_file_handling_note_new_moving (NULL);
2188 hildon_file_handling_note_set_fraction (HILDON_FILE_HANDLING_NOTE(file_note), 0.7);
2190 g_assert (file_note);
2195 /* hildon_file_handling_note_new_deleting */
2198 GtkWidget *file_note;
2200 file_note = hildon_file_handling_note_new_deleting (NULL);
2201 hildon_file_handling_note_set_counter_and_name (HILDON_FILE_HANDLING_NOTE (file_note),
2203 hildon_file_handling_note_set_counter_and_name (HILDON_FILE_HANDLING_NOTE (file_note),
2205 g_assert (file_note);
2210 /* hildon_file_handling_note_new_opening */
2213 GtkWidget *file_note;
2215 file_note = hildon_file_handling_note_new_opening (NULL);
2216 hildon_file_handling_note_set_name (HILDON_FILE_HANDLING_NOTE (file_note),
2218 g_assert (file_note);
2223 /* hildon_file_handling_note_new_saving */
2226 GtkWidget *file_note;
2228 file_note = hildon_file_handling_note_new_saving (NULL);
2229 hildon_file_handling_note_set_fraction (HILDON_FILE_HANDLING_NOTE (file_note), 0.7);
2230 g_assert (file_note);
2235 /* Add to Home dialog new: ok parameters */
2239 d = hildon_add_home_dialog_new( NULL, "name" , NULL);
2245 /* Add to Home dialog new: NULL parameter (is ok) */
2249 d = hildon_add_home_dialog_new( NULL, NULL, NULL );
2255 /* Rename dialog new: ok parameters */
2259 d = hildon_add_home_dialog_new( NULL, "name", "newname" );
2265 /* Rename dialog new: NULL parameter (is ok) */
2269 d = hildon_add_home_dialog_new( NULL, NULL, "newname" );
2275 /* Create item with icon basename. */
2278 /* If test fails, first see if icon exists. */
2280 item = hildon_grid_item_new (VALID_ICON);
2285 /* Create item without icon basename. */
2289 item = hildon_grid_item_new (NULL);
2294 /* Create item with icon basename and label. */
2297 /* If test fails, first see if icon exists. */
2299 item = hildon_grid_item_new_with_label (VALID_ICON, "foo");
2304 /* Create item with icon basename but with no label. */
2307 /* If test fails, first see if icon exists. */
2309 item = hildon_grid_item_new_with_label (VALID_ICON, NULL);
2316 item = hildon_grid_item_new_with_label (NULL, "foo");
2321 /* Create item without icon basename and without label. */
2325 item = hildon_grid_item_new_with_label (NULL, NULL);
2330 /* Set emblem type. Non-NULL item, non-NULL emblem. */
2333 /* If test fails, first see if icon exists. */
2335 item = hildon_grid_item_new (VALID_ICON);
2336 hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), VALID_ICON);
2340 /* Set emblem type. Non-NULL item, NULL emblem. */
2343 /* If test fails, first see if icon exists. */
2345 item = hildon_grid_item_new (VALID_ICON);
2346 hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), NULL);
2350 /* Set emblem type. NULL item, non-NULL emblem. */
2353 hildon_grid_item_set_emblem_type (NULL, VALID_ICON);
2357 /* Set emblem type. NULL item, NULL emblem. */
2360 hildon_grid_item_set_emblem_type (NULL, NULL);
2364 /* Get emblem type from existing item - has emblem. */
2367 /* If test fails, first see if icon exists. */
2370 item = hildon_grid_item_new (VALID_ICON);
2371 hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), VALID_ICON);
2372 type = hildon_grid_item_get_emblem_type (HILDON_GRID_ITEM (item));
2377 /* Get emblem type from existing item - has no emblem. */
2380 /* If test fails, first see if icon exists. */
2383 item = hildon_grid_item_new (VALID_ICON);
2384 type = hildon_grid_item_get_emblem_type (HILDON_GRID_ITEM (item));
2385 g_assert (type != NULL);
2389 /* Get emblem type from non-existing item. */
2393 type = hildon_grid_item_get_emblem_type (NULL);
2394 g_assert (type != NULL);
2398 /* Destroy griditem. */
2402 item = hildon_grid_item_new (VALID_ICON);
2403 gtk_widget_destroy (item);
2407 /* Create new grid. */
2411 grid = hildon_grid_new ();
2416 /* Set grid style. */
2420 grid = hildon_grid_new ();
2421 hildon_grid_set_style (HILDON_GRID (grid), "bar");
2425 /* Set grid style (no style). */
2429 grid = hildon_grid_new ();
2430 hildon_grid_set_style (HILDON_GRID (grid), NULL);
2434 /* Set grid style. Invalid grid. */
2437 hildon_grid_set_style (NULL, "bar");
2441 /* Set grid style. Invalid grid, no style. */
2444 hildon_grid_set_style (NULL, NULL);
2448 /* Get grid style. Valid grid, has style. */
2453 grid = hildon_grid_new ();
2454 hildon_grid_set_style (HILDON_GRID (grid), "foo");
2455 style = hildon_grid_get_style (HILDON_GRID (grid));
2460 /* Get grid style. Valid grid, has no style. */
2465 grid = hildon_grid_new ();
2466 hildon_grid_set_style (HILDON_GRID (grid), NULL);
2467 style = hildon_grid_get_style (HILDON_GRID (grid));
2468 g_assert (style != NULL && strcmp (style, "HildonGrid") == 0);
2472 /* Get grid style. Invalid grid. */
2476 style = hildon_grid_get_style (NULL);
2481 /* Set grid scrollbar position. Valid grid. */
2485 grid = hildon_grid_new ();
2486 hildon_grid_set_scrollbar_pos (HILDON_GRID (grid), 0);
2490 /* Set grid scrollbar position. Invalid grid. */
2493 hildon_grid_set_scrollbar_pos (NULL, 0);
2497 /* Get grid scrollbar position. Valid grid. */
2502 grid = hildon_grid_new ();
2503 pos = hildon_grid_get_scrollbar_pos (HILDON_GRID (grid));
2507 /* Get grid scrollbar position. Inalid grid. */
2511 pos = hildon_grid_get_scrollbar_pos (NULL);
2515 /* Add item to existing grid. */
2520 grid = hildon_grid_new ();
2521 item = hildon_grid_item_new (VALID_ICON);
2522 gtk_container_add (GTK_CONTAINER (grid), item);
2526 /* Add NULL to existing grid. */
2531 grid = hildon_grid_new ();
2532 item = hildon_grid_item_new (VALID_ICON);
2533 gtk_container_add (GTK_CONTAINER (grid), NULL);
2537 /* Add something to existing grid. */
2542 grid = hildon_grid_new ();
2543 item = gtk_button_new ();
2544 gtk_container_add (GTK_CONTAINER (grid), item);
2548 /* Add something to non-existing grid. */
2552 item = gtk_button_new ();
2553 gtk_container_add (NULL, item);
2557 /* Add something to invalid grid. */
2561 item = gtk_button_new ();
2562 gtk_container_add (GTK_CONTAINER (item), item);
2566 /* Remove item from grid. */
2571 grid = hildon_grid_new ();
2572 item = hildon_grid_item_new (VALID_ICON);
2573 gtk_container_add (GTK_CONTAINER (grid), item);
2574 gtk_container_remove (GTK_CONTAINER (grid), item);
2578 /* Remove non-existing item from grid. */
2583 grid = hildon_grid_new ();
2584 item = hildon_grid_item_new (VALID_ICON);
2585 gtk_container_add (GTK_CONTAINER (grid), item);
2586 item = hildon_grid_item_new (VALID_ICON);
2587 gtk_container_remove (GTK_CONTAINER (grid), item);
2591 /* Remove NULL from grid. */
2596 grid = hildon_grid_new ();
2597 item = hildon_grid_item_new (VALID_ICON);
2598 gtk_container_add (GTK_CONTAINER (grid), item);
2599 gtk_container_remove (GTK_CONTAINER (grid), NULL);
2603 /* Remove something from grid. */
2608 grid = hildon_grid_new ();
2609 item = hildon_grid_item_new (VALID_ICON);
2610 gtk_container_add (GTK_CONTAINER (grid), item);
2611 item = gtk_button_new ();
2612 gtk_container_remove (GTK_CONTAINER (grid), item);
2616 /* Remove something from NULL grid. */
2620 item = gtk_button_new ();
2621 gtk_container_remove (NULL, item);
2625 /* Remove something from invalid grid. */
2628 GtkWidget *item0, *item1;
2629 item0 = gtk_button_new ();
2630 item1 = gtk_button_new ();
2631 gtk_container_remove (GTK_CONTAINER (item0), item1);
2640 grid = hildon_grid_new ();
2641 item = hildon_grid_item_new (VALID_ICON);
2642 gtk_container_add (GTK_CONTAINER (grid), item);
2643 item = hildon_grid_item_new (VALID_ICON);
2644 gtk_container_add (GTK_CONTAINER (grid), item);
2645 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2649 /* Set focus to non-existing. */
2654 grid = hildon_grid_new ();
2655 item = hildon_grid_item_new (VALID_ICON);
2656 gtk_container_add (GTK_CONTAINER (grid), item);
2657 item = hildon_grid_item_new (VALID_ICON);
2658 gtk_container_add (GTK_CONTAINER (grid), item);
2659 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2660 item = hildon_grid_item_new (VALID_ICON);
2661 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2665 /* Set focus to NULL. */
2670 grid = hildon_grid_new ();
2671 item = hildon_grid_item_new (VALID_ICON);
2672 gtk_container_add (GTK_CONTAINER (grid), item);
2673 item = hildon_grid_item_new (VALID_ICON);
2674 gtk_container_add (GTK_CONTAINER (grid), item);
2675 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2679 /* Set focus to something. */
2684 grid = hildon_grid_new ();
2685 item = hildon_grid_item_new (VALID_ICON);
2686 gtk_container_add (GTK_CONTAINER (grid), item);
2687 item = hildon_grid_item_new (VALID_ICON);
2688 gtk_container_add (GTK_CONTAINER (grid), item);
2689 item = gtk_button_new ();
2690 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2699 grid = hildon_grid_new ();
2700 item = hildon_grid_item_new (VALID_ICON);
2701 gtk_container_add (GTK_CONTAINER (grid), item);
2702 item = hildon_grid_item_new (VALID_ICON);
2703 gtk_container_add (GTK_CONTAINER (grid), item);
2704 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2705 g_assert (GTK_CONTAINER (grid)->focus_child == item);
2709 /* Get focus (no focused). */
2713 grid = hildon_grid_new ();
2714 g_assert (GTK_CONTAINER (grid)->focus_child == NULL);
2718 /* Destroy grid. Has items. */
2722 grid = hildon_grid_new ();
2723 gtk_widget_destroy (grid);
2727 /* Destroy grid. No items. */
2732 grid = hildon_grid_new ();
2733 item = hildon_grid_item_new (VALID_ICON);
2734 gtk_container_add (GTK_CONTAINER (grid), item);
2735 gtk_widget_destroy (grid);
2739 /* HildonTimeEditor: create editor widget */
2742 editor = hildon_time_editor_new ();
2747 /* HildonTimeEditor: set time and check if returned
2748 * time value is same
2752 guint hour, min, sec;
2753 editor = hildon_time_editor_new ();
2754 hildon_time_editor_set_time (HILDON_TIME_EDITOR (editor),
2756 hildon_time_editor_get_time (HILDON_TIME_EDITOR (editor),
2758 g_assert (hour == 21);
2759 g_assert (min == 39);
2760 g_assert (sec ==45);
2764 /* HildonTimeEditor: enable/disable seconds */
2767 editor = hildon_time_editor_new ();
2768 #ifndef HILDON_DISABLE_DEPRECATED
2769 hildon_time_editor_show_seconds (HILDON_TIME_EDITOR (editor), 1);
2770 hildon_time_editor_show_seconds (HILDON_TIME_EDITOR (editor), 0);
2772 hildon_time_editor_set_show_seconds (HILDON_TIME_EDITOR (editor), 1);
2773 hildon_time_editor_set_show_seconds (HILDON_TIME_EDITOR (editor), 0);
2778 /* HildonTimeEditor: enable duration mode */
2781 editor = hildon_time_editor_new ();
2782 #ifndef HILDON_DISABLE_DEPRECATED
2783 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2786 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2792 /* HildonTimeEditor: set duration range and check values
2793 * against returned values
2797 guint min_seconds, max_seconds;
2798 editor = hildon_time_editor_new ();
2799 #ifndef HILDON_DISABLE_DEPRECATED
2800 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2803 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2806 hildon_time_editor_set_duration_range (HILDON_TIME_EDITOR (editor),
2808 hildon_time_editor_get_duration_range (HILDON_TIME_EDITOR (editor),
2809 &min_seconds, &max_seconds);
2810 g_assert (min_seconds == 3600);
2811 g_assert (max_seconds == 14500);
2815 /* HildonTimeEditor: enable and disable duration modes */
2818 editor = hildon_time_editor_new ();
2819 #ifndef HILDON_DISABLE_DEPRECATED
2820 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2822 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2825 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2827 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2833 /* HildonTimeEditor: set time and check against
2838 guint hour, min, sec;
2839 editor = hildon_time_editor_new ();
2840 hildon_time_editor_set_time (HILDON_TIME_EDITOR (editor),
2842 hildon_time_editor_get_time (HILDON_TIME_EDITOR (editor),
2844 g_assert (hour == 13);
2845 g_assert (min == 33);
2846 g_assert (sec ==42);
2850 /* HildonTimeEditor: set duration range and check values
2851 * against foo values
2855 guint min_seconds, max_seconds;
2856 editor = hildon_time_editor_new ();
2857 #ifndef HILDON_DISABLE_DEPRECATED
2858 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2861 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2864 hildon_time_editor_set_duration_range (HILDON_TIME_EDITOR (editor),
2866 hildon_time_editor_get_duration_range (HILDON_TIME_EDITOR (editor),
2867 &min_seconds, &max_seconds);
2868 g_assert (min_seconds == 4600);
2869 g_assert (max_seconds == 15500);
2876 gtk_infoprint_temporarily_disable_wrap ();
2877 gtk_infoprint (NULL, "A suitably long text for testing the wrapping of gtkinfoprint.");
2883 gtk_banner_temporarily_disable_wrap ();
2884 gtk_banner_show_animation (NULL, "A suitably long text for testing the wrapping of gtkinfoprint.");
2893 dialog = hildon_name_password_dialog_new(NULL);
2894 name = (gchar *)hildon_name_password_dialog_get_name(HILDON_NAME_PASSWORD_DIALOG(dialog));
2905 dialog = hildon_name_password_dialog_new(NULL);
2906 password = (gchar *)hildon_name_password_dialog_get_password(HILDON_NAME_PASSWORD_DIALOG(dialog));
2912 #ifndef HILDON_DISABLE_DEPRECATED
2917 fdialog = hildon_file_details_dialog_new (NULL, "this is probably very very long filename");
2918 assert (HILDON_FILE_DETAILS_DIALOG (fdialog));
2924 {*test1a, "hildon_controlbar_new", EXPECT_OK},
2925 {*test1b, "hildon_controlbar_get/set_max", EXPECT_OK},
2926 {*test1c, "hildon_controlbar_get/set_value", EXPECT_OK},
2927 {*test1d, "gtk_widget_destroy", EXPECT_OK},
2928 {*test1e, "hildon_controlbar_get/set_min", EXPECT_OK},
2929 {*test1f, "hildon_controlbar_set_range", EXPECT_OK},
2930 {*test1g, "hildon_controlbar_set/get_range", EXPECT_OK},
2931 {*test1h, "hildon_controlbar_range/set/get_value (min)", EXPECT_OK},
2932 {*test1i, "hildon_controlbar_range/set/get_value (max)", EXPECT_OK},
2933 {*test2a, "hildon_seekbar_new", EXPECT_OK},
2934 {*test2b, "hildon_seekbar_get/set_total_time", EXPECT_OK},
2935 {*test2c, "hildon_seekbar_get/set_position", EXPECT_OK},
2936 {*test2d, "gtk_widget_destroy", EXPECT_OK},
2937 {*test2e, "hildon_seekbat_get/set_fraction", EXPECT_OK},
2938 {*test3a, "gtk_infoprint system (something)", EXPECT_OK},
2939 {*test3b, "gtk_infoprint system (NULL)", EXPECT_OK},
2940 {*test3c, "gtk_infoprint_with_icon_stock (VALID ICON)", EXPECT_OK},
2941 {*test3d, "gtk_infoprint_with_icon_stock (EMPTY STRING)", EXPECT_OK},
2942 {*test3e, "gtk_infoprint_with_icon_stock (NULL STRING)", EXPECT_OK},
2943 {*test3f, "gtk_infoprintf (something)", EXPECT_OK},
2944 {*test3g, "gtk_infoprintf (NULL)", EXPECT_OK},
2945 {*test3h, "gtk_confirmation_banner (Somestring, NULL STRING)", EXPECT_OK},
2946 {*test3i, "gtk_confirmation_banner (Somestring, NULL)", EXPECT_OK},
2947 {*test3j, "gtk_banner_show_animation", EXPECT_OK},
2948 {*test3k, "gtk_banner_show_animation with set_fraction", EXPECT_OK},
2949 /*{*test3l, "gtk_banner_show_animation with two banner_closes", EXPECT_ASSERT},*/
2950 {*test3m, "gtk_banner_show_animation with destroy window", EXPECT_OK},
2951 {*test3n, "gtk_banner_show_bar", EXPECT_OK},
2952 {*test3o, "gtk_banner_show_bar with destroy window", EXPECT_OK},
2953 {*test3p, "gtk_banner_show_bar & close with null parent", EXPECT_OK},
2954 {*test3q, "gtk_banner_set_text with null parent", EXPECT_OK},
2955 {*test3r, "gtk_banner_set_fraction with null parent", EXPECT_OK},
2956 {*test3s, "gtk_banner_close with null parent", EXPECT_OK},
2957 {*test3t, "gtk_banner_set_fraction with invalid fraction", EXPECT_ASSERT},
2958 {*test3u, "gtk_banner_set_fraction with invalid fraction", EXPECT_ASSERT},
2959 {*test3v, "gtk_banner_show_animation & close with null parent", EXPECT_OK},
2960 {*test4a, "hildon_note_new_confirmation", EXPECT_OK},
2961 {*test4b, "hildon_note_new_confirmation_with_icon_stock", EXPECT_OK},
2962 {*test4c, "hildon_new_confirmation_add_buttons", EXPECT_OK},
2963 {*test4d, ".._new_confirmation: set_button_text", EXPECT_OK},
2964 {*test4e, "hildon_note_new_information", EXPECT_OK},
2965 {*test4f, "hildon_note_new_information_with_icon_stock", EXPECT_OK},
2966 {*test4g, ".._new_information: set_button_text", EXPECT_OK},
2967 /* {*test4h, "hildon_note_new_cancel", EXPECT_OK},*/
2968 /* {*test4i, ".._new_cancel: set_button_text", EXPECT_OK},*/
2969 {*test4j, "hildon_note_new_cancel_with_progress_bar", EXPECT_OK},
2970 {*test4k, ".._cancel_with_progress_bar: set_button_text", EXPECT_OK},
2971 {*test4l, "destroy note widgets", EXPECT_OK},
2973 {*test6a, "hildon_volumebar_new (horizontal)", EXPECT_OK},
2974 {*test6b, "hildon_volumebar_new (vertical)", EXPECT_OK},
2975 {*test6c, "hildon_volumebar_get/set_level", EXPECT_OK},
2976 {*test6d, "hildon_volumebar_get/set_mute", EXPECT_OK},
2977 {*test6e, "gtk_widget_destroy", EXPECT_OK},
2978 {*test10a, "hildon_weekday_picker_new", EXPECT_OK},
2979 {*test11a, "hildon_weekday_picker_{,un,is}set", EXPECT_OK},
2980 {*test11b, "hildon_weekday_picker_set: null", EXPECT_ASSERT},
2981 {*test11c, "hildon_weekday_picker_unset: null", EXPECT_ASSERT},
2982 {*test11d, "hildon_weekday_picker_isset: null", EXPECT_ASSERT},
2983 {*test12a, "hildon_weekday_picker_toggle_day", EXPECT_OK},
2984 {*test12b, "hildon_weekday_picker_toggle_day: null", EXPECT_ASSERT},
2985 {*test12c, "hildon_weekday_picker_set_all/unset_all", EXPECT_OK},
2986 {*test13a, "htp_editor_new: ok", EXPECT_OK},
2987 {*test13b, "htp_editor_new: inv", EXPECT_ASSERT},
2988 {*test14a, "htp_editor_set_editable: ok", EXPECT_OK},
2989 {*test14b, "htp_editor_set_editable: null", EXPECT_ASSERT},
2990 {*test15a, "htp_editor_set_show_plus: ok", EXPECT_OK},
2991 {*test15b, "htp_editor_set_show_plus: null", EXPECT_ASSERT},
2992 {*test15c, "htp_editor_get_show_plus: null", EXPECT_ASSERT},
2993 {*test15d, "htp_editor_set_show_border: ok", EXPECT_OK},
2994 {*test15e, "htp_editor_set_show_border: null", EXPECT_ASSERT},
2995 {*test15f, "htp_editor_get_show_border: null", EXPECT_ASSERT},
2996 {*test16a, "htp_editor_set_widths: ok", EXPECT_OK},
2997 {*test16b, "htp_editor_set_widths: null", EXPECT_ASSERT},
2998 {*test17a, "htp_editor_set/get_country: ok", EXPECT_OK},
2999 {*test17b, "htp_editor_set/get_country: inv", EXPECT_OK},
3000 {*test17c, "htp_editor_set_country: null", EXPECT_ASSERT},
3001 {*test17d, "htp_editor_get_country: null", EXPECT_ASSERT},
3002 {*test18a, "htp_editor_set/get_area: ok", EXPECT_OK},
3003 {*test18b, "htp_editor_set/get_area: inv", EXPECT_OK},
3004 {*test18c, "htp_editor_set_area: null", EXPECT_ASSERT},
3005 {*test18d, "htp_editor_get_area: null", EXPECT_ASSERT},
3006 {*test19a, "htp_editor_set/get_number: ok", EXPECT_OK},
3007 {*test19b, "htp_editor_set/get_number: FREE", EXPECT_OK},
3008 {*test19c, "htp_editor_set/get_number: inv", EXPECT_OK},
3009 {*test19d, "htp_editor_set_number: null", EXPECT_ASSERT},
3010 {*test19e, "htp_editor_get_number: null", EXPECT_ASSERT},
3011 {*test20a, "hildon_find_object: new", EXPECT_OK},
3012 {*test20b, "hildon_find_object: with_options", EXPECT_OK},
3013 {*test20c, "hildon_find_object: get_text", EXPECT_OK},
3014 {*test20d, "hildon_find_object: get_label", EXPECT_OK},
3015 /*{*test21a, "hildon_find_options: new", EXPECT_OK},
3016 {*test21b, "hildon_find_options: hide_loc", EXPECT_OK},
3017 {*test21c, "hildon_find_options: hide_find_in", EXPECT_OK},
3018 {*test21d, "hildon_find_options: get_location", EXPECT_OK},
3019 {*test21e, "hildon_find_options: get_find", EXPECT_OK},
3020 {*test21f, "hildon_find_options: get_time_period", EXPECT_OK},
3021 {*test21g, "hildon_find_options: get_start", EXPECT_OK},
3022 {*test21h, "hildon_find_options: get_end", EXPECT_OK},
3023 {*test21i, "hildon_find_options: add_custom", EXPECT_OK},
3024 {*test21j, "hildon_find_options: date_matches", EXPECT_ASSERT},*/
3025 {*test22a, "range_editor_new", EXPECT_OK},
3026 {*test22b, "range_editor_new_with_separator", EXPECT_OK},
3027 {*test22c, "range_editor_new_with_separator_null", EXPECT_OK},
3028 {*test22d, "hildon_range_editor_get_range", EXPECT_OK},
3029 {*test22e, "hildon_range_editor_get_range_null", EXPECT_ASSERT},
3030 {*test22f, "hildon_range_editor_get_range_null2", EXPECT_ASSERT},
3031 {*test22g, "hildon_range_editor_get_range_null3", EXPECT_ASSERT},
3032 {*test22h, "hildon_range_editor_get_range_null4", EXPECT_ASSERT},
3033 {*test22i, "hildon_range_editor_set_range", EXPECT_OK},
3034 {*test22j, "hildon_range_editor_set_range_null_editor", EXPECT_ASSERT},
3035 {*test22k, "hildon_range_editor_set_limits", EXPECT_OK},
3036 {*test22l, "hildon_range_editor_set_limits&range", EXPECT_OK},
3037 {*test22m, "hildon_range_editor_set_limits_null", EXPECT_ASSERT},
3038 {*test23a, "hildon_sort_dialog_new", EXPECT_OK},
3039 {*test23b, "hildon_sort_dialog_get_sort_key", EXPECT_OK},
3040 {*test23c, "hildon_sort_dialog_set_sort_key", EXPECT_OK},
3041 {*test23d, "hildon_sort_dialog_add_sort_key", EXPECT_OK},
3042 {*test23e, "hildon_sort_dialog_get_sort_order", EXPECT_OK},
3043 {*test23f, "hildon_sort_dialog_set_sort_order", EXPECT_OK},
3044 {*test23g, "gtk_widget_destroy", EXPECT_OK},
3045 {*test24a, "get_password_dialog. get dialog", EXPECT_OK},
3046 {*test24b, "get_password_dialog. get old dialog", EXPECT_OK},
3047 {*test24c, "get_password_dialog_new_get_password", EXPECT_OK},
3048 {*test24d, "gtk_widget_destroy", EXPECT_OK},
3049 {*test25a, "set_password_dialog. set dialog ", EXPECT_OK},
3050 {*test25b, "set_password_dialog. change dialog", EXPECT_OK},
3051 {*test25c, "set_password_dialog_new_get_password", EXPECT_OK},
3052 {*test25d, "set_password_dialog_new_get_protected", EXPECT_ASSERT},
3053 {*test25e, "gtk_widget_destroy", EXPECT_OK},
3054 #ifndef HILDON_DISABLE_DEPRECATED
3055 {*fsd_set_font, "FontSelectionDialog Set font", EXPECT_OK},
3056 {*fsd_get_font,"FontSelectionDialog Get font", EXPECT_OK},
3058 {*fsd_set_pretext, "FontSelectionDialog Set preview text", EXPECT_OK},
3059 {*fsd_get_pretext, "FontSelectionDialog Get preview text", EXPECT_OK},
3060 {*test27a, "hildon_insert_object: new", EXPECT_OK},
3061 {*test27b, "hildon_insert_object: get_name", EXPECT_OK},
3062 {*test27c, "hildon_insert_object: get_mime_type", EXPECT_ASSERT},
3063 {*test28a, "hildon_number_editor_new", EXPECT_OK},
3064 {*test28b, "hildon_number_editor_get_value", EXPECT_OK},
3065 {*test28c, "hildon_number_editor_set_range", EXPECT_OK},
3066 {*test28d, "hildon_number_editor_set_value", EXPECT_OK},
3067 {*test29a, "hildon_color_selector: set and get red color", EXPECT_OK},
3068 {*test29b, "hildon_color_selector: set and get non-base color", EXPECT_ASSERT},
3069 {*test30a, "hildon_file_handling_note_new_moving", EXPECT_OK},
3070 {*test30b, "hildon_file_handling_note_new_deleting", EXPECT_OK},
3071 {*test30c, "hildon_file_handling_note_new_opening", EXPECT_OK},
3072 {*test30d, "hildon_file_handling_note_new_saving", EXPECT_OK},
3073 {*test31a, "hildon_add_home_dialog_new: ok", EXPECT_OK},
3074 {*test31b, "hildon_add_home_dialog_new: NULL(ok)", EXPECT_OK},
3075 {*test32a, "hildon_rename_dialog: ok", EXPECT_OK},
3076 {*test32b, "hildon_rename_dialog: NULL(ok)", EXPECT_OK},
3077 {*test33a1, "grid_item_new (\"foo\")", EXPECT_OK},
3078 {*test33a2, "grid_item_new (NULL)", EXPECT_ASSERT},
3079 {*test33b1, "grid_item_new_label (\"foo\", \"bar\")", EXPECT_OK},
3080 {*test33b2, "grid_item_new_label (\"foo\", NULL)", EXPECT_OK},
3081 {*test33b3, "grid_item_new_label (NULL, \"bar\")", EXPECT_ASSERT},
3082 {*test33b4, "grid_item_new_label (NULL, NULL)", EXPECT_ASSERT},
3083 {*test33c1, "grid_item_set_emblem (foo, \"bar\")", EXPECT_OK},
3084 {*test33c2, "grid_item_set_emblem (foo, NULL)", EXPECT_OK},
3085 {*test33c3, "grid_item_set_emblem (NULL, \"bar\")", EXPECT_ASSERT},
3086 {*test33c4, "grid_item_set_emblem (NULL, NULL)", EXPECT_ASSERT},
3087 {*test33d1, "grid_item_get_emblem (foo)", EXPECT_OK},
3088 {*test33d2, "grid_item_get_emblem (foo) (no emblem)", EXPECT_ASSERT},
3089 {*test33d3, "grid_item_get_emblem (NULL)", EXPECT_ASSERT},
3090 {*test33e, "grid_item: destroy", EXPECT_OK},
3091 {*test34a, "grid_new ()", EXPECT_OK},
3092 {*test34b1, "grid_set_style (foo, \"bar\")", EXPECT_OK},
3093 {*test34b2, "grid_set_style (foo, NULL)", EXPECT_OK},
3094 {*test34b3, "grid_set_style (NULL, \"foo\")", EXPECT_ASSERT},
3095 {*test34b4, "grid_set_style (NULL, NULL)", EXPECT_ASSERT},
3096 {*test34c1, "grid_get_style (foo)", EXPECT_OK},
3097 {*test34c2, "grid_get_style (foo) (no style)", EXPECT_OK},
3098 {*test34c3, "grid_get_style (NULL)", EXPECT_ASSERT},
3099 {*test34d1, "grid_set_sb_pos (foo, 0)", EXPECT_OK},
3100 {*test34d2, "grid_set_sb_pos (NULL, 0)", EXPECT_ASSERT},
3101 {*test34e1, "grid_get_sb_pos (foo)", EXPECT_OK},
3102 {*test34e2, "grid_get_sb_pos (NULL)", EXPECT_ASSERT},
3103 {*test34f1, "grid_add (grid, item)", EXPECT_OK},
3104 {*test34f2, "grid_add (grid, NULL)", EXPECT_ASSERT},
3105 {*test34f3, "grid_add (grid, something)", EXPECT_ASSERT},
3106 {*test34f4, "grid_add (NULL, whatever)", EXPECT_ASSERT},
3107 {*test34f5, "grid_add (whatever, we)", EXPECT_ASSERT},
3108 {*test34g1, "grid_remove (item) (exist)", EXPECT_OK},
3109 {*test34g2, "grid_remove (item) (non-exist)", EXPECT_ASSERT},
3110 {*test34g3, "grid_remove (NULL)", EXPECT_ASSERT},
3111 {*test34g4, "grid_remove (something)", EXPECT_ASSERT},
3112 {*test34g5, "grid_remove (NULL, some)", EXPECT_ASSERT},
3113 {*test34g6, "grid_remove (some, some)", EXPECT_ASSERT},
3114 {*test34h1, "grid_set_focus (item) (exist)", EXPECT_OK},
3115 {*test34h2, "grid_set_focus (item) (non-exist)", EXPECT_ASSERT},
3116 {*test34h3, "grid_set_focus (NULL)", EXPECT_OK},
3117 {*test34h4, "grid_set_focus (something)", EXPECT_ASSERT},
3118 {*test34i1, "grid: CONTAINER->focus_child (set)", EXPECT_OK},
3119 {*test34i2, "grid: CONTAINER->focus_child (unset)", EXPECT_OK},
3120 {*test34j1, "grid: destroy (items)", EXPECT_OK},
3121 {*test34j2, "grid: destroy (no items)", EXPECT_OK},
3122 {*test35a, "hildon_time_editor_new", EXPECT_OK},
3123 {*test35b, "hildon_time_editor_set/get_time", EXPECT_OK},
3124 {*test35c, "hildon_time_editor_show_seconds", EXPECT_OK},
3125 {*test35d, "hildon_time_editor_enable_duration_mode", EXPECT_OK},
3126 {*test35e, "hildon_time_editor_set/get_duration_range", EXPECT_OK},
3127 {*test35f, "hildon_time_editor_enable_duration_mode (TRUE, FALSE", EXPECT_OK},
3128 {*test35g, "hildon_time_editor_set/get_time with foo value check", EXPECT_ASSERT},
3129 {*test35h, "hildon_time_editor_set/get_duration_range with foo value check", EXPECT_ASSERT},
3130 {*test36a, "hildon_find_replace_dialog_new", EXPECT_OK},
3131 {*test36b, "hildon_find_replace_dialog_new_with_options", EXPECT_OK},
3132 {*test36c, "hildon_find_replace_dialog_get_text", EXPECT_OK},
3133 {*test36d, "hildon_find_replace_dialog_get_new_text", EXPECT_OK},
3134 {*test37a, "gtk_infoprint_temporarily_disable_wrap", EXPECT_OK},
3135 {*test37b, "gtk_banner_temporarily_disable_wrap", EXPECT_OK},
3136 {*test39a, "namepassword dialog get_name", EXPECT_OK},
3137 {*test39b, "namepassword dialog get_password", EXPECT_OK},
3138 #ifndef HILDON_DISABLE_DEPRECATED
3139 {*test41a, "hildon_file_details_dialog_new", EXPECT_OK},
3141 /* {*test38a, "gtk_confirmation_banner (sometext)", EXPECT_OK},
3142 {*test38a, "gtk_confirmation_banner (NULL)", EXPECT_OK},*/
3144 {0} /*REMEMBER THE TERMINATING NULL*/
3147 /*use EXPECT_ASSERT for the tests that are _meant_ to throw assert so they are
3148 *considered passed when they throw assert and failed when they do not
3151 testcase* get_tests()
3153 g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);