2 * This file is part of hildon-libs
4 * Copyright (C) 2005, 2006 Nokia Corporation.
6 * Contact: Michael Dominic Kostrzewa <michael.kostrzewa@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; version 2.1 of
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-number-editor.h>
45 #include <hildon-widgets/hildon-color-selector.h>
46 #include <hildon-widgets/hildon-file-handling-note.h>
47 #include <hildon-widgets/hildon-add-home-dialog.h>
48 #include <hildon-widgets/hildon-grid-item.h>
49 #include <hildon-widgets/hildon-grid.h>
50 #include <hildon-widgets/hildon-time-editor.h>
51 #include <hildon-widgets/hildon-name-password-dialog.h>
52 #include <hildon-widgets/hildon-caption.h>
55 /* Icon which must exist (HildonGridItem). */
56 #define VALID_ICON "qgn_list_gene_default_app"
58 /*prototypes to keep the compiler happy*/
59 testcase *get_tests(void);
143 /* telephone editor */
171 /* find object dialog */
178 /* find object options dialog */
214 /* get / get old password dialog */
220 /* set / change password dialog */
227 /*FontSelectionDialog*/
228 #ifndef HILDON_DISABLE_DEPRECATED
229 int fsd_set_font(void);
230 int fsd_get_font(void);
232 int fsd_set_pretext(void);
233 int fsd_get_pretext(void);
249 /* FontHandlingNote */
255 /* Add to Home / Rename dialog */
310 /* Time/Duration Editor */
327 /* New infoprint/banner functionalities. */
332 /* namepassworddialog */
336 /* file details dialog */
337 #ifndef HILDON_DISABLE_DEPRECATED
347 /* this has to be like this (not static). outo
349 testcase *get_tests(void);
350 void init_test( void )
353 gtk_init (&plop, NULL);
358 HildonControlbar *controlBar;
359 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
367 HildonControlbar *controlBar;
370 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
371 hildon_controlbar_set_max(controlBar, max);
372 assert(hildon_controlbar_get_max(controlBar) == max);
378 HildonControlbar *controlBar;
382 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
383 hildon_controlbar_set_max(controlBar, max);
384 hildon_controlbar_set_value(controlBar, value);
385 assert(hildon_controlbar_get_value(controlBar) == value);
391 HildonControlbar *controlBar;
393 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
394 gtk_widget_destroy(GTK_WIDGET(controlBar));
401 HildonControlbar *controlBar;
403 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
404 hildon_controlbar_set_min(controlBar, 5);
405 getmin = hildon_controlbar_get_min (controlBar);
406 assert (getmin == 5);
415 HildonControlbar *controlBar;
417 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
418 hildon_controlbar_set_range (controlBar, min, max);
427 HildonControlbar *controlBar;
429 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
430 hildon_controlbar_set_range (controlBar, 57, 219);
431 minval = hildon_controlbar_get_min (controlBar);
432 maxval = hildon_controlbar_get_max (controlBar);
433 assert (minval == 57);
434 assert (maxval == 219);
442 HildonControlbar *controlBar;
444 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
445 hildon_controlbar_set_range (controlBar, 250, 550);
446 hildon_controlbar_set_value (controlBar, 100);
448 value = hildon_controlbar_get_value (controlBar);
450 assert (value == 250);
458 HildonControlbar *controlBar;
460 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
461 hildon_controlbar_set_range (controlBar, 250, 550);
462 hildon_controlbar_set_value (controlBar, 650);
464 value = hildon_controlbar_get_value (controlBar);
466 assert (value == 550);
474 seekBar = hildon_seekbar_new();
484 seekBar = hildon_seekbar_new();
485 hildon_seekbar_set_total_time(HILDON_SEEKBAR(seekBar), totalTime);
486 assert(hildon_seekbar_get_total_time(HILDON_SEEKBAR(seekBar)) == totalTime);
496 seekBar = hildon_seekbar_new();
497 hildon_seekbar_set_total_time(HILDON_SEEKBAR(seekBar), totalTime);
498 hildon_seekbar_set_position(HILDON_SEEKBAR(seekBar), position);
499 assert(hildon_seekbar_get_position(HILDON_SEEKBAR(seekBar)) == position);
507 seekBar = hildon_seekbar_new();
508 gtk_widget_destroy(GTK_WIDGET(seekBar));
517 seekBar = hildon_seekbar_new();
518 hildon_seekbar_set_total_time(HILDON_SEEKBAR(seekBar), totalTime);
519 hildon_seekbar_set_fraction(HILDON_SEEKBAR(seekBar), 200);
520 assert(hildon_seekbar_get_fraction(HILDON_SEEKBAR(seekBar)) == 200);
527 gtk_infoprint(NULL,"infoprint");
534 gtk_infoprint(NULL, NULL);
541 gtk_infoprint_with_icon_stock(NULL, "infoprint", GTK_STOCK_DIALOG_QUESTION);
548 gtk_infoprint_with_icon_stock(NULL, "infoprint", "");
555 gtk_infoprint_with_icon_stock(NULL, "infoprint", NULL);
562 gtk_infoprintf (NULL, "mambo %d", 2+3);
569 gtk_infoprintf (NULL, NULL);
576 gtk_confirmation_banner (NULL, "Insert our favourite testing text here.", NULL);
582 gtk_confirmation_banner (NULL, NULL, NULL);
588 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
589 gtk_banner_show_animation (win, "Insert our favourite testing text here.");
590 gtk_banner_set_text (win, "Insert our second favourite testing text here.");
591 gtk_banner_set_text (win, "");
592 gtk_banner_set_text (win, NULL);
593 gtk_banner_close (win);
594 gtk_widget_destroy (GTK_WIDGET (win));
600 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
601 gtk_banner_show_animation (win, "Insert our favourite testing text here.");
602 gtk_banner_set_fraction (win, 0.5);
603 gtk_banner_set_fraction (win, -0.5);
604 gtk_banner_set_fraction (win, 1.5);
605 gtk_banner_close (win);
606 gtk_widget_destroy (GTK_WIDGET (win));
612 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
613 gtk_banner_show_animation (win, "Insert our favourite testing text here.");
614 gtk_banner_close (win);
615 gtk_banner_close (win);
616 gtk_widget_destroy (GTK_WIDGET (win));
622 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
623 gtk_banner_show_animation (win, "Insert our favourite testing text here.");
624 gtk_widget_destroy (GTK_WIDGET (win));
630 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
631 gtk_banner_show_bar (win, "Insert our favourite testing text here.");
632 gtk_banner_set_text (win, "Insert our second favourite testing text here.");
633 gtk_banner_set_text (win, "");
634 gtk_banner_set_text (win, NULL);
635 gtk_banner_set_fraction (win, 0.5);
636 gtk_banner_close (win);
642 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
643 gtk_banner_show_bar (win, "Insert our favourite testing text here.");
644 gtk_banner_set_text (win, "Insert our second favourite testing text here.");
645 gtk_banner_set_text (win, "");
646 gtk_banner_set_text (win, NULL);
647 gtk_banner_set_fraction (win, 0.5);
648 gtk_widget_destroy (GTK_WIDGET (win));
654 gtk_banner_show_bar (NULL, "Insert our favourite testing text here.");
655 gtk_banner_close (NULL);
661 gtk_banner_set_text (NULL, "Insert our second favourite testing text here.");
667 gtk_banner_set_fraction (NULL, 0.5);
673 gtk_banner_close (NULL);
679 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
680 gtk_banner_show_bar (win, "Insert our favourite testing text here.");
681 gtk_banner_set_fraction (win, -0.5);
682 gtk_banner_close (win);
688 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
689 gtk_banner_show_bar (win, "Insert our favourite testing text here.");
690 gtk_banner_set_fraction (win, 1.5);
691 gtk_banner_close (win);
697 gtk_banner_show_animation (NULL, "Insert our favourite testing text here.");
698 gtk_banner_close (NULL);
703 /* note: confirmation note */
706 HildonNote *note = HILDON_NOTE( hildon_note_new_confirmation( NULL,
707 "Delete the presentation?\nHildon Slides" ));
711 /* note: confirmation note with icon stock */
715 note = HILDON_NOTE( hildon_note_new_confirmation_with_icon_stock(NULL,
716 "Delete the presentation?\nHildon Slides", GTK_STOCK_OPEN));
720 /* note: confirmation note with 10 additional buttons */
724 HildonNote *note = HILDON_NOTE( hildon_note_new_confirmation_add_buttons( NULL,
725 "Delete the presentation?\nHildon Slides",
726 "add 1", 12345, "add 2", 13579,
727 "add 3", 12345, "add 4", 13579,
728 "add 5", 12345, "add 6", 13579,
729 "add 7", 12345, "add 8", 13579,
730 "add 9", 24680, "add 9", 24680, NULL) );
735 /* note: confirmation note: Set button text*/
739 note = HILDON_NOTE( hildon_note_new_confirmation(NULL,
740 "Delete the presentation?\nHildon Slides"));
741 hildon_note_set_button_text( HILDON_NOTE( note ) , "Remove" );
745 /* note: information note */
749 note = HILDON_NOTE( hildon_note_new_information(NULL,
750 "Only one button present\nin this information note"));
754 /* note: information note with icon stock */
758 note = HILDON_NOTE( hildon_note_new_information_with_icon_stock(NULL,
759 "Only one button present\nin this information note", GTK_STOCK_HARDDISK));
763 /* note: information note: Set button text*/
767 note = HILDON_NOTE( hildon_note_new_information(NULL,
768 "Only one button present\nin this information note"));
769 hildon_note_set_button_text( HILDON_NOTE( note ) , "Continue" );
778 note = HILDON_NOTE( hildon_note_new_cancel( NULL,
779 "Deleting files.." ));
784 /* note: new cancel: set button text
789 note = HILDON_NOTE( hildon_note_new_cancel( NULL,
790 "Deleting files.." ));
791 hildon_note_set_button_text( HILDON_NOTE( note ) , "Stop" );
795 /* note: new cancel with progress bar*/
799 GtkWidget *progress_note;
801 progbar = gtk_progress_bar_new();
803 gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR( progbar ), 0.7 );
805 progress_note = hildon_note_new_cancel_with_progress_bar(
806 NULL, "Deleting files..",
807 GTK_PROGRESS_BAR( progbar ));
809 assert(progress_note);
813 /* note: new cancel with progress bar: set button text*/
817 GtkWidget *progress_note;
819 progbar = gtk_progress_bar_new();
821 gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR( progbar ), 0.7 );
823 progress_note = hildon_note_new_cancel_with_progress_bar(
824 NULL, "Deleting files..",
825 GTK_PROGRESS_BAR( progbar ));
827 hildon_note_set_button_text( HILDON_NOTE( progress_note ) , "Stop" );
830 /* destroy note widgets */
835 /* GtkWidget *cancel;*/
838 GtkWidget *conf_button;
840 conf = hildon_note_new_confirmation(NULL, NULL);
842 gtk_widget_destroy(conf);
844 inf = hildon_note_new_information(NULL, NULL);
846 gtk_widget_destroy(inf);
849 cancel = hildon_note_new_cancel( NULL, NULL );
851 gtk_widget_destroy(cancel);
854 progbar = gtk_progress_bar_new();
855 progress = hildon_note_new_cancel_with_progress_bar(
856 NULL, NULL, GTK_PROGRESS_BAR( progbar ));
858 gtk_widget_destroy(progress);
860 conf_button = hildon_note_new_confirmation_add_buttons( NULL, NULL, NULL );
862 gtk_widget_destroy(conf_button);
869 HildonHVolumebar *volumeBar;
871 volumeBar = HILDON_HVOLUMEBAR(hildon_hvolumebar_new());
878 HildonVVolumebar *volumeBar;
880 volumeBar = HILDON_VVOLUMEBAR(hildon_vvolumebar_new());
887 HildonHVolumebar *volumeBar;
888 gdouble volumeLevel = 0.5;
890 volumeBar = HILDON_HVOLUMEBAR(hildon_hvolumebar_new());
891 hildon_volumebar_set_level(HILDON_VOLUMEBAR(volumeBar), volumeLevel);
892 assert(hildon_volumebar_get_level(HILDON_VOLUMEBAR(volumeBar)) == volumeLevel);
898 HildonHVolumebar *volumeBar;
899 gboolean mute = FALSE;
901 volumeBar = HILDON_HVOLUMEBAR(hildon_hvolumebar_new());
902 hildon_volumebar_set_mute(HILDON_VOLUMEBAR(volumeBar), mute);
903 assert(hildon_volumebar_get_mute(HILDON_VOLUMEBAR(volumeBar)) == mute);
909 HildonVVolumebar *volumeBar;
911 volumeBar = HILDON_VVOLUMEBAR(hildon_vvolumebar_new());
912 gtk_widget_destroy(GTK_WIDGET(volumeBar));
916 /* weekday_picker: new: ok */
922 picker = hildon_weekday_picker_new();
927 /* weekday_picker: set/unset/isset: ok */
931 HildonWeekdayPicker *picker;
934 picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
937 /* set all one by one */
938 for( i = 1; i < 8; ++i )
939 hildon_weekday_picker_set_day( picker, i );
941 /* check that the proper days are set */
942 for( j = 1; j < 8; ++j )
943 assert( hildon_weekday_picker_isset_day( picker, j ) );
945 /* unset all one by one */
946 for( i = 1; i < 8; ++i )
947 hildon_weekday_picker_unset_day( picker, i );
949 /* check that the proper days are unset */
950 for( j = 1; j < 8; ++j )
951 assert( !hildon_weekday_picker_isset_day( picker, j ) );
956 /* weekday_picker: set_day: null */
960 hildon_weekday_picker_set_day( NULL, 0 );
964 /* weekday_picker: unset_day: null */
968 hildon_weekday_picker_unset_day( NULL, 0 );
972 /* weekday_picker: isset_day: null */
976 hildon_weekday_picker_isset_day( NULL, 0 );
980 /* weekday_picker: toggle: ok */
984 HildonWeekdayPicker *picker;
986 picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
989 /* set all one by one */
990 for( i = 1; i < 8; i++ )
991 hildon_weekday_picker_toggle_day( picker, i );
993 /* check that the proper days are set */
994 for( j = 1; j < 8; j++ )
995 assert ( hildon_weekday_picker_isset_day( picker, j ) );
997 /* unset all one by one */
998 for( i = 1; i < 8; ++i )
999 hildon_weekday_picker_toggle_day( picker, i );
1001 /* check that the proper days are unset */
1002 for( j = 1; j < 8; ++j )
1003 assert( !hildon_weekday_picker_isset_day( picker, j ) );
1008 /* weekday_picker: toggle_day: null */
1011 HildonWeekdayPicker *picker;
1012 picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
1013 hildon_weekday_picker_toggle_day( NULL, 0 );
1017 /* weekday_picker: set_all/unset_all*/
1020 HildonWeekdayPicker *picker;
1021 picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
1022 hildon_weekday_picker_set_all( picker );
1023 hildon_weekday_picker_unset_all( picker );
1027 /* telephone editor: new: ok */
1034 editor = hildon_telephone_editor_new( HILDON_TELEPHONE_EDITOR_FORMAT_FREE );
1037 editor = hildon_telephone_editor_new
1038 ( HILDON_TELEPHONE_EDITOR_FORMAT_COERCE );
1041 editor = hildon_telephone_editor_new
1042 ( HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY );
1045 editor = hildon_telephone_editor_new
1046 ( HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA );
1052 /* telephone editor: new: inv */
1059 editor = hildon_telephone_editor_new( 17 );
1065 /* telephone editor: set_editable: ok */
1069 HildonTelephoneEditorFormat fmt[4] = {
1070 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1071 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1072 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1073 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1078 for( i = 0; i < 4; ++i )
1080 editor = hildon_telephone_editor_new( fmt[i] );
1081 hildon_telephone_editor_set_editable( HILDON_TELEPHONE_EDITOR( editor ),
1083 hildon_telephone_editor_set_editable( HILDON_TELEPHONE_EDITOR( editor ),
1084 FALSE, FALSE, FALSE );
1085 gtk_widget_destroy( editor );
1091 /* telephone editor: set_editable: null */
1095 hildon_telephone_editor_set_editable( NULL, TRUE, TRUE, TRUE );
1099 /* telephone editor: set_show_plus: ok */
1103 HildonTelephoneEditorFormat fmt[4] = {
1104 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1105 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1106 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1107 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1112 for( i = 0; i < 4; ++i )
1114 editor = hildon_telephone_editor_new( fmt[i] );
1118 hildon_telephone_editor_set_show_plus( HILDON_TELEPHONE_EDITOR( editor ),
1121 /* only check if not in free mode (no plus there) */
1123 assert( hildon_telephone_editor_get_show_plus( HILDON_TELEPHONE_EDITOR( editor ) )
1125 hildon_telephone_editor_set_show_plus( HILDON_TELEPHONE_EDITOR( editor ),
1128 assert( hildon_telephone_editor_get_show_plus( HILDON_TELEPHONE_EDITOR( editor ) )
1130 gtk_widget_destroy( editor );
1136 /* telephone editor: set_show_plus: null */
1140 hildon_telephone_editor_set_show_plus( NULL, TRUE );
1145 /* telephone editor: get_show_plus: null */
1149 hildon_telephone_editor_get_show_plus( NULL );
1154 /* telephone editor: set_show_border: ok */
1158 HildonTelephoneEditorFormat fmt[4] = {
1159 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1160 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1161 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1162 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1167 for( i = 0; i < 4; ++i )
1169 editor = hildon_telephone_editor_new( fmt[i] );
1173 hildon_telephone_editor_set_show_border( HILDON_TELEPHONE_EDITOR( editor ),
1175 assert( hildon_telephone_editor_get_show_border
1176 ( HILDON_TELEPHONE_EDITOR( editor ) ) == TRUE );
1178 hildon_telephone_editor_set_show_border( HILDON_TELEPHONE_EDITOR( editor ),
1180 assert( hildon_telephone_editor_get_show_border( HILDON_TELEPHONE_EDITOR( editor ) )
1183 gtk_widget_destroy( editor );
1189 /* telephone editor: set_show_border: null */
1193 hildon_telephone_editor_set_show_border( NULL, TRUE );
1198 /* telephone editor: get_show_border: null */
1202 hildon_telephone_editor_get_show_border( NULL );
1207 /* telephone editor: set_widths: ok */
1211 HildonTelephoneEditorFormat fmt[4] = {
1212 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1213 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1214 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1215 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1220 for( i = 0; i < 4; ++i )
1222 editor = hildon_telephone_editor_new( fmt[i] );
1223 hildon_telephone_editor_set_widths( HILDON_TELEPHONE_EDITOR( editor ),
1225 hildon_telephone_editor_set_widths( HILDON_TELEPHONE_EDITOR( editor ),
1227 hildon_telephone_editor_set_widths( HILDON_TELEPHONE_EDITOR( editor ),
1229 gtk_widget_destroy( editor );
1235 /* telephone editor: set_widths: null */
1239 hildon_telephone_editor_set_widths( NULL, 1, 1, 1 );
1244 /* telephone editor: set/get_country: ok */
1249 gchar teststr[] = "123456";
1250 HildonTelephoneEditorFormat fmt[4] = {
1251 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1252 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1253 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1254 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1259 for( i = 0; i < 4; ++i )
1261 editor = hildon_telephone_editor_new( fmt[i] );
1262 hildon_telephone_editor_set_country( HILDON_TELEPHONE_EDITOR( editor ),
1264 c = hildon_telephone_editor_get_country
1265 ( HILDON_TELEPHONE_EDITOR( editor ) );
1267 /* format != FREE */
1271 g_assert( strcmp( teststr, c ) == 0 );
1274 gtk_widget_destroy( editor );
1280 /* telephone editor: set/get_country: inv */
1285 gchar teststr[] = "123456p";
1289 editor = hildon_telephone_editor_new(
1290 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY );
1291 hildon_telephone_editor_set_country( HILDON_TELEPHONE_EDITOR( editor ),
1293 c = hildon_telephone_editor_get_country
1294 ( HILDON_TELEPHONE_EDITOR( editor ) );
1297 g_assert( strcmp( teststr, c ) != 0 );
1299 gtk_widget_destroy( editor );
1304 /* telephone editor: set_country: null */
1308 hildon_telephone_editor_set_country( NULL, "123" );
1313 /* telephone editor: get_country: null */
1317 hildon_telephone_editor_get_country( NULL );
1322 /* telephone editor: set/get_area: ok */
1327 gchar teststr[] = "123456";
1328 HildonTelephoneEditorFormat fmt[4] = {
1329 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1330 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1331 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1332 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1337 for( i = 0; i < 4; ++i )
1339 editor = hildon_telephone_editor_new( fmt[i] );
1340 hildon_telephone_editor_set_area( HILDON_TELEPHONE_EDITOR( editor ),
1342 c = hildon_telephone_editor_get_area
1343 ( HILDON_TELEPHONE_EDITOR( editor ) );
1345 /* format != FREE nor COUNTRY */
1350 g_assert( strncmp( teststr, c, strlen( c ) ) == 0 );
1353 gtk_widget_destroy( editor );
1359 /* telephone editor: set/get_area: inv */
1364 gchar teststr[] = "123456p";
1368 editor = hildon_telephone_editor_new(
1369 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA );
1370 hildon_telephone_editor_set_area( HILDON_TELEPHONE_EDITOR( editor ),
1372 c = hildon_telephone_editor_get_area
1373 ( HILDON_TELEPHONE_EDITOR( editor ) );
1376 g_assert( strcmp( teststr, c ) != 0 );
1378 gtk_widget_destroy( editor );
1383 /* telephone editor: set_area: null */
1387 hildon_telephone_editor_set_area( NULL, "123" );
1392 /* telephone editor: get_area: null */
1396 hildon_telephone_editor_get_area( NULL );
1401 /* telephone editor: set/get_number: ok */
1406 gchar teststr[] = "123456";
1407 HildonTelephoneEditorFormat fmt[4] = {
1408 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1409 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1410 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1411 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1416 for( i = 0; i < 4; ++i )
1418 editor = hildon_telephone_editor_new( fmt[i] );
1419 hildon_telephone_editor_set_number( HILDON_TELEPHONE_EDITOR( editor ),
1421 c = hildon_telephone_editor_get_number
1422 ( HILDON_TELEPHONE_EDITOR( editor ) );
1424 /* free != COUNTRY nor AREA */
1425 if( i != 2 && i != 3 )
1428 g_assert( strcmp( teststr, c ) == 0 );
1431 gtk_widget_destroy( editor );
1437 /* telephone editor: set/get_number: ok in FREE format */
1442 gchar teststr[] = "()+?*pw1234567890";
1444 editor = hildon_telephone_editor_new(
1445 HILDON_TELEPHONE_EDITOR_FORMAT_FREE );
1446 hildon_telephone_editor_set_number( HILDON_TELEPHONE_EDITOR( editor ),
1448 c = hildon_telephone_editor_get_number
1449 ( HILDON_TELEPHONE_EDITOR( editor ) );
1452 g_assert( strncmp( teststr, c, strlen(c) ) == 0 );
1454 gtk_widget_destroy( editor );
1459 /* telephone editor: set/get_number: inv */
1464 gchar teststr[] = "123456f";
1468 editor = hildon_telephone_editor_new(
1469 HILDON_TELEPHONE_EDITOR_FORMAT_FREE );
1470 hildon_telephone_editor_set_number( HILDON_TELEPHONE_EDITOR( editor ),
1472 c = hildon_telephone_editor_get_number
1473 ( HILDON_TELEPHONE_EDITOR( editor ) );
1476 g_assert( strcmp( teststr, c ) != 0 );
1478 gtk_widget_destroy( editor );
1483 /* telephone editor: set_number: null */
1486 hildon_telephone_editor_set_number( NULL, "123" );
1491 /* telephone editor: get_number: null */
1494 hildon_telephone_editor_get_number( NULL );
1499 /* find object options dialog: new */
1500 /*int test21a(void){
1502 dialog = hildon_find_object_options_dialog_new(NULL);
1507 /* find object options dialog: hide_location */
1508 /*int test21b(void){
1510 dialog = hildon_find_object_options_dialog_new(NULL);
1511 hildon_find_object_options_dialog_hide_location(
1512 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1513 gtk_widget_destroy(dialog);
1518 /* find object options dialog: hide_find_in */
1519 /*int test21c(void){
1521 dialog = hildon_find_object_options_dialog_new(NULL);
1522 hildon_find_object_options_dialog_hide_find_in(
1523 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1528 /* find object options dialog: get_location */
1529 /*int test21d(void){
1530 const gchar *retString;
1532 dialog = hildon_find_object_options_dialog_new(NULL);
1533 retString = hildon_find_object_options_dialog_get_location(
1534 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1536 g_assert(retString);
1541 /* find object options dialog: get_find_type */
1542 /*int test21e(void){
1543 HildonFindInType find_type;
1545 dialog = hildon_find_object_options_dialog_new(NULL);
1547 find_type = hildon_find_object_options_dialog_get_find_type(
1548 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1553 /* find object options dialog: get_time_period_type */
1554 /*int test21f(void){
1555 HildonTimePeriodType type;
1557 dialog = hildon_find_object_options_dialog_new(NULL);
1558 type = hildon_find_object_options_dialog_get_time_period_type(
1559 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1563 /* find object options dialog: get_start_date */
1564 /*int test21g(void){
1566 gint year, month, day;
1568 dialog = hildon_find_object_options_dialog_new(NULL);
1570 hildon_find_object_options_dialog_get_start_date(HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog),
1571 &year, &month, &day);
1580 /* find object options dialog: get_end_date */
1581 /*int test21h(void){
1583 gint year, month, day;
1585 dialog = hildon_find_object_options_dialog_new(NULL);
1587 hildon_find_object_options_dialog_get_end_date(HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog),
1588 &year, &month, &day);
1597 /* find object options dialog: add_custom_options */
1598 /*int test21i(void){
1600 GtkWidget *widget = gtk_entry_new();
1602 dialog = hildon_find_object_options_dialog_new(NULL);
1604 hildon_find_object_options_dialog_add_custom_option(
1605 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog), "New widget", widget);
1610 /* find object options dialog: date_matches */
1611 /*int test21j(void){
1613 dialog = hildon_find_object_options_dialog_new(NULL);
1615 g_assert(hildon_find_object_dialog_date_matches(HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog),
1621 /* range editor: new range editor: ok parameters */
1624 HildonRangeEditor *range_editor;
1626 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1627 assert(range_editor);
1631 /* range editor: new range editor with separator: ok parameters */
1634 HildonRangeEditor *range_editor;
1636 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new_with_separator(
1638 assert(range_editor);
1642 /* range editor: new range editor with separator: NULL parameters */
1645 HildonRangeEditor *range_editor;
1647 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new_with_separator(NULL));
1648 assert(range_editor);
1652 /* range editor: get range: ok parameters */
1655 HildonRangeEditor *range_editor;
1658 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1659 hildon_range_editor_get_range (range_editor, &start, &end);
1661 assert (start == -999);
1662 assert (end == 999);
1667 /* range editor: get range: null range editor */
1670 HildonRangeEditor *range_editor = NULL;
1673 hildon_range_editor_get_range (range_editor, &start, &end);
1678 /* range editor: get range: null end */
1681 HildonRangeEditor *range_editor = NULL;
1684 hildon_range_editor_get_range (range_editor, &start, NULL);
1689 /* range editor: get range: null start */
1692 HildonRangeEditor *range_editor = NULL;
1695 hildon_range_editor_get_range (range_editor, NULL, &end);
1700 /* range editor: get range: null start, end */
1703 HildonRangeEditor *range_editor = NULL;
1705 hildon_range_editor_get_range (range_editor, NULL, NULL);
1710 /* range editor: set range: ok parameters */
1713 HildonRangeEditor *range_editor;
1714 gint start = 5, end = 6;
1716 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1718 hildon_range_editor_set_range (range_editor, start, end);
1719 hildon_range_editor_get_range (range_editor, &start, &end);
1721 assert (start == 5);
1727 /* range editor: set range: null range editor*/
1730 HildonRangeEditor *range_editor = NULL;
1731 gint start = 5, end = 6;
1733 hildon_range_editor_set_range (range_editor, start, end);
1738 /* range editor: set limits: ok parameters */
1741 HildonRangeEditor *range_editor;
1742 gint start = 0, end = 0;
1744 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1746 hildon_range_editor_set_limits (range_editor, start, end);
1747 hildon_range_editor_get_range (range_editor, &start, &end);
1749 assert (start == 0);
1755 /* range editor: set limits: set range over start minimum and end maximum */
1758 HildonRangeEditor *range_editor;
1759 gint start = -1, end = 1;
1761 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1763 hildon_range_editor_set_limits (range_editor, 0, 0);
1764 hildon_range_editor_set_range (range_editor, start, end);
1765 hildon_range_editor_get_range (range_editor, &start, &end);
1767 assert (start == 0);
1773 /* range editor: set limits: NULL editor */
1776 HildonRangeEditor *range_editor = NULL;
1777 gint start = 0, end = 0;
1779 hildon_range_editor_set_limits (range_editor, start, end);
1789 HildonSortDialog *sort_dialog;
1791 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1792 assert(sort_dialog);
1796 /* sort dialog: Get sort key. '0' is the default index value */
1800 HildonSortDialog *sort_dialog;
1801 gint default_key = 0;
1803 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1804 assert(hildon_sort_dialog_get_sort_key( sort_dialog ) == default_key );
1808 /* sort dialog: Set sort key */
1812 HildonSortDialog *sort_dialog;
1815 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1816 hildon_sort_dialog_set_sort_key( sort_dialog, key );
1817 assert(hildon_sort_dialog_get_sort_key( sort_dialog ) == 1 );
1821 /* sort dialog: add sort key */
1825 HildonSortDialog *sort_dialog;
1827 gint added_key_index = 0;
1829 sort_dialog = HILDON_SORT_DIALOG (hildon_sort_dialog_new(NULL));
1830 hildon_sort_dialog_add_sort_key (sort_dialog, "Random");
1831 added_key_index = hildon_sort_dialog_add_sort_key (sort_dialog,
1834 hildon_sort_dialog_set_sort_key( sort_dialog, added_key_index );
1835 assert(hildon_sort_dialog_get_sort_key( sort_dialog ) == key );
1839 /* sort dialog: get sort order. '0' is the default index value */
1843 HildonSortDialog *sort_dialog;
1844 GtkSortType type = 0;
1846 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1847 assert(hildon_sort_dialog_get_sort_order( sort_dialog ) == type);
1851 /* sort dialog: set sort order */
1855 HildonSortDialog *sort_dialog;
1856 GtkSortType type = 1;
1858 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1859 hildon_sort_dialog_set_sort_order( sort_dialog , type);
1860 assert(hildon_sort_dialog_get_sort_order( sort_dialog ) == 1);
1864 /* sort dialog: gtk_widget_destroy */
1867 GtkWidget *sort_dialog;
1869 sort_dialog = hildon_sort_dialog_new(FALSE);
1870 gtk_widget_destroy(GTK_WIDGET(sort_dialog));
1875 /* Get password dialog */
1879 HildonGetPasswordDialog *get_dialog;
1881 get_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1887 /* Get Old password dialog */
1891 HildonGetPasswordDialog *get_old_dialog;
1893 get_old_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1895 assert(get_old_dialog);
1899 /* Get / Get Old password dialog: get password */
1902 HildonGetPasswordDialog *get_dialog;
1903 HildonGetPasswordDialog *get_old_dialog;
1904 const gchar *get_string;
1905 const gchar *get_old_string;
1907 get_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1909 get_string = hildon_get_password_dialog_get_password( get_dialog);
1912 get_old_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1914 get_old_string = hildon_get_password_dialog_get_password( get_old_dialog);
1915 assert(get_old_string);
1919 /* get / get old password dialog: gtk_widget_destroy */
1922 GtkWidget *get_dialog;
1923 GtkWidget *get_old_dialog;
1925 get_dialog = hildon_get_password_dialog_new(NULL, FALSE);
1926 gtk_widget_destroy(GTK_WIDGET(get_dialog));
1928 get_old_dialog = hildon_get_password_dialog_new(NULL, TRUE);
1929 gtk_widget_destroy(GTK_WIDGET(get_old_dialog));
1934 /* set password dialog */
1938 HildonSetPasswordDialog *set_dialog;
1940 set_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(NULL,
1946 /* change password dialog */
1950 HildonSetPasswordDialog *change_dialog;
1952 change_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1954 assert(change_dialog);
1958 /* set / change password dialog: get password */
1961 HildonSetPasswordDialog *set_dialog;
1962 HildonSetPasswordDialog *change_dialog;
1963 const gchar *set_string;
1964 const gchar *change_string;
1966 set_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1968 set_string = hildon_set_password_dialog_get_password( set_dialog);
1971 change_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1973 change_string = hildon_set_password_dialog_get_password( change_dialog);
1974 assert(change_string);
1978 /* set / change password dialog: get protected */
1981 HildonSetPasswordDialog *set_dialog;
1982 HildonSetPasswordDialog *change_dialog;
1986 set_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1988 set = hildon_set_password_dialog_get_protected(set_dialog);
1991 change_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1993 change = hildon_set_password_dialog_get_protected(change_dialog);
1997 /* set / change password dialog: gtk_widget_destroy */
2000 GtkWidget *set_dialog;
2001 GtkWidget *change_dialog;
2003 set_dialog = hildon_set_password_dialog_new(NULL, FALSE);
2004 gtk_widget_destroy(GTK_WIDGET(set_dialog));
2006 change_dialog = hildon_set_password_dialog_new(NULL, TRUE);
2007 gtk_widget_destroy(GTK_WIDGET(change_dialog));
2012 #ifndef HILDON_DISABLE_DEPRECATED
2013 int fsd_get_font(void)
2016 PangoAttrList *list = NULL;
2017 fsd = hildon_font_selection_dialog_new( NULL, "fsd" );
2018 list = hildon_font_selection_dialog_get_font(HILDON_FONT_SELECTION_DIALOG(fsd));
2019 assert( list!=NULL );
2023 int fsd_set_font(void)
2026 PangoAttrList *list = NULL;
2027 fsd = hildon_font_selection_dialog_new( NULL, "fsd" );
2028 list = hildon_font_selection_dialog_get_font(HILDON_FONT_SELECTION_DIALOG(fsd));
2029 hildon_font_selection_dialog_set_font(HILDON_FONT_SELECTION_DIALOG(fsd), list);
2033 int fsd_set_pretext(void)
2036 char *str = "Mopo karkas käsistä";
2037 fsd = hildon_font_selection_dialog_new( NULL, "fsd" );
2038 hildon_font_selection_dialog_set_preview_text(HILDON_FONT_SELECTION_DIALOG(fsd),str);
2042 int fsd_get_pretext(void)
2046 fsd = hildon_font_selection_dialog_new( NULL, "fsd" );
2047 str = (char*)hildon_font_selection_dialog_get_preview_text(
2048 HILDON_FONT_SELECTION_DIALOG(fsd));
2050 assert( str!=NULL );
2054 /* hildon_number_editor_new */
2060 editor = hildon_number_editor_new (min, max);
2066 /* hildon_number_editor_get_value */
2073 editor = hildon_number_editor_new (min, max);
2074 value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2075 g_assert (value == max);
2080 /* hildon_number_editor_set_range */
2087 editor = hildon_number_editor_new (min, max);
2088 hildon_number_editor_set_range (HILDON_NUMBER_EDITOR (editor), 30, 80);
2089 value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2090 g_assert (value == 80);
2095 /* hildon_number_editor_set_value */
2102 editor = hildon_number_editor_new (min, max);
2103 hildon_number_editor_set_value (HILDON_NUMBER_EDITOR (editor), 3450);
2104 value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2105 g_assert (value == 3450);
2110 /* Hildon-Color-Selector:
2111 hildon_color_selector_new()
2115 GtkWidget *colselector;
2116 GdkColor redcolor = {0, 65535, 0, 0 };
2119 colselector = hildon_color_selector_new( NULL );
2121 hildon_color_selector_set_color( HILDON_COLOR_SELECTOR(colselector), &(redcolor) );
2122 color = hildon_color_selector_get_color( HILDON_COLOR_SELECTOR(colselector) );
2124 g_assert( colselector );
2125 g_assert( redcolor.pixel == color->pixel );
2126 g_assert( redcolor.red == color->red );
2127 g_assert( redcolor.green == color->green );
2128 g_assert( redcolor.blue == color->blue );
2131 gtk_widget_destroy ( colselector );
2135 /* Hildon-Color-Selector:
2136 HildonColorSelector with non-base color
2140 HildonColorSelector *colorsel;
2141 GtkWidget *obj_self;
2142 GdkColor mixedcolor = { 0, 7281, 21845, 65535 };
2145 obj_self = hildon_color_selector_new( NULL );
2146 colorsel = HILDON_COLOR_SELECTOR ( obj_self );
2148 hildon_color_selector_set_color( colorsel, &mixedcolor );
2149 color = hildon_color_selector_get_color( colorsel );
2151 g_assert( colorsel );
2152 g_assert( color->pixel == 0 );
2153 g_assert( color->red == 7281 );
2154 g_assert( color->green == 21845 );
2155 g_assert( color->blue == 65535 );
2158 g_object_unref ( obj_self );
2159 gtk_widget_destroy( GTK_WIDGET(colorsel) );
2164 /* hildon_file_handling_note_new_moving */
2167 GtkWidget *file_note;
2169 file_note = hildon_file_handling_note_new_moving (NULL);
2170 hildon_file_handling_note_set_fraction (HILDON_FILE_HANDLING_NOTE(file_note), 0.7);
2172 g_assert (file_note);
2177 /* hildon_file_handling_note_new_deleting */
2180 GtkWidget *file_note;
2182 file_note = hildon_file_handling_note_new_deleting (NULL);
2183 hildon_file_handling_note_set_counter_and_name (HILDON_FILE_HANDLING_NOTE (file_note),
2185 hildon_file_handling_note_set_counter_and_name (HILDON_FILE_HANDLING_NOTE (file_note),
2187 g_assert (file_note);
2192 /* hildon_file_handling_note_new_opening */
2195 GtkWidget *file_note;
2197 file_note = hildon_file_handling_note_new_opening (NULL);
2198 hildon_file_handling_note_set_name (HILDON_FILE_HANDLING_NOTE (file_note),
2200 g_assert (file_note);
2205 /* hildon_file_handling_note_new_saving */
2208 GtkWidget *file_note;
2210 file_note = hildon_file_handling_note_new_saving (NULL);
2211 hildon_file_handling_note_set_fraction (HILDON_FILE_HANDLING_NOTE (file_note), 0.7);
2212 g_assert (file_note);
2217 /* Add to Home dialog new: ok parameters */
2221 d = hildon_add_home_dialog_new( NULL, "name" , NULL);
2227 /* Add to Home dialog new: NULL parameter (is ok) */
2231 d = hildon_add_home_dialog_new( NULL, NULL, NULL );
2237 /* Rename dialog new: ok parameters */
2241 d = hildon_add_home_dialog_new( NULL, "name", "newname" );
2247 /* Rename dialog new: NULL parameter (is ok) */
2251 d = hildon_add_home_dialog_new( NULL, NULL, "newname" );
2257 /* Create item with icon basename. */
2260 /* If test fails, first see if icon exists. */
2262 item = hildon_grid_item_new (VALID_ICON);
2267 /* Create item without icon basename. */
2271 item = hildon_grid_item_new (NULL);
2276 /* Create item with icon basename and label. */
2279 /* If test fails, first see if icon exists. */
2281 item = hildon_grid_item_new_with_label (VALID_ICON, "foo");
2286 /* Create item with icon basename but with no label. */
2289 /* If test fails, first see if icon exists. */
2291 item = hildon_grid_item_new_with_label (VALID_ICON, NULL);
2298 item = hildon_grid_item_new_with_label (NULL, "foo");
2303 /* Create item without icon basename and without label. */
2307 item = hildon_grid_item_new_with_label (NULL, NULL);
2312 /* Set emblem type. Non-NULL item, non-NULL emblem. */
2315 /* If test fails, first see if icon exists. */
2317 item = hildon_grid_item_new (VALID_ICON);
2318 hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), VALID_ICON);
2322 /* Set emblem type. Non-NULL item, NULL emblem. */
2325 /* If test fails, first see if icon exists. */
2327 item = hildon_grid_item_new (VALID_ICON);
2328 hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), NULL);
2332 /* Set emblem type. NULL item, non-NULL emblem. */
2335 hildon_grid_item_set_emblem_type (NULL, VALID_ICON);
2339 /* Set emblem type. NULL item, NULL emblem. */
2342 hildon_grid_item_set_emblem_type (NULL, NULL);
2346 /* Get emblem type from existing item - has emblem. */
2349 /* If test fails, first see if icon exists. */
2352 item = hildon_grid_item_new (VALID_ICON);
2353 hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), VALID_ICON);
2354 type = hildon_grid_item_get_emblem_type (HILDON_GRID_ITEM (item));
2359 /* Get emblem type from existing item - has no emblem. */
2362 /* If test fails, first see if icon exists. */
2365 item = hildon_grid_item_new (VALID_ICON);
2366 type = hildon_grid_item_get_emblem_type (HILDON_GRID_ITEM (item));
2367 g_assert (type != NULL);
2371 /* Get emblem type from non-existing item. */
2375 type = hildon_grid_item_get_emblem_type (NULL);
2376 g_assert (type != NULL);
2380 /* Destroy griditem. */
2384 item = hildon_grid_item_new (VALID_ICON);
2385 gtk_widget_destroy (item);
2389 /* Create new grid. */
2393 grid = hildon_grid_new ();
2398 /* Set grid style. */
2402 grid = hildon_grid_new ();
2403 hildon_grid_set_style (HILDON_GRID (grid), "bar");
2407 /* Set grid style (no style). */
2411 grid = hildon_grid_new ();
2412 hildon_grid_set_style (HILDON_GRID (grid), NULL);
2416 /* Set grid style. Invalid grid. */
2419 hildon_grid_set_style (NULL, "bar");
2423 /* Set grid style. Invalid grid, no style. */
2426 hildon_grid_set_style (NULL, NULL);
2430 /* Get grid style. Valid grid, has style. */
2435 grid = hildon_grid_new ();
2436 hildon_grid_set_style (HILDON_GRID (grid), "foo");
2437 style = hildon_grid_get_style (HILDON_GRID (grid));
2442 /* Get grid style. Valid grid, has no style. */
2447 grid = hildon_grid_new ();
2448 hildon_grid_set_style (HILDON_GRID (grid), NULL);
2449 style = hildon_grid_get_style (HILDON_GRID (grid));
2450 g_assert (style != NULL && strcmp (style, "HildonGrid") == 0);
2454 /* Get grid style. Invalid grid. */
2458 style = hildon_grid_get_style (NULL);
2463 /* Set grid scrollbar position. Valid grid. */
2467 grid = hildon_grid_new ();
2468 hildon_grid_set_scrollbar_pos (HILDON_GRID (grid), 0);
2472 /* Set grid scrollbar position. Invalid grid. */
2475 hildon_grid_set_scrollbar_pos (NULL, 0);
2479 /* Get grid scrollbar position. Valid grid. */
2484 grid = hildon_grid_new ();
2485 pos = hildon_grid_get_scrollbar_pos (HILDON_GRID (grid));
2489 /* Get grid scrollbar position. Inalid grid. */
2493 pos = hildon_grid_get_scrollbar_pos (NULL);
2497 /* Add item to existing grid. */
2502 grid = hildon_grid_new ();
2503 item = hildon_grid_item_new (VALID_ICON);
2504 gtk_container_add (GTK_CONTAINER (grid), item);
2508 /* Add NULL to existing grid. */
2513 grid = hildon_grid_new ();
2514 item = hildon_grid_item_new (VALID_ICON);
2515 gtk_container_add (GTK_CONTAINER (grid), NULL);
2519 /* Add something to existing grid. */
2524 grid = hildon_grid_new ();
2525 item = gtk_button_new ();
2526 gtk_container_add (GTK_CONTAINER (grid), item);
2530 /* Add something to non-existing grid. */
2534 item = gtk_button_new ();
2535 gtk_container_add (NULL, item);
2539 /* Add something to invalid grid. */
2543 item = gtk_button_new ();
2544 gtk_container_add (GTK_CONTAINER (item), item);
2548 /* Remove item from grid. */
2553 grid = hildon_grid_new ();
2554 item = hildon_grid_item_new (VALID_ICON);
2555 gtk_container_add (GTK_CONTAINER (grid), item);
2556 gtk_container_remove (GTK_CONTAINER (grid), item);
2560 /* Remove non-existing item from grid. */
2565 grid = hildon_grid_new ();
2566 item = hildon_grid_item_new (VALID_ICON);
2567 gtk_container_add (GTK_CONTAINER (grid), item);
2568 item = hildon_grid_item_new (VALID_ICON);
2569 gtk_container_remove (GTK_CONTAINER (grid), item);
2573 /* Remove NULL from grid. */
2578 grid = hildon_grid_new ();
2579 item = hildon_grid_item_new (VALID_ICON);
2580 gtk_container_add (GTK_CONTAINER (grid), item);
2581 gtk_container_remove (GTK_CONTAINER (grid), NULL);
2585 /* Remove something from grid. */
2590 grid = hildon_grid_new ();
2591 item = hildon_grid_item_new (VALID_ICON);
2592 gtk_container_add (GTK_CONTAINER (grid), item);
2593 item = gtk_button_new ();
2594 gtk_container_remove (GTK_CONTAINER (grid), item);
2598 /* Remove something from NULL grid. */
2602 item = gtk_button_new ();
2603 gtk_container_remove (NULL, item);
2607 /* Remove something from invalid grid. */
2610 GtkWidget *item0, *item1;
2611 item0 = gtk_button_new ();
2612 item1 = gtk_button_new ();
2613 gtk_container_remove (GTK_CONTAINER (item0), item1);
2622 grid = hildon_grid_new ();
2623 item = hildon_grid_item_new (VALID_ICON);
2624 gtk_container_add (GTK_CONTAINER (grid), item);
2625 item = hildon_grid_item_new (VALID_ICON);
2626 gtk_container_add (GTK_CONTAINER (grid), item);
2627 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2631 /* Set focus to non-existing. */
2636 grid = hildon_grid_new ();
2637 item = hildon_grid_item_new (VALID_ICON);
2638 gtk_container_add (GTK_CONTAINER (grid), item);
2639 item = hildon_grid_item_new (VALID_ICON);
2640 gtk_container_add (GTK_CONTAINER (grid), item);
2641 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2642 item = hildon_grid_item_new (VALID_ICON);
2643 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2647 /* Set focus to NULL. */
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_add (GTK_CONTAINER (grid), item);
2657 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2661 /* Set focus to something. */
2666 grid = hildon_grid_new ();
2667 item = hildon_grid_item_new (VALID_ICON);
2668 gtk_container_add (GTK_CONTAINER (grid), item);
2669 item = hildon_grid_item_new (VALID_ICON);
2670 gtk_container_add (GTK_CONTAINER (grid), item);
2671 item = gtk_button_new ();
2672 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2681 grid = hildon_grid_new ();
2682 item = hildon_grid_item_new (VALID_ICON);
2683 gtk_container_add (GTK_CONTAINER (grid), item);
2684 item = hildon_grid_item_new (VALID_ICON);
2685 gtk_container_add (GTK_CONTAINER (grid), item);
2686 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2687 g_assert (GTK_CONTAINER (grid)->focus_child == item);
2691 /* Get focus (no focused). */
2695 grid = hildon_grid_new ();
2696 g_assert (GTK_CONTAINER (grid)->focus_child == NULL);
2700 /* Destroy grid. Has items. */
2704 grid = hildon_grid_new ();
2705 gtk_widget_destroy (grid);
2709 /* Destroy grid. No items. */
2714 grid = hildon_grid_new ();
2715 item = hildon_grid_item_new (VALID_ICON);
2716 gtk_container_add (GTK_CONTAINER (grid), item);
2717 gtk_widget_destroy (grid);
2721 /* HildonTimeEditor: create editor widget */
2724 editor = hildon_time_editor_new ();
2729 /* HildonTimeEditor: set time and check if returned
2730 * time value is same
2734 guint hour, min, sec;
2735 editor = hildon_time_editor_new ();
2736 hildon_time_editor_set_time (HILDON_TIME_EDITOR (editor),
2738 hildon_time_editor_get_time (HILDON_TIME_EDITOR (editor),
2740 g_assert (hour == 21);
2741 g_assert (min == 39);
2742 g_assert (sec ==45);
2746 /* HildonTimeEditor: enable/disable seconds */
2749 editor = hildon_time_editor_new ();
2750 #ifndef HILDON_DISABLE_DEPRECATED
2751 hildon_time_editor_show_seconds (HILDON_TIME_EDITOR (editor), 1);
2752 hildon_time_editor_show_seconds (HILDON_TIME_EDITOR (editor), 0);
2754 hildon_time_editor_set_show_seconds (HILDON_TIME_EDITOR (editor), 1);
2755 hildon_time_editor_set_show_seconds (HILDON_TIME_EDITOR (editor), 0);
2760 /* HildonTimeEditor: enable duration mode */
2763 editor = hildon_time_editor_new ();
2764 #ifndef HILDON_DISABLE_DEPRECATED
2765 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2768 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2774 /* HildonTimeEditor: set duration range and check values
2775 * against returned values
2779 guint min_seconds, max_seconds;
2780 editor = hildon_time_editor_new ();
2781 #ifndef HILDON_DISABLE_DEPRECATED
2782 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2785 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2788 hildon_time_editor_set_duration_range (HILDON_TIME_EDITOR (editor),
2790 hildon_time_editor_get_duration_range (HILDON_TIME_EDITOR (editor),
2791 &min_seconds, &max_seconds);
2792 g_assert (min_seconds == 3600);
2793 g_assert (max_seconds == 14500);
2797 /* HildonTimeEditor: enable and disable duration modes */
2800 editor = hildon_time_editor_new ();
2801 #ifndef HILDON_DISABLE_DEPRECATED
2802 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2804 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2807 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2809 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2815 /* HildonTimeEditor: set time and check against
2820 guint hour, min, sec;
2821 editor = hildon_time_editor_new ();
2822 hildon_time_editor_set_time (HILDON_TIME_EDITOR (editor),
2824 hildon_time_editor_get_time (HILDON_TIME_EDITOR (editor),
2826 g_assert (hour == 13);
2827 g_assert (min == 33);
2828 g_assert (sec ==42);
2832 /* HildonTimeEditor: set duration range and check values
2833 * against foo values
2837 guint min_seconds, max_seconds;
2838 editor = hildon_time_editor_new ();
2839 #ifndef HILDON_DISABLE_DEPRECATED
2840 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2843 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2846 hildon_time_editor_set_duration_range (HILDON_TIME_EDITOR (editor),
2848 hildon_time_editor_get_duration_range (HILDON_TIME_EDITOR (editor),
2849 &min_seconds, &max_seconds);
2850 g_assert (min_seconds == 4600);
2851 g_assert (max_seconds == 15500);
2858 gtk_infoprint_temporarily_disable_wrap ();
2859 gtk_infoprint (NULL, "A suitably long text for testing the wrapping of gtkinfoprint.");
2865 gtk_banner_temporarily_disable_wrap ();
2866 gtk_banner_show_animation (NULL, "A suitably long text for testing the wrapping of gtkinfoprint.");
2875 dialog = hildon_name_password_dialog_new(NULL);
2876 name = (gchar *)hildon_name_password_dialog_get_name(HILDON_NAME_PASSWORD_DIALOG(dialog));
2887 dialog = hildon_name_password_dialog_new(NULL);
2888 password = (gchar *)hildon_name_password_dialog_get_password(HILDON_NAME_PASSWORD_DIALOG(dialog));
2896 GtkWidget *entry, *caption;
2898 entry = gtk_entry_new ();
2899 caption = hildon_caption_new (NULL /* group */,
2901 GTK_WIDGET(entry), NULL,
2902 HILDON_CAPTION_OPTIONAL /* flag */);
2912 dialog = hildon_get_password_dialog_new (NULL, TRUE);
2915 dialog = hildon_get_password_dialog_new (NULL, FALSE);
2925 dialog = hildon_get_password_dialog_new_with_default (NULL, "seekrit",
2929 dialog = hildon_get_password_dialog_new_with_default (NULL, "seekrit",
2940 dialog = hildon_calendar_popup_new (NULL, 1973, 5, 11);
2951 dialog = hildon_add_home_dialog_new (NULL, "oldname", "newname");
2955 dialog = hildon_add_home_dialog_new (NULL, "oldname", NULL);
2965 {*test1a, "hildon_controlbar_new", EXPECT_OK},
2966 {*test1b, "hildon_controlbar_get/set_max", EXPECT_OK},
2967 {*test1c, "hildon_controlbar_get/set_value", EXPECT_OK},
2968 {*test1d, "gtk_widget_destroy", EXPECT_OK},
2969 {*test1e, "hildon_controlbar_get/set_min", EXPECT_OK},
2970 {*test1f, "hildon_controlbar_set_range", EXPECT_OK},
2971 {*test1g, "hildon_controlbar_set/get_range", EXPECT_OK},
2972 {*test1h, "hildon_controlbar_range/set/get_value (min)", EXPECT_OK},
2973 {*test1i, "hildon_controlbar_range/set/get_value (max)", EXPECT_OK},
2974 {*test2a, "hildon_seekbar_new", EXPECT_OK},
2975 {*test2b, "hildon_seekbar_get/set_total_time", EXPECT_OK},
2976 {*test2c, "hildon_seekbar_get/set_position", EXPECT_OK},
2977 {*test2d, "gtk_widget_destroy", EXPECT_OK},
2978 {*test2e, "hildon_seekbat_get/set_fraction", EXPECT_OK},
2979 {*test3a, "gtk_infoprint system (something)", EXPECT_OK},
2980 {*test3b, "gtk_infoprint system (NULL)", EXPECT_OK},
2981 {*test3c, "gtk_infoprint_with_icon_stock (VALID ICON)", EXPECT_OK},
2982 {*test3d, "gtk_infoprint_with_icon_stock (EMPTY STRING)", EXPECT_OK},
2983 {*test3e, "gtk_infoprint_with_icon_stock (NULL STRING)", EXPECT_OK},
2984 {*test3f, "gtk_infoprintf (something)", EXPECT_OK},
2985 {*test3g, "gtk_infoprintf (NULL)", EXPECT_OK},
2986 {*test3h, "gtk_confirmation_banner (Somestring, NULL STRING)", EXPECT_OK},
2987 {*test3i, "gtk_confirmation_banner (Somestring, NULL)", EXPECT_OK},
2988 {*test3j, "gtk_banner_show_animation", EXPECT_OK},
2989 {*test3k, "gtk_banner_show_animation with set_fraction", EXPECT_OK},
2990 /*{*test3l, "gtk_banner_show_animation with two banner_closes", EXPECT_ASSERT},*/
2991 {*test3m, "gtk_banner_show_animation with destroy window", EXPECT_OK},
2992 {*test3n, "gtk_banner_show_bar", EXPECT_OK},
2993 {*test3o, "gtk_banner_show_bar with destroy window", EXPECT_OK},
2994 {*test3p, "gtk_banner_show_bar & close with null parent", EXPECT_OK},
2995 {*test3q, "gtk_banner_set_text with null parent", EXPECT_OK},
2996 {*test3r, "gtk_banner_set_fraction with null parent", EXPECT_OK},
2997 {*test3s, "gtk_banner_close with null parent", EXPECT_OK},
2998 {*test3t, "gtk_banner_set_fraction with invalid fraction", EXPECT_ASSERT},
2999 {*test3u, "gtk_banner_set_fraction with invalid fraction", EXPECT_ASSERT},
3000 {*test3v, "gtk_banner_show_animation & close with null parent", EXPECT_OK},
3001 {*test4a, "hildon_note_new_confirmation", EXPECT_OK},
3002 {*test4b, "hildon_note_new_confirmation_with_icon_stock", EXPECT_OK},
3003 {*test4c, "hildon_new_confirmation_add_buttons", EXPECT_OK},
3004 {*test4d, ".._new_confirmation: set_button_text", EXPECT_OK},
3005 {*test4e, "hildon_note_new_information", EXPECT_OK},
3006 {*test4f, "hildon_note_new_information_with_icon_stock", EXPECT_OK},
3007 {*test4g, ".._new_information: set_button_text", EXPECT_OK},
3008 /* {*test4h, "hildon_note_new_cancel", EXPECT_OK},*/
3009 /* {*test4i, ".._new_cancel: set_button_text", EXPECT_OK},*/
3010 {*test4j, "hildon_note_new_cancel_with_progress_bar", EXPECT_OK},
3011 {*test4k, ".._cancel_with_progress_bar: set_button_text", EXPECT_OK},
3012 {*test4l, "destroy note widgets", EXPECT_OK},
3014 {*test6a, "hildon_volumebar_new (horizontal)", EXPECT_OK},
3015 {*test6b, "hildon_volumebar_new (vertical)", EXPECT_OK},
3016 {*test6c, "hildon_volumebar_get/set_level", EXPECT_OK},
3017 {*test6d, "hildon_volumebar_get/set_mute", EXPECT_OK},
3018 {*test6e, "gtk_widget_destroy", EXPECT_OK},
3019 {*test10a, "hildon_weekday_picker_new", EXPECT_OK},
3020 {*test11a, "hildon_weekday_picker_{,un,is}set", EXPECT_OK},
3021 {*test11b, "hildon_weekday_picker_set: null", EXPECT_ASSERT},
3022 {*test11c, "hildon_weekday_picker_unset: null", EXPECT_ASSERT},
3023 {*test11d, "hildon_weekday_picker_isset: null", EXPECT_ASSERT},
3024 {*test12a, "hildon_weekday_picker_toggle_day", EXPECT_OK},
3025 {*test12b, "hildon_weekday_picker_toggle_day: null", EXPECT_ASSERT},
3026 {*test12c, "hildon_weekday_picker_set_all/unset_all", EXPECT_OK},
3027 {*test13a, "htp_editor_new: ok", EXPECT_OK},
3028 {*test13b, "htp_editor_new: inv", EXPECT_ASSERT},
3029 {*test14a, "htp_editor_set_editable: ok", EXPECT_OK},
3030 {*test14b, "htp_editor_set_editable: null", EXPECT_ASSERT},
3031 {*test15a, "htp_editor_set_show_plus: ok", EXPECT_OK},
3032 {*test15b, "htp_editor_set_show_plus: null", EXPECT_ASSERT},
3033 {*test15c, "htp_editor_get_show_plus: null", EXPECT_ASSERT},
3034 {*test15d, "htp_editor_set_show_border: ok", EXPECT_OK},
3035 {*test15e, "htp_editor_set_show_border: null", EXPECT_ASSERT},
3036 {*test15f, "htp_editor_get_show_border: null", EXPECT_ASSERT},
3037 {*test16a, "htp_editor_set_widths: ok", EXPECT_OK},
3038 {*test16b, "htp_editor_set_widths: null", EXPECT_ASSERT},
3039 {*test17a, "htp_editor_set/get_country: ok", EXPECT_OK},
3040 {*test17b, "htp_editor_set/get_country: inv", EXPECT_OK},
3041 {*test17c, "htp_editor_set_country: null", EXPECT_ASSERT},
3042 {*test17d, "htp_editor_get_country: null", EXPECT_ASSERT},
3043 {*test18a, "htp_editor_set/get_area: ok", EXPECT_OK},
3044 {*test18b, "htp_editor_set/get_area: inv", EXPECT_OK},
3045 {*test18c, "htp_editor_set_area: null", EXPECT_ASSERT},
3046 {*test18d, "htp_editor_get_area: null", EXPECT_ASSERT},
3047 {*test19a, "htp_editor_set/get_number: ok", EXPECT_OK},
3048 {*test19b, "htp_editor_set/get_number: FREE", EXPECT_OK},
3049 {*test19c, "htp_editor_set/get_number: inv", EXPECT_OK},
3050 {*test19d, "htp_editor_set_number: null", EXPECT_ASSERT},
3051 {*test19e, "htp_editor_get_number: null", EXPECT_ASSERT},
3053 {*test20a, "hildon_find_object: new", EXPECT_OK},
3054 {*test20b, "hildon_find_object: with_options", EXPECT_OK},
3055 {*test20c, "hildon_find_object: get_text", EXPECT_OK},
3056 {*test20d, "hildon_find_object: get_label", EXPECT_OK},
3058 /*{*test21a, "hildon_find_options: new", EXPECT_OK},
3059 {*test21b, "hildon_find_options: hide_loc", EXPECT_OK},
3060 {*test21c, "hildon_find_options: hide_find_in", EXPECT_OK},
3061 {*test21d, "hildon_find_options: get_location", EXPECT_OK},
3062 {*test21e, "hildon_find_options: get_find", EXPECT_OK},
3063 {*test21f, "hildon_find_options: get_time_period", EXPECT_OK},
3064 {*test21g, "hildon_find_options: get_start", EXPECT_OK},
3065 {*test21h, "hildon_find_options: get_end", EXPECT_OK},
3066 {*test21i, "hildon_find_options: add_custom", EXPECT_OK},
3067 {*test21j, "hildon_find_options: date_matches", EXPECT_ASSERT},*/
3068 {*test22a, "range_editor_new", EXPECT_OK},
3069 {*test22b, "range_editor_new_with_separator", EXPECT_OK},
3070 {*test22c, "range_editor_new_with_separator_null", EXPECT_OK},
3071 {*test22d, "hildon_range_editor_get_range", EXPECT_OK},
3072 {*test22e, "hildon_range_editor_get_range_null", EXPECT_ASSERT},
3073 {*test22f, "hildon_range_editor_get_range_null2", EXPECT_ASSERT},
3074 {*test22g, "hildon_range_editor_get_range_null3", EXPECT_ASSERT},
3075 {*test22h, "hildon_range_editor_get_range_null4", EXPECT_ASSERT},
3076 {*test22i, "hildon_range_editor_set_range", EXPECT_OK},
3077 {*test22j, "hildon_range_editor_set_range_null_editor", EXPECT_ASSERT},
3078 {*test22k, "hildon_range_editor_set_limits", EXPECT_OK},
3079 {*test22l, "hildon_range_editor_set_limits&range", EXPECT_OK},
3080 {*test22m, "hildon_range_editor_set_limits_null", EXPECT_ASSERT},
3081 {*test23a, "hildon_sort_dialog_new", EXPECT_OK},
3082 {*test23b, "hildon_sort_dialog_get_sort_key", EXPECT_OK},
3083 {*test23c, "hildon_sort_dialog_set_sort_key", EXPECT_OK},
3084 {*test23d, "hildon_sort_dialog_add_sort_key", EXPECT_OK},
3085 {*test23e, "hildon_sort_dialog_get_sort_order", EXPECT_OK},
3086 {*test23f, "hildon_sort_dialog_set_sort_order", EXPECT_OK},
3087 {*test23g, "gtk_widget_destroy", EXPECT_OK},
3088 {*test24a, "get_password_dialog. get dialog", EXPECT_OK},
3089 {*test24b, "get_password_dialog. get old dialog", EXPECT_OK},
3090 {*test24c, "get_password_dialog_new_get_password", EXPECT_OK},
3091 {*test24d, "gtk_widget_destroy", EXPECT_OK},
3092 {*test25a, "set_password_dialog. set dialog ", EXPECT_OK},
3093 {*test25b, "set_password_dialog. change dialog", EXPECT_OK},
3094 {*test25c, "set_password_dialog_new_get_password", EXPECT_OK},
3095 {*test25d, "set_password_dialog_new_get_protected", EXPECT_ASSERT},
3096 {*test25e, "gtk_widget_destroy", EXPECT_OK},
3097 #ifndef HILDON_DISABLE_DEPRECATED
3098 {*fsd_set_font, "FontSelectionDialog Set font", EXPECT_OK},
3099 {*fsd_get_font,"FontSelectionDialog Get font", EXPECT_OK},
3101 {*fsd_set_pretext, "FontSelectionDialog Set preview text", EXPECT_OK},
3102 {*fsd_get_pretext, "FontSelectionDialog Get preview text", EXPECT_OK},
3103 {*test28a, "hildon_number_editor_new", EXPECT_OK},
3104 {*test28b, "hildon_number_editor_get_value", EXPECT_OK},
3105 {*test28c, "hildon_number_editor_set_range", EXPECT_OK},
3106 {*test28d, "hildon_number_editor_set_value", EXPECT_OK},
3107 {*test29a, "hildon_color_selector: set and get red color", EXPECT_OK},
3108 {*test29b, "hildon_color_selector: set and get non-base color", EXPECT_ASSERT},
3109 {*test30a, "hildon_file_handling_note_new_moving", EXPECT_OK},
3110 {*test30b, "hildon_file_handling_note_new_deleting", EXPECT_OK},
3111 {*test30c, "hildon_file_handling_note_new_opening", EXPECT_OK},
3112 {*test30d, "hildon_file_handling_note_new_saving", EXPECT_OK},
3113 {*test31a, "hildon_add_home_dialog_new: ok", EXPECT_OK},
3114 {*test31b, "hildon_add_home_dialog_new: NULL(ok)", EXPECT_OK},
3115 {*test32a, "hildon_rename_dialog: ok", EXPECT_OK},
3116 {*test32b, "hildon_rename_dialog: NULL(ok)", EXPECT_OK},
3117 {*test33a1, "grid_item_new (\"foo\")", EXPECT_OK},
3118 {*test33a2, "grid_item_new (NULL)", EXPECT_OK},
3119 {*test33b1, "grid_item_new_label (\"foo\", \"bar\")", EXPECT_OK},
3120 {*test33b2, "grid_item_new_label (\"foo\", NULL)", EXPECT_OK},
3121 {*test33b3, "grid_item_new_label (NULL, \"bar\")", EXPECT_OK},
3122 {*test33b4, "grid_item_new_label (NULL, NULL)", EXPECT_OK},
3123 {*test33c1, "grid_item_set_emblem (foo, \"bar\")", EXPECT_OK},
3124 {*test33c2, "grid_item_set_emblem (foo, NULL)", EXPECT_OK},
3125 {*test33c3, "grid_item_set_emblem (NULL, \"bar\")", EXPECT_ASSERT},
3126 {*test33c4, "grid_item_set_emblem (NULL, NULL)", EXPECT_ASSERT},
3127 {*test33d1, "grid_item_get_emblem (foo)", EXPECT_OK},
3128 {*test33d2, "grid_item_get_emblem (foo) (no emblem)", EXPECT_ASSERT},
3129 {*test33d3, "grid_item_get_emblem (NULL)", EXPECT_ASSERT},
3130 {*test33e, "grid_item: destroy", EXPECT_OK},
3131 {*test34a, "grid_new ()", EXPECT_OK},
3132 {*test34b1, "grid_set_style (foo, \"bar\")", EXPECT_OK},
3133 {*test34b2, "grid_set_style (foo, NULL)", EXPECT_OK},
3134 {*test34b3, "grid_set_style (NULL, \"foo\")", EXPECT_ASSERT},
3135 {*test34b4, "grid_set_style (NULL, NULL)", EXPECT_ASSERT},
3136 {*test34c1, "grid_get_style (foo)", EXPECT_OK},
3137 {*test34c2, "grid_get_style (foo) (no style)", EXPECT_OK},
3138 {*test34c3, "grid_get_style (NULL)", EXPECT_ASSERT},
3139 {*test34d1, "grid_set_sb_pos (foo, 0)", EXPECT_OK},
3140 {*test34d2, "grid_set_sb_pos (NULL, 0)", EXPECT_ASSERT},
3141 {*test34e1, "grid_get_sb_pos (foo)", EXPECT_OK},
3142 {*test34e2, "grid_get_sb_pos (NULL)", EXPECT_ASSERT},
3143 {*test34f1, "grid_add (grid, item)", EXPECT_OK},
3144 {*test34f2, "grid_add (grid, NULL)", EXPECT_ASSERT},
3145 {*test34f3, "grid_add (grid, something)", EXPECT_ASSERT},
3146 {*test34f4, "grid_add (NULL, whatever)", EXPECT_ASSERT},
3147 {*test34f5, "grid_add (whatever, we)", EXPECT_ASSERT},
3148 {*test34g1, "grid_remove (item) (exist)", EXPECT_OK},
3149 {*test34g2, "grid_remove (item) (non-exist)", EXPECT_ASSERT},
3150 {*test34g3, "grid_remove (NULL)", EXPECT_ASSERT},
3151 {*test34g4, "grid_remove (something)", EXPECT_ASSERT},
3152 {*test34g5, "grid_remove (NULL, some)", EXPECT_ASSERT},
3153 {*test34g6, "grid_remove (some, some)", EXPECT_ASSERT},
3154 {*test34h1, "grid_set_focus (item) (exist)", EXPECT_OK},
3155 {*test34h2, "grid_set_focus (item) (non-exist)", EXPECT_ASSERT},
3156 {*test34h3, "grid_set_focus (NULL)", EXPECT_OK},
3157 {*test34h4, "grid_set_focus (something)", EXPECT_ASSERT},
3158 {*test34i1, "grid: CONTAINER->focus_child (set)", EXPECT_OK},
3159 {*test34i2, "grid: CONTAINER->focus_child (unset)", EXPECT_OK},
3160 {*test34j1, "grid: destroy (items)", EXPECT_OK},
3161 {*test34j2, "grid: destroy (no items)", EXPECT_OK},
3162 {*test35a, "hildon_time_editor_new", EXPECT_OK},
3163 {*test35b, "hildon_time_editor_set/get_time", EXPECT_OK},
3164 {*test35c, "hildon_time_editor_show_seconds", EXPECT_OK},
3165 {*test35d, "hildon_time_editor_enable_duration_mode", EXPECT_OK},
3166 {*test35e, "hildon_time_editor_set/get_duration_range", EXPECT_OK},
3167 {*test35f, "hildon_time_editor_enable_duration_mode (TRUE, FALSE", EXPECT_OK},
3168 {*test35g, "hildon_time_editor_set/get_time with foo value check", EXPECT_ASSERT},
3169 {*test35h, "hildon_time_editor_set/get_duration_range with foo value check", EXPECT_ASSERT},
3171 {*test36a, "hildon_find_replace_dialog_new", EXPECT_OK},
3172 {*test36b, "hildon_find_replace_dialog_new_with_options", EXPECT_OK},
3173 {*test36c, "hildon_find_replace_dialog_get_text", EXPECT_OK},
3174 {*test36d, "hildon_find_replace_dialog_get_new_text", EXPECT_OK},
3176 {*test37a, "gtk_infoprint_temporarily_disable_wrap", EXPECT_OK},
3177 {*test37b, "gtk_banner_temporarily_disable_wrap", EXPECT_OK},
3178 {*test39a, "namepassword dialog get_name", EXPECT_OK},
3179 {*test39b, "namepassword dialog get_password", EXPECT_OK},
3180 /* {*test38a, "gtk_confirmation_banner (sometext)", EXPECT_OK},
3181 {*test38a, "gtk_confirmation_banner (NULL)", EXPECT_OK},*/
3183 { test42, "hildon_caption_new", EXPECT_OK },
3184 { test43, "hildon_get_password_dialog_new", EXPECT_OK },
3185 { test44, "hildon_get_password_dialog_new_with_default", EXPECT_OK },
3186 { test45, "hildon_calendor_popup_new", EXPECT_OK },
3187 { test46, "hildon_add_home_dialog_new", EXPECT_OK },
3189 {0} /*REMEMBER THE TERMINATING NULL*/
3192 /*use EXPECT_ASSERT for the tests that are _meant_ to throw assert so they are
3193 *considered passed when they throw assert and failed when they do not
3196 testcase* get_tests()
3198 g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);