8 #include "hildon-controlbar.h"
9 #include "hildon-search.h"
10 #include "hildon-seekbar.h"
11 #include "hildon-note.h"
12 #include <hildon-widgets/gtk-infoprint.h>
13 #include <hildon-widgets/hildon-weekday-picker.h>
14 #include <hildon-widgets/hildon-telephone-editor.h>
15 #include <hildon-widgets/hildon-find-object-dialog.h>
16 #include <hildon-widgets/hildon-range-editor.h>
17 #include <hildon-widgets/hildon-sort-dialog.h>
18 #include <hildon-widgets/hildon-get-password-dialog.h>
19 #include <hildon-widgets/hildon-set-password-dialog.h>
20 #include <hildon-widgets/hildon-hvolumebar.h>
21 #include <hildon-widgets/hildon-vvolumebar.h>
22 #include <hildon-widgets/hildon-font-selection-dialog.h>
23 #include <hildon-widgets/hildon-insert-object-dialog.h>
24 #include <hildon-widgets/hildon-number-editor.h>
25 #include <hildon-widgets/hildon-color-selector.h>
26 #include <hildon-widgets/hildon-file-handling-note.h>
27 #include <hildon-widgets/hildon-add-home-dialog.h>
28 #include <hildon-widgets/hildon-grid-item.h>
29 #include <hildon-widgets/hildon-grid.h>
30 #include <hildon-widgets/hildon-time-editor.h>
31 #include <hildon-widgets/hildon-find-replace-dialog.h>
32 #include <hildon-widgets/hildon-name-password-dialog.h>
33 #include <hildon-widgets/hildon-file-details-dialog.h>
37 /* Icon which must exist (HildonGridItem). */
38 #define VALID_ICON "Help"
40 /*prototypes to keep the compiler happy*/
41 testcase *get_tests(void);
130 /* telephone editor */
157 /* find object dialog */
163 /* find object options dialog */
199 /* get / get old password dialog */
205 /* set / change password dialog */
212 /*FontSelectionDialog*/
213 int fsd_set_font(void);
214 int fsd_get_font(void);
215 int fsd_set_pretext(void);
216 int fsd_get_pretext(void);
232 /* FontHandlingNote */
238 /* Add to Home / Rename dialog */
293 /* Time/Duration Editor */
307 /* New infoprint/banner functionalities. */
312 /* namepassworddialog */
316 /* file details dialog */
319 /* this has to be like this (not static). outo
321 testcase *get_tests(void);
322 void init_test( void )
325 gtk_init (&plop, NULL);
330 HildonControlbar *controlBar;
331 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
339 HildonControlbar *controlBar;
342 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
343 hildon_controlbar_set_max(controlBar, max);
344 assert(hildon_controlbar_get_max(controlBar) == max);
350 HildonControlbar *controlBar;
354 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
355 hildon_controlbar_set_max(controlBar, max);
356 hildon_controlbar_set_value(controlBar, value);
357 assert(hildon_controlbar_get_value(controlBar) == value);
363 HildonControlbar *controlBar;
365 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
366 gtk_widget_destroy(GTK_WIDGET(controlBar));
373 HildonControlbar *controlBar;
375 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
376 hildon_controlbar_set_min(controlBar, 5);
377 getmin = hildon_controlbar_get_min (controlBar);
378 assert (getmin == 5);
387 HildonControlbar *controlBar;
389 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
390 hildon_controlbar_set_range (controlBar, min, max);
399 HildonControlbar *controlBar;
401 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
402 hildon_controlbar_set_range (controlBar, 57, 219);
403 minval = hildon_controlbar_get_min (controlBar);
404 maxval = hildon_controlbar_get_max (controlBar);
405 assert (minval == 57);
406 assert (maxval == 219);
414 HildonControlbar *controlBar;
416 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
417 hildon_controlbar_set_range (controlBar, 250, 550);
418 hildon_controlbar_set_value (controlBar, 100);
420 value = hildon_controlbar_get_value (controlBar);
422 assert (value == 250);
430 HildonControlbar *controlBar;
432 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
433 hildon_controlbar_set_range (controlBar, 250, 550);
434 hildon_controlbar_set_value (controlBar, 650);
436 value = hildon_controlbar_get_value (controlBar);
438 assert (value == 550);
446 seekBar = hildon_seekbar_new();
456 seekBar = hildon_seekbar_new();
457 hildon_seekbar_set_total_time(HILDON_SEEKBAR(seekBar), totalTime);
458 assert(hildon_seekbar_get_total_time(HILDON_SEEKBAR(seekBar)) == totalTime);
468 seekBar = hildon_seekbar_new();
469 hildon_seekbar_set_total_time(HILDON_SEEKBAR(seekBar), totalTime);
470 hildon_seekbar_set_position(HILDON_SEEKBAR(seekBar), position);
471 assert(hildon_seekbar_get_position(HILDON_SEEKBAR(seekBar)) == position);
479 seekBar = hildon_seekbar_new();
480 gtk_widget_destroy(GTK_WIDGET(seekBar));
489 seekBar = hildon_seekbar_new();
490 hildon_seekbar_set_total_time(HILDON_SEEKBAR(seekBar), totalTime);
491 hildon_seekbar_set_fraction(HILDON_SEEKBAR(seekBar), 200);
492 assert(hildon_seekbar_get_fraction(HILDON_SEEKBAR(seekBar)) == 200);
499 gtk_infoprint(NULL,"infoprint");
506 gtk_infoprint(NULL, NULL);
513 gtk_infoprint_with_icon_stock(NULL, "infoprint", GTK_STOCK_DIALOG_QUESTION);
520 gtk_infoprint_with_icon_stock(NULL, "infoprint", "");
527 gtk_infoprint_with_icon_stock(NULL, "infoprint", NULL);
534 gtk_infoprintf (NULL, "mambo %d", 2+3);
541 gtk_infoprintf (NULL, NULL);
548 gtk_confirmation_banner (NULL, "Insert our favourite testing text here.", NULL);
554 gtk_confirmation_banner (NULL, NULL, NULL);
560 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
561 gtk_banner_show_animation (win, "Insert our favourite testing text here.");
562 gtk_banner_set_text (win, "Insert our second favourite testing text here.");
563 gtk_banner_set_text (win, "");
564 gtk_banner_set_text (win, NULL);
565 gtk_banner_close (win);
566 gtk_widget_destroy (GTK_WIDGET (win));
572 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
573 gtk_banner_show_animation (win, "Insert our favourite testing text here.");
574 gtk_banner_set_fraction (win, 0.5);
575 gtk_banner_set_fraction (win, -0.5);
576 gtk_banner_set_fraction (win, 1.5);
577 gtk_banner_close (win);
578 gtk_widget_destroy (GTK_WIDGET (win));
584 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
585 gtk_banner_show_animation (win, "Insert our favourite testing text here.");
586 gtk_banner_close (win);
587 gtk_banner_close (win);
588 gtk_widget_destroy (GTK_WIDGET (win));
594 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
595 gtk_banner_show_animation (win, "Insert our favourite testing text here.");
596 gtk_widget_destroy (GTK_WIDGET (win));
602 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
603 gtk_banner_show_bar (win, "Insert our favourite testing text here.");
604 gtk_banner_set_text (win, "Insert our second favourite testing text here.");
605 gtk_banner_set_text (win, "");
606 gtk_banner_set_text (win, NULL);
607 gtk_banner_set_fraction (win, 0.5);
608 gtk_banner_close (win);
614 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
615 gtk_banner_show_bar (win, "Insert our favourite testing text here.");
616 gtk_banner_set_text (win, "Insert our second favourite testing text here.");
617 gtk_banner_set_text (win, "");
618 gtk_banner_set_text (win, NULL);
619 gtk_banner_set_fraction (win, 0.5);
620 gtk_widget_destroy (GTK_WIDGET (win));
626 gtk_banner_show_bar (NULL, "Insert our favourite testing text here.");
627 gtk_banner_close (NULL);
633 gtk_banner_set_text (NULL, "Insert our second favourite testing text here.");
639 gtk_banner_set_fraction (NULL, 0.5);
645 gtk_banner_close (NULL);
651 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
652 gtk_banner_show_bar (win, "Insert our favourite testing text here.");
653 gtk_banner_set_fraction (win, -0.5);
654 gtk_banner_close (win);
660 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
661 gtk_banner_show_bar (win, "Insert our favourite testing text here.");
662 gtk_banner_set_fraction (win, 1.5);
663 gtk_banner_close (win);
669 gtk_banner_show_animation (NULL, "Insert our favourite testing text here.");
670 gtk_banner_close (NULL);
675 /* note: confirmation note */
678 HildonNote *note = HILDON_NOTE( hildon_note_new_confirmation( NULL,
679 "Delete the presentation?\nHildon Slides" ));
683 /* note: confirmation note with icon stock */
687 note = HILDON_NOTE( hildon_note_new_confirmation_with_icon_stock(NULL,
688 "Delete the presentation?\nHildon Slides", GTK_STOCK_OPEN));
692 /* note: confirmation note with 10 additional buttons */
696 HildonNote *note = HILDON_NOTE( hildon_note_new_confirmation_add_buttons( NULL,
697 "Delete the presentation?\nHildon Slides",
698 "add 1", 12345, "add 2", 13579,
699 "add 3", 12345, "add 4", 13579,
700 "add 5", 12345, "add 6", 13579,
701 "add 7", 12345, "add 8", 13579,
702 "add 9", 24680, "add 9", 24680, NULL) );
707 /* note: confirmation note: Set button text*/
711 note = HILDON_NOTE( hildon_note_new_confirmation(NULL,
712 "Delete the presentation?\nHildon Slides"));
713 hildon_note_set_button_text( HILDON_NOTE( note ) , "Remove" );
717 /* note: information note */
721 note = HILDON_NOTE( hildon_note_new_information(NULL,
722 "Only one button present\nin this information note"));
726 /* note: information note with icon stock */
730 note = HILDON_NOTE( hildon_note_new_information_with_icon_stock(NULL,
731 "Only one button present\nin this information note", GTK_STOCK_HARDDISK));
735 /* note: information note: Set button text*/
739 note = HILDON_NOTE( hildon_note_new_information(NULL,
740 "Only one button present\nin this information note"));
741 hildon_note_set_button_text( HILDON_NOTE( note ) , "Continue" );
750 note = HILDON_NOTE( hildon_note_new_cancel( NULL,
751 "Deleting files.." ));
756 /* note: new cancel: set button text
761 note = HILDON_NOTE( hildon_note_new_cancel( NULL,
762 "Deleting files.." ));
763 hildon_note_set_button_text( HILDON_NOTE( note ) , "Stop" );
767 /* note: new cancel with progress bar*/
771 GtkWidget *progress_note;
773 progbar = gtk_progress_bar_new();
775 gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR( progbar ), 0.7 );
777 progress_note = hildon_note_new_cancel_with_progress_bar(
778 NULL, "Deleting files..",
779 GTK_PROGRESS_BAR( progbar ));
781 assert(progress_note);
785 /* note: new cancel with progress bar: set button text*/
789 GtkWidget *progress_note;
791 progbar = gtk_progress_bar_new();
793 gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR( progbar ), 0.7 );
795 progress_note = hildon_note_new_cancel_with_progress_bar(
796 NULL, "Deleting files..",
797 GTK_PROGRESS_BAR( progbar ));
799 hildon_note_set_button_text( HILDON_NOTE( progress_note ) , "Stop" );
802 /* destroy note widgets */
807 /* GtkWidget *cancel;*/
810 GtkWidget *conf_button;
812 conf = hildon_note_new_confirmation(NULL, NULL);
814 gtk_widget_destroy(conf);
816 inf = hildon_note_new_information(NULL, NULL);
818 gtk_widget_destroy(inf);
821 cancel = hildon_note_new_cancel( NULL, NULL );
823 gtk_widget_destroy(cancel);
826 progbar = gtk_progress_bar_new();
827 progress = hildon_note_new_cancel_with_progress_bar(
828 NULL, NULL, GTK_PROGRESS_BAR( progbar ));
830 gtk_widget_destroy(progress);
832 conf_button = hildon_note_new_confirmation_add_buttons( NULL, NULL, NULL );
834 gtk_widget_destroy(conf_button);
841 HildonHVolumebar *volumeBar;
843 volumeBar = HILDON_HVOLUMEBAR(hildon_hvolumebar_new());
850 HildonVVolumebar *volumeBar;
852 volumeBar = HILDON_VVOLUMEBAR(hildon_vvolumebar_new());
859 HildonHVolumebar *volumeBar;
860 gdouble volumeLevel = 0.5;
862 volumeBar = HILDON_HVOLUMEBAR(hildon_hvolumebar_new());
863 hildon_volumebar_set_level(HILDON_VOLUMEBAR(volumeBar), volumeLevel);
864 assert(hildon_volumebar_get_level(HILDON_VOLUMEBAR(volumeBar)) == volumeLevel);
870 HildonHVolumebar *volumeBar;
871 gboolean mute = FALSE;
873 volumeBar = HILDON_HVOLUMEBAR(hildon_hvolumebar_new());
874 hildon_volumebar_set_mute(HILDON_VOLUMEBAR(volumeBar), mute);
875 assert(hildon_volumebar_get_mute(HILDON_VOLUMEBAR(volumeBar)) == mute);
881 HildonVVolumebar *volumeBar;
883 volumeBar = HILDON_VVOLUMEBAR(hildon_vvolumebar_new());
884 gtk_widget_destroy(GTK_WIDGET(volumeBar));
892 search = hildon_search_new( NULL );
901 search = hildon_search_new( "some text" );
910 search = hildon_search_new( "gtk-add" );
911 hildon_search_set_image_stock(HILDON_SEARCH(search), "soopaa");
920 search = hildon_search_new( NULL );
921 hildon_search_set_image_stock(HILDON_SEARCH(search), "gtk-add");
929 search = hildon_search_new( NULL );
930 gtk_widget_destroy(search);
934 /* weekday_picker: new: ok */
940 picker = hildon_weekday_picker_new();
945 /* weekday_picker: set/unset/isset: ok */
949 HildonWeekdayPicker *picker;
952 picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
955 /* set all one by one */
956 for( i = 1; i < 8; ++i )
957 hildon_weekday_picker_set_day( picker, i );
959 /* check that the proper days are set */
960 for( j = 1; j < 8; ++j )
961 assert( hildon_weekday_picker_isset_day( picker, j ) );
963 /* unset all one by one */
964 for( i = 1; i < 8; ++i )
965 hildon_weekday_picker_unset_day( picker, i );
967 /* check that the proper days are unset */
968 for( j = 1; j < 8; ++j )
969 assert( !hildon_weekday_picker_isset_day( picker, j ) );
974 /* weekday_picker: set_day: null */
978 hildon_weekday_picker_set_day( NULL, 0 );
982 /* weekday_picker: unset_day: null */
986 hildon_weekday_picker_unset_day( NULL, 0 );
990 /* weekday_picker: isset_day: null */
994 hildon_weekday_picker_isset_day( NULL, 0 );
998 /* weekday_picker: toggle: ok */
1002 HildonWeekdayPicker *picker;
1004 picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
1007 /* set all one by one */
1008 for( i = 1; i < 8; i++ )
1009 hildon_weekday_picker_toggle_day( picker, i );
1011 /* check that the proper days are set */
1012 for( j = 1; j < 8; j++ )
1013 assert ( hildon_weekday_picker_isset_day( picker, j ) );
1015 /* unset all one by one */
1016 for( i = 1; i < 8; ++i )
1017 hildon_weekday_picker_toggle_day( picker, i );
1019 /* check that the proper days are unset */
1020 for( j = 1; j < 8; ++j )
1021 assert( !hildon_weekday_picker_isset_day( picker, j ) );
1026 /* weekday_picker: toggle_day: null */
1029 HildonWeekdayPicker *picker;
1030 picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
1031 hildon_weekday_picker_toggle_day( NULL, 0 );
1035 /* weekday_picker: set_all/unset_all*/
1038 HildonWeekdayPicker *picker;
1039 picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
1040 hildon_weekday_picker_set_all( picker );
1041 hildon_weekday_picker_unset_all( picker );
1045 /* telephone editor: new: ok */
1052 editor = hildon_telephone_editor_new( HILDON_TELEPHONE_EDITOR_FORMAT_FREE );
1055 editor = hildon_telephone_editor_new
1056 ( HILDON_TELEPHONE_EDITOR_FORMAT_COERCE );
1059 editor = hildon_telephone_editor_new
1060 ( HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY );
1063 editor = hildon_telephone_editor_new
1064 ( HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA );
1070 /* telephone editor: new: inv */
1077 editor = hildon_telephone_editor_new( 17 );
1083 /* telephone editor: set_editable: ok */
1087 HildonTelephoneEditorFormat fmt[4] = {
1088 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1089 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1090 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1091 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1096 for( i = 0; i < 4; ++i )
1098 editor = hildon_telephone_editor_new( fmt[i] );
1099 hildon_telephone_editor_set_editable( HILDON_TELEPHONE_EDITOR( editor ),
1101 hildon_telephone_editor_set_editable( HILDON_TELEPHONE_EDITOR( editor ),
1102 FALSE, FALSE, FALSE );
1103 gtk_widget_destroy( editor );
1109 /* telephone editor: set_editable: null */
1113 hildon_telephone_editor_set_editable( NULL, TRUE, TRUE, TRUE );
1117 /* telephone editor: set_show_plus: ok */
1121 HildonTelephoneEditorFormat fmt[4] = {
1122 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1123 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1124 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1125 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1130 for( i = 0; i < 4; ++i )
1132 editor = hildon_telephone_editor_new( fmt[i] );
1136 hildon_telephone_editor_set_show_plus( HILDON_TELEPHONE_EDITOR( editor ),
1139 /* only check if not in free mode (no plus there) */
1141 assert( hildon_telephone_editor_get_show_plus( HILDON_TELEPHONE_EDITOR( editor ) )
1143 hildon_telephone_editor_set_show_plus( HILDON_TELEPHONE_EDITOR( editor ),
1146 assert( hildon_telephone_editor_get_show_plus( HILDON_TELEPHONE_EDITOR( editor ) )
1148 gtk_widget_destroy( editor );
1154 /* telephone editor: set_show_plus: null */
1158 hildon_telephone_editor_set_show_plus( NULL, TRUE );
1163 /* telephone editor: get_show_plus: null */
1167 hildon_telephone_editor_get_show_plus( NULL );
1172 /* telephone editor: set_show_border: ok */
1176 HildonTelephoneEditorFormat fmt[4] = {
1177 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1178 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1179 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1180 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1185 for( i = 0; i < 4; ++i )
1187 editor = hildon_telephone_editor_new( fmt[i] );
1191 hildon_telephone_editor_set_show_border( HILDON_TELEPHONE_EDITOR( editor ),
1193 assert( hildon_telephone_editor_get_show_border
1194 ( HILDON_TELEPHONE_EDITOR( editor ) ) == TRUE );
1196 hildon_telephone_editor_set_show_border( HILDON_TELEPHONE_EDITOR( editor ),
1198 assert( hildon_telephone_editor_get_show_border( HILDON_TELEPHONE_EDITOR( editor ) )
1201 gtk_widget_destroy( editor );
1207 /* telephone editor: set_show_border: null */
1211 hildon_telephone_editor_set_show_border( NULL, TRUE );
1216 /* telephone editor: get_show_border: null */
1220 hildon_telephone_editor_get_show_border( NULL );
1225 /* telephone editor: set_widths: ok */
1229 HildonTelephoneEditorFormat fmt[4] = {
1230 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1231 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1232 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1233 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1238 for( i = 0; i < 4; ++i )
1240 editor = hildon_telephone_editor_new( fmt[i] );
1241 hildon_telephone_editor_set_widths( HILDON_TELEPHONE_EDITOR( editor ),
1243 hildon_telephone_editor_set_widths( HILDON_TELEPHONE_EDITOR( editor ),
1245 hildon_telephone_editor_set_widths( HILDON_TELEPHONE_EDITOR( editor ),
1247 gtk_widget_destroy( editor );
1253 /* telephone editor: set_widths: null */
1257 hildon_telephone_editor_set_widths( NULL, 1, 1, 1 );
1262 /* telephone editor: set/get_country: ok */
1267 gchar teststr[] = "123456";
1268 HildonTelephoneEditorFormat fmt[4] = {
1269 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1270 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1271 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1272 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1277 for( i = 0; i < 4; ++i )
1279 editor = hildon_telephone_editor_new( fmt[i] );
1280 hildon_telephone_editor_set_country( HILDON_TELEPHONE_EDITOR( editor ),
1282 c = hildon_telephone_editor_get_country
1283 ( HILDON_TELEPHONE_EDITOR( editor ) );
1285 /* format != FREE */
1289 g_assert( strcmp( teststr, c ) == 0 );
1292 gtk_widget_destroy( editor );
1298 /* telephone editor: set/get_country: inv */
1303 gchar teststr[] = "123456p";
1307 editor = hildon_telephone_editor_new(
1308 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY );
1309 hildon_telephone_editor_set_country( HILDON_TELEPHONE_EDITOR( editor ),
1311 c = hildon_telephone_editor_get_country
1312 ( HILDON_TELEPHONE_EDITOR( editor ) );
1315 g_assert( strcmp( teststr, c ) != 0 );
1317 gtk_widget_destroy( editor );
1322 /* telephone editor: set_country: null */
1326 hildon_telephone_editor_set_country( NULL, "123" );
1331 /* telephone editor: get_country: null */
1335 hildon_telephone_editor_get_country( NULL );
1340 /* telephone editor: set/get_area: ok */
1345 gchar teststr[] = "123456";
1346 HildonTelephoneEditorFormat fmt[4] = {
1347 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1348 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1349 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1350 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1355 for( i = 0; i < 4; ++i )
1357 editor = hildon_telephone_editor_new( fmt[i] );
1358 hildon_telephone_editor_set_area( HILDON_TELEPHONE_EDITOR( editor ),
1360 c = hildon_telephone_editor_get_area
1361 ( HILDON_TELEPHONE_EDITOR( editor ) );
1363 /* format != FREE nor COUNTRY */
1368 g_assert( strncmp( teststr, c, strlen( c ) ) == 0 );
1371 gtk_widget_destroy( editor );
1377 /* telephone editor: set/get_area: inv */
1382 gchar teststr[] = "123456p";
1386 editor = hildon_telephone_editor_new(
1387 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA );
1388 hildon_telephone_editor_set_area( HILDON_TELEPHONE_EDITOR( editor ),
1390 c = hildon_telephone_editor_get_area
1391 ( HILDON_TELEPHONE_EDITOR( editor ) );
1394 g_assert( strcmp( teststr, c ) != 0 );
1396 gtk_widget_destroy( editor );
1401 /* telephone editor: set_area: null */
1405 hildon_telephone_editor_set_area( NULL, "123" );
1410 /* telephone editor: get_area: null */
1414 hildon_telephone_editor_get_area( NULL );
1419 /* telephone editor: set/get_number: ok */
1424 gchar teststr[] = "123456";
1425 HildonTelephoneEditorFormat fmt[4] = {
1426 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1427 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1428 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1429 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1434 for( i = 0; i < 4; ++i )
1436 editor = hildon_telephone_editor_new( fmt[i] );
1437 hildon_telephone_editor_set_number( HILDON_TELEPHONE_EDITOR( editor ),
1439 c = hildon_telephone_editor_get_number
1440 ( HILDON_TELEPHONE_EDITOR( editor ) );
1442 /* free != COUNTRY nor AREA */
1443 if( i != 2 && i != 3 )
1446 g_assert( strcmp( teststr, c ) == 0 );
1449 gtk_widget_destroy( editor );
1455 /* telephone editor: set/get_number: ok in FREE format */
1460 gchar teststr[] = "()+?*pw1234567890";
1462 editor = hildon_telephone_editor_new(
1463 HILDON_TELEPHONE_EDITOR_FORMAT_FREE );
1464 hildon_telephone_editor_set_number( HILDON_TELEPHONE_EDITOR( editor ),
1466 c = hildon_telephone_editor_get_number
1467 ( HILDON_TELEPHONE_EDITOR( editor ) );
1470 g_assert( strncmp( teststr, c, strlen(c) ) == 0 );
1472 gtk_widget_destroy( editor );
1477 /* telephone editor: set/get_number: inv */
1482 gchar teststr[] = "123456f";
1486 editor = hildon_telephone_editor_new(
1487 HILDON_TELEPHONE_EDITOR_FORMAT_FREE );
1488 hildon_telephone_editor_set_number( HILDON_TELEPHONE_EDITOR( editor ),
1490 c = hildon_telephone_editor_get_number
1491 ( HILDON_TELEPHONE_EDITOR( editor ) );
1494 g_assert( strcmp( teststr, c ) != 0 );
1496 gtk_widget_destroy( editor );
1501 /* telephone editor: set_number: null */
1504 hildon_telephone_editor_set_number( NULL, "123" );
1509 /* telephone editor: get_number: null */
1512 hildon_telephone_editor_get_number( NULL );
1517 /* find object dialog: new */
1520 dialog = hildon_find_object_dialog_new(NULL);
1525 /* find object dialog: new with options */
1530 options = gtk_dialog_new();
1531 dialog = hildon_find_object_dialog_new_with_options(NULL,GTK_DIALOG(options));
1532 gtk_widget_destroy(dialog);
1537 /* find object dialog: get_text */
1539 const gchar *string;
1542 dialog = hildon_find_object_dialog_new(NULL);
1543 string = hildon_find_object_dialog_get_text(HILDON_FIND_OBJECT_DIALOG(dialog));
1548 /* find object dialog: set_label */
1552 dialog = hildon_find_object_dialog_new(NULL);
1553 hildon_find_object_dialog_set_label(HILDON_FIND_OBJECT_DIALOG(dialog),"labeltext");
1558 /* find object options dialog: new */
1559 /*int test21a(void){
1561 dialog = hildon_find_object_options_dialog_new(NULL);
1566 /* find object options dialog: hide_location */
1567 /*int test21b(void){
1569 dialog = hildon_find_object_options_dialog_new(NULL);
1570 hildon_find_object_options_dialog_hide_location(
1571 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1572 gtk_widget_destroy(dialog);
1577 /* find object options dialog: hide_find_in */
1578 /*int test21c(void){
1580 dialog = hildon_find_object_options_dialog_new(NULL);
1581 hildon_find_object_options_dialog_hide_find_in(
1582 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1587 /* find object options dialog: get_location */
1588 /*int test21d(void){
1589 const gchar *retString;
1591 dialog = hildon_find_object_options_dialog_new(NULL);
1592 retString = hildon_find_object_options_dialog_get_location(
1593 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1595 g_assert(retString);
1600 /* find object options dialog: get_find_type */
1601 /*int test21e(void){
1602 HildonFindInType find_type;
1604 dialog = hildon_find_object_options_dialog_new(NULL);
1606 find_type = hildon_find_object_options_dialog_get_find_type(
1607 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1612 /* find object options dialog: get_time_period_type */
1613 /*int test21f(void){
1614 HildonTimePeriodType type;
1616 dialog = hildon_find_object_options_dialog_new(NULL);
1617 type = hildon_find_object_options_dialog_get_time_period_type(
1618 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1622 /* find object options dialog: get_start_date */
1623 /*int test21g(void){
1625 gint year, month, day;
1627 dialog = hildon_find_object_options_dialog_new(NULL);
1629 hildon_find_object_options_dialog_get_start_date(HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog),
1630 &year, &month, &day);
1639 /* find object options dialog: get_end_date */
1640 /*int test21h(void){
1642 gint year, month, day;
1644 dialog = hildon_find_object_options_dialog_new(NULL);
1646 hildon_find_object_options_dialog_get_end_date(HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog),
1647 &year, &month, &day);
1656 /* find object options dialog: add_custom_options */
1657 /*int test21i(void){
1659 GtkWidget *widget = gtk_entry_new();
1661 dialog = hildon_find_object_options_dialog_new(NULL);
1663 hildon_find_object_options_dialog_add_custom_option(
1664 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog), "New widget", widget);
1669 /* find object options dialog: date_matches */
1670 /*int test21j(void){
1672 dialog = hildon_find_object_options_dialog_new(NULL);
1674 g_assert(hildon_find_object_dialog_date_matches(HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog),
1680 /* range editor: new range editor: ok parameters */
1683 HildonRangeEditor *range_editor;
1685 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1686 assert(range_editor);
1690 /* range editor: new range editor with separator: ok parameters */
1693 HildonRangeEditor *range_editor;
1695 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new_with_separator(
1697 assert(range_editor);
1701 /* range editor: new range editor with separator: NULL parameters */
1704 HildonRangeEditor *range_editor;
1706 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new_with_separator(NULL));
1707 assert(range_editor);
1711 /* range editor: get range: ok parameters */
1714 HildonRangeEditor *range_editor;
1717 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1718 hildon_range_editor_get_range (range_editor, &start, &end);
1720 assert (start == -999);
1721 assert (end == 999);
1726 /* range editor: get range: null range editor */
1729 HildonRangeEditor *range_editor = NULL;
1732 hildon_range_editor_get_range (range_editor, &start, &end);
1737 /* range editor: get range: null end */
1740 HildonRangeEditor *range_editor = NULL;
1743 hildon_range_editor_get_range (range_editor, &start, NULL);
1748 /* range editor: get range: null start */
1751 HildonRangeEditor *range_editor = NULL;
1754 hildon_range_editor_get_range (range_editor, NULL, &end);
1759 /* range editor: get range: null start, end */
1762 HildonRangeEditor *range_editor = NULL;
1764 hildon_range_editor_get_range (range_editor, NULL, NULL);
1769 /* range editor: set range: ok parameters */
1772 HildonRangeEditor *range_editor;
1773 gint start = 5, end = 6;
1775 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1777 hildon_range_editor_set_range (range_editor, start, end);
1778 hildon_range_editor_get_range (range_editor, &start, &end);
1780 assert (start == 5);
1786 /* range editor: set range: null range editor*/
1789 HildonRangeEditor *range_editor = NULL;
1790 gint start = 5, end = 6;
1792 hildon_range_editor_set_range (range_editor, start, end);
1797 /* range editor: set limits: ok parameters */
1800 HildonRangeEditor *range_editor;
1801 gint start = 0, end = 0;
1803 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1805 hildon_range_editor_set_limits (range_editor, start, end);
1806 hildon_range_editor_get_range (range_editor, &start, &end);
1808 assert (start == 0);
1814 /* range editor: set limits: set range over start minimum and end maximum */
1817 HildonRangeEditor *range_editor;
1818 gint start = -1, end = 1;
1820 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1822 hildon_range_editor_set_limits (range_editor, 0, 0);
1823 hildon_range_editor_set_range (range_editor, start, end);
1824 hildon_range_editor_get_range (range_editor, &start, &end);
1826 assert (start == 0);
1832 /* range editor: set limits: NULL editor */
1835 HildonRangeEditor *range_editor = NULL;
1836 gint start = 0, end = 0;
1838 hildon_range_editor_set_limits (range_editor, start, end);
1848 HildonSortDialog *sort_dialog;
1850 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1851 assert(sort_dialog);
1855 /* sort dialog: Get sort key. '0' is the default index value */
1859 HildonSortDialog *sort_dialog;
1860 gint default_key = 0;
1862 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1863 assert(hildon_sort_dialog_get_sort_key( sort_dialog ) == default_key );
1867 /* sort dialog: Set sort key */
1871 HildonSortDialog *sort_dialog;
1874 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1875 hildon_sort_dialog_set_sort_key( sort_dialog, key );
1876 assert(hildon_sort_dialog_get_sort_key( sort_dialog ) == 1 );
1880 /* sort dialog: add sort key */
1884 HildonSortDialog *sort_dialog;
1886 gint added_key_index = 0;
1888 sort_dialog = HILDON_SORT_DIALOG (hildon_sort_dialog_new(NULL));
1889 hildon_sort_dialog_add_sort_key (sort_dialog, "Random");
1890 added_key_index = hildon_sort_dialog_add_sort_key (sort_dialog,
1893 hildon_sort_dialog_set_sort_key( sort_dialog, added_key_index );
1894 assert(hildon_sort_dialog_get_sort_key( sort_dialog ) == key );
1898 /* sort dialog: get sort order. '0' is the default index value */
1902 HildonSortDialog *sort_dialog;
1903 GtkSortType type = 0;
1905 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1906 assert(hildon_sort_dialog_get_sort_order( sort_dialog ) == type);
1910 /* sort dialog: set sort order */
1914 HildonSortDialog *sort_dialog;
1915 GtkSortType type = 1;
1917 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1918 hildon_sort_dialog_set_sort_order( sort_dialog , type);
1919 assert(hildon_sort_dialog_get_sort_order( sort_dialog ) == 1);
1923 /* sort dialog: gtk_widget_destroy */
1926 GtkWidget *sort_dialog;
1928 sort_dialog = hildon_sort_dialog_new(FALSE);
1929 gtk_widget_destroy(GTK_WIDGET(sort_dialog));
1934 /* Get password dialog */
1938 HildonGetPasswordDialog *get_dialog;
1940 get_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1946 /* Get Old password dialog */
1950 HildonGetPasswordDialog *get_old_dialog;
1952 get_old_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1954 assert(get_old_dialog);
1958 /* Get / Get Old password dialog: get password */
1961 HildonGetPasswordDialog *get_dialog;
1962 HildonGetPasswordDialog *get_old_dialog;
1963 const gchar *get_string;
1964 const gchar *get_old_string;
1966 get_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1968 get_string = hildon_get_password_dialog_get_password( get_dialog);
1971 get_old_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1973 get_old_string = hildon_get_password_dialog_get_password( get_old_dialog);
1974 assert(get_old_string);
1978 /* get / get old password dialog: gtk_widget_destroy */
1981 GtkWidget *get_dialog;
1982 GtkWidget *get_old_dialog;
1984 get_dialog = hildon_get_password_dialog_new(NULL, FALSE);
1985 gtk_widget_destroy(GTK_WIDGET(get_dialog));
1987 get_old_dialog = hildon_get_password_dialog_new(NULL, TRUE);
1988 gtk_widget_destroy(GTK_WIDGET(get_old_dialog));
1993 /* set password dialog */
1997 HildonSetPasswordDialog *set_dialog;
1999 set_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(NULL,
2005 /* change password dialog */
2009 HildonSetPasswordDialog *change_dialog;
2011 change_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
2013 assert(change_dialog);
2017 /* set / change password dialog: get password */
2020 HildonSetPasswordDialog *set_dialog;
2021 HildonSetPasswordDialog *change_dialog;
2022 const gchar *set_string;
2023 const gchar *change_string;
2025 set_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
2027 set_string = hildon_set_password_dialog_get_password( set_dialog);
2030 change_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
2032 change_string = hildon_set_password_dialog_get_password( change_dialog);
2033 assert(change_string);
2037 /* set / change password dialog: get protected */
2040 HildonSetPasswordDialog *set_dialog;
2041 HildonSetPasswordDialog *change_dialog;
2045 set_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
2047 set = hildon_set_password_dialog_get_protected(set_dialog);
2050 change_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
2052 change = hildon_set_password_dialog_get_protected(change_dialog);
2056 /* set / change password dialog: gtk_widget_destroy */
2059 GtkWidget *set_dialog;
2060 GtkWidget *change_dialog;
2062 set_dialog = hildon_set_password_dialog_new(NULL, FALSE);
2063 gtk_widget_destroy(GTK_WIDGET(set_dialog));
2065 change_dialog = hildon_set_password_dialog_new(NULL, TRUE);
2066 gtk_widget_destroy(GTK_WIDGET(change_dialog));
2071 int fsd_get_font(void)
2074 PangoAttrList *list = NULL;
2075 fsd = hildon_font_selection_dialog_new( NULL, "fsd" );
2076 list = hildon_font_selection_dialog_get_font(HILDON_FONT_SELECTION_DIALOG(fsd));
2077 assert( list!=NULL );
2081 int fsd_set_font(void)
2084 PangoAttrList *list = NULL;
2085 fsd = hildon_font_selection_dialog_new( NULL, "fsd" );
2086 list = hildon_font_selection_dialog_get_font(HILDON_FONT_SELECTION_DIALOG(fsd));
2087 hildon_font_selection_dialog_set_font(HILDON_FONT_SELECTION_DIALOG(fsd), list);
2091 int fsd_set_pretext(void)
2094 char *str = "Mopo karkas käsistä";
2095 fsd = hildon_font_selection_dialog_new( NULL, "fsd" );
2096 hildon_font_selection_dialog_set_preview_text(HILDON_FONT_SELECTION_DIALOG(fsd),str);
2100 int fsd_get_pretext(void)
2104 fsd = hildon_font_selection_dialog_new( NULL, "fsd" );
2105 str = (char*)hildon_font_selection_dialog_get_preview_text(
2106 HILDON_FONT_SELECTION_DIALOG(fsd));
2108 assert( str!=NULL );
2111 /* insert object dialog: new */
2114 dialog = hildon_insert_object_dialog_new(NULL);
2119 /* insert object dialog: get_name */
2121 const gchar *string;
2124 dialog = hildon_insert_object_dialog_new(NULL);
2125 string = hildon_insert_object_dialog_get_name(HILDON_INSERT_OBJECT_DIALOG(dialog));
2130 /* insert object dialog: get_mime_type */
2132 const gchar *string;
2135 dialog = hildon_insert_object_dialog_new(NULL);
2136 string = hildon_insert_object_dialog_get_mime_type(HILDON_INSERT_OBJECT_DIALOG(dialog));
2141 /* hildon_number_editor_new */
2147 editor = hildon_number_editor_new (min, max);
2153 /* hildon_number_editor_get_value */
2160 editor = hildon_number_editor_new (min, max);
2161 value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2162 g_assert (value == max);
2167 /* hildon_number_editor_set_range */
2174 editor = hildon_number_editor_new (min, max);
2175 hildon_number_editor_set_range (HILDON_NUMBER_EDITOR (editor), 30, 80);
2176 value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2177 g_assert (value == 80);
2182 /* hildon_number_editor_set_value */
2189 editor = hildon_number_editor_new (min, max);
2190 hildon_number_editor_set_value (HILDON_NUMBER_EDITOR (editor), 3450);
2191 value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2192 g_assert (value == 3450);
2197 /* Hildon-Color-Selector:
2198 hildon_color_selector_new()
2202 GtkWidget *colselector;
2203 GdkColor redcolor = {0, 65535, 0, 0 };
2206 colselector = hildon_color_selector_new( NULL );
2208 hildon_color_selector_set_color( HILDON_COLOR_SELECTOR(colselector), &(redcolor) );
2209 color = hildon_color_selector_get_color( HILDON_COLOR_SELECTOR(colselector) );
2211 g_assert( colselector );
2212 g_assert( redcolor.pixel == color->pixel );
2213 g_assert( redcolor.red == color->red );
2214 g_assert( redcolor.green == color->green );
2215 g_assert( redcolor.blue == color->blue );
2218 gtk_widget_destroy ( colselector );
2222 /* Hildon-Color-Selector:
2223 HildonColorSelector with non-base color
2227 HildonColorSelector *colorsel;
2228 GtkWidget *obj_self;
2229 GdkColor mixedcolor = { 0, 7281, 21845, 65535 };
2232 obj_self = hildon_color_selector_new( NULL );
2233 colorsel = HILDON_COLOR_SELECTOR ( obj_self );
2235 hildon_color_selector_set_color( colorsel, &mixedcolor );
2236 color = hildon_color_selector_get_color( colorsel );
2238 g_assert( colorsel );
2239 g_assert( color->pixel == 0 );
2240 g_assert( color->red == 7281 );
2241 g_assert( color->green == 21845 );
2242 g_assert( color->blue == 65535 );
2245 g_object_unref ( obj_self );
2246 gtk_widget_destroy( GTK_WIDGET(colorsel) );
2251 /* hildon_file_handling_note_new_moving */
2254 GtkWidget *file_note;
2256 file_note = hildon_file_handling_note_new_moving (NULL);
2257 hildon_file_handling_note_set_fraction (HILDON_FILE_HANDLING_NOTE(file_note), 0.7);
2259 g_assert (file_note);
2264 /* hildon_file_handling_note_new_deleting */
2267 GtkWidget *file_note;
2269 file_note = hildon_file_handling_note_new_deleting (NULL);
2270 hildon_file_handling_note_set_counter_and_name (HILDON_FILE_HANDLING_NOTE (file_note),
2272 hildon_file_handling_note_set_counter_and_name (HILDON_FILE_HANDLING_NOTE (file_note),
2274 g_assert (file_note);
2279 /* hildon_file_handling_note_new_opening */
2282 GtkWidget *file_note;
2284 file_note = hildon_file_handling_note_new_opening (NULL);
2285 hildon_file_handling_note_set_name (HILDON_FILE_HANDLING_NOTE (file_note),
2287 g_assert (file_note);
2292 /* hildon_file_handling_note_new_saving */
2295 GtkWidget *file_note;
2297 file_note = hildon_file_handling_note_new_saving (NULL);
2298 hildon_file_handling_note_set_fraction (HILDON_FILE_HANDLING_NOTE (file_note), 0.7);
2299 g_assert (file_note);
2304 /* Add to Home dialog new: ok parameters */
2308 d = hildon_add_home_dialog_new( NULL, "name" , NULL);
2314 /* Add to Home dialog new: NULL parameter (is ok) */
2318 d = hildon_add_home_dialog_new( NULL, NULL, NULL );
2324 /* Rename dialog new: ok parameters */
2328 d = hildon_add_home_dialog_new( NULL, "name", "newname" );
2334 /* Rename dialog new: NULL parameter (is ok) */
2338 d = hildon_add_home_dialog_new( NULL, NULL, "newname" );
2344 /* Create item with icon basename. */
2347 /* If test fails, first see if icon exists. */
2349 item = hildon_grid_item_new (VALID_ICON);
2354 /* Create item without icon basename. */
2358 item = hildon_grid_item_new (NULL);
2363 /* Create item with icon basename and label. */
2366 /* If test fails, first see if icon exists. */
2368 item = hildon_grid_item_new_with_label (VALID_ICON, "foo");
2373 /* Create item with icon basename but with no label. */
2376 /* If test fails, first see if icon exists. */
2378 item = hildon_grid_item_new_with_label (VALID_ICON, NULL);
2385 item = hildon_grid_item_new_with_label (NULL, "foo");
2390 /* Create item without icon basename and without label. */
2394 item = hildon_grid_item_new_with_label (NULL, NULL);
2399 /* Set emblem type. Non-NULL item, non-NULL emblem. */
2402 /* If test fails, first see if icon exists. */
2404 item = hildon_grid_item_new (VALID_ICON);
2405 hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), VALID_ICON);
2409 /* Set emblem type. Non-NULL item, NULL emblem. */
2412 /* If test fails, first see if icon exists. */
2414 item = hildon_grid_item_new (VALID_ICON);
2415 hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), NULL);
2419 /* Set emblem type. NULL item, non-NULL emblem. */
2422 hildon_grid_item_set_emblem_type (NULL, VALID_ICON);
2426 /* Set emblem type. NULL item, NULL emblem. */
2429 hildon_grid_item_set_emblem_type (NULL, NULL);
2433 /* Get emblem type from existing item - has emblem. */
2436 /* If test fails, first see if icon exists. */
2439 item = hildon_grid_item_new (VALID_ICON);
2440 hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), VALID_ICON);
2441 type = hildon_grid_item_get_emblem_type (HILDON_GRID_ITEM (item));
2446 /* Get emblem type from existing item - has no emblem. */
2449 /* If test fails, first see if icon exists. */
2452 item = hildon_grid_item_new (VALID_ICON);
2453 type = hildon_grid_item_get_emblem_type (HILDON_GRID_ITEM (item));
2454 g_assert (type != NULL);
2458 /* Get emblem type from non-existing item. */
2462 type = hildon_grid_item_get_emblem_type (NULL);
2463 g_assert (type != NULL);
2467 /* Destroy griditem. */
2471 item = hildon_grid_item_new (VALID_ICON);
2472 gtk_widget_destroy (item);
2476 /* Create new grid. */
2480 grid = hildon_grid_new ();
2485 /* Set grid style. */
2489 grid = hildon_grid_new ();
2490 hildon_grid_set_style (HILDON_GRID (grid), "bar");
2494 /* Set grid style (no style). */
2498 grid = hildon_grid_new ();
2499 hildon_grid_set_style (HILDON_GRID (grid), NULL);
2503 /* Set grid style. Invalid grid. */
2506 hildon_grid_set_style (NULL, "bar");
2510 /* Set grid style. Invalid grid, no style. */
2513 hildon_grid_set_style (NULL, NULL);
2517 /* Get grid style. Valid grid, has style. */
2522 grid = hildon_grid_new ();
2523 hildon_grid_set_style (HILDON_GRID (grid), "foo");
2524 style = hildon_grid_get_style (HILDON_GRID (grid));
2529 /* Get grid style. Valid grid, has no style. */
2534 grid = hildon_grid_new ();
2535 hildon_grid_set_style (HILDON_GRID (grid), NULL);
2536 style = hildon_grid_get_style (HILDON_GRID (grid));
2537 g_assert (style != NULL && strcmp (style, "HildonGrid") == 0);
2541 /* Get grid style. Invalid grid. */
2545 style = hildon_grid_get_style (NULL);
2550 /* Set grid scrollbar position. Valid grid. */
2554 grid = hildon_grid_new ();
2555 hildon_grid_set_scrollbar_pos (HILDON_GRID (grid), 0);
2559 /* Set grid scrollbar position. Invalid grid. */
2562 hildon_grid_set_scrollbar_pos (NULL, 0);
2566 /* Get grid scrollbar position. Valid grid. */
2571 grid = hildon_grid_new ();
2572 pos = hildon_grid_get_scrollbar_pos (HILDON_GRID (grid));
2576 /* Get grid scrollbar position. Inalid grid. */
2580 pos = hildon_grid_get_scrollbar_pos (NULL);
2584 /* Add item to existing grid. */
2589 grid = hildon_grid_new ();
2590 item = hildon_grid_item_new (VALID_ICON);
2591 gtk_container_add (GTK_CONTAINER (grid), item);
2595 /* Add NULL to existing grid. */
2600 grid = hildon_grid_new ();
2601 item = hildon_grid_item_new (VALID_ICON);
2602 gtk_container_add (GTK_CONTAINER (grid), NULL);
2606 /* Add something to existing grid. */
2611 grid = hildon_grid_new ();
2612 item = gtk_button_new ();
2613 gtk_container_add (GTK_CONTAINER (grid), item);
2617 /* Add something to non-existing grid. */
2621 item = gtk_button_new ();
2622 gtk_container_add (NULL, item);
2626 /* Add something to invalid grid. */
2630 item = gtk_button_new ();
2631 gtk_container_add (GTK_CONTAINER (item), item);
2635 /* Remove item from grid. */
2640 grid = hildon_grid_new ();
2641 item = hildon_grid_item_new (VALID_ICON);
2642 gtk_container_add (GTK_CONTAINER (grid), item);
2643 gtk_container_remove (GTK_CONTAINER (grid), item);
2647 /* Remove non-existing item from grid. */
2652 grid = hildon_grid_new ();
2653 item = hildon_grid_item_new (VALID_ICON);
2654 gtk_container_add (GTK_CONTAINER (grid), item);
2655 item = hildon_grid_item_new (VALID_ICON);
2656 gtk_container_remove (GTK_CONTAINER (grid), item);
2660 /* Remove NULL from grid. */
2665 grid = hildon_grid_new ();
2666 item = hildon_grid_item_new (VALID_ICON);
2667 gtk_container_add (GTK_CONTAINER (grid), item);
2668 gtk_container_remove (GTK_CONTAINER (grid), NULL);
2672 /* Remove something from grid. */
2677 grid = hildon_grid_new ();
2678 item = hildon_grid_item_new (VALID_ICON);
2679 gtk_container_add (GTK_CONTAINER (grid), item);
2680 item = gtk_button_new ();
2681 gtk_container_remove (GTK_CONTAINER (grid), item);
2685 /* Remove something from NULL grid. */
2689 item = gtk_button_new ();
2690 gtk_container_remove (NULL, item);
2694 /* Remove something from invalid grid. */
2697 GtkWidget *item0, *item1;
2698 item0 = gtk_button_new ();
2699 item1 = gtk_button_new ();
2700 gtk_container_remove (GTK_CONTAINER (item0), item1);
2709 grid = hildon_grid_new ();
2710 item = hildon_grid_item_new (VALID_ICON);
2711 gtk_container_add (GTK_CONTAINER (grid), item);
2712 item = hildon_grid_item_new (VALID_ICON);
2713 gtk_container_add (GTK_CONTAINER (grid), item);
2714 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2718 /* Set focus to non-existing. */
2723 grid = hildon_grid_new ();
2724 item = hildon_grid_item_new (VALID_ICON);
2725 gtk_container_add (GTK_CONTAINER (grid), item);
2726 item = hildon_grid_item_new (VALID_ICON);
2727 gtk_container_add (GTK_CONTAINER (grid), item);
2728 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2729 item = hildon_grid_item_new (VALID_ICON);
2730 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2734 /* Set focus to NULL. */
2739 grid = hildon_grid_new ();
2740 item = hildon_grid_item_new (VALID_ICON);
2741 gtk_container_add (GTK_CONTAINER (grid), item);
2742 item = hildon_grid_item_new (VALID_ICON);
2743 gtk_container_add (GTK_CONTAINER (grid), item);
2744 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2748 /* Set focus to something. */
2753 grid = hildon_grid_new ();
2754 item = hildon_grid_item_new (VALID_ICON);
2755 gtk_container_add (GTK_CONTAINER (grid), item);
2756 item = hildon_grid_item_new (VALID_ICON);
2757 gtk_container_add (GTK_CONTAINER (grid), item);
2758 item = gtk_button_new ();
2759 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2768 grid = hildon_grid_new ();
2769 item = hildon_grid_item_new (VALID_ICON);
2770 gtk_container_add (GTK_CONTAINER (grid), item);
2771 item = hildon_grid_item_new (VALID_ICON);
2772 gtk_container_add (GTK_CONTAINER (grid), item);
2773 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2774 g_assert (GTK_CONTAINER (grid)->focus_child == item);
2778 /* Get focus (no focused). */
2782 grid = hildon_grid_new ();
2783 g_assert (GTK_CONTAINER (grid)->focus_child == NULL);
2787 /* Destroy grid. Has items. */
2791 grid = hildon_grid_new ();
2792 gtk_widget_destroy (grid);
2796 /* Destroy grid. No items. */
2801 grid = hildon_grid_new ();
2802 item = hildon_grid_item_new (VALID_ICON);
2803 gtk_container_add (GTK_CONTAINER (grid), item);
2804 gtk_widget_destroy (grid);
2808 /* HildonTimeEditor: create editor widget */
2811 editor = hildon_time_editor_new ();
2816 /* HildonTimeEditor: set time and check if returned
2817 * time value is same
2821 guint hour, min, sec;
2822 editor = hildon_time_editor_new ();
2823 hildon_time_editor_set_time (HILDON_TIME_EDITOR (editor),
2825 hildon_time_editor_get_time (HILDON_TIME_EDITOR (editor),
2827 g_assert (hour == 21);
2828 g_assert (min == 39);
2829 g_assert (sec ==45);
2833 /* HildonTimeEditor: enable/disable seconds */
2836 editor = hildon_time_editor_new ();
2837 hildon_time_editor_show_seconds (HILDON_TIME_EDITOR (editor), 1);
2838 hildon_time_editor_show_seconds (HILDON_TIME_EDITOR (editor), 0);
2842 /* HildonTimeEditor: enable duration mode */
2845 editor = hildon_time_editor_new ();
2846 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2851 /* HildonTimeEditor: set duration range and check values
2852 * against returned values
2856 guint min_seconds, max_seconds;
2857 editor = hildon_time_editor_new ();
2858 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2860 hildon_time_editor_set_duration_range (HILDON_TIME_EDITOR (editor),
2862 hildon_time_editor_get_duration_range (HILDON_TIME_EDITOR (editor),
2863 &min_seconds, &max_seconds);
2864 g_assert (min_seconds == 3600);
2865 g_assert (max_seconds == 14500);
2869 /* HildonTimeEditor: enable and disable duration modes */
2872 editor = hildon_time_editor_new ();
2873 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2875 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2880 /* HildonTimeEditor: set time and check against
2885 guint hour, min, sec;
2886 editor = hildon_time_editor_new ();
2887 hildon_time_editor_set_time (HILDON_TIME_EDITOR (editor),
2889 hildon_time_editor_get_time (HILDON_TIME_EDITOR (editor),
2891 g_assert (hour == 13);
2892 g_assert (min == 33);
2893 g_assert (sec ==42);
2897 /* HildonTimeEditor: set duration range and check values
2898 * against foo values
2902 guint min_seconds, max_seconds;
2903 editor = hildon_time_editor_new ();
2904 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2906 hildon_time_editor_set_duration_range (HILDON_TIME_EDITOR (editor),
2908 hildon_time_editor_get_duration_range (HILDON_TIME_EDITOR (editor),
2909 &min_seconds, &max_seconds);
2910 g_assert (min_seconds == 4600);
2911 g_assert (max_seconds == 15500);
2916 /* find replace dialog: new */
2921 dialog = hildon_find_replace_dialog_new(NULL, HILDON_REPLACE_NORMAL);
2927 /* find replace dialog: new with options */
2934 options = gtk_dialog_new();
2935 dialog = hildon_find_replace_dialog_new_with_options(NULL,GTK_DIALOG(options), HILDON_REPLACE_NORMAL);
2936 gtk_widget_destroy(dialog);
2942 /* find replace dialog: get_text */
2946 const gchar *string;
2949 dialog = hildon_find_replace_dialog_new(NULL, HILDON_REPLACE_NORMAL);
2950 string = hildon_find_replace_dialog_get_text(HILDON_FIND_REPLACE_DIALOG(dialog));
2955 /* find replace dialog: get_new_text */
2959 const gchar *string;
2962 dialog = hildon_find_replace_dialog_new(NULL, HILDON_REPLACE_NORMAL);
2963 string = hildon_find_replace_dialog_get_new_text(HILDON_FIND_REPLACE_DIALOG(dialog));
2970 gtk_infoprint_temporarily_disable_wrap ();
2971 gtk_infoprint (NULL, "A suitably long text for testing the wrapping of gtkinfoprint.");
2977 gtk_banner_temporarily_disable_wrap ();
2978 gtk_banner_show_animation (NULL, "A suitably long text for testing the wrapping of gtkinfoprint.");
2987 dialog = hildon_name_password_dialog_new(NULL);
2988 name = (gchar *)hildon_name_password_dialog_get_name(HILDON_NAME_PASSWORD_DIALOG(dialog));
2999 dialog = hildon_name_password_dialog_new(NULL);
3000 password = (gchar *)hildon_name_password_dialog_get_password(HILDON_NAME_PASSWORD_DIALOG(dialog));
3010 fdialog = hildon_file_details_dialog_new (NULL, "this is probably very very long filename");
3011 assert (HILDON_FILE_DETAILS_DIALOG (fdialog));
3017 {*test1a, "hildon_controlbar_new", EXPECT_OK},
3018 {*test1b, "hildon_controlbar_get/set_max", EXPECT_OK},
3019 {*test1c, "hildon_controlbar_get/set_value", EXPECT_OK},
3020 {*test1d, "gtk_widget_destroy", EXPECT_OK},
3021 {*test1e, "hildon_controlbar_get/set_min", EXPECT_OK},
3022 {*test1f, "hildon_controlbar_set_range", EXPECT_OK},
3023 {*test1g, "hildon_controlbar_set/get_range", EXPECT_OK},
3024 {*test1h, "hildon_controlbar_range/set/get_value (min)", EXPECT_OK},
3025 {*test1i, "hildon_controlbar_range/set/get_value (max)", EXPECT_OK},
3026 {*test2a, "hildon_seekbar_new", EXPECT_OK},
3027 {*test2b, "hildon_seekbar_get/set_total_time", EXPECT_OK},
3028 {*test2c, "hildon_seekbar_get/set_position", EXPECT_OK},
3029 {*test2d, "gtk_widget_destroy", EXPECT_OK},
3030 {*test2e, "hildon_seekbat_get/set_fraction", EXPECT_OK},
3031 {*test3a, "gtk_infoprint system (something)", EXPECT_OK},
3032 {*test3b, "gtk_infoprint system (NULL)", EXPECT_OK},
3033 {*test3c, "gtk_infoprint_with_icon_stock (VALID ICON)", EXPECT_OK},
3034 {*test3d, "gtk_infoprint_with_icon_stock (EMPTY STRING)", EXPECT_OK},
3035 {*test3e, "gtk_infoprint_with_icon_stock (NULL STRING)", EXPECT_OK},
3036 {*test3f, "gtk_infoprintf (something)", EXPECT_OK},
3037 {*test3g, "gtk_infoprintf (NULL)", EXPECT_OK},
3038 {*test3h, "gtk_confirmation_banner (Somestring, NULL STRING)", EXPECT_OK},
3039 {*test3i, "gtk_confirmation_banner (Somestring, NULL)", EXPECT_OK},
3040 {*test3j, "gtk_banner_show_animation", EXPECT_OK},
3041 {*test3k, "gtk_banner_show_animation with set_fraction", EXPECT_OK},
3042 /*{*test3l, "gtk_banner_show_animation with two banner_closes", EXPECT_ASSERT},*/
3043 {*test3m, "gtk_banner_show_animation with destroy window", EXPECT_OK},
3044 {*test3n, "gtk_banner_show_bar", EXPECT_OK},
3045 {*test3o, "gtk_banner_show_bar with destroy window", EXPECT_OK},
3046 {*test3p, "gtk_banner_show_bar & close with null parent", EXPECT_OK},
3047 {*test3q, "gtk_banner_set_text with null parent", EXPECT_OK},
3048 {*test3r, "gtk_banner_set_fraction with null parent", EXPECT_OK},
3049 {*test3s, "gtk_banner_close with null parent", EXPECT_OK},
3050 {*test3t, "gtk_banner_set_fraction with invalid fraction", EXPECT_ASSERT},
3051 {*test3u, "gtk_banner_set_fraction with invalid fraction", EXPECT_ASSERT},
3052 {*test3v, "gtk_banner_show_animation & close with null parent", EXPECT_OK},
3053 {*test4a, "hildon_note_new_confirmation", EXPECT_OK},
3054 {*test4b, "hildon_note_new_confirmation_with_icon_stock", EXPECT_OK},
3055 {*test4c, "hildon_new_confirmation_add_buttons", EXPECT_OK},
3056 {*test4d, ".._new_confirmation: set_button_text", EXPECT_OK},
3057 {*test4e, "hildon_note_new_information", EXPECT_OK},
3058 {*test4f, "hildon_note_new_information_with_icon_stock", EXPECT_OK},
3059 {*test4g, ".._new_information: set_button_text", EXPECT_OK},
3060 /* {*test4h, "hildon_note_new_cancel", EXPECT_OK},*/
3061 /* {*test4i, ".._new_cancel: set_button_text", EXPECT_OK},*/
3062 {*test4j, "hildon_note_new_cancel_with_progress_bar", EXPECT_OK},
3063 {*test4k, ".._cancel_with_progress_bar: set_button_text", EXPECT_OK},
3064 {*test4l, "destroy note widgets", EXPECT_OK},
3066 {*test6a, "hildon_volumebar_new (horizontal)", EXPECT_OK},
3067 {*test6b, "hildon_volumebar_new (vertical)", EXPECT_OK},
3068 {*test6c, "hildon_volumebar_get/set_level", EXPECT_OK},
3069 {*test6d, "hildon_volumebar_get/set_mute", EXPECT_OK},
3070 {*test6e, "gtk_widget_destroy", EXPECT_OK},
3071 {*test7a, "hildon_search_new", EXPECT_OK},
3072 {*test7b, "hildon_search_new (fake icon)", EXPECT_OK},
3073 {*test7c, "hildon_search_set_image (fake icon)", EXPECT_OK},
3074 {*test7d, "hildon_search_set_image", EXPECT_OK},
3075 {*test7e, "gtk_widget_destroy", EXPECT_OK},
3076 {*test10a, "hildon_weekday_picker_new", EXPECT_OK},
3077 {*test11a, "hildon_weekday_picker_{,un,is}set", EXPECT_OK},
3078 {*test11b, "hildon_weekday_picker_set: null", EXPECT_ASSERT},
3079 {*test11c, "hildon_weekday_picker_unset: null", EXPECT_ASSERT},
3080 {*test11d, "hildon_weekday_picker_isset: null", EXPECT_ASSERT},
3081 {*test12a, "hildon_weekday_picker_toggle_day", EXPECT_OK},
3082 {*test12b, "hildon_weekday_picker_toggle_day: null", EXPECT_ASSERT},
3083 {*test12c, "hildon_weekday_picker_set_all/unset_all", EXPECT_OK},
3084 {*test13a, "htp_editor_new: ok", EXPECT_OK},
3085 {*test13b, "htp_editor_new: inv", EXPECT_ASSERT},
3086 {*test14a, "htp_editor_set_editable: ok", EXPECT_OK},
3087 {*test14b, "htp_editor_set_editable: null", EXPECT_ASSERT},
3088 {*test15a, "htp_editor_set_show_plus: ok", EXPECT_OK},
3089 {*test15b, "htp_editor_set_show_plus: null", EXPECT_ASSERT},
3090 {*test15c, "htp_editor_get_show_plus: null", EXPECT_ASSERT},
3091 {*test15d, "htp_editor_set_show_border: ok", EXPECT_OK},
3092 {*test15e, "htp_editor_set_show_border: null", EXPECT_ASSERT},
3093 {*test15f, "htp_editor_get_show_border: null", EXPECT_ASSERT},
3094 {*test16a, "htp_editor_set_widths: ok", EXPECT_OK},
3095 {*test16b, "htp_editor_set_widths: null", EXPECT_ASSERT},
3096 {*test17a, "htp_editor_set/get_country: ok", EXPECT_OK},
3097 {*test17b, "htp_editor_set/get_country: inv", EXPECT_OK},
3098 {*test17c, "htp_editor_set_country: null", EXPECT_ASSERT},
3099 {*test17d, "htp_editor_get_country: null", EXPECT_ASSERT},
3100 {*test18a, "htp_editor_set/get_area: ok", EXPECT_OK},
3101 {*test18b, "htp_editor_set/get_area: inv", EXPECT_OK},
3102 {*test18c, "htp_editor_set_area: null", EXPECT_ASSERT},
3103 {*test18d, "htp_editor_get_area: null", EXPECT_ASSERT},
3104 {*test19a, "htp_editor_set/get_number: ok", EXPECT_OK},
3105 {*test19b, "htp_editor_set/get_number: FREE", EXPECT_OK},
3106 {*test19c, "htp_editor_set/get_number: inv", EXPECT_OK},
3107 {*test19d, "htp_editor_set_number: null", EXPECT_ASSERT},
3108 {*test19e, "htp_editor_get_number: null", EXPECT_ASSERT},
3109 {*test20a, "hildon_find_object: new", EXPECT_OK},
3110 {*test20b, "hildon_find_object: with_options", EXPECT_OK},
3111 {*test20c, "hildon_find_object: get_text", EXPECT_OK},
3112 {*test20d, "hildon_find_object: get_label", EXPECT_OK},
3113 /*{*test21a, "hildon_find_options: new", EXPECT_OK},
3114 {*test21b, "hildon_find_options: hide_loc", EXPECT_OK},
3115 {*test21c, "hildon_find_options: hide_find_in", EXPECT_OK},
3116 {*test21d, "hildon_find_options: get_location", EXPECT_OK},
3117 {*test21e, "hildon_find_options: get_find", EXPECT_OK},
3118 {*test21f, "hildon_find_options: get_time_period", EXPECT_OK},
3119 {*test21g, "hildon_find_options: get_start", EXPECT_OK},
3120 {*test21h, "hildon_find_options: get_end", EXPECT_OK},
3121 {*test21i, "hildon_find_options: add_custom", EXPECT_OK},
3122 {*test21j, "hildon_find_options: date_matches", EXPECT_ASSERT},*/
3123 {*test22a, "range_editor_new", EXPECT_OK},
3124 {*test22b, "range_editor_new_with_separator", EXPECT_OK},
3125 {*test22c, "range_editor_new_with_separator_null", EXPECT_OK},
3126 {*test22d, "hildon_range_editor_get_range", EXPECT_OK},
3127 {*test22e, "hildon_range_editor_get_range_null", EXPECT_ASSERT},
3128 {*test22f, "hildon_range_editor_get_range_null2", EXPECT_ASSERT},
3129 {*test22g, "hildon_range_editor_get_range_null3", EXPECT_ASSERT},
3130 {*test22h, "hildon_range_editor_get_range_null4", EXPECT_ASSERT},
3131 {*test22i, "hildon_range_editor_set_range", EXPECT_OK},
3132 {*test22j, "hildon_range_editor_set_range_null_editor", EXPECT_ASSERT},
3133 {*test22k, "hildon_range_editor_set_limits", EXPECT_OK},
3134 {*test22l, "hildon_range_editor_set_limits&range", EXPECT_OK},
3135 {*test22m, "hildon_range_editor_set_limits_null", EXPECT_ASSERT},
3136 {*test23a, "hildon_sort_dialog_new", EXPECT_OK},
3137 {*test23b, "hildon_sort_dialog_get_sort_key", EXPECT_OK},
3138 {*test23c, "hildon_sort_dialog_set_sort_key", EXPECT_OK},
3139 {*test23d, "hildon_sort_dialog_add_sort_key", EXPECT_OK},
3140 {*test23e, "hildon_sort_dialog_get_sort_order", EXPECT_OK},
3141 {*test23f, "hildon_sort_dialog_set_sort_order", EXPECT_OK},
3142 {*test23g, "gtk_widget_destroy", EXPECT_OK},
3143 {*test24a, "get_password_dialog. get dialog", EXPECT_OK},
3144 {*test24b, "get_password_dialog. get old dialog", EXPECT_OK},
3145 {*test24c, "get_password_dialog_new_get_password", EXPECT_OK},
3146 {*test24d, "gtk_widget_destroy", EXPECT_OK},
3147 {*test25a, "set_password_dialog. set dialog ", EXPECT_OK},
3148 {*test25b, "set_password_dialog. change dialog", EXPECT_OK},
3149 {*test25c, "set_password_dialog_new_get_password", EXPECT_OK},
3150 {*test25d, "set_password_dialog_new_get_protected", EXPECT_ASSERT},
3151 {*test25e, "gtk_widget_destroy", EXPECT_OK},
3152 {*fsd_set_font, "FontSelectionDialog Set font", EXPECT_OK},
3153 {*fsd_get_font,"FontSelectionDialog Get font", EXPECT_OK},
3154 {*fsd_set_pretext, "FontSelectionDialog Set preview text", EXPECT_OK},
3155 {*fsd_get_pretext, "FontSelectionDialog Get preview text", EXPECT_OK},
3156 {*test27a, "hildon_insert_object: new", EXPECT_OK},
3157 {*test27b, "hildon_insert_object: get_name", EXPECT_OK},
3158 {*test27c, "hildon_insert_object: get_mime_type", EXPECT_ASSERT},
3159 {*test28a, "hildon_number_editor_new", EXPECT_OK},
3160 {*test28b, "hildon_number_editor_get_value", EXPECT_OK},
3161 {*test28c, "hildon_number_editor_set_range", EXPECT_OK},
3162 {*test28d, "hildon_number_editor_set_value", EXPECT_OK},
3163 {*test29a, "hildon_color_selector: set and get red color", EXPECT_OK},
3164 {*test29b, "hildon_color_selector: set and get non-base color", EXPECT_ASSERT},
3165 {*test30a, "hildon_file_handling_note_new_moving", EXPECT_OK},
3166 {*test30b, "hildon_file_handling_note_new_deleting", EXPECT_OK},
3167 {*test30c, "hildon_file_handling_note_new_opening", EXPECT_OK},
3168 {*test30d, "hildon_file_handling_note_new_saving", EXPECT_OK},
3169 {*test31a, "hildon_add_home_dialog_new: ok", EXPECT_OK},
3170 {*test31b, "hildon_add_home_dialog_new: NULL(ok)", EXPECT_OK},
3171 {*test32a, "hildon_rename_dialog: ok", EXPECT_OK},
3172 {*test32b, "hildon_rename_dialog: NULL(ok)", EXPECT_OK},
3173 {*test33a1, "grid_item_new (\"foo\")", EXPECT_OK},
3174 {*test33a2, "grid_item_new (NULL)", EXPECT_ASSERT},
3175 {*test33b1, "grid_item_new_label (\"foo\", \"bar\")", EXPECT_OK},
3176 {*test33b2, "grid_item_new_label (\"foo\", NULL)", EXPECT_OK},
3177 {*test33b3, "grid_item_new_label (NULL, \"bar\")", EXPECT_ASSERT},
3178 {*test33b4, "grid_item_new_label (NULL, NULL)", EXPECT_ASSERT},
3179 {*test33c1, "grid_item_set_emblem (foo, \"bar\")", EXPECT_OK},
3180 {*test33c2, "grid_item_set_emblem (foo, NULL)", EXPECT_OK},
3181 {*test33c3, "grid_item_set_emblem (NULL, \"bar\")", EXPECT_ASSERT},
3182 {*test33c4, "grid_item_set_emblem (NULL, NULL)", EXPECT_ASSERT},
3183 {*test33d1, "grid_item_get_emblem (foo)", EXPECT_OK},
3184 {*test33d2, "grid_item_get_emblem (foo) (no emblem)", EXPECT_ASSERT},
3185 {*test33d3, "grid_item_get_emblem (NULL)", EXPECT_ASSERT},
3186 {*test33e, "grid_item: destroy", EXPECT_OK},
3187 {*test34a, "grid_new ()", EXPECT_OK},
3188 {*test34b1, "grid_set_style (foo, \"bar\")", EXPECT_OK},
3189 {*test34b2, "grid_set_style (foo, NULL)", EXPECT_OK},
3190 {*test34b3, "grid_set_style (NULL, \"foo\")", EXPECT_ASSERT},
3191 {*test34b4, "grid_set_style (NULL, NULL)", EXPECT_ASSERT},
3192 {*test34c1, "grid_get_style (foo)", EXPECT_OK},
3193 {*test34c2, "grid_get_style (foo) (no style)", EXPECT_OK},
3194 {*test34c3, "grid_get_style (NULL)", EXPECT_ASSERT},
3195 {*test34d1, "grid_set_sb_pos (foo, 0)", EXPECT_OK},
3196 {*test34d2, "grid_set_sb_pos (NULL, 0)", EXPECT_ASSERT},
3197 {*test34e1, "grid_get_sb_pos (foo)", EXPECT_OK},
3198 {*test34e2, "grid_get_sb_pos (NULL)", EXPECT_ASSERT},
3199 {*test34f1, "grid_add (grid, item)", EXPECT_OK},
3200 {*test34f2, "grid_add (grid, NULL)", EXPECT_ASSERT},
3201 {*test34f3, "grid_add (grid, something)", EXPECT_ASSERT},
3202 {*test34f4, "grid_add (NULL, whatever)", EXPECT_ASSERT},
3203 {*test34f5, "grid_add (whatever, we)", EXPECT_ASSERT},
3204 {*test34g1, "grid_remove (item) (exist)", EXPECT_OK},
3205 {*test34g2, "grid_remove (item) (non-exist)", EXPECT_ASSERT},
3206 {*test34g3, "grid_remove (NULL)", EXPECT_ASSERT},
3207 {*test34g4, "grid_remove (something)", EXPECT_ASSERT},
3208 {*test34g5, "grid_remove (NULL, some)", EXPECT_ASSERT},
3209 {*test34g6, "grid_remove (some, some)", EXPECT_ASSERT},
3210 {*test34h1, "grid_set_focus (item) (exist)", EXPECT_OK},
3211 {*test34h2, "grid_set_focus (item) (non-exist)", EXPECT_ASSERT},
3212 {*test34h3, "grid_set_focus (NULL)", EXPECT_OK},
3213 {*test34h4, "grid_set_focus (something)", EXPECT_ASSERT},
3214 {*test34i1, "grid: CONTAINER->focus_child (set)", EXPECT_OK},
3215 {*test34i2, "grid: CONTAINER->focus_child (unset)", EXPECT_OK},
3216 {*test34j1, "grid: destroy (items)", EXPECT_OK},
3217 {*test34j2, "grid: destroy (no items)", EXPECT_OK},
3218 {*test35a, "hildon_time_editor_new", EXPECT_OK},
3219 {*test35b, "hildon_time_editor_set/get_time", EXPECT_OK},
3220 {*test35c, "hildon_time_editor_show_seconds", EXPECT_OK},
3221 {*test35d, "hildon_time_editor_enable_duration_mode", EXPECT_OK},
3222 {*test35e, "hildon_time_editor_set/get_duration_range", EXPECT_OK},
3223 {*test35f, "hildon_time_editor_enable_duration_mode (TRUE, FALSE", EXPECT_OK},
3224 {*test35g, "hildon_time_editor_set/get_time with foo value check", EXPECT_ASSERT},
3225 {*test35h, "hildon_time_editor_set/get_duration_range with foo value check", EXPECT_ASSERT},
3226 {*test36a, "hildon_find_replace_dialog_new", EXPECT_OK},
3227 {*test36b, "hildon_find_replace_dialog_new_with_options", EXPECT_OK},
3228 {*test36c, "hildon_find_replace_dialog_get_text", EXPECT_OK},
3229 {*test36d, "hildon_find_replace_dialog_get_new_text", EXPECT_OK},
3230 {*test37a, "gtk_infoprint_temporarily_disable_wrap", EXPECT_OK},
3231 {*test37b, "gtk_banner_temporarily_disable_wrap", EXPECT_OK},
3232 {*test39a, "namepassword dialog get_name", EXPECT_OK},
3233 {*test39b, "namepassword dialog get_password", EXPECT_OK},
3234 {*test41a, "hildon_file_details_dialog_new", EXPECT_OK},
3235 /* {*test38a, "gtk_confirmation_banner (sometext)", EXPECT_OK},
3236 {*test38a, "gtk_confirmation_banner (NULL)", EXPECT_OK},*/
3238 {0} /*REMEMBER THE TERMINATING NULL*/
3241 /*use EXPECT_ASSERT for the tests that are _meant_ to throw assert so they are
3242 *considered passed when they throw assert and failed when they do not
3245 testcase* get_tests()
3247 g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);