2 * This file is part of hildon-libs
4 * Copyright (C) 2005 Nokia Corporation.
6 * Contact: Luc Pionchon <luc.pionchon@nokia.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
31 #include "hildon-controlbar.h"
32 #include "hildon-seekbar.h"
33 #include "hildon-note.h"
34 #include <hildon-widgets/gtk-infoprint.h>
35 #include <hildon-widgets/hildon-weekday-picker.h>
36 #include <hildon-widgets/hildon-telephone-editor.h>
37 #include <hildon-widgets/hildon-range-editor.h>
38 #include <hildon-widgets/hildon-sort-dialog.h>
39 #include <hildon-widgets/hildon-get-password-dialog.h>
40 #include <hildon-widgets/hildon-set-password-dialog.h>
41 #include <hildon-widgets/hildon-hvolumebar.h>
42 #include <hildon-widgets/hildon-vvolumebar.h>
43 #include <hildon-widgets/hildon-font-selection-dialog.h>
44 #include <hildon-widgets/hildon-insert-object-dialog.h>
45 #include <hildon-widgets/hildon-number-editor.h>
46 #include <hildon-widgets/hildon-color-selector.h>
47 #include <hildon-widgets/hildon-file-handling-note.h>
48 #include <hildon-widgets/hildon-add-home-dialog.h>
49 #include <hildon-widgets/hildon-grid-item.h>
50 #include <hildon-widgets/hildon-grid.h>
51 #include <hildon-widgets/hildon-time-editor.h>
52 #include <hildon-widgets/hildon-name-password-dialog.h>
53 #include <hildon-widgets/hildon-caption.h>
56 /* Icon which must exist (HildonGridItem). */
57 #define VALID_ICON "Help"
59 /*prototypes to keep the compiler happy*/
60 testcase *get_tests(void);
144 /* telephone editor */
172 /* find object dialog */
179 /* find object options dialog */
215 /* get / get old password dialog */
221 /* set / change password dialog */
228 /*FontSelectionDialog*/
229 #ifndef HILDON_DISABLE_DEPRECATED
230 int fsd_set_font(void);
231 int fsd_get_font(void);
233 int fsd_set_pretext(void);
234 int fsd_get_pretext(void);
250 /* FontHandlingNote */
256 /* Add to Home / Rename dialog */
311 /* Time/Duration Editor */
328 /* New infoprint/banner functionalities. */
333 /* namepassworddialog */
337 /* file details dialog */
338 #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 );
2053 /* insert object dialog: new */
2056 dialog = hildon_insert_object_dialog_new(NULL);
2061 /* insert object dialog: get_name */
2063 const gchar *string;
2066 dialog = hildon_insert_object_dialog_new(NULL);
2067 string = hildon_insert_object_dialog_get_name(HILDON_INSERT_OBJECT_DIALOG(dialog));
2072 /* insert object dialog: get_mime_type */
2074 const gchar *string;
2077 dialog = hildon_insert_object_dialog_new(NULL);
2078 string = hildon_insert_object_dialog_get_mime_type(HILDON_INSERT_OBJECT_DIALOG(dialog));
2083 /* hildon_number_editor_new */
2089 editor = hildon_number_editor_new (min, max);
2095 /* hildon_number_editor_get_value */
2102 editor = hildon_number_editor_new (min, max);
2103 value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2104 g_assert (value == max);
2109 /* hildon_number_editor_set_range */
2116 editor = hildon_number_editor_new (min, max);
2117 hildon_number_editor_set_range (HILDON_NUMBER_EDITOR (editor), 30, 80);
2118 value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2119 g_assert (value == 80);
2124 /* hildon_number_editor_set_value */
2131 editor = hildon_number_editor_new (min, max);
2132 hildon_number_editor_set_value (HILDON_NUMBER_EDITOR (editor), 3450);
2133 value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2134 g_assert (value == 3450);
2139 /* Hildon-Color-Selector:
2140 hildon_color_selector_new()
2144 GtkWidget *colselector;
2145 GdkColor redcolor = {0, 65535, 0, 0 };
2148 colselector = hildon_color_selector_new( NULL );
2150 hildon_color_selector_set_color( HILDON_COLOR_SELECTOR(colselector), &(redcolor) );
2151 color = hildon_color_selector_get_color( HILDON_COLOR_SELECTOR(colselector) );
2153 g_assert( colselector );
2154 g_assert( redcolor.pixel == color->pixel );
2155 g_assert( redcolor.red == color->red );
2156 g_assert( redcolor.green == color->green );
2157 g_assert( redcolor.blue == color->blue );
2160 gtk_widget_destroy ( colselector );
2164 /* Hildon-Color-Selector:
2165 HildonColorSelector with non-base color
2169 HildonColorSelector *colorsel;
2170 GtkWidget *obj_self;
2171 GdkColor mixedcolor = { 0, 7281, 21845, 65535 };
2174 obj_self = hildon_color_selector_new( NULL );
2175 colorsel = HILDON_COLOR_SELECTOR ( obj_self );
2177 hildon_color_selector_set_color( colorsel, &mixedcolor );
2178 color = hildon_color_selector_get_color( colorsel );
2180 g_assert( colorsel );
2181 g_assert( color->pixel == 0 );
2182 g_assert( color->red == 7281 );
2183 g_assert( color->green == 21845 );
2184 g_assert( color->blue == 65535 );
2187 g_object_unref ( obj_self );
2188 gtk_widget_destroy( GTK_WIDGET(colorsel) );
2193 /* hildon_file_handling_note_new_moving */
2196 GtkWidget *file_note;
2198 file_note = hildon_file_handling_note_new_moving (NULL);
2199 hildon_file_handling_note_set_fraction (HILDON_FILE_HANDLING_NOTE(file_note), 0.7);
2201 g_assert (file_note);
2206 /* hildon_file_handling_note_new_deleting */
2209 GtkWidget *file_note;
2211 file_note = hildon_file_handling_note_new_deleting (NULL);
2212 hildon_file_handling_note_set_counter_and_name (HILDON_FILE_HANDLING_NOTE (file_note),
2214 hildon_file_handling_note_set_counter_and_name (HILDON_FILE_HANDLING_NOTE (file_note),
2216 g_assert (file_note);
2221 /* hildon_file_handling_note_new_opening */
2224 GtkWidget *file_note;
2226 file_note = hildon_file_handling_note_new_opening (NULL);
2227 hildon_file_handling_note_set_name (HILDON_FILE_HANDLING_NOTE (file_note),
2229 g_assert (file_note);
2234 /* hildon_file_handling_note_new_saving */
2237 GtkWidget *file_note;
2239 file_note = hildon_file_handling_note_new_saving (NULL);
2240 hildon_file_handling_note_set_fraction (HILDON_FILE_HANDLING_NOTE (file_note), 0.7);
2241 g_assert (file_note);
2246 /* Add to Home dialog new: ok parameters */
2250 d = hildon_add_home_dialog_new( NULL, "name" , NULL);
2256 /* Add to Home dialog new: NULL parameter (is ok) */
2260 d = hildon_add_home_dialog_new( NULL, NULL, NULL );
2266 /* Rename dialog new: ok parameters */
2270 d = hildon_add_home_dialog_new( NULL, "name", "newname" );
2276 /* Rename dialog new: NULL parameter (is ok) */
2280 d = hildon_add_home_dialog_new( NULL, NULL, "newname" );
2286 /* Create item with icon basename. */
2289 /* If test fails, first see if icon exists. */
2291 item = hildon_grid_item_new (VALID_ICON);
2296 /* Create item without icon basename. */
2300 item = hildon_grid_item_new (NULL);
2305 /* Create item with icon basename and label. */
2308 /* If test fails, first see if icon exists. */
2310 item = hildon_grid_item_new_with_label (VALID_ICON, "foo");
2315 /* Create item with icon basename but with no label. */
2318 /* If test fails, first see if icon exists. */
2320 item = hildon_grid_item_new_with_label (VALID_ICON, NULL);
2327 item = hildon_grid_item_new_with_label (NULL, "foo");
2332 /* Create item without icon basename and without label. */
2336 item = hildon_grid_item_new_with_label (NULL, NULL);
2341 /* Set emblem type. Non-NULL item, non-NULL emblem. */
2344 /* If test fails, first see if icon exists. */
2346 item = hildon_grid_item_new (VALID_ICON);
2347 hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), VALID_ICON);
2351 /* Set emblem type. Non-NULL item, NULL emblem. */
2354 /* If test fails, first see if icon exists. */
2356 item = hildon_grid_item_new (VALID_ICON);
2357 hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), NULL);
2361 /* Set emblem type. NULL item, non-NULL emblem. */
2364 hildon_grid_item_set_emblem_type (NULL, VALID_ICON);
2368 /* Set emblem type. NULL item, NULL emblem. */
2371 hildon_grid_item_set_emblem_type (NULL, NULL);
2375 /* Get emblem type from existing item - has emblem. */
2378 /* If test fails, first see if icon exists. */
2381 item = hildon_grid_item_new (VALID_ICON);
2382 hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), VALID_ICON);
2383 type = hildon_grid_item_get_emblem_type (HILDON_GRID_ITEM (item));
2388 /* Get emblem type from existing item - has no emblem. */
2391 /* If test fails, first see if icon exists. */
2394 item = hildon_grid_item_new (VALID_ICON);
2395 type = hildon_grid_item_get_emblem_type (HILDON_GRID_ITEM (item));
2396 g_assert (type != NULL);
2400 /* Get emblem type from non-existing item. */
2404 type = hildon_grid_item_get_emblem_type (NULL);
2405 g_assert (type != NULL);
2409 /* Destroy griditem. */
2413 item = hildon_grid_item_new (VALID_ICON);
2414 gtk_widget_destroy (item);
2418 /* Create new grid. */
2422 grid = hildon_grid_new ();
2427 /* Set grid style. */
2431 grid = hildon_grid_new ();
2432 hildon_grid_set_style (HILDON_GRID (grid), "bar");
2436 /* Set grid style (no style). */
2440 grid = hildon_grid_new ();
2441 hildon_grid_set_style (HILDON_GRID (grid), NULL);
2445 /* Set grid style. Invalid grid. */
2448 hildon_grid_set_style (NULL, "bar");
2452 /* Set grid style. Invalid grid, no style. */
2455 hildon_grid_set_style (NULL, NULL);
2459 /* Get grid style. Valid grid, has style. */
2464 grid = hildon_grid_new ();
2465 hildon_grid_set_style (HILDON_GRID (grid), "foo");
2466 style = hildon_grid_get_style (HILDON_GRID (grid));
2471 /* Get grid style. Valid grid, has no style. */
2476 grid = hildon_grid_new ();
2477 hildon_grid_set_style (HILDON_GRID (grid), NULL);
2478 style = hildon_grid_get_style (HILDON_GRID (grid));
2479 g_assert (style != NULL && strcmp (style, "HildonGrid") == 0);
2483 /* Get grid style. Invalid grid. */
2487 style = hildon_grid_get_style (NULL);
2492 /* Set grid scrollbar position. Valid grid. */
2496 grid = hildon_grid_new ();
2497 hildon_grid_set_scrollbar_pos (HILDON_GRID (grid), 0);
2501 /* Set grid scrollbar position. Invalid grid. */
2504 hildon_grid_set_scrollbar_pos (NULL, 0);
2508 /* Get grid scrollbar position. Valid grid. */
2513 grid = hildon_grid_new ();
2514 pos = hildon_grid_get_scrollbar_pos (HILDON_GRID (grid));
2518 /* Get grid scrollbar position. Inalid grid. */
2522 pos = hildon_grid_get_scrollbar_pos (NULL);
2526 /* Add item to existing grid. */
2531 grid = hildon_grid_new ();
2532 item = hildon_grid_item_new (VALID_ICON);
2533 gtk_container_add (GTK_CONTAINER (grid), item);
2537 /* Add NULL to existing grid. */
2542 grid = hildon_grid_new ();
2543 item = hildon_grid_item_new (VALID_ICON);
2544 gtk_container_add (GTK_CONTAINER (grid), NULL);
2548 /* Add something to existing grid. */
2553 grid = hildon_grid_new ();
2554 item = gtk_button_new ();
2555 gtk_container_add (GTK_CONTAINER (grid), item);
2559 /* Add something to non-existing grid. */
2563 item = gtk_button_new ();
2564 gtk_container_add (NULL, item);
2568 /* Add something to invalid grid. */
2572 item = gtk_button_new ();
2573 gtk_container_add (GTK_CONTAINER (item), item);
2577 /* Remove item from grid. */
2582 grid = hildon_grid_new ();
2583 item = hildon_grid_item_new (VALID_ICON);
2584 gtk_container_add (GTK_CONTAINER (grid), item);
2585 gtk_container_remove (GTK_CONTAINER (grid), item);
2589 /* Remove non-existing item from grid. */
2594 grid = hildon_grid_new ();
2595 item = hildon_grid_item_new (VALID_ICON);
2596 gtk_container_add (GTK_CONTAINER (grid), item);
2597 item = hildon_grid_item_new (VALID_ICON);
2598 gtk_container_remove (GTK_CONTAINER (grid), item);
2602 /* Remove NULL from grid. */
2607 grid = hildon_grid_new ();
2608 item = hildon_grid_item_new (VALID_ICON);
2609 gtk_container_add (GTK_CONTAINER (grid), item);
2610 gtk_container_remove (GTK_CONTAINER (grid), NULL);
2614 /* Remove something from grid. */
2619 grid = hildon_grid_new ();
2620 item = hildon_grid_item_new (VALID_ICON);
2621 gtk_container_add (GTK_CONTAINER (grid), item);
2622 item = gtk_button_new ();
2623 gtk_container_remove (GTK_CONTAINER (grid), item);
2627 /* Remove something from NULL grid. */
2631 item = gtk_button_new ();
2632 gtk_container_remove (NULL, item);
2636 /* Remove something from invalid grid. */
2639 GtkWidget *item0, *item1;
2640 item0 = gtk_button_new ();
2641 item1 = gtk_button_new ();
2642 gtk_container_remove (GTK_CONTAINER (item0), item1);
2651 grid = hildon_grid_new ();
2652 item = hildon_grid_item_new (VALID_ICON);
2653 gtk_container_add (GTK_CONTAINER (grid), item);
2654 item = hildon_grid_item_new (VALID_ICON);
2655 gtk_container_add (GTK_CONTAINER (grid), item);
2656 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2660 /* Set focus to non-existing. */
2665 grid = hildon_grid_new ();
2666 item = hildon_grid_item_new (VALID_ICON);
2667 gtk_container_add (GTK_CONTAINER (grid), item);
2668 item = hildon_grid_item_new (VALID_ICON);
2669 gtk_container_add (GTK_CONTAINER (grid), item);
2670 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2671 item = hildon_grid_item_new (VALID_ICON);
2672 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2676 /* Set focus to NULL. */
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);
2690 /* Set focus to something. */
2695 grid = hildon_grid_new ();
2696 item = hildon_grid_item_new (VALID_ICON);
2697 gtk_container_add (GTK_CONTAINER (grid), item);
2698 item = hildon_grid_item_new (VALID_ICON);
2699 gtk_container_add (GTK_CONTAINER (grid), item);
2700 item = gtk_button_new ();
2701 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2710 grid = hildon_grid_new ();
2711 item = hildon_grid_item_new (VALID_ICON);
2712 gtk_container_add (GTK_CONTAINER (grid), item);
2713 item = hildon_grid_item_new (VALID_ICON);
2714 gtk_container_add (GTK_CONTAINER (grid), item);
2715 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2716 g_assert (GTK_CONTAINER (grid)->focus_child == item);
2720 /* Get focus (no focused). */
2724 grid = hildon_grid_new ();
2725 g_assert (GTK_CONTAINER (grid)->focus_child == NULL);
2729 /* Destroy grid. Has items. */
2733 grid = hildon_grid_new ();
2734 gtk_widget_destroy (grid);
2738 /* Destroy grid. No items. */
2743 grid = hildon_grid_new ();
2744 item = hildon_grid_item_new (VALID_ICON);
2745 gtk_container_add (GTK_CONTAINER (grid), item);
2746 gtk_widget_destroy (grid);
2750 /* HildonTimeEditor: create editor widget */
2753 editor = hildon_time_editor_new ();
2758 /* HildonTimeEditor: set time and check if returned
2759 * time value is same
2763 guint hour, min, sec;
2764 editor = hildon_time_editor_new ();
2765 hildon_time_editor_set_time (HILDON_TIME_EDITOR (editor),
2767 hildon_time_editor_get_time (HILDON_TIME_EDITOR (editor),
2769 g_assert (hour == 21);
2770 g_assert (min == 39);
2771 g_assert (sec ==45);
2775 /* HildonTimeEditor: enable/disable seconds */
2778 editor = hildon_time_editor_new ();
2779 #ifndef HILDON_DISABLE_DEPRECATED
2780 hildon_time_editor_show_seconds (HILDON_TIME_EDITOR (editor), 1);
2781 hildon_time_editor_show_seconds (HILDON_TIME_EDITOR (editor), 0);
2783 hildon_time_editor_set_show_seconds (HILDON_TIME_EDITOR (editor), 1);
2784 hildon_time_editor_set_show_seconds (HILDON_TIME_EDITOR (editor), 0);
2789 /* HildonTimeEditor: enable duration mode */
2792 editor = hildon_time_editor_new ();
2793 #ifndef HILDON_DISABLE_DEPRECATED
2794 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2797 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2803 /* HildonTimeEditor: set duration range and check values
2804 * against returned values
2808 guint min_seconds, max_seconds;
2809 editor = hildon_time_editor_new ();
2810 #ifndef HILDON_DISABLE_DEPRECATED
2811 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2814 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2817 hildon_time_editor_set_duration_range (HILDON_TIME_EDITOR (editor),
2819 hildon_time_editor_get_duration_range (HILDON_TIME_EDITOR (editor),
2820 &min_seconds, &max_seconds);
2821 g_assert (min_seconds == 3600);
2822 g_assert (max_seconds == 14500);
2826 /* HildonTimeEditor: enable and disable duration modes */
2829 editor = hildon_time_editor_new ();
2830 #ifndef HILDON_DISABLE_DEPRECATED
2831 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2833 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2836 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2838 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2844 /* HildonTimeEditor: set time and check against
2849 guint hour, min, sec;
2850 editor = hildon_time_editor_new ();
2851 hildon_time_editor_set_time (HILDON_TIME_EDITOR (editor),
2853 hildon_time_editor_get_time (HILDON_TIME_EDITOR (editor),
2855 g_assert (hour == 13);
2856 g_assert (min == 33);
2857 g_assert (sec ==42);
2861 /* HildonTimeEditor: set duration range and check values
2862 * against foo values
2866 guint min_seconds, max_seconds;
2867 editor = hildon_time_editor_new ();
2868 #ifndef HILDON_DISABLE_DEPRECATED
2869 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2872 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2875 hildon_time_editor_set_duration_range (HILDON_TIME_EDITOR (editor),
2877 hildon_time_editor_get_duration_range (HILDON_TIME_EDITOR (editor),
2878 &min_seconds, &max_seconds);
2879 g_assert (min_seconds == 4600);
2880 g_assert (max_seconds == 15500);
2887 gtk_infoprint_temporarily_disable_wrap ();
2888 gtk_infoprint (NULL, "A suitably long text for testing the wrapping of gtkinfoprint.");
2894 gtk_banner_temporarily_disable_wrap ();
2895 gtk_banner_show_animation (NULL, "A suitably long text for testing the wrapping of gtkinfoprint.");
2904 dialog = hildon_name_password_dialog_new(NULL);
2905 name = (gchar *)hildon_name_password_dialog_get_name(HILDON_NAME_PASSWORD_DIALOG(dialog));
2916 dialog = hildon_name_password_dialog_new(NULL);
2917 password = (gchar *)hildon_name_password_dialog_get_password(HILDON_NAME_PASSWORD_DIALOG(dialog));
2925 GtkWidget *entry, *caption;
2927 entry = gtk_entry_new ();
2928 caption = hildon_caption_new (NULL /* group */,
2930 GTK_WIDGET(entry), NULL,
2931 HILDON_CAPTION_OPTIONAL /* flag */);
2941 dialog = hildon_get_password_dialog_new (NULL, TRUE);
2944 dialog = hildon_get_password_dialog_new (NULL, FALSE);
2954 dialog = hildon_get_password_dialog_new_with_default (NULL, "seekrit",
2958 dialog = hildon_get_password_dialog_new_with_default (NULL, "seekrit",
2969 dialog = hildon_calendar_popup_new (NULL, 1973, 5, 11);
2979 {*test1a, "hildon_controlbar_new", EXPECT_OK},
2980 {*test1b, "hildon_controlbar_get/set_max", EXPECT_OK},
2981 {*test1c, "hildon_controlbar_get/set_value", EXPECT_OK},
2982 {*test1d, "gtk_widget_destroy", EXPECT_OK},
2983 {*test1e, "hildon_controlbar_get/set_min", EXPECT_OK},
2984 {*test1f, "hildon_controlbar_set_range", EXPECT_OK},
2985 {*test1g, "hildon_controlbar_set/get_range", EXPECT_OK},
2986 {*test1h, "hildon_controlbar_range/set/get_value (min)", EXPECT_OK},
2987 {*test1i, "hildon_controlbar_range/set/get_value (max)", EXPECT_OK},
2988 {*test2a, "hildon_seekbar_new", EXPECT_OK},
2989 {*test2b, "hildon_seekbar_get/set_total_time", EXPECT_OK},
2990 {*test2c, "hildon_seekbar_get/set_position", EXPECT_OK},
2991 {*test2d, "gtk_widget_destroy", EXPECT_OK},
2992 {*test2e, "hildon_seekbat_get/set_fraction", EXPECT_OK},
2993 {*test3a, "gtk_infoprint system (something)", EXPECT_OK},
2994 {*test3b, "gtk_infoprint system (NULL)", EXPECT_OK},
2995 {*test3c, "gtk_infoprint_with_icon_stock (VALID ICON)", EXPECT_OK},
2996 {*test3d, "gtk_infoprint_with_icon_stock (EMPTY STRING)", EXPECT_OK},
2997 {*test3e, "gtk_infoprint_with_icon_stock (NULL STRING)", EXPECT_OK},
2998 {*test3f, "gtk_infoprintf (something)", EXPECT_OK},
2999 {*test3g, "gtk_infoprintf (NULL)", EXPECT_OK},
3000 {*test3h, "gtk_confirmation_banner (Somestring, NULL STRING)", EXPECT_OK},
3001 {*test3i, "gtk_confirmation_banner (Somestring, NULL)", EXPECT_OK},
3002 {*test3j, "gtk_banner_show_animation", EXPECT_OK},
3003 {*test3k, "gtk_banner_show_animation with set_fraction", EXPECT_OK},
3004 /*{*test3l, "gtk_banner_show_animation with two banner_closes", EXPECT_ASSERT},*/
3005 {*test3m, "gtk_banner_show_animation with destroy window", EXPECT_OK},
3006 {*test3n, "gtk_banner_show_bar", EXPECT_OK},
3007 {*test3o, "gtk_banner_show_bar with destroy window", EXPECT_OK},
3008 {*test3p, "gtk_banner_show_bar & close with null parent", EXPECT_OK},
3009 {*test3q, "gtk_banner_set_text with null parent", EXPECT_OK},
3010 {*test3r, "gtk_banner_set_fraction with null parent", EXPECT_OK},
3011 {*test3s, "gtk_banner_close with null parent", EXPECT_OK},
3012 {*test3t, "gtk_banner_set_fraction with invalid fraction", EXPECT_ASSERT},
3013 {*test3u, "gtk_banner_set_fraction with invalid fraction", EXPECT_ASSERT},
3014 {*test3v, "gtk_banner_show_animation & close with null parent", EXPECT_OK},
3015 {*test4a, "hildon_note_new_confirmation", EXPECT_OK},
3016 {*test4b, "hildon_note_new_confirmation_with_icon_stock", EXPECT_OK},
3017 {*test4c, "hildon_new_confirmation_add_buttons", EXPECT_OK},
3018 {*test4d, ".._new_confirmation: set_button_text", EXPECT_OK},
3019 {*test4e, "hildon_note_new_information", EXPECT_OK},
3020 {*test4f, "hildon_note_new_information_with_icon_stock", EXPECT_OK},
3021 {*test4g, ".._new_information: set_button_text", EXPECT_OK},
3022 /* {*test4h, "hildon_note_new_cancel", EXPECT_OK},*/
3023 /* {*test4i, ".._new_cancel: set_button_text", EXPECT_OK},*/
3024 {*test4j, "hildon_note_new_cancel_with_progress_bar", EXPECT_OK},
3025 {*test4k, ".._cancel_with_progress_bar: set_button_text", EXPECT_OK},
3026 {*test4l, "destroy note widgets", EXPECT_OK},
3028 {*test6a, "hildon_volumebar_new (horizontal)", EXPECT_OK},
3029 {*test6b, "hildon_volumebar_new (vertical)", EXPECT_OK},
3030 {*test6c, "hildon_volumebar_get/set_level", EXPECT_OK},
3031 {*test6d, "hildon_volumebar_get/set_mute", EXPECT_OK},
3032 {*test6e, "gtk_widget_destroy", EXPECT_OK},
3033 {*test10a, "hildon_weekday_picker_new", EXPECT_OK},
3034 {*test11a, "hildon_weekday_picker_{,un,is}set", EXPECT_OK},
3035 {*test11b, "hildon_weekday_picker_set: null", EXPECT_ASSERT},
3036 {*test11c, "hildon_weekday_picker_unset: null", EXPECT_ASSERT},
3037 {*test11d, "hildon_weekday_picker_isset: null", EXPECT_ASSERT},
3038 {*test12a, "hildon_weekday_picker_toggle_day", EXPECT_OK},
3039 {*test12b, "hildon_weekday_picker_toggle_day: null", EXPECT_ASSERT},
3040 {*test12c, "hildon_weekday_picker_set_all/unset_all", EXPECT_OK},
3041 {*test13a, "htp_editor_new: ok", EXPECT_OK},
3042 {*test13b, "htp_editor_new: inv", EXPECT_ASSERT},
3043 {*test14a, "htp_editor_set_editable: ok", EXPECT_OK},
3044 {*test14b, "htp_editor_set_editable: null", EXPECT_ASSERT},
3045 {*test15a, "htp_editor_set_show_plus: ok", EXPECT_OK},
3046 {*test15b, "htp_editor_set_show_plus: null", EXPECT_ASSERT},
3047 {*test15c, "htp_editor_get_show_plus: null", EXPECT_ASSERT},
3048 {*test15d, "htp_editor_set_show_border: ok", EXPECT_OK},
3049 {*test15e, "htp_editor_set_show_border: null", EXPECT_ASSERT},
3050 {*test15f, "htp_editor_get_show_border: null", EXPECT_ASSERT},
3051 {*test16a, "htp_editor_set_widths: ok", EXPECT_OK},
3052 {*test16b, "htp_editor_set_widths: null", EXPECT_ASSERT},
3053 {*test17a, "htp_editor_set/get_country: ok", EXPECT_OK},
3054 {*test17b, "htp_editor_set/get_country: inv", EXPECT_OK},
3055 {*test17c, "htp_editor_set_country: null", EXPECT_ASSERT},
3056 {*test17d, "htp_editor_get_country: null", EXPECT_ASSERT},
3057 {*test18a, "htp_editor_set/get_area: ok", EXPECT_OK},
3058 {*test18b, "htp_editor_set/get_area: inv", EXPECT_OK},
3059 {*test18c, "htp_editor_set_area: null", EXPECT_ASSERT},
3060 {*test18d, "htp_editor_get_area: null", EXPECT_ASSERT},
3061 {*test19a, "htp_editor_set/get_number: ok", EXPECT_OK},
3062 {*test19b, "htp_editor_set/get_number: FREE", EXPECT_OK},
3063 {*test19c, "htp_editor_set/get_number: inv", EXPECT_OK},
3064 {*test19d, "htp_editor_set_number: null", EXPECT_ASSERT},
3065 {*test19e, "htp_editor_get_number: null", EXPECT_ASSERT},
3067 {*test20a, "hildon_find_object: new", EXPECT_OK},
3068 {*test20b, "hildon_find_object: with_options", EXPECT_OK},
3069 {*test20c, "hildon_find_object: get_text", EXPECT_OK},
3070 {*test20d, "hildon_find_object: get_label", EXPECT_OK},
3072 /*{*test21a, "hildon_find_options: new", EXPECT_OK},
3073 {*test21b, "hildon_find_options: hide_loc", EXPECT_OK},
3074 {*test21c, "hildon_find_options: hide_find_in", EXPECT_OK},
3075 {*test21d, "hildon_find_options: get_location", EXPECT_OK},
3076 {*test21e, "hildon_find_options: get_find", EXPECT_OK},
3077 {*test21f, "hildon_find_options: get_time_period", EXPECT_OK},
3078 {*test21g, "hildon_find_options: get_start", EXPECT_OK},
3079 {*test21h, "hildon_find_options: get_end", EXPECT_OK},
3080 {*test21i, "hildon_find_options: add_custom", EXPECT_OK},
3081 {*test21j, "hildon_find_options: date_matches", EXPECT_ASSERT},*/
3082 {*test22a, "range_editor_new", EXPECT_OK},
3083 {*test22b, "range_editor_new_with_separator", EXPECT_OK},
3084 {*test22c, "range_editor_new_with_separator_null", EXPECT_OK},
3085 {*test22d, "hildon_range_editor_get_range", EXPECT_OK},
3086 {*test22e, "hildon_range_editor_get_range_null", EXPECT_ASSERT},
3087 {*test22f, "hildon_range_editor_get_range_null2", EXPECT_ASSERT},
3088 {*test22g, "hildon_range_editor_get_range_null3", EXPECT_ASSERT},
3089 {*test22h, "hildon_range_editor_get_range_null4", EXPECT_ASSERT},
3090 {*test22i, "hildon_range_editor_set_range", EXPECT_OK},
3091 {*test22j, "hildon_range_editor_set_range_null_editor", EXPECT_ASSERT},
3092 {*test22k, "hildon_range_editor_set_limits", EXPECT_OK},
3093 {*test22l, "hildon_range_editor_set_limits&range", EXPECT_OK},
3094 {*test22m, "hildon_range_editor_set_limits_null", EXPECT_ASSERT},
3095 {*test23a, "hildon_sort_dialog_new", EXPECT_OK},
3096 {*test23b, "hildon_sort_dialog_get_sort_key", EXPECT_OK},
3097 {*test23c, "hildon_sort_dialog_set_sort_key", EXPECT_OK},
3098 {*test23d, "hildon_sort_dialog_add_sort_key", EXPECT_OK},
3099 {*test23e, "hildon_sort_dialog_get_sort_order", EXPECT_OK},
3100 {*test23f, "hildon_sort_dialog_set_sort_order", EXPECT_OK},
3101 {*test23g, "gtk_widget_destroy", EXPECT_OK},
3102 {*test24a, "get_password_dialog. get dialog", EXPECT_OK},
3103 {*test24b, "get_password_dialog. get old dialog", EXPECT_OK},
3104 {*test24c, "get_password_dialog_new_get_password", EXPECT_OK},
3105 {*test24d, "gtk_widget_destroy", EXPECT_OK},
3106 {*test25a, "set_password_dialog. set dialog ", EXPECT_OK},
3107 {*test25b, "set_password_dialog. change dialog", EXPECT_OK},
3108 {*test25c, "set_password_dialog_new_get_password", EXPECT_OK},
3109 {*test25d, "set_password_dialog_new_get_protected", EXPECT_ASSERT},
3110 {*test25e, "gtk_widget_destroy", EXPECT_OK},
3111 #ifndef HILDON_DISABLE_DEPRECATED
3112 {*fsd_set_font, "FontSelectionDialog Set font", EXPECT_OK},
3113 {*fsd_get_font,"FontSelectionDialog Get font", EXPECT_OK},
3115 {*fsd_set_pretext, "FontSelectionDialog Set preview text", EXPECT_OK},
3116 {*fsd_get_pretext, "FontSelectionDialog Get preview text", EXPECT_OK},
3117 {*test27a, "hildon_insert_object: new", EXPECT_OK},
3118 {*test27b, "hildon_insert_object: get_name", EXPECT_OK},
3119 {*test27c, "hildon_insert_object: get_mime_type", EXPECT_ASSERT},
3120 {*test28a, "hildon_number_editor_new", EXPECT_OK},
3121 {*test28b, "hildon_number_editor_get_value", EXPECT_OK},
3122 {*test28c, "hildon_number_editor_set_range", EXPECT_OK},
3123 {*test28d, "hildon_number_editor_set_value", EXPECT_OK},
3124 {*test29a, "hildon_color_selector: set and get red color", EXPECT_OK},
3125 {*test29b, "hildon_color_selector: set and get non-base color", EXPECT_ASSERT},
3126 {*test30a, "hildon_file_handling_note_new_moving", EXPECT_OK},
3127 {*test30b, "hildon_file_handling_note_new_deleting", EXPECT_OK},
3128 {*test30c, "hildon_file_handling_note_new_opening", EXPECT_OK},
3129 {*test30d, "hildon_file_handling_note_new_saving", EXPECT_OK},
3130 {*test31a, "hildon_add_home_dialog_new: ok", EXPECT_OK},
3131 {*test31b, "hildon_add_home_dialog_new: NULL(ok)", EXPECT_OK},
3132 {*test32a, "hildon_rename_dialog: ok", EXPECT_OK},
3133 {*test32b, "hildon_rename_dialog: NULL(ok)", EXPECT_OK},
3134 {*test33a1, "grid_item_new (\"foo\")", EXPECT_OK},
3135 {*test33a2, "grid_item_new (NULL)", EXPECT_ASSERT},
3136 {*test33b1, "grid_item_new_label (\"foo\", \"bar\")", EXPECT_OK},
3137 {*test33b2, "grid_item_new_label (\"foo\", NULL)", EXPECT_OK},
3138 {*test33b3, "grid_item_new_label (NULL, \"bar\")", EXPECT_ASSERT},
3139 {*test33b4, "grid_item_new_label (NULL, NULL)", EXPECT_ASSERT},
3140 {*test33c1, "grid_item_set_emblem (foo, \"bar\")", EXPECT_OK},
3141 {*test33c2, "grid_item_set_emblem (foo, NULL)", EXPECT_OK},
3142 {*test33c3, "grid_item_set_emblem (NULL, \"bar\")", EXPECT_ASSERT},
3143 {*test33c4, "grid_item_set_emblem (NULL, NULL)", EXPECT_ASSERT},
3144 {*test33d1, "grid_item_get_emblem (foo)", EXPECT_OK},
3145 {*test33d2, "grid_item_get_emblem (foo) (no emblem)", EXPECT_ASSERT},
3146 {*test33d3, "grid_item_get_emblem (NULL)", EXPECT_ASSERT},
3147 {*test33e, "grid_item: destroy", EXPECT_OK},
3148 {*test34a, "grid_new ()", EXPECT_OK},
3149 {*test34b1, "grid_set_style (foo, \"bar\")", EXPECT_OK},
3150 {*test34b2, "grid_set_style (foo, NULL)", EXPECT_OK},
3151 {*test34b3, "grid_set_style (NULL, \"foo\")", EXPECT_ASSERT},
3152 {*test34b4, "grid_set_style (NULL, NULL)", EXPECT_ASSERT},
3153 {*test34c1, "grid_get_style (foo)", EXPECT_OK},
3154 {*test34c2, "grid_get_style (foo) (no style)", EXPECT_OK},
3155 {*test34c3, "grid_get_style (NULL)", EXPECT_ASSERT},
3156 {*test34d1, "grid_set_sb_pos (foo, 0)", EXPECT_OK},
3157 {*test34d2, "grid_set_sb_pos (NULL, 0)", EXPECT_ASSERT},
3158 {*test34e1, "grid_get_sb_pos (foo)", EXPECT_OK},
3159 {*test34e2, "grid_get_sb_pos (NULL)", EXPECT_ASSERT},
3160 {*test34f1, "grid_add (grid, item)", EXPECT_OK},
3161 {*test34f2, "grid_add (grid, NULL)", EXPECT_ASSERT},
3162 {*test34f3, "grid_add (grid, something)", EXPECT_ASSERT},
3163 {*test34f4, "grid_add (NULL, whatever)", EXPECT_ASSERT},
3164 {*test34f5, "grid_add (whatever, we)", EXPECT_ASSERT},
3165 {*test34g1, "grid_remove (item) (exist)", EXPECT_OK},
3166 {*test34g2, "grid_remove (item) (non-exist)", EXPECT_ASSERT},
3167 {*test34g3, "grid_remove (NULL)", EXPECT_ASSERT},
3168 {*test34g4, "grid_remove (something)", EXPECT_ASSERT},
3169 {*test34g5, "grid_remove (NULL, some)", EXPECT_ASSERT},
3170 {*test34g6, "grid_remove (some, some)", EXPECT_ASSERT},
3171 {*test34h1, "grid_set_focus (item) (exist)", EXPECT_OK},
3172 {*test34h2, "grid_set_focus (item) (non-exist)", EXPECT_ASSERT},
3173 {*test34h3, "grid_set_focus (NULL)", EXPECT_OK},
3174 {*test34h4, "grid_set_focus (something)", EXPECT_ASSERT},
3175 {*test34i1, "grid: CONTAINER->focus_child (set)", EXPECT_OK},
3176 {*test34i2, "grid: CONTAINER->focus_child (unset)", EXPECT_OK},
3177 {*test34j1, "grid: destroy (items)", EXPECT_OK},
3178 {*test34j2, "grid: destroy (no items)", EXPECT_OK},
3179 {*test35a, "hildon_time_editor_new", EXPECT_OK},
3180 {*test35b, "hildon_time_editor_set/get_time", EXPECT_OK},
3181 {*test35c, "hildon_time_editor_show_seconds", EXPECT_OK},
3182 {*test35d, "hildon_time_editor_enable_duration_mode", EXPECT_OK},
3183 {*test35e, "hildon_time_editor_set/get_duration_range", EXPECT_OK},
3184 {*test35f, "hildon_time_editor_enable_duration_mode (TRUE, FALSE", EXPECT_OK},
3185 {*test35g, "hildon_time_editor_set/get_time with foo value check", EXPECT_ASSERT},
3186 {*test35h, "hildon_time_editor_set/get_duration_range with foo value check", EXPECT_ASSERT},
3188 {*test36a, "hildon_find_replace_dialog_new", EXPECT_OK},
3189 {*test36b, "hildon_find_replace_dialog_new_with_options", EXPECT_OK},
3190 {*test36c, "hildon_find_replace_dialog_get_text", EXPECT_OK},
3191 {*test36d, "hildon_find_replace_dialog_get_new_text", EXPECT_OK},
3193 {*test37a, "gtk_infoprint_temporarily_disable_wrap", EXPECT_OK},
3194 {*test37b, "gtk_banner_temporarily_disable_wrap", EXPECT_OK},
3195 {*test39a, "namepassword dialog get_name", EXPECT_OK},
3196 {*test39b, "namepassword dialog get_password", EXPECT_OK},
3197 /* {*test38a, "gtk_confirmation_banner (sometext)", EXPECT_OK},
3198 {*test38a, "gtk_confirmation_banner (NULL)", EXPECT_OK},*/
3200 { test42, "hildon_caption_new", EXPECT_OK },
3201 { test43, "hildon_get_password_dialog_new", EXPECT_OK },
3202 { test44, "hildon_get_password_dialog_new_with_default", EXPECT_OK },
3203 { test45, "hildon_calendor_popup_new", EXPECT_OK },
3205 {0} /*REMEMBER THE TERMINATING NULL*/
3208 /*use EXPECT_ASSERT for the tests that are _meant_ to throw assert so they are
3209 *considered passed when they throw assert and failed when they do not
3212 testcase* get_tests()
3214 g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);