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>
55 /* Icon which must exist (HildonGridItem). */
56 #define VALID_ICON "Help"
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
340 /* this has to be like this (not static). outo
342 testcase *get_tests(void);
343 void init_test( void )
346 gtk_init (&plop, NULL);
351 HildonControlbar *controlBar;
352 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
360 HildonControlbar *controlBar;
363 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
364 hildon_controlbar_set_max(controlBar, max);
365 assert(hildon_controlbar_get_max(controlBar) == max);
371 HildonControlbar *controlBar;
375 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
376 hildon_controlbar_set_max(controlBar, max);
377 hildon_controlbar_set_value(controlBar, value);
378 assert(hildon_controlbar_get_value(controlBar) == value);
384 HildonControlbar *controlBar;
386 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
387 gtk_widget_destroy(GTK_WIDGET(controlBar));
394 HildonControlbar *controlBar;
396 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
397 hildon_controlbar_set_min(controlBar, 5);
398 getmin = hildon_controlbar_get_min (controlBar);
399 assert (getmin == 5);
408 HildonControlbar *controlBar;
410 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
411 hildon_controlbar_set_range (controlBar, min, max);
420 HildonControlbar *controlBar;
422 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
423 hildon_controlbar_set_range (controlBar, 57, 219);
424 minval = hildon_controlbar_get_min (controlBar);
425 maxval = hildon_controlbar_get_max (controlBar);
426 assert (minval == 57);
427 assert (maxval == 219);
435 HildonControlbar *controlBar;
437 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
438 hildon_controlbar_set_range (controlBar, 250, 550);
439 hildon_controlbar_set_value (controlBar, 100);
441 value = hildon_controlbar_get_value (controlBar);
443 assert (value == 250);
451 HildonControlbar *controlBar;
453 controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
454 hildon_controlbar_set_range (controlBar, 250, 550);
455 hildon_controlbar_set_value (controlBar, 650);
457 value = hildon_controlbar_get_value (controlBar);
459 assert (value == 550);
467 seekBar = hildon_seekbar_new();
477 seekBar = hildon_seekbar_new();
478 hildon_seekbar_set_total_time(HILDON_SEEKBAR(seekBar), totalTime);
479 assert(hildon_seekbar_get_total_time(HILDON_SEEKBAR(seekBar)) == totalTime);
489 seekBar = hildon_seekbar_new();
490 hildon_seekbar_set_total_time(HILDON_SEEKBAR(seekBar), totalTime);
491 hildon_seekbar_set_position(HILDON_SEEKBAR(seekBar), position);
492 assert(hildon_seekbar_get_position(HILDON_SEEKBAR(seekBar)) == position);
500 seekBar = hildon_seekbar_new();
501 gtk_widget_destroy(GTK_WIDGET(seekBar));
510 seekBar = hildon_seekbar_new();
511 hildon_seekbar_set_total_time(HILDON_SEEKBAR(seekBar), totalTime);
512 hildon_seekbar_set_fraction(HILDON_SEEKBAR(seekBar), 200);
513 assert(hildon_seekbar_get_fraction(HILDON_SEEKBAR(seekBar)) == 200);
520 gtk_infoprint(NULL,"infoprint");
527 gtk_infoprint(NULL, NULL);
534 gtk_infoprint_with_icon_stock(NULL, "infoprint", GTK_STOCK_DIALOG_QUESTION);
541 gtk_infoprint_with_icon_stock(NULL, "infoprint", "");
548 gtk_infoprint_with_icon_stock(NULL, "infoprint", NULL);
555 gtk_infoprintf (NULL, "mambo %d", 2+3);
562 gtk_infoprintf (NULL, NULL);
569 gtk_confirmation_banner (NULL, "Insert our favourite testing text here.", NULL);
575 gtk_confirmation_banner (NULL, NULL, NULL);
581 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
582 gtk_banner_show_animation (win, "Insert our favourite testing text here.");
583 gtk_banner_set_text (win, "Insert our second favourite testing text here.");
584 gtk_banner_set_text (win, "");
585 gtk_banner_set_text (win, NULL);
586 gtk_banner_close (win);
587 gtk_widget_destroy (GTK_WIDGET (win));
593 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
594 gtk_banner_show_animation (win, "Insert our favourite testing text here.");
595 gtk_banner_set_fraction (win, 0.5);
596 gtk_banner_set_fraction (win, -0.5);
597 gtk_banner_set_fraction (win, 1.5);
598 gtk_banner_close (win);
599 gtk_widget_destroy (GTK_WIDGET (win));
605 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
606 gtk_banner_show_animation (win, "Insert our favourite testing text here.");
607 gtk_banner_close (win);
608 gtk_banner_close (win);
609 gtk_widget_destroy (GTK_WIDGET (win));
615 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
616 gtk_banner_show_animation (win, "Insert our favourite testing text here.");
617 gtk_widget_destroy (GTK_WIDGET (win));
623 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
624 gtk_banner_show_bar (win, "Insert our favourite testing text here.");
625 gtk_banner_set_text (win, "Insert our second favourite testing text here.");
626 gtk_banner_set_text (win, "");
627 gtk_banner_set_text (win, NULL);
628 gtk_banner_set_fraction (win, 0.5);
629 gtk_banner_close (win);
635 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
636 gtk_banner_show_bar (win, "Insert our favourite testing text here.");
637 gtk_banner_set_text (win, "Insert our second favourite testing text here.");
638 gtk_banner_set_text (win, "");
639 gtk_banner_set_text (win, NULL);
640 gtk_banner_set_fraction (win, 0.5);
641 gtk_widget_destroy (GTK_WIDGET (win));
647 gtk_banner_show_bar (NULL, "Insert our favourite testing text here.");
648 gtk_banner_close (NULL);
654 gtk_banner_set_text (NULL, "Insert our second favourite testing text here.");
660 gtk_banner_set_fraction (NULL, 0.5);
666 gtk_banner_close (NULL);
672 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
673 gtk_banner_show_bar (win, "Insert our favourite testing text here.");
674 gtk_banner_set_fraction (win, -0.5);
675 gtk_banner_close (win);
681 GtkWindow *win = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL));
682 gtk_banner_show_bar (win, "Insert our favourite testing text here.");
683 gtk_banner_set_fraction (win, 1.5);
684 gtk_banner_close (win);
690 gtk_banner_show_animation (NULL, "Insert our favourite testing text here.");
691 gtk_banner_close (NULL);
696 /* note: confirmation note */
699 HildonNote *note = HILDON_NOTE( hildon_note_new_confirmation( NULL,
700 "Delete the presentation?\nHildon Slides" ));
704 /* note: confirmation note with icon stock */
708 note = HILDON_NOTE( hildon_note_new_confirmation_with_icon_stock(NULL,
709 "Delete the presentation?\nHildon Slides", GTK_STOCK_OPEN));
713 /* note: confirmation note with 10 additional buttons */
717 HildonNote *note = HILDON_NOTE( hildon_note_new_confirmation_add_buttons( NULL,
718 "Delete the presentation?\nHildon Slides",
719 "add 1", 12345, "add 2", 13579,
720 "add 3", 12345, "add 4", 13579,
721 "add 5", 12345, "add 6", 13579,
722 "add 7", 12345, "add 8", 13579,
723 "add 9", 24680, "add 9", 24680, NULL) );
728 /* note: confirmation note: Set button text*/
732 note = HILDON_NOTE( hildon_note_new_confirmation(NULL,
733 "Delete the presentation?\nHildon Slides"));
734 hildon_note_set_button_text( HILDON_NOTE( note ) , "Remove" );
738 /* note: information note */
742 note = HILDON_NOTE( hildon_note_new_information(NULL,
743 "Only one button present\nin this information note"));
747 /* note: information note with icon stock */
751 note = HILDON_NOTE( hildon_note_new_information_with_icon_stock(NULL,
752 "Only one button present\nin this information note", GTK_STOCK_HARDDISK));
756 /* note: information note: Set button text*/
760 note = HILDON_NOTE( hildon_note_new_information(NULL,
761 "Only one button present\nin this information note"));
762 hildon_note_set_button_text( HILDON_NOTE( note ) , "Continue" );
771 note = HILDON_NOTE( hildon_note_new_cancel( NULL,
772 "Deleting files.." ));
777 /* note: new cancel: set button text
782 note = HILDON_NOTE( hildon_note_new_cancel( NULL,
783 "Deleting files.." ));
784 hildon_note_set_button_text( HILDON_NOTE( note ) , "Stop" );
788 /* note: new cancel with progress bar*/
792 GtkWidget *progress_note;
794 progbar = gtk_progress_bar_new();
796 gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR( progbar ), 0.7 );
798 progress_note = hildon_note_new_cancel_with_progress_bar(
799 NULL, "Deleting files..",
800 GTK_PROGRESS_BAR( progbar ));
802 assert(progress_note);
806 /* note: new cancel with progress bar: set button text*/
810 GtkWidget *progress_note;
812 progbar = gtk_progress_bar_new();
814 gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR( progbar ), 0.7 );
816 progress_note = hildon_note_new_cancel_with_progress_bar(
817 NULL, "Deleting files..",
818 GTK_PROGRESS_BAR( progbar ));
820 hildon_note_set_button_text( HILDON_NOTE( progress_note ) , "Stop" );
823 /* destroy note widgets */
828 /* GtkWidget *cancel;*/
831 GtkWidget *conf_button;
833 conf = hildon_note_new_confirmation(NULL, NULL);
835 gtk_widget_destroy(conf);
837 inf = hildon_note_new_information(NULL, NULL);
839 gtk_widget_destroy(inf);
842 cancel = hildon_note_new_cancel( NULL, NULL );
844 gtk_widget_destroy(cancel);
847 progbar = gtk_progress_bar_new();
848 progress = hildon_note_new_cancel_with_progress_bar(
849 NULL, NULL, GTK_PROGRESS_BAR( progbar ));
851 gtk_widget_destroy(progress);
853 conf_button = hildon_note_new_confirmation_add_buttons( NULL, NULL, NULL );
855 gtk_widget_destroy(conf_button);
862 HildonHVolumebar *volumeBar;
864 volumeBar = HILDON_HVOLUMEBAR(hildon_hvolumebar_new());
871 HildonVVolumebar *volumeBar;
873 volumeBar = HILDON_VVOLUMEBAR(hildon_vvolumebar_new());
880 HildonHVolumebar *volumeBar;
881 gdouble volumeLevel = 0.5;
883 volumeBar = HILDON_HVOLUMEBAR(hildon_hvolumebar_new());
884 hildon_volumebar_set_level(HILDON_VOLUMEBAR(volumeBar), volumeLevel);
885 assert(hildon_volumebar_get_level(HILDON_VOLUMEBAR(volumeBar)) == volumeLevel);
891 HildonHVolumebar *volumeBar;
892 gboolean mute = FALSE;
894 volumeBar = HILDON_HVOLUMEBAR(hildon_hvolumebar_new());
895 hildon_volumebar_set_mute(HILDON_VOLUMEBAR(volumeBar), mute);
896 assert(hildon_volumebar_get_mute(HILDON_VOLUMEBAR(volumeBar)) == mute);
902 HildonVVolumebar *volumeBar;
904 volumeBar = HILDON_VVOLUMEBAR(hildon_vvolumebar_new());
905 gtk_widget_destroy(GTK_WIDGET(volumeBar));
909 /* weekday_picker: new: ok */
915 picker = hildon_weekday_picker_new();
920 /* weekday_picker: set/unset/isset: ok */
924 HildonWeekdayPicker *picker;
927 picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
930 /* set all one by one */
931 for( i = 1; i < 8; ++i )
932 hildon_weekday_picker_set_day( picker, i );
934 /* check that the proper days are set */
935 for( j = 1; j < 8; ++j )
936 assert( hildon_weekday_picker_isset_day( picker, j ) );
938 /* unset all one by one */
939 for( i = 1; i < 8; ++i )
940 hildon_weekday_picker_unset_day( picker, i );
942 /* check that the proper days are unset */
943 for( j = 1; j < 8; ++j )
944 assert( !hildon_weekday_picker_isset_day( picker, j ) );
949 /* weekday_picker: set_day: null */
953 hildon_weekday_picker_set_day( NULL, 0 );
957 /* weekday_picker: unset_day: null */
961 hildon_weekday_picker_unset_day( NULL, 0 );
965 /* weekday_picker: isset_day: null */
969 hildon_weekday_picker_isset_day( NULL, 0 );
973 /* weekday_picker: toggle: ok */
977 HildonWeekdayPicker *picker;
979 picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
982 /* set all one by one */
983 for( i = 1; i < 8; i++ )
984 hildon_weekday_picker_toggle_day( picker, i );
986 /* check that the proper days are set */
987 for( j = 1; j < 8; j++ )
988 assert ( hildon_weekday_picker_isset_day( picker, j ) );
990 /* unset all one by one */
991 for( i = 1; i < 8; ++i )
992 hildon_weekday_picker_toggle_day( picker, i );
994 /* check that the proper days are unset */
995 for( j = 1; j < 8; ++j )
996 assert( !hildon_weekday_picker_isset_day( picker, j ) );
1001 /* weekday_picker: toggle_day: null */
1004 HildonWeekdayPicker *picker;
1005 picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
1006 hildon_weekday_picker_toggle_day( NULL, 0 );
1010 /* weekday_picker: set_all/unset_all*/
1013 HildonWeekdayPicker *picker;
1014 picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
1015 hildon_weekday_picker_set_all( picker );
1016 hildon_weekday_picker_unset_all( picker );
1020 /* telephone editor: new: ok */
1027 editor = hildon_telephone_editor_new( HILDON_TELEPHONE_EDITOR_FORMAT_FREE );
1030 editor = hildon_telephone_editor_new
1031 ( HILDON_TELEPHONE_EDITOR_FORMAT_COERCE );
1034 editor = hildon_telephone_editor_new
1035 ( HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY );
1038 editor = hildon_telephone_editor_new
1039 ( HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA );
1045 /* telephone editor: new: inv */
1052 editor = hildon_telephone_editor_new( 17 );
1058 /* telephone editor: set_editable: ok */
1062 HildonTelephoneEditorFormat fmt[4] = {
1063 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1064 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1065 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1066 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1071 for( i = 0; i < 4; ++i )
1073 editor = hildon_telephone_editor_new( fmt[i] );
1074 hildon_telephone_editor_set_editable( HILDON_TELEPHONE_EDITOR( editor ),
1076 hildon_telephone_editor_set_editable( HILDON_TELEPHONE_EDITOR( editor ),
1077 FALSE, FALSE, FALSE );
1078 gtk_widget_destroy( editor );
1084 /* telephone editor: set_editable: null */
1088 hildon_telephone_editor_set_editable( NULL, TRUE, TRUE, TRUE );
1092 /* telephone editor: set_show_plus: ok */
1096 HildonTelephoneEditorFormat fmt[4] = {
1097 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1098 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1099 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1100 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1105 for( i = 0; i < 4; ++i )
1107 editor = hildon_telephone_editor_new( fmt[i] );
1111 hildon_telephone_editor_set_show_plus( HILDON_TELEPHONE_EDITOR( editor ),
1114 /* only check if not in free mode (no plus there) */
1116 assert( hildon_telephone_editor_get_show_plus( HILDON_TELEPHONE_EDITOR( editor ) )
1118 hildon_telephone_editor_set_show_plus( HILDON_TELEPHONE_EDITOR( editor ),
1121 assert( hildon_telephone_editor_get_show_plus( HILDON_TELEPHONE_EDITOR( editor ) )
1123 gtk_widget_destroy( editor );
1129 /* telephone editor: set_show_plus: null */
1133 hildon_telephone_editor_set_show_plus( NULL, TRUE );
1138 /* telephone editor: get_show_plus: null */
1142 hildon_telephone_editor_get_show_plus( NULL );
1147 /* telephone editor: set_show_border: ok */
1151 HildonTelephoneEditorFormat fmt[4] = {
1152 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1153 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1154 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1155 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1160 for( i = 0; i < 4; ++i )
1162 editor = hildon_telephone_editor_new( fmt[i] );
1166 hildon_telephone_editor_set_show_border( HILDON_TELEPHONE_EDITOR( editor ),
1168 assert( hildon_telephone_editor_get_show_border
1169 ( HILDON_TELEPHONE_EDITOR( editor ) ) == TRUE );
1171 hildon_telephone_editor_set_show_border( HILDON_TELEPHONE_EDITOR( editor ),
1173 assert( hildon_telephone_editor_get_show_border( HILDON_TELEPHONE_EDITOR( editor ) )
1176 gtk_widget_destroy( editor );
1182 /* telephone editor: set_show_border: null */
1186 hildon_telephone_editor_set_show_border( NULL, TRUE );
1191 /* telephone editor: get_show_border: null */
1195 hildon_telephone_editor_get_show_border( NULL );
1200 /* telephone editor: set_widths: ok */
1204 HildonTelephoneEditorFormat fmt[4] = {
1205 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1206 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1207 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1208 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1213 for( i = 0; i < 4; ++i )
1215 editor = hildon_telephone_editor_new( fmt[i] );
1216 hildon_telephone_editor_set_widths( HILDON_TELEPHONE_EDITOR( editor ),
1218 hildon_telephone_editor_set_widths( HILDON_TELEPHONE_EDITOR( editor ),
1220 hildon_telephone_editor_set_widths( HILDON_TELEPHONE_EDITOR( editor ),
1222 gtk_widget_destroy( editor );
1228 /* telephone editor: set_widths: null */
1232 hildon_telephone_editor_set_widths( NULL, 1, 1, 1 );
1237 /* telephone editor: set/get_country: ok */
1242 gchar teststr[] = "123456";
1243 HildonTelephoneEditorFormat fmt[4] = {
1244 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1245 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1246 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1247 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1252 for( i = 0; i < 4; ++i )
1254 editor = hildon_telephone_editor_new( fmt[i] );
1255 hildon_telephone_editor_set_country( HILDON_TELEPHONE_EDITOR( editor ),
1257 c = hildon_telephone_editor_get_country
1258 ( HILDON_TELEPHONE_EDITOR( editor ) );
1260 /* format != FREE */
1264 g_assert( strcmp( teststr, c ) == 0 );
1267 gtk_widget_destroy( editor );
1273 /* telephone editor: set/get_country: inv */
1278 gchar teststr[] = "123456p";
1282 editor = hildon_telephone_editor_new(
1283 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY );
1284 hildon_telephone_editor_set_country( HILDON_TELEPHONE_EDITOR( editor ),
1286 c = hildon_telephone_editor_get_country
1287 ( HILDON_TELEPHONE_EDITOR( editor ) );
1290 g_assert( strcmp( teststr, c ) != 0 );
1292 gtk_widget_destroy( editor );
1297 /* telephone editor: set_country: null */
1301 hildon_telephone_editor_set_country( NULL, "123" );
1306 /* telephone editor: get_country: null */
1310 hildon_telephone_editor_get_country( NULL );
1315 /* telephone editor: set/get_area: ok */
1320 gchar teststr[] = "123456";
1321 HildonTelephoneEditorFormat fmt[4] = {
1322 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1323 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1324 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1325 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1330 for( i = 0; i < 4; ++i )
1332 editor = hildon_telephone_editor_new( fmt[i] );
1333 hildon_telephone_editor_set_area( HILDON_TELEPHONE_EDITOR( editor ),
1335 c = hildon_telephone_editor_get_area
1336 ( HILDON_TELEPHONE_EDITOR( editor ) );
1338 /* format != FREE nor COUNTRY */
1343 g_assert( strncmp( teststr, c, strlen( c ) ) == 0 );
1346 gtk_widget_destroy( editor );
1352 /* telephone editor: set/get_area: inv */
1357 gchar teststr[] = "123456p";
1361 editor = hildon_telephone_editor_new(
1362 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA );
1363 hildon_telephone_editor_set_area( HILDON_TELEPHONE_EDITOR( editor ),
1365 c = hildon_telephone_editor_get_area
1366 ( HILDON_TELEPHONE_EDITOR( editor ) );
1369 g_assert( strcmp( teststr, c ) != 0 );
1371 gtk_widget_destroy( editor );
1376 /* telephone editor: set_area: null */
1380 hildon_telephone_editor_set_area( NULL, "123" );
1385 /* telephone editor: get_area: null */
1389 hildon_telephone_editor_get_area( NULL );
1394 /* telephone editor: set/get_number: ok */
1399 gchar teststr[] = "123456";
1400 HildonTelephoneEditorFormat fmt[4] = {
1401 HILDON_TELEPHONE_EDITOR_FORMAT_FREE,
1402 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE,
1403 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY,
1404 HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA };
1409 for( i = 0; i < 4; ++i )
1411 editor = hildon_telephone_editor_new( fmt[i] );
1412 hildon_telephone_editor_set_number( HILDON_TELEPHONE_EDITOR( editor ),
1414 c = hildon_telephone_editor_get_number
1415 ( HILDON_TELEPHONE_EDITOR( editor ) );
1417 /* free != COUNTRY nor AREA */
1418 if( i != 2 && i != 3 )
1421 g_assert( strcmp( teststr, c ) == 0 );
1424 gtk_widget_destroy( editor );
1430 /* telephone editor: set/get_number: ok in FREE format */
1435 gchar teststr[] = "()+?*pw1234567890";
1437 editor = hildon_telephone_editor_new(
1438 HILDON_TELEPHONE_EDITOR_FORMAT_FREE );
1439 hildon_telephone_editor_set_number( HILDON_TELEPHONE_EDITOR( editor ),
1441 c = hildon_telephone_editor_get_number
1442 ( HILDON_TELEPHONE_EDITOR( editor ) );
1445 g_assert( strncmp( teststr, c, strlen(c) ) == 0 );
1447 gtk_widget_destroy( editor );
1452 /* telephone editor: set/get_number: inv */
1457 gchar teststr[] = "123456f";
1461 editor = hildon_telephone_editor_new(
1462 HILDON_TELEPHONE_EDITOR_FORMAT_FREE );
1463 hildon_telephone_editor_set_number( HILDON_TELEPHONE_EDITOR( editor ),
1465 c = hildon_telephone_editor_get_number
1466 ( HILDON_TELEPHONE_EDITOR( editor ) );
1469 g_assert( strcmp( teststr, c ) != 0 );
1471 gtk_widget_destroy( editor );
1476 /* telephone editor: set_number: null */
1479 hildon_telephone_editor_set_number( NULL, "123" );
1484 /* telephone editor: get_number: null */
1487 hildon_telephone_editor_get_number( NULL );
1492 /* find object options dialog: new */
1493 /*int test21a(void){
1495 dialog = hildon_find_object_options_dialog_new(NULL);
1500 /* find object options dialog: hide_location */
1501 /*int test21b(void){
1503 dialog = hildon_find_object_options_dialog_new(NULL);
1504 hildon_find_object_options_dialog_hide_location(
1505 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1506 gtk_widget_destroy(dialog);
1511 /* find object options dialog: hide_find_in */
1512 /*int test21c(void){
1514 dialog = hildon_find_object_options_dialog_new(NULL);
1515 hildon_find_object_options_dialog_hide_find_in(
1516 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1521 /* find object options dialog: get_location */
1522 /*int test21d(void){
1523 const gchar *retString;
1525 dialog = hildon_find_object_options_dialog_new(NULL);
1526 retString = hildon_find_object_options_dialog_get_location(
1527 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1529 g_assert(retString);
1534 /* find object options dialog: get_find_type */
1535 /*int test21e(void){
1536 HildonFindInType find_type;
1538 dialog = hildon_find_object_options_dialog_new(NULL);
1540 find_type = hildon_find_object_options_dialog_get_find_type(
1541 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1546 /* find object options dialog: get_time_period_type */
1547 /*int test21f(void){
1548 HildonTimePeriodType type;
1550 dialog = hildon_find_object_options_dialog_new(NULL);
1551 type = hildon_find_object_options_dialog_get_time_period_type(
1552 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1556 /* find object options dialog: get_start_date */
1557 /*int test21g(void){
1559 gint year, month, day;
1561 dialog = hildon_find_object_options_dialog_new(NULL);
1563 hildon_find_object_options_dialog_get_start_date(HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog),
1564 &year, &month, &day);
1573 /* find object options dialog: get_end_date */
1574 /*int test21h(void){
1576 gint year, month, day;
1578 dialog = hildon_find_object_options_dialog_new(NULL);
1580 hildon_find_object_options_dialog_get_end_date(HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog),
1581 &year, &month, &day);
1590 /* find object options dialog: add_custom_options */
1591 /*int test21i(void){
1593 GtkWidget *widget = gtk_entry_new();
1595 dialog = hildon_find_object_options_dialog_new(NULL);
1597 hildon_find_object_options_dialog_add_custom_option(
1598 HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog), "New widget", widget);
1603 /* find object options dialog: date_matches */
1604 /*int test21j(void){
1606 dialog = hildon_find_object_options_dialog_new(NULL);
1608 g_assert(hildon_find_object_dialog_date_matches(HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog),
1614 /* range editor: new range editor: ok parameters */
1617 HildonRangeEditor *range_editor;
1619 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1620 assert(range_editor);
1624 /* range editor: new range editor with separator: ok parameters */
1627 HildonRangeEditor *range_editor;
1629 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new_with_separator(
1631 assert(range_editor);
1635 /* range editor: new range editor with separator: NULL parameters */
1638 HildonRangeEditor *range_editor;
1640 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new_with_separator(NULL));
1641 assert(range_editor);
1645 /* range editor: get range: ok parameters */
1648 HildonRangeEditor *range_editor;
1651 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1652 hildon_range_editor_get_range (range_editor, &start, &end);
1654 assert (start == -999);
1655 assert (end == 999);
1660 /* range editor: get range: null range editor */
1663 HildonRangeEditor *range_editor = NULL;
1666 hildon_range_editor_get_range (range_editor, &start, &end);
1671 /* range editor: get range: null end */
1674 HildonRangeEditor *range_editor = NULL;
1677 hildon_range_editor_get_range (range_editor, &start, NULL);
1682 /* range editor: get range: null start */
1685 HildonRangeEditor *range_editor = NULL;
1688 hildon_range_editor_get_range (range_editor, NULL, &end);
1693 /* range editor: get range: null start, end */
1696 HildonRangeEditor *range_editor = NULL;
1698 hildon_range_editor_get_range (range_editor, NULL, NULL);
1703 /* range editor: set range: ok parameters */
1706 HildonRangeEditor *range_editor;
1707 gint start = 5, end = 6;
1709 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1711 hildon_range_editor_set_range (range_editor, start, end);
1712 hildon_range_editor_get_range (range_editor, &start, &end);
1714 assert (start == 5);
1720 /* range editor: set range: null range editor*/
1723 HildonRangeEditor *range_editor = NULL;
1724 gint start = 5, end = 6;
1726 hildon_range_editor_set_range (range_editor, start, end);
1731 /* range editor: set limits: ok parameters */
1734 HildonRangeEditor *range_editor;
1735 gint start = 0, end = 0;
1737 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1739 hildon_range_editor_set_limits (range_editor, start, end);
1740 hildon_range_editor_get_range (range_editor, &start, &end);
1742 assert (start == 0);
1748 /* range editor: set limits: set range over start minimum and end maximum */
1751 HildonRangeEditor *range_editor;
1752 gint start = -1, end = 1;
1754 range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1756 hildon_range_editor_set_limits (range_editor, 0, 0);
1757 hildon_range_editor_set_range (range_editor, start, end);
1758 hildon_range_editor_get_range (range_editor, &start, &end);
1760 assert (start == 0);
1766 /* range editor: set limits: NULL editor */
1769 HildonRangeEditor *range_editor = NULL;
1770 gint start = 0, end = 0;
1772 hildon_range_editor_set_limits (range_editor, start, end);
1782 HildonSortDialog *sort_dialog;
1784 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1785 assert(sort_dialog);
1789 /* sort dialog: Get sort key. '0' is the default index value */
1793 HildonSortDialog *sort_dialog;
1794 gint default_key = 0;
1796 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1797 assert(hildon_sort_dialog_get_sort_key( sort_dialog ) == default_key );
1801 /* sort dialog: Set sort key */
1805 HildonSortDialog *sort_dialog;
1808 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1809 hildon_sort_dialog_set_sort_key( sort_dialog, key );
1810 assert(hildon_sort_dialog_get_sort_key( sort_dialog ) == 1 );
1814 /* sort dialog: add sort key */
1818 HildonSortDialog *sort_dialog;
1820 gint added_key_index = 0;
1822 sort_dialog = HILDON_SORT_DIALOG (hildon_sort_dialog_new(NULL));
1823 hildon_sort_dialog_add_sort_key (sort_dialog, "Random");
1824 added_key_index = hildon_sort_dialog_add_sort_key (sort_dialog,
1827 hildon_sort_dialog_set_sort_key( sort_dialog, added_key_index );
1828 assert(hildon_sort_dialog_get_sort_key( sort_dialog ) == key );
1832 /* sort dialog: get sort order. '0' is the default index value */
1836 HildonSortDialog *sort_dialog;
1837 GtkSortType type = 0;
1839 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1840 assert(hildon_sort_dialog_get_sort_order( sort_dialog ) == type);
1844 /* sort dialog: set sort order */
1848 HildonSortDialog *sort_dialog;
1849 GtkSortType type = 1;
1851 sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1852 hildon_sort_dialog_set_sort_order( sort_dialog , type);
1853 assert(hildon_sort_dialog_get_sort_order( sort_dialog ) == 1);
1857 /* sort dialog: gtk_widget_destroy */
1860 GtkWidget *sort_dialog;
1862 sort_dialog = hildon_sort_dialog_new(FALSE);
1863 gtk_widget_destroy(GTK_WIDGET(sort_dialog));
1868 /* Get password dialog */
1872 HildonGetPasswordDialog *get_dialog;
1874 get_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1880 /* Get Old password dialog */
1884 HildonGetPasswordDialog *get_old_dialog;
1886 get_old_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1888 assert(get_old_dialog);
1892 /* Get / Get Old password dialog: get password */
1895 HildonGetPasswordDialog *get_dialog;
1896 HildonGetPasswordDialog *get_old_dialog;
1897 const gchar *get_string;
1898 const gchar *get_old_string;
1900 get_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1902 get_string = hildon_get_password_dialog_get_password( get_dialog);
1905 get_old_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1907 get_old_string = hildon_get_password_dialog_get_password( get_old_dialog);
1908 assert(get_old_string);
1912 /* get / get old password dialog: gtk_widget_destroy */
1915 GtkWidget *get_dialog;
1916 GtkWidget *get_old_dialog;
1918 get_dialog = hildon_get_password_dialog_new(NULL, FALSE);
1919 gtk_widget_destroy(GTK_WIDGET(get_dialog));
1921 get_old_dialog = hildon_get_password_dialog_new(NULL, TRUE);
1922 gtk_widget_destroy(GTK_WIDGET(get_old_dialog));
1927 /* set password dialog */
1931 HildonSetPasswordDialog *set_dialog;
1933 set_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(NULL,
1939 /* change password dialog */
1943 HildonSetPasswordDialog *change_dialog;
1945 change_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1947 assert(change_dialog);
1951 /* set / change password dialog: get password */
1954 HildonSetPasswordDialog *set_dialog;
1955 HildonSetPasswordDialog *change_dialog;
1956 const gchar *set_string;
1957 const gchar *change_string;
1959 set_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1961 set_string = hildon_set_password_dialog_get_password( set_dialog);
1964 change_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1966 change_string = hildon_set_password_dialog_get_password( change_dialog);
1967 assert(change_string);
1971 /* set / change password dialog: get protected */
1974 HildonSetPasswordDialog *set_dialog;
1975 HildonSetPasswordDialog *change_dialog;
1979 set_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1981 set = hildon_set_password_dialog_get_protected(set_dialog);
1984 change_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1986 change = hildon_set_password_dialog_get_protected(change_dialog);
1990 /* set / change password dialog: gtk_widget_destroy */
1993 GtkWidget *set_dialog;
1994 GtkWidget *change_dialog;
1996 set_dialog = hildon_set_password_dialog_new(NULL, FALSE);
1997 gtk_widget_destroy(GTK_WIDGET(set_dialog));
1999 change_dialog = hildon_set_password_dialog_new(NULL, TRUE);
2000 gtk_widget_destroy(GTK_WIDGET(change_dialog));
2005 #ifndef HILDON_DISABLE_DEPRECATED
2006 int fsd_get_font(void)
2009 PangoAttrList *list = NULL;
2010 fsd = hildon_font_selection_dialog_new( NULL, "fsd" );
2011 list = hildon_font_selection_dialog_get_font(HILDON_FONT_SELECTION_DIALOG(fsd));
2012 assert( list!=NULL );
2016 int fsd_set_font(void)
2019 PangoAttrList *list = NULL;
2020 fsd = hildon_font_selection_dialog_new( NULL, "fsd" );
2021 list = hildon_font_selection_dialog_get_font(HILDON_FONT_SELECTION_DIALOG(fsd));
2022 hildon_font_selection_dialog_set_font(HILDON_FONT_SELECTION_DIALOG(fsd), list);
2026 int fsd_set_pretext(void)
2029 char *str = "Mopo karkas käsistä";
2030 fsd = hildon_font_selection_dialog_new( NULL, "fsd" );
2031 hildon_font_selection_dialog_set_preview_text(HILDON_FONT_SELECTION_DIALOG(fsd),str);
2035 int fsd_get_pretext(void)
2039 fsd = hildon_font_selection_dialog_new( NULL, "fsd" );
2040 str = (char*)hildon_font_selection_dialog_get_preview_text(
2041 HILDON_FONT_SELECTION_DIALOG(fsd));
2043 assert( str!=NULL );
2046 /* insert object dialog: new */
2049 dialog = hildon_insert_object_dialog_new(NULL);
2054 /* insert object dialog: get_name */
2056 const gchar *string;
2059 dialog = hildon_insert_object_dialog_new(NULL);
2060 string = hildon_insert_object_dialog_get_name(HILDON_INSERT_OBJECT_DIALOG(dialog));
2065 /* insert object dialog: get_mime_type */
2067 const gchar *string;
2070 dialog = hildon_insert_object_dialog_new(NULL);
2071 string = hildon_insert_object_dialog_get_mime_type(HILDON_INSERT_OBJECT_DIALOG(dialog));
2076 /* hildon_number_editor_new */
2082 editor = hildon_number_editor_new (min, max);
2088 /* hildon_number_editor_get_value */
2095 editor = hildon_number_editor_new (min, max);
2096 value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2097 g_assert (value == max);
2102 /* hildon_number_editor_set_range */
2109 editor = hildon_number_editor_new (min, max);
2110 hildon_number_editor_set_range (HILDON_NUMBER_EDITOR (editor), 30, 80);
2111 value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2112 g_assert (value == 80);
2117 /* hildon_number_editor_set_value */
2124 editor = hildon_number_editor_new (min, max);
2125 hildon_number_editor_set_value (HILDON_NUMBER_EDITOR (editor), 3450);
2126 value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2127 g_assert (value == 3450);
2132 /* Hildon-Color-Selector:
2133 hildon_color_selector_new()
2137 GtkWidget *colselector;
2138 GdkColor redcolor = {0, 65535, 0, 0 };
2141 colselector = hildon_color_selector_new( NULL );
2143 hildon_color_selector_set_color( HILDON_COLOR_SELECTOR(colselector), &(redcolor) );
2144 color = hildon_color_selector_get_color( HILDON_COLOR_SELECTOR(colselector) );
2146 g_assert( colselector );
2147 g_assert( redcolor.pixel == color->pixel );
2148 g_assert( redcolor.red == color->red );
2149 g_assert( redcolor.green == color->green );
2150 g_assert( redcolor.blue == color->blue );
2153 gtk_widget_destroy ( colselector );
2157 /* Hildon-Color-Selector:
2158 HildonColorSelector with non-base color
2162 HildonColorSelector *colorsel;
2163 GtkWidget *obj_self;
2164 GdkColor mixedcolor = { 0, 7281, 21845, 65535 };
2167 obj_self = hildon_color_selector_new( NULL );
2168 colorsel = HILDON_COLOR_SELECTOR ( obj_self );
2170 hildon_color_selector_set_color( colorsel, &mixedcolor );
2171 color = hildon_color_selector_get_color( colorsel );
2173 g_assert( colorsel );
2174 g_assert( color->pixel == 0 );
2175 g_assert( color->red == 7281 );
2176 g_assert( color->green == 21845 );
2177 g_assert( color->blue == 65535 );
2180 g_object_unref ( obj_self );
2181 gtk_widget_destroy( GTK_WIDGET(colorsel) );
2186 /* hildon_file_handling_note_new_moving */
2189 GtkWidget *file_note;
2191 file_note = hildon_file_handling_note_new_moving (NULL);
2192 hildon_file_handling_note_set_fraction (HILDON_FILE_HANDLING_NOTE(file_note), 0.7);
2194 g_assert (file_note);
2199 /* hildon_file_handling_note_new_deleting */
2202 GtkWidget *file_note;
2204 file_note = hildon_file_handling_note_new_deleting (NULL);
2205 hildon_file_handling_note_set_counter_and_name (HILDON_FILE_HANDLING_NOTE (file_note),
2207 hildon_file_handling_note_set_counter_and_name (HILDON_FILE_HANDLING_NOTE (file_note),
2209 g_assert (file_note);
2214 /* hildon_file_handling_note_new_opening */
2217 GtkWidget *file_note;
2219 file_note = hildon_file_handling_note_new_opening (NULL);
2220 hildon_file_handling_note_set_name (HILDON_FILE_HANDLING_NOTE (file_note),
2222 g_assert (file_note);
2227 /* hildon_file_handling_note_new_saving */
2230 GtkWidget *file_note;
2232 file_note = hildon_file_handling_note_new_saving (NULL);
2233 hildon_file_handling_note_set_fraction (HILDON_FILE_HANDLING_NOTE (file_note), 0.7);
2234 g_assert (file_note);
2239 /* Add to Home dialog new: ok parameters */
2243 d = hildon_add_home_dialog_new( NULL, "name" , NULL);
2249 /* Add to Home dialog new: NULL parameter (is ok) */
2253 d = hildon_add_home_dialog_new( NULL, NULL, NULL );
2259 /* Rename dialog new: ok parameters */
2263 d = hildon_add_home_dialog_new( NULL, "name", "newname" );
2269 /* Rename dialog new: NULL parameter (is ok) */
2273 d = hildon_add_home_dialog_new( NULL, NULL, "newname" );
2279 /* Create item with icon basename. */
2282 /* If test fails, first see if icon exists. */
2284 item = hildon_grid_item_new (VALID_ICON);
2289 /* Create item without icon basename. */
2293 item = hildon_grid_item_new (NULL);
2298 /* Create item with icon basename and label. */
2301 /* If test fails, first see if icon exists. */
2303 item = hildon_grid_item_new_with_label (VALID_ICON, "foo");
2308 /* Create item with icon basename but with no label. */
2311 /* If test fails, first see if icon exists. */
2313 item = hildon_grid_item_new_with_label (VALID_ICON, NULL);
2320 item = hildon_grid_item_new_with_label (NULL, "foo");
2325 /* Create item without icon basename and without label. */
2329 item = hildon_grid_item_new_with_label (NULL, NULL);
2334 /* Set emblem type. Non-NULL item, non-NULL emblem. */
2337 /* If test fails, first see if icon exists. */
2339 item = hildon_grid_item_new (VALID_ICON);
2340 hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), VALID_ICON);
2344 /* Set emblem type. Non-NULL item, NULL emblem. */
2347 /* If test fails, first see if icon exists. */
2349 item = hildon_grid_item_new (VALID_ICON);
2350 hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), NULL);
2354 /* Set emblem type. NULL item, non-NULL emblem. */
2357 hildon_grid_item_set_emblem_type (NULL, VALID_ICON);
2361 /* Set emblem type. NULL item, NULL emblem. */
2364 hildon_grid_item_set_emblem_type (NULL, NULL);
2368 /* Get emblem type from existing item - has emblem. */
2371 /* If test fails, first see if icon exists. */
2374 item = hildon_grid_item_new (VALID_ICON);
2375 hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), VALID_ICON);
2376 type = hildon_grid_item_get_emblem_type (HILDON_GRID_ITEM (item));
2381 /* Get emblem type from existing item - has no emblem. */
2384 /* If test fails, first see if icon exists. */
2387 item = hildon_grid_item_new (VALID_ICON);
2388 type = hildon_grid_item_get_emblem_type (HILDON_GRID_ITEM (item));
2389 g_assert (type != NULL);
2393 /* Get emblem type from non-existing item. */
2397 type = hildon_grid_item_get_emblem_type (NULL);
2398 g_assert (type != NULL);
2402 /* Destroy griditem. */
2406 item = hildon_grid_item_new (VALID_ICON);
2407 gtk_widget_destroy (item);
2411 /* Create new grid. */
2415 grid = hildon_grid_new ();
2420 /* Set grid style. */
2424 grid = hildon_grid_new ();
2425 hildon_grid_set_style (HILDON_GRID (grid), "bar");
2429 /* Set grid style (no style). */
2433 grid = hildon_grid_new ();
2434 hildon_grid_set_style (HILDON_GRID (grid), NULL);
2438 /* Set grid style. Invalid grid. */
2441 hildon_grid_set_style (NULL, "bar");
2445 /* Set grid style. Invalid grid, no style. */
2448 hildon_grid_set_style (NULL, NULL);
2452 /* Get grid style. Valid grid, has style. */
2457 grid = hildon_grid_new ();
2458 hildon_grid_set_style (HILDON_GRID (grid), "foo");
2459 style = hildon_grid_get_style (HILDON_GRID (grid));
2464 /* Get grid style. Valid grid, has no style. */
2469 grid = hildon_grid_new ();
2470 hildon_grid_set_style (HILDON_GRID (grid), NULL);
2471 style = hildon_grid_get_style (HILDON_GRID (grid));
2472 g_assert (style != NULL && strcmp (style, "HildonGrid") == 0);
2476 /* Get grid style. Invalid grid. */
2480 style = hildon_grid_get_style (NULL);
2485 /* Set grid scrollbar position. Valid grid. */
2489 grid = hildon_grid_new ();
2490 hildon_grid_set_scrollbar_pos (HILDON_GRID (grid), 0);
2494 /* Set grid scrollbar position. Invalid grid. */
2497 hildon_grid_set_scrollbar_pos (NULL, 0);
2501 /* Get grid scrollbar position. Valid grid. */
2506 grid = hildon_grid_new ();
2507 pos = hildon_grid_get_scrollbar_pos (HILDON_GRID (grid));
2511 /* Get grid scrollbar position. Inalid grid. */
2515 pos = hildon_grid_get_scrollbar_pos (NULL);
2519 /* Add item to existing grid. */
2524 grid = hildon_grid_new ();
2525 item = hildon_grid_item_new (VALID_ICON);
2526 gtk_container_add (GTK_CONTAINER (grid), item);
2530 /* Add NULL to existing grid. */
2535 grid = hildon_grid_new ();
2536 item = hildon_grid_item_new (VALID_ICON);
2537 gtk_container_add (GTK_CONTAINER (grid), NULL);
2541 /* Add something to existing grid. */
2546 grid = hildon_grid_new ();
2547 item = gtk_button_new ();
2548 gtk_container_add (GTK_CONTAINER (grid), item);
2552 /* Add something to non-existing grid. */
2556 item = gtk_button_new ();
2557 gtk_container_add (NULL, item);
2561 /* Add something to invalid grid. */
2565 item = gtk_button_new ();
2566 gtk_container_add (GTK_CONTAINER (item), item);
2570 /* Remove item from grid. */
2575 grid = hildon_grid_new ();
2576 item = hildon_grid_item_new (VALID_ICON);
2577 gtk_container_add (GTK_CONTAINER (grid), item);
2578 gtk_container_remove (GTK_CONTAINER (grid), item);
2582 /* Remove non-existing item from grid. */
2587 grid = hildon_grid_new ();
2588 item = hildon_grid_item_new (VALID_ICON);
2589 gtk_container_add (GTK_CONTAINER (grid), item);
2590 item = hildon_grid_item_new (VALID_ICON);
2591 gtk_container_remove (GTK_CONTAINER (grid), item);
2595 /* Remove NULL from grid. */
2600 grid = hildon_grid_new ();
2601 item = hildon_grid_item_new (VALID_ICON);
2602 gtk_container_add (GTK_CONTAINER (grid), item);
2603 gtk_container_remove (GTK_CONTAINER (grid), NULL);
2607 /* Remove something from grid. */
2612 grid = hildon_grid_new ();
2613 item = hildon_grid_item_new (VALID_ICON);
2614 gtk_container_add (GTK_CONTAINER (grid), item);
2615 item = gtk_button_new ();
2616 gtk_container_remove (GTK_CONTAINER (grid), item);
2620 /* Remove something from NULL grid. */
2624 item = gtk_button_new ();
2625 gtk_container_remove (NULL, item);
2629 /* Remove something from invalid grid. */
2632 GtkWidget *item0, *item1;
2633 item0 = gtk_button_new ();
2634 item1 = gtk_button_new ();
2635 gtk_container_remove (GTK_CONTAINER (item0), item1);
2644 grid = hildon_grid_new ();
2645 item = hildon_grid_item_new (VALID_ICON);
2646 gtk_container_add (GTK_CONTAINER (grid), item);
2647 item = hildon_grid_item_new (VALID_ICON);
2648 gtk_container_add (GTK_CONTAINER (grid), item);
2649 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2653 /* Set focus to non-existing. */
2658 grid = hildon_grid_new ();
2659 item = hildon_grid_item_new (VALID_ICON);
2660 gtk_container_add (GTK_CONTAINER (grid), item);
2661 item = hildon_grid_item_new (VALID_ICON);
2662 gtk_container_add (GTK_CONTAINER (grid), item);
2663 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2664 item = hildon_grid_item_new (VALID_ICON);
2665 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2669 /* Set focus to NULL. */
2674 grid = hildon_grid_new ();
2675 item = hildon_grid_item_new (VALID_ICON);
2676 gtk_container_add (GTK_CONTAINER (grid), item);
2677 item = hildon_grid_item_new (VALID_ICON);
2678 gtk_container_add (GTK_CONTAINER (grid), item);
2679 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2683 /* Set focus to something. */
2688 grid = hildon_grid_new ();
2689 item = hildon_grid_item_new (VALID_ICON);
2690 gtk_container_add (GTK_CONTAINER (grid), item);
2691 item = hildon_grid_item_new (VALID_ICON);
2692 gtk_container_add (GTK_CONTAINER (grid), item);
2693 item = gtk_button_new ();
2694 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2703 grid = hildon_grid_new ();
2704 item = hildon_grid_item_new (VALID_ICON);
2705 gtk_container_add (GTK_CONTAINER (grid), item);
2706 item = hildon_grid_item_new (VALID_ICON);
2707 gtk_container_add (GTK_CONTAINER (grid), item);
2708 gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2709 g_assert (GTK_CONTAINER (grid)->focus_child == item);
2713 /* Get focus (no focused). */
2717 grid = hildon_grid_new ();
2718 g_assert (GTK_CONTAINER (grid)->focus_child == NULL);
2722 /* Destroy grid. Has items. */
2726 grid = hildon_grid_new ();
2727 gtk_widget_destroy (grid);
2731 /* Destroy grid. No items. */
2736 grid = hildon_grid_new ();
2737 item = hildon_grid_item_new (VALID_ICON);
2738 gtk_container_add (GTK_CONTAINER (grid), item);
2739 gtk_widget_destroy (grid);
2743 /* HildonTimeEditor: create editor widget */
2746 editor = hildon_time_editor_new ();
2751 /* HildonTimeEditor: set time and check if returned
2752 * time value is same
2756 guint hour, min, sec;
2757 editor = hildon_time_editor_new ();
2758 hildon_time_editor_set_time (HILDON_TIME_EDITOR (editor),
2760 hildon_time_editor_get_time (HILDON_TIME_EDITOR (editor),
2762 g_assert (hour == 21);
2763 g_assert (min == 39);
2764 g_assert (sec ==45);
2768 /* HildonTimeEditor: enable/disable seconds */
2771 editor = hildon_time_editor_new ();
2772 #ifndef HILDON_DISABLE_DEPRECATED
2773 hildon_time_editor_show_seconds (HILDON_TIME_EDITOR (editor), 1);
2774 hildon_time_editor_show_seconds (HILDON_TIME_EDITOR (editor), 0);
2776 hildon_time_editor_set_show_seconds (HILDON_TIME_EDITOR (editor), 1);
2777 hildon_time_editor_set_show_seconds (HILDON_TIME_EDITOR (editor), 0);
2782 /* HildonTimeEditor: enable duration mode */
2785 editor = hildon_time_editor_new ();
2786 #ifndef HILDON_DISABLE_DEPRECATED
2787 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2790 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2796 /* HildonTimeEditor: set duration range and check values
2797 * against returned values
2801 guint min_seconds, max_seconds;
2802 editor = hildon_time_editor_new ();
2803 #ifndef HILDON_DISABLE_DEPRECATED
2804 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2807 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2810 hildon_time_editor_set_duration_range (HILDON_TIME_EDITOR (editor),
2812 hildon_time_editor_get_duration_range (HILDON_TIME_EDITOR (editor),
2813 &min_seconds, &max_seconds);
2814 g_assert (min_seconds == 3600);
2815 g_assert (max_seconds == 14500);
2819 /* HildonTimeEditor: enable and disable duration modes */
2822 editor = hildon_time_editor_new ();
2823 #ifndef HILDON_DISABLE_DEPRECATED
2824 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2826 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2829 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2831 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2837 /* HildonTimeEditor: set time and check against
2842 guint hour, min, sec;
2843 editor = hildon_time_editor_new ();
2844 hildon_time_editor_set_time (HILDON_TIME_EDITOR (editor),
2846 hildon_time_editor_get_time (HILDON_TIME_EDITOR (editor),
2848 g_assert (hour == 13);
2849 g_assert (min == 33);
2850 g_assert (sec ==42);
2854 /* HildonTimeEditor: set duration range and check values
2855 * against foo values
2859 guint min_seconds, max_seconds;
2860 editor = hildon_time_editor_new ();
2861 #ifndef HILDON_DISABLE_DEPRECATED
2862 hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2865 hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2868 hildon_time_editor_set_duration_range (HILDON_TIME_EDITOR (editor),
2870 hildon_time_editor_get_duration_range (HILDON_TIME_EDITOR (editor),
2871 &min_seconds, &max_seconds);
2872 g_assert (min_seconds == 4600);
2873 g_assert (max_seconds == 15500);
2880 gtk_infoprint_temporarily_disable_wrap ();
2881 gtk_infoprint (NULL, "A suitably long text for testing the wrapping of gtkinfoprint.");
2887 gtk_banner_temporarily_disable_wrap ();
2888 gtk_banner_show_animation (NULL, "A suitably long text for testing the wrapping of gtkinfoprint.");
2897 dialog = hildon_name_password_dialog_new(NULL);
2898 name = (gchar *)hildon_name_password_dialog_get_name(HILDON_NAME_PASSWORD_DIALOG(dialog));
2909 dialog = hildon_name_password_dialog_new(NULL);
2910 password = (gchar *)hildon_name_password_dialog_get_password(HILDON_NAME_PASSWORD_DIALOG(dialog));
2918 {*test1a, "hildon_controlbar_new", EXPECT_OK},
2919 {*test1b, "hildon_controlbar_get/set_max", EXPECT_OK},
2920 {*test1c, "hildon_controlbar_get/set_value", EXPECT_OK},
2921 {*test1d, "gtk_widget_destroy", EXPECT_OK},
2922 {*test1e, "hildon_controlbar_get/set_min", EXPECT_OK},
2923 {*test1f, "hildon_controlbar_set_range", EXPECT_OK},
2924 {*test1g, "hildon_controlbar_set/get_range", EXPECT_OK},
2925 {*test1h, "hildon_controlbar_range/set/get_value (min)", EXPECT_OK},
2926 {*test1i, "hildon_controlbar_range/set/get_value (max)", EXPECT_OK},
2927 {*test2a, "hildon_seekbar_new", EXPECT_OK},
2928 {*test2b, "hildon_seekbar_get/set_total_time", EXPECT_OK},
2929 {*test2c, "hildon_seekbar_get/set_position", EXPECT_OK},
2930 {*test2d, "gtk_widget_destroy", EXPECT_OK},
2931 {*test2e, "hildon_seekbat_get/set_fraction", EXPECT_OK},
2932 {*test3a, "gtk_infoprint system (something)", EXPECT_OK},
2933 {*test3b, "gtk_infoprint system (NULL)", EXPECT_OK},
2934 {*test3c, "gtk_infoprint_with_icon_stock (VALID ICON)", EXPECT_OK},
2935 {*test3d, "gtk_infoprint_with_icon_stock (EMPTY STRING)", EXPECT_OK},
2936 {*test3e, "gtk_infoprint_with_icon_stock (NULL STRING)", EXPECT_OK},
2937 {*test3f, "gtk_infoprintf (something)", EXPECT_OK},
2938 {*test3g, "gtk_infoprintf (NULL)", EXPECT_OK},
2939 {*test3h, "gtk_confirmation_banner (Somestring, NULL STRING)", EXPECT_OK},
2940 {*test3i, "gtk_confirmation_banner (Somestring, NULL)", EXPECT_OK},
2941 {*test3j, "gtk_banner_show_animation", EXPECT_OK},
2942 {*test3k, "gtk_banner_show_animation with set_fraction", EXPECT_OK},
2943 /*{*test3l, "gtk_banner_show_animation with two banner_closes", EXPECT_ASSERT},*/
2944 {*test3m, "gtk_banner_show_animation with destroy window", EXPECT_OK},
2945 {*test3n, "gtk_banner_show_bar", EXPECT_OK},
2946 {*test3o, "gtk_banner_show_bar with destroy window", EXPECT_OK},
2947 {*test3p, "gtk_banner_show_bar & close with null parent", EXPECT_OK},
2948 {*test3q, "gtk_banner_set_text with null parent", EXPECT_OK},
2949 {*test3r, "gtk_banner_set_fraction with null parent", EXPECT_OK},
2950 {*test3s, "gtk_banner_close with null parent", EXPECT_OK},
2951 {*test3t, "gtk_banner_set_fraction with invalid fraction", EXPECT_ASSERT},
2952 {*test3u, "gtk_banner_set_fraction with invalid fraction", EXPECT_ASSERT},
2953 {*test3v, "gtk_banner_show_animation & close with null parent", EXPECT_OK},
2954 {*test4a, "hildon_note_new_confirmation", EXPECT_OK},
2955 {*test4b, "hildon_note_new_confirmation_with_icon_stock", EXPECT_OK},
2956 {*test4c, "hildon_new_confirmation_add_buttons", EXPECT_OK},
2957 {*test4d, ".._new_confirmation: set_button_text", EXPECT_OK},
2958 {*test4e, "hildon_note_new_information", EXPECT_OK},
2959 {*test4f, "hildon_note_new_information_with_icon_stock", EXPECT_OK},
2960 {*test4g, ".._new_information: set_button_text", EXPECT_OK},
2961 /* {*test4h, "hildon_note_new_cancel", EXPECT_OK},*/
2962 /* {*test4i, ".._new_cancel: set_button_text", EXPECT_OK},*/
2963 {*test4j, "hildon_note_new_cancel_with_progress_bar", EXPECT_OK},
2964 {*test4k, ".._cancel_with_progress_bar: set_button_text", EXPECT_OK},
2965 {*test4l, "destroy note widgets", EXPECT_OK},
2967 {*test6a, "hildon_volumebar_new (horizontal)", EXPECT_OK},
2968 {*test6b, "hildon_volumebar_new (vertical)", EXPECT_OK},
2969 {*test6c, "hildon_volumebar_get/set_level", EXPECT_OK},
2970 {*test6d, "hildon_volumebar_get/set_mute", EXPECT_OK},
2971 {*test6e, "gtk_widget_destroy", EXPECT_OK},
2972 {*test10a, "hildon_weekday_picker_new", EXPECT_OK},
2973 {*test11a, "hildon_weekday_picker_{,un,is}set", EXPECT_OK},
2974 {*test11b, "hildon_weekday_picker_set: null", EXPECT_ASSERT},
2975 {*test11c, "hildon_weekday_picker_unset: null", EXPECT_ASSERT},
2976 {*test11d, "hildon_weekday_picker_isset: null", EXPECT_ASSERT},
2977 {*test12a, "hildon_weekday_picker_toggle_day", EXPECT_OK},
2978 {*test12b, "hildon_weekday_picker_toggle_day: null", EXPECT_ASSERT},
2979 {*test12c, "hildon_weekday_picker_set_all/unset_all", EXPECT_OK},
2980 {*test13a, "htp_editor_new: ok", EXPECT_OK},
2981 {*test13b, "htp_editor_new: inv", EXPECT_ASSERT},
2982 {*test14a, "htp_editor_set_editable: ok", EXPECT_OK},
2983 {*test14b, "htp_editor_set_editable: null", EXPECT_ASSERT},
2984 {*test15a, "htp_editor_set_show_plus: ok", EXPECT_OK},
2985 {*test15b, "htp_editor_set_show_plus: null", EXPECT_ASSERT},
2986 {*test15c, "htp_editor_get_show_plus: null", EXPECT_ASSERT},
2987 {*test15d, "htp_editor_set_show_border: ok", EXPECT_OK},
2988 {*test15e, "htp_editor_set_show_border: null", EXPECT_ASSERT},
2989 {*test15f, "htp_editor_get_show_border: null", EXPECT_ASSERT},
2990 {*test16a, "htp_editor_set_widths: ok", EXPECT_OK},
2991 {*test16b, "htp_editor_set_widths: null", EXPECT_ASSERT},
2992 {*test17a, "htp_editor_set/get_country: ok", EXPECT_OK},
2993 {*test17b, "htp_editor_set/get_country: inv", EXPECT_OK},
2994 {*test17c, "htp_editor_set_country: null", EXPECT_ASSERT},
2995 {*test17d, "htp_editor_get_country: null", EXPECT_ASSERT},
2996 {*test18a, "htp_editor_set/get_area: ok", EXPECT_OK},
2997 {*test18b, "htp_editor_set/get_area: inv", EXPECT_OK},
2998 {*test18c, "htp_editor_set_area: null", EXPECT_ASSERT},
2999 {*test18d, "htp_editor_get_area: null", EXPECT_ASSERT},
3000 {*test19a, "htp_editor_set/get_number: ok", EXPECT_OK},
3001 {*test19b, "htp_editor_set/get_number: FREE", EXPECT_OK},
3002 {*test19c, "htp_editor_set/get_number: inv", EXPECT_OK},
3003 {*test19d, "htp_editor_set_number: null", EXPECT_ASSERT},
3004 {*test19e, "htp_editor_get_number: null", EXPECT_ASSERT},
3006 {*test20a, "hildon_find_object: new", EXPECT_OK},
3007 {*test20b, "hildon_find_object: with_options", EXPECT_OK},
3008 {*test20c, "hildon_find_object: get_text", EXPECT_OK},
3009 {*test20d, "hildon_find_object: get_label", EXPECT_OK},
3011 /*{*test21a, "hildon_find_options: new", EXPECT_OK},
3012 {*test21b, "hildon_find_options: hide_loc", EXPECT_OK},
3013 {*test21c, "hildon_find_options: hide_find_in", EXPECT_OK},
3014 {*test21d, "hildon_find_options: get_location", EXPECT_OK},
3015 {*test21e, "hildon_find_options: get_find", EXPECT_OK},
3016 {*test21f, "hildon_find_options: get_time_period", EXPECT_OK},
3017 {*test21g, "hildon_find_options: get_start", EXPECT_OK},
3018 {*test21h, "hildon_find_options: get_end", EXPECT_OK},
3019 {*test21i, "hildon_find_options: add_custom", EXPECT_OK},
3020 {*test21j, "hildon_find_options: date_matches", EXPECT_ASSERT},*/
3021 {*test22a, "range_editor_new", EXPECT_OK},
3022 {*test22b, "range_editor_new_with_separator", EXPECT_OK},
3023 {*test22c, "range_editor_new_with_separator_null", EXPECT_OK},
3024 {*test22d, "hildon_range_editor_get_range", EXPECT_OK},
3025 {*test22e, "hildon_range_editor_get_range_null", EXPECT_ASSERT},
3026 {*test22f, "hildon_range_editor_get_range_null2", EXPECT_ASSERT},
3027 {*test22g, "hildon_range_editor_get_range_null3", EXPECT_ASSERT},
3028 {*test22h, "hildon_range_editor_get_range_null4", EXPECT_ASSERT},
3029 {*test22i, "hildon_range_editor_set_range", EXPECT_OK},
3030 {*test22j, "hildon_range_editor_set_range_null_editor", EXPECT_ASSERT},
3031 {*test22k, "hildon_range_editor_set_limits", EXPECT_OK},
3032 {*test22l, "hildon_range_editor_set_limits&range", EXPECT_OK},
3033 {*test22m, "hildon_range_editor_set_limits_null", EXPECT_ASSERT},
3034 {*test23a, "hildon_sort_dialog_new", EXPECT_OK},
3035 {*test23b, "hildon_sort_dialog_get_sort_key", EXPECT_OK},
3036 {*test23c, "hildon_sort_dialog_set_sort_key", EXPECT_OK},
3037 {*test23d, "hildon_sort_dialog_add_sort_key", EXPECT_OK},
3038 {*test23e, "hildon_sort_dialog_get_sort_order", EXPECT_OK},
3039 {*test23f, "hildon_sort_dialog_set_sort_order", EXPECT_OK},
3040 {*test23g, "gtk_widget_destroy", EXPECT_OK},
3041 {*test24a, "get_password_dialog. get dialog", EXPECT_OK},
3042 {*test24b, "get_password_dialog. get old dialog", EXPECT_OK},
3043 {*test24c, "get_password_dialog_new_get_password", EXPECT_OK},
3044 {*test24d, "gtk_widget_destroy", EXPECT_OK},
3045 {*test25a, "set_password_dialog. set dialog ", EXPECT_OK},
3046 {*test25b, "set_password_dialog. change dialog", EXPECT_OK},
3047 {*test25c, "set_password_dialog_new_get_password", EXPECT_OK},
3048 {*test25d, "set_password_dialog_new_get_protected", EXPECT_ASSERT},
3049 {*test25e, "gtk_widget_destroy", EXPECT_OK},
3050 #ifndef HILDON_DISABLE_DEPRECATED
3051 {*fsd_set_font, "FontSelectionDialog Set font", EXPECT_OK},
3052 {*fsd_get_font,"FontSelectionDialog Get font", EXPECT_OK},
3054 {*fsd_set_pretext, "FontSelectionDialog Set preview text", EXPECT_OK},
3055 {*fsd_get_pretext, "FontSelectionDialog Get preview text", EXPECT_OK},
3056 {*test27a, "hildon_insert_object: new", EXPECT_OK},
3057 {*test27b, "hildon_insert_object: get_name", EXPECT_OK},
3058 {*test27c, "hildon_insert_object: get_mime_type", EXPECT_ASSERT},
3059 {*test28a, "hildon_number_editor_new", EXPECT_OK},
3060 {*test28b, "hildon_number_editor_get_value", EXPECT_OK},
3061 {*test28c, "hildon_number_editor_set_range", EXPECT_OK},
3062 {*test28d, "hildon_number_editor_set_value", EXPECT_OK},
3063 {*test29a, "hildon_color_selector: set and get red color", EXPECT_OK},
3064 {*test29b, "hildon_color_selector: set and get non-base color", EXPECT_ASSERT},
3065 {*test30a, "hildon_file_handling_note_new_moving", EXPECT_OK},
3066 {*test30b, "hildon_file_handling_note_new_deleting", EXPECT_OK},
3067 {*test30c, "hildon_file_handling_note_new_opening", EXPECT_OK},
3068 {*test30d, "hildon_file_handling_note_new_saving", EXPECT_OK},
3069 {*test31a, "hildon_add_home_dialog_new: ok", EXPECT_OK},
3070 {*test31b, "hildon_add_home_dialog_new: NULL(ok)", EXPECT_OK},
3071 {*test32a, "hildon_rename_dialog: ok", EXPECT_OK},
3072 {*test32b, "hildon_rename_dialog: NULL(ok)", EXPECT_OK},
3073 {*test33a1, "grid_item_new (\"foo\")", EXPECT_OK},
3074 {*test33a2, "grid_item_new (NULL)", EXPECT_ASSERT},
3075 {*test33b1, "grid_item_new_label (\"foo\", \"bar\")", EXPECT_OK},
3076 {*test33b2, "grid_item_new_label (\"foo\", NULL)", EXPECT_OK},
3077 {*test33b3, "grid_item_new_label (NULL, \"bar\")", EXPECT_ASSERT},
3078 {*test33b4, "grid_item_new_label (NULL, NULL)", EXPECT_ASSERT},
3079 {*test33c1, "grid_item_set_emblem (foo, \"bar\")", EXPECT_OK},
3080 {*test33c2, "grid_item_set_emblem (foo, NULL)", EXPECT_OK},
3081 {*test33c3, "grid_item_set_emblem (NULL, \"bar\")", EXPECT_ASSERT},
3082 {*test33c4, "grid_item_set_emblem (NULL, NULL)", EXPECT_ASSERT},
3083 {*test33d1, "grid_item_get_emblem (foo)", EXPECT_OK},
3084 {*test33d2, "grid_item_get_emblem (foo) (no emblem)", EXPECT_ASSERT},
3085 {*test33d3, "grid_item_get_emblem (NULL)", EXPECT_ASSERT},
3086 {*test33e, "grid_item: destroy", EXPECT_OK},
3087 {*test34a, "grid_new ()", EXPECT_OK},
3088 {*test34b1, "grid_set_style (foo, \"bar\")", EXPECT_OK},
3089 {*test34b2, "grid_set_style (foo, NULL)", EXPECT_OK},
3090 {*test34b3, "grid_set_style (NULL, \"foo\")", EXPECT_ASSERT},
3091 {*test34b4, "grid_set_style (NULL, NULL)", EXPECT_ASSERT},
3092 {*test34c1, "grid_get_style (foo)", EXPECT_OK},
3093 {*test34c2, "grid_get_style (foo) (no style)", EXPECT_OK},
3094 {*test34c3, "grid_get_style (NULL)", EXPECT_ASSERT},
3095 {*test34d1, "grid_set_sb_pos (foo, 0)", EXPECT_OK},
3096 {*test34d2, "grid_set_sb_pos (NULL, 0)", EXPECT_ASSERT},
3097 {*test34e1, "grid_get_sb_pos (foo)", EXPECT_OK},
3098 {*test34e2, "grid_get_sb_pos (NULL)", EXPECT_ASSERT},
3099 {*test34f1, "grid_add (grid, item)", EXPECT_OK},
3100 {*test34f2, "grid_add (grid, NULL)", EXPECT_ASSERT},
3101 {*test34f3, "grid_add (grid, something)", EXPECT_ASSERT},
3102 {*test34f4, "grid_add (NULL, whatever)", EXPECT_ASSERT},
3103 {*test34f5, "grid_add (whatever, we)", EXPECT_ASSERT},
3104 {*test34g1, "grid_remove (item) (exist)", EXPECT_OK},
3105 {*test34g2, "grid_remove (item) (non-exist)", EXPECT_ASSERT},
3106 {*test34g3, "grid_remove (NULL)", EXPECT_ASSERT},
3107 {*test34g4, "grid_remove (something)", EXPECT_ASSERT},
3108 {*test34g5, "grid_remove (NULL, some)", EXPECT_ASSERT},
3109 {*test34g6, "grid_remove (some, some)", EXPECT_ASSERT},
3110 {*test34h1, "grid_set_focus (item) (exist)", EXPECT_OK},
3111 {*test34h2, "grid_set_focus (item) (non-exist)", EXPECT_ASSERT},
3112 {*test34h3, "grid_set_focus (NULL)", EXPECT_OK},
3113 {*test34h4, "grid_set_focus (something)", EXPECT_ASSERT},
3114 {*test34i1, "grid: CONTAINER->focus_child (set)", EXPECT_OK},
3115 {*test34i2, "grid: CONTAINER->focus_child (unset)", EXPECT_OK},
3116 {*test34j1, "grid: destroy (items)", EXPECT_OK},
3117 {*test34j2, "grid: destroy (no items)", EXPECT_OK},
3118 {*test35a, "hildon_time_editor_new", EXPECT_OK},
3119 {*test35b, "hildon_time_editor_set/get_time", EXPECT_OK},
3120 {*test35c, "hildon_time_editor_show_seconds", EXPECT_OK},
3121 {*test35d, "hildon_time_editor_enable_duration_mode", EXPECT_OK},
3122 {*test35e, "hildon_time_editor_set/get_duration_range", EXPECT_OK},
3123 {*test35f, "hildon_time_editor_enable_duration_mode (TRUE, FALSE", EXPECT_OK},
3124 {*test35g, "hildon_time_editor_set/get_time with foo value check", EXPECT_ASSERT},
3125 {*test35h, "hildon_time_editor_set/get_duration_range with foo value check", EXPECT_ASSERT},
3127 {*test36a, "hildon_find_replace_dialog_new", EXPECT_OK},
3128 {*test36b, "hildon_find_replace_dialog_new_with_options", EXPECT_OK},
3129 {*test36c, "hildon_find_replace_dialog_get_text", EXPECT_OK},
3130 {*test36d, "hildon_find_replace_dialog_get_new_text", EXPECT_OK},
3132 {*test37a, "gtk_infoprint_temporarily_disable_wrap", EXPECT_OK},
3133 {*test37b, "gtk_banner_temporarily_disable_wrap", EXPECT_OK},
3134 {*test39a, "namepassword dialog get_name", EXPECT_OK},
3135 {*test39b, "namepassword dialog get_password", EXPECT_OK},
3136 /* {*test38a, "gtk_confirmation_banner (sometext)", EXPECT_OK},
3137 {*test38a, "gtk_confirmation_banner (NULL)", EXPECT_OK},*/
3139 {0} /*REMEMBER THE TERMINATING NULL*/
3142 /*use EXPECT_ASSERT for the tests that are _meant_ to throw assert so they are
3143 *considered passed when they throw assert and failed when they do not
3146 testcase* get_tests()
3148 g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);