2006-08-30 Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
[hildon] / ut / hildon-widgets_tests.c
1 /*
2  * This file is part of hildon-libs
3  *
4  * Copyright (C) 2005, 2006 Nokia Corporation.
5  *
6  * Contact: Michael Dominic Kostrzewa <michael.kostrzewa@nokia.com>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; version 2.1 of
11  * the License.
12  *
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.
17  *
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
21  * 02110-1301 USA
22  *
23  */
24 #include <stdio.h>
25 #include <unistd.h>
26 #include <string.h>
27 #include <assert.h>
28
29 #include <gtk/gtk.h>
30
31 #include "hildon-controlbar.h"
32 #include "hildon-seekbar.h"
33 #include "hildon-note.h"
34 #include <hildon-widgets/gtk-infoprint.h>
35 #include <hildon-widgets/hildon-weekday-picker.h>
36 #include <hildon-widgets/hildon-telephone-editor.h>
37 #include <hildon-widgets/hildon-range-editor.h>
38 #include <hildon-widgets/hildon-sort-dialog.h>
39 #include <hildon-widgets/hildon-get-password-dialog.h>
40 #include <hildon-widgets/hildon-set-password-dialog.h>
41 #include <hildon-widgets/hildon-hvolumebar.h>
42 #include <hildon-widgets/hildon-vvolumebar.h>
43 #include <hildon-widgets/hildon-font-selection-dialog.h>
44 #include <hildon-widgets/hildon-number-editor.h>
45 #include <hildon-widgets/hildon-color-selector.h>
46 #include <hildon-widgets/hildon-file-handling-note.h>
47 #include <hildon-widgets/hildon-add-home-dialog.h>
48 #include <hildon-widgets/hildon-grid-item.h>
49 #include <hildon-widgets/hildon-grid.h>
50 #include <hildon-widgets/hildon-time-editor.h>
51 #include <hildon-widgets/hildon-name-password-dialog.h>
52 #include <hildon-widgets/hildon-caption.h>
53 #include <outo.h>
54
55 /* Icon which must exist (HildonGridItem). */
56 #define VALID_ICON  "qgn_list_gene_default_app"
57
58 /*prototypes to keep the compiler happy*/
59 testcase *get_tests(void);
60 void init_test(void);
61
62      /* the testfuncs */
63 int test1a(void);
64 int test1b(void);
65 int test1c(void);
66 int test1d(void);
67 int test1e(void);
68 int test1f(void);
69 int test1g(void);
70 int test1h(void);
71 int test1i(void);
72 int test2a(void);
73 int test2b(void);
74 int test2c(void);
75 int test2d(void);
76 int test2e(void);
77 int test3a(void);
78 int test3b(void);
79 int test3c(void);
80 int test3d(void);
81 int test3e(void);
82 int test3f(void);
83 int test3g(void);
84 int test3h(void);
85 int test3i(void);
86 int test3j(void);
87 int test3k(void);
88 /*int test3l(void);*/
89 int test3m(void);
90 int test3n(void);
91 int test3o(void);
92 int test3p(void);
93 int test3q(void);
94 int test3r(void);
95 int test3s(void);
96 int test3t(void);
97 int test3u(void);
98 int test3v(void);
99
100 /* notes */
101 int test4a(void);
102 int test4b(void);
103 int test4c(void);
104 int test4d(void);
105 int test4e(void);
106 int test4f(void);
107 int test4g(void);
108 int test4h(void);
109 int test4i(void);
110 int test4j(void);
111 int test4k(void);
112 int test4l(void);
113
114 /* volumebar */
115 int test6a(void);
116 int test6b(void);
117 int test6c(void);
118 int test6d(void);
119 int test6e(void);
120
121 int test8a(void);
122 int test8b(void);
123 int test8c(void);
124 int test8d(void);
125 int test8e(void);
126 int test8f(void);
127 int test8g(void);
128 int test8h(void);
129 int test8i(void);
130 int test8j(void);
131 int test8k(void);
132
133 /* weekday picker */
134 int test10a(void);
135 int test11a(void);
136 int test11b(void);
137 int test11c(void);
138 int test11d(void);
139 int test12a(void);
140 int test12b(void);
141 int test12c(void);
142
143 /* telephone editor */
144 int test13a(void);
145 int test13b(void);
146 int test14a(void);
147 int test14b(void);
148 int test15a(void);
149 int test15b(void);
150 int test15c(void);
151 int test15d(void);
152 int test15e(void);
153 int test15f(void);
154 int test16a(void);
155 int test16b(void);
156 int test17a(void);
157 int test17b(void);
158 int test17c(void);
159 int test17d(void);
160 int test18a(void);
161 int test18b(void);
162 int test18c(void);
163 int test18d(void);
164 int test19a(void);
165 int test19b(void);
166 int test19c(void);
167 int test19d(void);
168 int test19e(void);
169
170 #if 0
171 /* find object dialog */
172 int test20a(void);
173 int test20b(void);
174 int test20c(void);
175 int test20d(void);
176 #endif
177
178 /* find object options dialog */
179 /*int test21a(void);
180 int test21b(void);
181 int test21c(void);
182 int test21d(void);
183 int test21e(void);
184 int test21f(void);
185 int test21g(void);
186 int test21h(void);
187 int test21i(void);
188 int test21j(void);*/
189
190 /* range editor */
191 int test22a(void);
192 int test22b(void);
193 int test22c(void);
194 int test22d(void);
195 int test22e(void);
196 int test22f(void);
197 int test22g(void);
198 int test22h(void);
199 int test22i(void);
200 int test22j(void);
201 int test22k(void);
202 int test22l(void);
203 int test22m(void);
204
205 /* sort dialog */
206 int test23a(void);
207 int test23b(void);
208 int test23c(void);
209 int test23d(void);
210 int test23e(void);
211 int test23f(void);
212 int test23g(void);
213
214 /* get / get old password dialog */
215 int test24a(void);
216 int test24b(void);
217 int test24c(void);
218 int test24d(void);
219
220 /* set / change password dialog */
221 int test25a(void);
222 int test25b(void);
223 int test25c(void);
224 int test25d(void);
225 int test25e(void);
226
227 /*FontSelectionDialog*/
228 #ifndef HILDON_DISABLE_DEPRECATED
229 int fsd_set_font(void);
230 int fsd_get_font(void);
231 #endif
232 int fsd_set_pretext(void);
233 int fsd_get_pretext(void);
234
235 int test27a(void);
236 int test27b(void);
237 int test27c(void);
238
239 /* NumberEditor */
240 int test28a(void);
241 int test28b(void);
242 int test28c(void);
243 int test28d(void);
244
245 /* ColorSelector */
246 int test29a(void);
247 int test29b(void);
248
249 /* FontHandlingNote */
250 int test30a(void);
251 int test30b(void);
252 int test30c(void);
253 int test30d(void);
254
255 /* Add to Home / Rename dialog */
256 int test31a(void);
257 int test31b(void);
258 int test32a(void);
259 int test32b(void);
260
261 /* HildonGridItem */
262 int test33a1(void);
263 int test33a2(void);
264 int test33b1(void);
265 int test33b2(void);
266 int test33b3(void);
267 int test33b4(void);
268 int test33c1(void);
269 int test33c2(void);
270 int test33c3(void);
271 int test33c4(void);
272 int test33d1(void);
273 int test33d2(void);
274 int test33d3(void);
275 int test33e(void);
276
277 /* HildonGrid */
278 int test34a(void);
279 int test34b1(void);
280 int test34b2(void);
281 int test34b3(void);
282 int test34b4(void);
283 int test34c1(void);
284 int test34c2(void);
285 int test34c3(void);
286 int test34d1(void);
287 int test34d2(void);
288 int test34e1(void);
289 int test34e2(void);
290 int test34f1(void);
291 int test34f2(void);
292 int test34f3(void);
293 int test34f4(void);
294 int test34f5(void);
295 int test34g1(void);
296 int test34g2(void);
297 int test34g3(void);
298 int test34g4(void);
299 int test34g5(void);
300 int test34g6(void);
301 int test34h1(void);
302 int test34h2(void);
303 int test34h3(void);
304 int test34h4(void);
305 int test34i1(void);
306 int test34i2(void);
307 int test34j1(void);
308 int test34j2(void);
309
310 /* Time/Duration Editor */
311 int test35a(void);
312 int test35b(void);
313 int test35c(void);
314 int test35d(void);
315 int test35e(void);
316 int test35f(void);
317 int test35g(void);
318 int test35h(void);
319
320 #if 0
321 int test36a(void);
322 int test36b(void);
323 int test36c(void);
324 int test36d(void);
325 #endif
326
327 /* New infoprint/banner functionalities. */
328 int test37a(void);
329 int test37b(void);
330 int test38a(void);
331
332 /* namepassworddialog */
333 int test39a(void);
334 int test39b(void);
335
336 /* file details dialog */
337 #ifndef HILDON_DISABLE_DEPRECATED
338 int test41a(void);
339 #endif
340
341 int test42 (void);
342 int test43 (void);
343 int test44 (void);
344 int test45 (void);
345 int test46 (void);
346
347 /* this has to be like this (not static). outo
348    calls for this! */
349 testcase *get_tests(void);
350 void init_test( void )
351 {
352     int plop = 0;
353     gtk_init (&plop, NULL);
354 }
355
356 int test1a()
357 {
358     HildonControlbar *controlBar;
359     controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
360
361     assert(controlBar);
362     return 1;
363 }
364
365 int test1b()
366 {
367     HildonControlbar *controlBar;
368     gint max=500;
369     
370     controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
371     hildon_controlbar_set_max(controlBar, max);
372     assert(hildon_controlbar_get_max(controlBar) == max);
373     return 1;
374 }
375
376 int test1c()
377 {
378     HildonControlbar *controlBar;
379     gint max=500;
380     gint value=250;
381     
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);
386     return 1;
387 }
388
389 int test1d()
390 {
391     HildonControlbar *controlBar;
392     
393     controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
394     gtk_widget_destroy(GTK_WIDGET(controlBar));
395     return 1;
396 }
397
398 int test1e()
399 {
400     gint getmin;
401     HildonControlbar *controlBar;
402
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);
407     return 1;
408 }
409
410 int test1f()
411 {
412    gint min = 10;
413    gint max = 50;
414
415    HildonControlbar *controlBar;
416
417    controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
418    hildon_controlbar_set_range (controlBar, min, max);
419    return 1;
420 }
421
422 int test1g()
423 {
424     gint minval;
425     gint maxval;
426
427     HildonControlbar *controlBar;
428
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);
435     return 1;
436 }
437
438 int test1h()
439 {
440     gint value;
441
442     HildonControlbar *controlBar;
443
444     controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
445     hildon_controlbar_set_range (controlBar, 250, 550);
446     hildon_controlbar_set_value (controlBar, 100);
447    
448     value = hildon_controlbar_get_value (controlBar);
449
450     assert (value == 250);
451     return 1;
452 }
453
454 int test1i()
455 {
456     gint value;
457
458     HildonControlbar *controlBar;
459
460     controlBar = HILDON_CONTROLBAR(hildon_controlbar_new());
461     hildon_controlbar_set_range (controlBar, 250, 550);
462     hildon_controlbar_set_value (controlBar, 650);
463     
464     value = hildon_controlbar_get_value (controlBar);
465
466     assert (value == 550);
467     return 1;
468 }
469
470 int test2a()
471 {
472     GtkWidget *seekBar;
473     
474     seekBar = hildon_seekbar_new();
475     assert(seekBar);
476     return 1;
477 }
478
479 int test2b()
480 {
481     GtkWidget *seekBar;
482     gint totalTime=500;
483     
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);
487     return 1;
488 }
489
490 int test2c()
491 {
492     GtkWidget *seekBar;
493     gint totalTime=500;
494     gint position=250;
495     
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);
500     return 1;
501 }
502
503 int test2d()
504 {
505     GtkWidget *seekBar;
506     
507     seekBar = hildon_seekbar_new();
508     gtk_widget_destroy(GTK_WIDGET(seekBar));
509     return 1;
510 }
511
512 int test2e()
513 {
514     GtkWidget *seekBar;
515     gint totalTime=500;
516     
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);
521     return 1;
522 }
523
524 int test3a()
525 {
526     
527     gtk_infoprint(NULL,"infoprint");
528     return 1;
529 }
530
531 int test3b()
532 {
533     
534     gtk_infoprint(NULL, NULL);
535     return 1;
536 }
537
538 int test3c()
539 {
540     
541     gtk_infoprint_with_icon_stock(NULL, "infoprint", GTK_STOCK_DIALOG_QUESTION);
542     return 1;
543 }
544
545 int test3d()
546 {
547     
548     gtk_infoprint_with_icon_stock(NULL, "infoprint", "");
549     return 1;
550 }
551
552 int test3e()
553 {
554
555     gtk_infoprint_with_icon_stock(NULL, "infoprint", NULL);
556     return 1;
557 }
558
559 int test3f()
560 {
561     
562     gtk_infoprintf (NULL, "mambo %d", 2+3);
563     return 1;
564 }
565
566 int test3g()
567 {
568     
569     gtk_infoprintf (NULL, NULL);
570     return 1;
571 }
572
573
574 int test3h()
575 {
576     gtk_confirmation_banner (NULL, "Insert our favourite testing text here.", NULL);
577     return 1;
578 }
579
580 int test3i()
581 {
582     gtk_confirmation_banner (NULL, NULL, NULL);
583     return 1;
584 }
585
586 int test3j()
587 {
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));
595     return 1;
596 }
597
598 int test3k()
599 {
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));
607     return 1;
608 }
609
610 /*int test3l()
611 {
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));
617     return 1;
618 }*/
619
620 int test3m()
621 {
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));
625     return 1;
626 }
627
628 int test3n()
629 {
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);
637     return 1;
638 }
639
640 int test3o()
641 {
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));
649     return 1;
650 }
651
652 int test3p()
653 {
654     gtk_banner_show_bar (NULL, "Insert our favourite testing text here.");
655     gtk_banner_close (NULL);
656     return 1;
657 }
658
659 int test3q()
660 {
661     gtk_banner_set_text (NULL, "Insert our second favourite testing text here.");
662     return 1;
663 }
664
665 int test3r()
666 {
667     gtk_banner_set_fraction (NULL, 0.5);
668     return 1;
669 }
670
671 int test3s()
672 {
673     gtk_banner_close (NULL);
674     return 1;
675 }
676
677 int test3t()
678 {
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);
683     return 1;
684 }
685
686 int test3u()
687 {
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);
692     return 1;
693 }
694
695 int test3v()
696 {
697     gtk_banner_show_animation (NULL, "Insert our favourite testing text here.");
698     gtk_banner_close (NULL);
699     return 1;
700 }
701
702
703 /* note: confirmation note */
704 int test4a()
705 {
706     HildonNote *note =  HILDON_NOTE( hildon_note_new_confirmation(  NULL, 
707     "Delete the presentation?\nHildon Slides" ));
708     assert(note);
709     return 1;
710 }
711 /* note: confirmation note with icon stock */
712 int test4b()
713 {
714     HildonNote *note;
715     note = HILDON_NOTE( hildon_note_new_confirmation_with_icon_stock(NULL, 
716     "Delete the presentation?\nHildon Slides", GTK_STOCK_OPEN));
717     assert(note);   
718     return 1;
719 }
720 /* note: confirmation note with 10 additional buttons */
721 int test4c()
722 {
723     
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) );  
731     assert(note);   
732     return 1;
733 }
734
735 /* note: confirmation note: Set button text*/
736 int test4d()
737 {
738     HildonNote *note;
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" );
742     return 1;
743 }
744
745 /* note: information note */
746 int test4e()
747 {
748     HildonNote *note;
749     note = HILDON_NOTE( hildon_note_new_information(NULL, 
750     "Only one button present\nin this information note"));
751     return 1;
752 }
753
754 /* note: information note with icon stock */
755 int test4f()
756 {
757     HildonNote *note;
758     note = HILDON_NOTE( hildon_note_new_information_with_icon_stock(NULL, 
759     "Only one button present\nin this information note", GTK_STOCK_HARDDISK));
760     return 1;
761 }
762
763 /* note: information note: Set button text*/
764 int test4g()
765 {
766     HildonNote *note;
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" );
770     return 1;
771 }
772
773 /* note: new cancel
774 int test4h()
775 {
776     HildonNote *note;
777     
778     note = HILDON_NOTE( hildon_note_new_cancel( NULL, 
779     "Deleting files.." )); 
780     assert(note);
781     return 1;
782 }*/
783
784 /* note: new cancel: set button text
785 int test4i()
786 {
787     HildonNote *note;
788     
789     note = HILDON_NOTE( hildon_note_new_cancel( NULL, 
790     "Deleting files.." )); 
791     hildon_note_set_button_text( HILDON_NOTE( note ) , "Stop" );
792     return 1;
793 }*/
794
795 /* note: new cancel with progress bar*/
796 int test4j()
797 {
798   GtkWidget *progbar;
799   GtkWidget *progress_note;
800     
801   progbar = gtk_progress_bar_new();
802
803   gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR( progbar ), 0.7 );
804
805   progress_note = hildon_note_new_cancel_with_progress_bar( 
806   NULL, "Deleting files..", 
807   GTK_PROGRESS_BAR( progbar ));
808  
809   assert(progress_note);
810   return 1;
811 }
812
813 /* note: new cancel with progress bar: set button text*/
814 int test4k()
815 {
816   GtkWidget *progbar;
817   GtkWidget *progress_note;
818     
819   progbar = gtk_progress_bar_new();
820
821   gtk_progress_bar_set_fraction( GTK_PROGRESS_BAR( progbar ), 0.7 );
822
823   progress_note = hildon_note_new_cancel_with_progress_bar( 
824   NULL, "Deleting files..", 
825   GTK_PROGRESS_BAR( progbar ));
826  
827   hildon_note_set_button_text( HILDON_NOTE( progress_note ) , "Stop" );
828   return 1;
829 }
830 /* destroy note widgets */
831 int test4l()
832 {
833     GtkWidget *conf;
834     GtkWidget *inf;
835     /*    GtkWidget *cancel;*/
836     GtkWidget *progress;
837     GtkWidget *progbar;
838     GtkWidget *conf_button;
839     
840     conf = hildon_note_new_confirmation(NULL, NULL);
841     assert(conf);
842     gtk_widget_destroy(conf);
843     
844     inf = hildon_note_new_information(NULL, NULL);
845     assert(inf);
846     gtk_widget_destroy(inf);
847     
848     /*
849     cancel = hildon_note_new_cancel( NULL, NULL ); 
850     assert(cancel);
851     gtk_widget_destroy(cancel);
852     */
853     
854     progbar = gtk_progress_bar_new();
855     progress = hildon_note_new_cancel_with_progress_bar( 
856     NULL, NULL, GTK_PROGRESS_BAR( progbar ));
857     assert(progress);
858     gtk_widget_destroy(progress);
859
860     conf_button =  hildon_note_new_confirmation_add_buttons( NULL, NULL, NULL );
861     assert(conf_button);
862     gtk_widget_destroy(conf_button);
863     
864     return 1;
865 }
866
867 int test6a()
868 {
869     HildonHVolumebar *volumeBar;
870     
871     volumeBar = HILDON_HVOLUMEBAR(hildon_hvolumebar_new());
872     assert(volumeBar);
873     return 1;
874 }
875
876 int test6b()
877 {
878     HildonVVolumebar *volumeBar;
879     
880     volumeBar = HILDON_VVOLUMEBAR(hildon_vvolumebar_new());
881     assert(volumeBar);
882     return 1;
883 }
884
885 int test6c()
886 {
887     HildonHVolumebar *volumeBar;
888     gdouble volumeLevel = 0.5;
889     
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);
893     return 1;
894 }
895
896 int test6d()
897 {
898     HildonHVolumebar *volumeBar;
899     gboolean mute = FALSE;
900     
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);
904     return 1;
905 }
906
907 int test6e()
908 {
909     HildonVVolumebar *volumeBar;
910     
911     volumeBar = HILDON_VVOLUMEBAR(hildon_vvolumebar_new());
912     gtk_widget_destroy(GTK_WIDGET(volumeBar));
913     return 1;
914 }
915
916 /* weekday_picker: new: ok */
917 int test10a()
918 {
919     GtkWidget *picker;
920
921     
922     picker = hildon_weekday_picker_new();
923     assert( picker );
924     return 1;
925 }
926
927 /* weekday_picker: set/unset/isset: ok */
928 int test11a()
929 {
930     gint i, j;
931     HildonWeekdayPicker *picker;
932
933     
934     picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
935     assert( picker );
936    
937     /* set all one by one */
938     for( i = 1; i < 8; ++i )
939           hildon_weekday_picker_set_day( picker, i );
940
941     /* check that the proper days are set */
942         for( j = 1; j < 8; ++j )
943            assert( hildon_weekday_picker_isset_day( picker, j ) );
944     
945     /* unset all one by one */
946     for( i = 1; i < 8; ++i )
947           hildon_weekday_picker_unset_day( picker, i );
948
949     /* check that the proper days are unset */
950         for( j = 1; j < 8; ++j )
951           assert( !hildon_weekday_picker_isset_day( picker, j ) );
952     
953     return 1;
954 }
955
956 /* weekday_picker: set_day: null */
957 int test11b()
958 {
959     
960     hildon_weekday_picker_set_day( NULL, 0 );
961     return 1;
962 }
963
964 /* weekday_picker: unset_day: null */
965 int test11c()
966 {
967     
968     hildon_weekday_picker_unset_day( NULL, 0 );
969     return 1;
970 }
971
972 /* weekday_picker: isset_day: null */
973 int test11d()
974 {
975     
976     hildon_weekday_picker_isset_day( NULL, 0 );
977     return 1;
978 }
979
980 /* weekday_picker: toggle: ok */
981 int test12a()
982 {
983     gint i, j;
984     HildonWeekdayPicker *picker;
985
986     picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
987     assert( picker );
988     
989     /* set all one by one */
990     for( i = 1; i < 8; i++ )
991           hildon_weekday_picker_toggle_day( picker, i );
992     
993     /* check that the proper days are set */
994         for( j = 1; j < 8; j++ )
995       assert ( hildon_weekday_picker_isset_day( picker, j ) );
996    
997     /* unset all one by one */
998     for( i = 1; i < 8; ++i )
999           hildon_weekday_picker_toggle_day( picker, i );
1000     
1001     /* check that the proper days are unset */
1002         for( j = 1; j < 8; ++j )
1003           assert( !hildon_weekday_picker_isset_day( picker, j ) );
1004     
1005     return 1;
1006 }
1007
1008 /* weekday_picker: toggle_day: null */
1009 int test12b()
1010 {
1011     HildonWeekdayPicker *picker;
1012     picker = HILDON_WEEKDAY_PICKER( hildon_weekday_picker_new() );
1013     hildon_weekday_picker_toggle_day( NULL, 0 );
1014     return 1;
1015 }
1016
1017 /* weekday_picker: set_all/unset_all*/
1018 int test12c()
1019 {
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 );
1024     return 1;
1025 }
1026
1027 /* telephone editor: new: ok */
1028 int test13a()
1029 {
1030     GtkWidget *editor;
1031
1032     
1033
1034     editor = hildon_telephone_editor_new( HILDON_TELEPHONE_EDITOR_FORMAT_FREE );
1035     assert( editor );
1036
1037     editor = hildon_telephone_editor_new
1038       ( HILDON_TELEPHONE_EDITOR_FORMAT_COERCE );
1039     assert( editor );
1040
1041     editor = hildon_telephone_editor_new
1042       ( HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY );
1043     assert( editor );
1044
1045     editor = hildon_telephone_editor_new
1046       ( HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA );
1047     assert( editor );
1048
1049     return 1;
1050 }
1051
1052 /* telephone editor: new: inv */
1053 int test13b()
1054 {
1055     GtkWidget *editor;
1056
1057     
1058
1059     editor = hildon_telephone_editor_new( 17 );
1060
1061     return 1;
1062 }
1063
1064
1065 /* telephone editor: set_editable: ok  */
1066 int test14a()
1067 {
1068     GtkWidget *editor;
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 };
1074     gint i;
1075
1076     
1077     
1078     for( i = 0; i < 4; ++i )
1079     {
1080         editor = hildon_telephone_editor_new( fmt[i] );
1081         hildon_telephone_editor_set_editable( HILDON_TELEPHONE_EDITOR( editor ),
1082                                               TRUE, TRUE, TRUE );
1083         hildon_telephone_editor_set_editable( HILDON_TELEPHONE_EDITOR( editor ),
1084                                               FALSE, FALSE, FALSE );
1085         gtk_widget_destroy( editor );
1086     }
1087
1088     return 1;
1089 }
1090
1091 /* telephone editor: set_editable: null  */
1092 int test14b()
1093 {
1094     
1095     hildon_telephone_editor_set_editable( NULL, TRUE, TRUE, TRUE );
1096
1097     return 1;
1098 }
1099 /* telephone editor: set_show_plus: ok  */
1100 int test15a()
1101 {
1102     GtkWidget *editor;
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 };
1108     gint i;
1109
1110     
1111     
1112     for( i = 0; i < 4; ++i )
1113     {
1114         editor = hildon_telephone_editor_new( fmt[i] );
1115
1116         assert( editor );
1117
1118         hildon_telephone_editor_set_show_plus( HILDON_TELEPHONE_EDITOR( editor ),
1119                                                TRUE );
1120
1121         /* only check if not in free mode (no plus there) */
1122         if( i )
1123           assert( hildon_telephone_editor_get_show_plus( HILDON_TELEPHONE_EDITOR( editor ) ) 
1124                   == TRUE );
1125         hildon_telephone_editor_set_show_plus( HILDON_TELEPHONE_EDITOR( editor ),
1126                                                FALSE );
1127         if( i )
1128           assert( hildon_telephone_editor_get_show_plus( HILDON_TELEPHONE_EDITOR( editor ) )
1129                   == FALSE );
1130         gtk_widget_destroy( editor );
1131     }
1132
1133     return 1;
1134 }
1135
1136 /* telephone editor: set_show_plus: null  */
1137 int test15b()
1138 {
1139     
1140     hildon_telephone_editor_set_show_plus( NULL, TRUE );
1141
1142     return 1;
1143 }
1144
1145 /* telephone editor: get_show_plus: null  */
1146 int test15c()
1147 {
1148     
1149     hildon_telephone_editor_get_show_plus( NULL );
1150
1151     return 1;
1152 }
1153
1154 /* telephone editor: set_show_border: ok  */
1155 int test15d()
1156 {
1157     GtkWidget *editor;
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 };
1163     gint i;
1164
1165     
1166     
1167     for( i = 0; i < 4; ++i )
1168     {
1169         editor = hildon_telephone_editor_new( fmt[i] );
1170
1171         assert( editor );
1172
1173         hildon_telephone_editor_set_show_border( HILDON_TELEPHONE_EDITOR( editor ),
1174                                                  TRUE );
1175         assert( hildon_telephone_editor_get_show_border
1176                 ( HILDON_TELEPHONE_EDITOR( editor ) ) == TRUE );
1177
1178         hildon_telephone_editor_set_show_border( HILDON_TELEPHONE_EDITOR( editor ),
1179                                                  FALSE );
1180         assert( hildon_telephone_editor_get_show_border( HILDON_TELEPHONE_EDITOR( editor ) )
1181                 == FALSE );
1182
1183         gtk_widget_destroy( editor );
1184     }
1185
1186     return 1;
1187 }
1188
1189 /* telephone editor: set_show_border: null  */
1190 int test15e()
1191 {
1192     
1193     hildon_telephone_editor_set_show_border( NULL, TRUE );
1194
1195     return 1;
1196 }
1197
1198 /* telephone editor: get_show_border: null  */
1199 int test15f()
1200 {
1201     
1202     hildon_telephone_editor_get_show_border( NULL );
1203
1204     return 1;
1205 }
1206
1207 /* telephone editor: set_widths: ok  */
1208 int test16a()
1209 {
1210     GtkWidget *editor;
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 };
1216     gint i;
1217
1218     
1219     
1220     for( i = 0; i < 4; ++i )
1221     {
1222         editor = hildon_telephone_editor_new( fmt[i] );
1223         hildon_telephone_editor_set_widths( HILDON_TELEPHONE_EDITOR( editor ),
1224                                             0, 0, 0 );
1225         hildon_telephone_editor_set_widths( HILDON_TELEPHONE_EDITOR( editor ),
1226                                             10, 10, 10 );
1227         hildon_telephone_editor_set_widths( HILDON_TELEPHONE_EDITOR( editor ),
1228                                             100, 100, 100 );
1229         gtk_widget_destroy( editor );
1230     }
1231
1232     return 1;
1233 }
1234
1235 /* telephone editor: set_widths: null  */
1236 int test16b()
1237 {
1238     
1239     hildon_telephone_editor_set_widths( NULL, 1, 1, 1 );
1240
1241     return 1;
1242 }
1243
1244 /* telephone editor: set/get_country: ok  */
1245 int test17a()
1246 {
1247     GtkWidget *editor;
1248     const gchar *c;
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 };
1255     gint i;
1256
1257     
1258     
1259     for( i = 0; i < 4; ++i )
1260     {
1261         editor = hildon_telephone_editor_new( fmt[i] );
1262         hildon_telephone_editor_set_country( HILDON_TELEPHONE_EDITOR( editor ),
1263                                              teststr );
1264         c = hildon_telephone_editor_get_country
1265             ( HILDON_TELEPHONE_EDITOR( editor ) );
1266
1267         /* format != FREE */
1268         if( i )
1269         {
1270             g_assert( c );
1271             g_assert( strcmp( teststr, c ) == 0 );
1272         }
1273
1274         gtk_widget_destroy( editor );
1275     }
1276
1277     return 1;
1278 }
1279
1280 /* telephone editor: set/get_country: inv  */
1281 int test17b()
1282 {
1283     GtkWidget *editor;
1284     const gchar *c;
1285     gchar teststr[] = "123456p";
1286
1287     
1288     
1289     editor = hildon_telephone_editor_new( 
1290         HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_COUNTRY );
1291     hildon_telephone_editor_set_country( HILDON_TELEPHONE_EDITOR( editor ),
1292                                          teststr );
1293     c = hildon_telephone_editor_get_country
1294         ( HILDON_TELEPHONE_EDITOR( editor ) );
1295
1296     g_assert( c );
1297     g_assert( strcmp( teststr, c ) != 0 );
1298
1299     gtk_widget_destroy( editor );
1300
1301     return 1;
1302 }
1303
1304 /* telephone editor: set_country: null  */
1305 int test17c()
1306 {
1307     
1308     hildon_telephone_editor_set_country( NULL, "123" );
1309
1310     return 1;
1311 }
1312
1313 /* telephone editor: get_country: null  */
1314 int test17d()
1315 {
1316     
1317     hildon_telephone_editor_get_country( NULL );
1318
1319     return 1;
1320 }
1321
1322 /* telephone editor: set/get_area: ok  */
1323 int test18a()
1324 {
1325     GtkWidget *editor;
1326     const gchar *c;
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 };
1333     gint i;
1334
1335     
1336     
1337     for( i = 0; i < 4; ++i )
1338     {
1339         editor = hildon_telephone_editor_new( fmt[i] );
1340         hildon_telephone_editor_set_area( HILDON_TELEPHONE_EDITOR( editor ),
1341                                              teststr );
1342         c = hildon_telephone_editor_get_area
1343             ( HILDON_TELEPHONE_EDITOR( editor ) );
1344
1345         /* format != FREE nor COUNTRY */
1346         if( i && i != 2 )
1347         {
1348             g_assert( c );
1349             
1350             g_assert( strncmp( teststr, c, strlen( c ) ) == 0 );
1351         }
1352
1353         gtk_widget_destroy( editor );
1354     }
1355
1356     return 1;
1357 }
1358
1359 /* telephone editor: set/get_area: inv  */
1360 int test18b()
1361 {
1362     GtkWidget *editor;
1363     const gchar *c;
1364     gchar teststr[] = "123456p";
1365
1366     
1367     
1368     editor = hildon_telephone_editor_new( 
1369         HILDON_TELEPHONE_EDITOR_FORMAT_COERCE_AREA );
1370     hildon_telephone_editor_set_area( HILDON_TELEPHONE_EDITOR( editor ),
1371                                          teststr );
1372     c = hildon_telephone_editor_get_area
1373         ( HILDON_TELEPHONE_EDITOR( editor ) );
1374
1375     g_assert( c );
1376     g_assert( strcmp( teststr, c ) != 0 );
1377
1378     gtk_widget_destroy( editor );
1379
1380     return 1;
1381 }
1382
1383 /* telephone editor: set_area: null  */
1384 int test18c()
1385 {
1386     
1387     hildon_telephone_editor_set_area( NULL, "123" );
1388
1389     return 1;
1390 }
1391
1392 /* telephone editor: get_area: null  */
1393 int test18d()
1394 {
1395     
1396     hildon_telephone_editor_get_area( NULL );
1397
1398     return 1;
1399 }
1400  
1401 /* telephone editor: set/get_number: ok  */
1402 int test19a()
1403 {
1404     GtkWidget *editor;
1405     const gchar *c;
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 };
1412     gint i;
1413
1414     
1415     
1416     for( i = 0; i < 4; ++i )
1417     {
1418         editor = hildon_telephone_editor_new( fmt[i] );
1419         hildon_telephone_editor_set_number( HILDON_TELEPHONE_EDITOR( editor ),
1420                                              teststr );
1421         c = hildon_telephone_editor_get_number
1422             ( HILDON_TELEPHONE_EDITOR( editor ) );
1423
1424         /* free != COUNTRY nor AREA */
1425         if( i != 2 && i != 3 )
1426         {
1427             g_assert( c );
1428             g_assert( strcmp( teststr, c ) == 0 );
1429         }
1430
1431         gtk_widget_destroy( editor );
1432     }
1433
1434     return 1;
1435 }
1436
1437 /* telephone editor: set/get_number: ok in FREE format  */
1438 int test19b()
1439 {
1440     GtkWidget *editor;
1441     const gchar *c;
1442     gchar teststr[] = "()+?*pw1234567890";
1443     
1444     editor = hildon_telephone_editor_new( 
1445         HILDON_TELEPHONE_EDITOR_FORMAT_FREE );
1446     hildon_telephone_editor_set_number( HILDON_TELEPHONE_EDITOR( editor ),
1447                                          teststr );
1448     c = hildon_telephone_editor_get_number
1449         ( HILDON_TELEPHONE_EDITOR( editor ) );
1450
1451     g_assert( c );
1452     g_assert( strncmp( teststr, c, strlen(c) ) == 0 );
1453
1454     gtk_widget_destroy( editor );
1455
1456     return 1;
1457 }
1458
1459 /* telephone editor: set/get_number: inv  */
1460 int test19c()
1461 {
1462     GtkWidget *editor;
1463     const gchar *c;
1464     gchar teststr[] = "123456f";
1465
1466     
1467     
1468     editor = hildon_telephone_editor_new( 
1469         HILDON_TELEPHONE_EDITOR_FORMAT_FREE );
1470     hildon_telephone_editor_set_number( HILDON_TELEPHONE_EDITOR( editor ),
1471                                          teststr );
1472     c = hildon_telephone_editor_get_number
1473         ( HILDON_TELEPHONE_EDITOR( editor ) );
1474
1475     g_assert( c );
1476     g_assert( strcmp( teststr, c ) != 0 );
1477
1478     gtk_widget_destroy( editor );
1479
1480     return 1;
1481 }
1482
1483 /* telephone editor: set_number: null  */
1484 int test19d()
1485 {   
1486     hildon_telephone_editor_set_number( NULL, "123" );
1487
1488     return 1;
1489 }
1490
1491 /* telephone editor: get_number: null  */
1492 int test19e()
1493 {    
1494     hildon_telephone_editor_get_number( NULL );
1495
1496     return 1;
1497 }
1498
1499 /* find object options dialog: new */
1500 /*int test21a(void){
1501   GtkWidget *dialog;
1502   dialog = hildon_find_object_options_dialog_new(NULL);
1503   g_assert(dialog);
1504   return 1;
1505 }*/
1506
1507 /* find object options dialog: hide_location */
1508 /*int test21b(void){
1509   GtkWidget *dialog;
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);
1514   
1515   return 1;
1516 }*/
1517
1518 /* find object options dialog: hide_find_in */
1519 /*int test21c(void){
1520   GtkWidget *dialog;
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));
1524
1525   return 1;  
1526 }*/
1527
1528 /* find object options dialog: get_location */
1529 /*int test21d(void){
1530   const gchar *retString;
1531   GtkWidget *dialog;
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));
1535   
1536   g_assert(retString);
1537
1538   return 1;
1539 }*/
1540
1541 /* find object options dialog: get_find_type */
1542 /*int test21e(void){
1543   HildonFindInType find_type;
1544   GtkWidget *dialog;
1545   dialog = hildon_find_object_options_dialog_new(NULL);
1546   
1547   find_type = hildon_find_object_options_dialog_get_find_type(
1548                      HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog));
1549
1550   return 1;
1551 }*/
1552
1553 /* find object options dialog: get_time_period_type */
1554 /*int test21f(void){
1555   HildonTimePeriodType type;
1556   GtkWidget *dialog;
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));
1560   return 1;
1561 }*/
1562
1563 /* find object options dialog: get_start_date */
1564 /*int test21g(void){
1565   GtkWidget *dialog;
1566   gint year, month, day;
1567
1568   dialog = hildon_find_object_options_dialog_new(NULL);
1569
1570   hildon_find_object_options_dialog_get_start_date(HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog),
1571                                                    &year, &month, &day);
1572
1573   g_assert(year);
1574   g_assert(month);
1575   g_assert(day);
1576
1577   return 1;
1578 }*/
1579
1580 /* find object options dialog: get_end_date */
1581 /*int test21h(void){
1582   GtkWidget *dialog;
1583   gint year, month, day;
1584
1585   dialog = hildon_find_object_options_dialog_new(NULL);
1586
1587   hildon_find_object_options_dialog_get_end_date(HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog), 
1588                                                  &year, &month, &day);
1589
1590   g_assert(year);
1591   g_assert(month);
1592   g_assert(day);
1593
1594   return 1;
1595 }*/
1596
1597 /* find object options dialog: add_custom_options */
1598 /*int test21i(void){
1599   GtkWidget *dialog;
1600   GtkWidget *widget = gtk_entry_new();
1601
1602   dialog = hildon_find_object_options_dialog_new(NULL);
1603
1604   hildon_find_object_options_dialog_add_custom_option(
1605       HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog), "New widget", widget);
1606
1607   return 1;
1608 }*/
1609
1610 /* find object options dialog: date_matches */
1611 /*int test21j(void){
1612   GtkWidget *dialog;
1613   dialog = hildon_find_object_options_dialog_new(NULL);
1614   
1615   g_assert(hildon_find_object_dialog_date_matches(HILDON_FIND_OBJECT_OPTIONS_DIALOG(dialog),
1616                                                   1, 1, 1979));
1617
1618   return 1;
1619 }*/
1620  
1621 /* range editor: new range editor: ok parameters */
1622 int test22a()
1623 {
1624   HildonRangeEditor *range_editor;
1625
1626   range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1627   assert(range_editor);
1628   return 1;
1629 }
1630
1631 /* range editor: new range editor with separator: ok parameters */
1632 int test22b()
1633 {
1634   HildonRangeEditor *range_editor;
1635   
1636   range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new_with_separator(
1637                                      "String"));
1638   assert(range_editor);
1639   return 1;
1640 }
1641
1642 /* range editor: new range editor with separator: NULL parameters */
1643 int test22c()
1644 {
1645   HildonRangeEditor *range_editor;
1646
1647   range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new_with_separator(NULL));
1648   assert(range_editor);
1649   return 1;
1650 }
1651
1652 /* range editor: get range: ok parameters */
1653 int test22d()
1654 {
1655   HildonRangeEditor *range_editor;
1656   gint start, end;
1657
1658   range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1659   hildon_range_editor_get_range (range_editor, &start, &end);
1660
1661   assert (start == -999);
1662   assert (end == 999);
1663
1664   return 1;
1665 }
1666
1667 /* range editor: get range: null range editor */
1668 int test22e()
1669 {
1670   HildonRangeEditor *range_editor = NULL;
1671   gint start, end;
1672
1673   hildon_range_editor_get_range (range_editor, &start, &end);
1674
1675   return 1;
1676 }
1677
1678 /* range editor: get range: null end */
1679 int test22f()
1680 {
1681   HildonRangeEditor *range_editor = NULL;
1682   gint start;
1683
1684   hildon_range_editor_get_range (range_editor, &start, NULL);
1685
1686   return 1;
1687 }
1688
1689 /* range editor: get range: null start */
1690  int test22g()
1691 {
1692   HildonRangeEditor *range_editor = NULL;
1693   gint end;
1694
1695   hildon_range_editor_get_range (range_editor, NULL, &end);
1696
1697   return 1;
1698 }
1699
1700 /* range editor: get range: null start, end */
1701 int test22h()
1702 {
1703   HildonRangeEditor *range_editor = NULL;
1704
1705   hildon_range_editor_get_range (range_editor, NULL, NULL);
1706
1707   return 1;
1708 }
1709
1710 /* range editor: set range: ok parameters */
1711 int test22i()
1712 {
1713   HildonRangeEditor *range_editor;
1714   gint start = 5, end = 6;
1715
1716   range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1717
1718   hildon_range_editor_set_range (range_editor, start, end);
1719   hildon_range_editor_get_range (range_editor, &start, &end);
1720
1721   assert (start   == 5);
1722   assert (end == 6);
1723
1724   return 1;
1725 }
1726
1727 /* range editor: set range: null range editor*/
1728 int test22j()
1729 {
1730   HildonRangeEditor *range_editor = NULL;
1731   gint start = 5, end = 6;
1732
1733   hildon_range_editor_set_range (range_editor, start, end);
1734
1735   return 1;
1736 }
1737
1738 /* range editor: set limits: ok parameters */
1739 int test22k()
1740 {
1741   HildonRangeEditor *range_editor;
1742   gint start = 0, end = 0;
1743
1744   range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1745
1746   hildon_range_editor_set_limits (range_editor, start, end);
1747   hildon_range_editor_get_range (range_editor, &start, &end);
1748
1749   assert (start == 0);
1750   assert (end == 0);
1751
1752   return 1;
1753 }
1754
1755 /* range editor: set limits: set range over start minimum and end maximum */
1756 int test22l()
1757 {
1758   HildonRangeEditor *range_editor;
1759   gint start = -1, end = 1;
1760
1761   range_editor = HILDON_RANGE_EDITOR(hildon_range_editor_new());
1762
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);
1766
1767   assert (start  == 0);
1768   assert (end == 0);
1769
1770   return 1;
1771 }
1772
1773 /* range editor: set limits: NULL editor */
1774 int test22m()
1775 {
1776   HildonRangeEditor *range_editor = NULL;
1777   gint start = 0, end = 0;
1778
1779   hildon_range_editor_set_limits (range_editor, start, end);
1780
1781   return 1;
1782 }
1783
1784
1785 /* sort dialog:  */
1786 int test23a(void)
1787 {
1788
1789   HildonSortDialog *sort_dialog;
1790
1791   sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1792   assert(sort_dialog);
1793   return 1;
1794 }
1795
1796 /* sort dialog: Get sort key. '0' is the default index value */
1797 int test23b(void)
1798 {
1799
1800   HildonSortDialog *sort_dialog;
1801   gint default_key = 0;
1802     
1803   sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1804   assert(hildon_sort_dialog_get_sort_key( sort_dialog ) == default_key );
1805   return 1;
1806 }
1807
1808 /* sort dialog: Set sort key */
1809 int test23c(void)
1810 {
1811
1812   HildonSortDialog *sort_dialog;
1813   gint key = 1;
1814    
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 );
1818   return 1;
1819 }
1820
1821 /* sort dialog: add sort key */
1822 int test23d(void)
1823 {
1824
1825   HildonSortDialog *sort_dialog;
1826   gint key = 1;
1827   gint added_key_index = 0;
1828    
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,
1832                                                      "Date");
1833                                                      
1834   hildon_sort_dialog_set_sort_key( sort_dialog, added_key_index );
1835   assert(hildon_sort_dialog_get_sort_key( sort_dialog ) == key );
1836   return 1;
1837 }
1838
1839 /* sort dialog: get sort order. '0' is the default index value */
1840 int test23e(void)
1841 {
1842
1843   HildonSortDialog *sort_dialog;
1844   GtkSortType type = 0;
1845
1846   sort_dialog = HILDON_SORT_DIALOG(hildon_sort_dialog_new(NULL));
1847   assert(hildon_sort_dialog_get_sort_order( sort_dialog ) == type);
1848   return 1;
1849 }
1850
1851 /* sort dialog: set sort order */
1852 int test23f(void)
1853 {
1854
1855   HildonSortDialog *sort_dialog;
1856   GtkSortType type = 1;
1857
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);
1861   return 1;
1862 }
1863
1864 /* sort dialog: gtk_widget_destroy  */
1865 int test23g()
1866 {
1867     GtkWidget *sort_dialog;
1868      
1869     sort_dialog = hildon_sort_dialog_new(FALSE);
1870     gtk_widget_destroy(GTK_WIDGET(sort_dialog));
1871         
1872     return 1;
1873 }
1874
1875 /* Get password dialog */
1876 int test24a(void)
1877 {
1878
1879   HildonGetPasswordDialog *get_dialog;
1880  
1881   get_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1882                                           FALSE));
1883   assert(get_dialog);
1884   return 1;
1885 }
1886
1887 /* Get Old password dialog */
1888 int test24b(void)
1889 {
1890
1891   HildonGetPasswordDialog *get_old_dialog;
1892  
1893   get_old_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1894                                               TRUE));
1895   assert(get_old_dialog);
1896   return 1;
1897 }
1898
1899 /* Get / Get Old password dialog: get password  */
1900 int test24c(void)
1901 {
1902   HildonGetPasswordDialog *get_dialog;
1903   HildonGetPasswordDialog *get_old_dialog;
1904   const gchar *get_string;
1905   const gchar *get_old_string;
1906  
1907   get_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL, 
1908                                           FALSE));
1909   get_string = hildon_get_password_dialog_get_password( get_dialog);
1910   assert(get_string);
1911   
1912   get_old_dialog = HILDON_GET_PASSWORD_DIALOG(hildon_get_password_dialog_new(NULL,
1913                                               TRUE));
1914   get_old_string = hildon_get_password_dialog_get_password( get_old_dialog);
1915   assert(get_old_string);
1916   return 1;
1917 }
1918
1919 /* get / get old password dialog: gtk_widget_destroy  */
1920 int test24d()
1921 {
1922     GtkWidget *get_dialog;
1923     GtkWidget *get_old_dialog;
1924     
1925     get_dialog = hildon_get_password_dialog_new(NULL, FALSE);
1926     gtk_widget_destroy(GTK_WIDGET(get_dialog));
1927     
1928     get_old_dialog = hildon_get_password_dialog_new(NULL, TRUE);
1929     gtk_widget_destroy(GTK_WIDGET(get_old_dialog));
1930     
1931     return 1;
1932 }
1933
1934 /* set password dialog */
1935 int test25a(void)
1936 {
1937
1938   HildonSetPasswordDialog *set_dialog;
1939  
1940   set_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(NULL, 
1941                                           FALSE));
1942   assert(set_dialog);
1943   return 1;
1944 }
1945
1946 /* change password dialog */
1947 int test25b(void)
1948 {
1949
1950   HildonSetPasswordDialog *change_dialog;
1951  
1952   change_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1953                                              NULL, TRUE));
1954   assert(change_dialog);
1955   return 1;
1956 }
1957
1958 /* set / change password dialog: get password  */
1959 int test25c(void)
1960 {
1961   HildonSetPasswordDialog *set_dialog;
1962   HildonSetPasswordDialog *change_dialog;
1963   const gchar *set_string;
1964   const gchar *change_string;
1965  
1966   set_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1967                                           NULL, FALSE));
1968   set_string = hildon_set_password_dialog_get_password( set_dialog);
1969   assert(set_string);
1970   
1971   change_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1972                                              NULL, TRUE));
1973   change_string = hildon_set_password_dialog_get_password( change_dialog);
1974   assert(change_string);
1975   return 1;
1976 }
1977
1978 /* set / change password dialog: get protected  */
1979 int test25d(void)
1980 {                                     
1981   HildonSetPasswordDialog *set_dialog;
1982   HildonSetPasswordDialog *change_dialog;
1983   gboolean set;
1984   gboolean change;
1985  
1986   set_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1987                                           NULL, FALSE));
1988   set = hildon_set_password_dialog_get_protected(set_dialog);
1989   assert(set);
1990   
1991   change_dialog = HILDON_SET_PASSWORD_DIALOG(hildon_set_password_dialog_new(
1992                                              NULL, TRUE));
1993   change = hildon_set_password_dialog_get_protected(change_dialog);
1994   assert(change);
1995   return 1; 
1996
1997 /* set / change password dialog: gtk_widget_destroy  */
1998 int test25e()
1999 {
2000     GtkWidget *set_dialog;
2001     GtkWidget *change_dialog;
2002     
2003     set_dialog = hildon_set_password_dialog_new(NULL, FALSE);
2004     gtk_widget_destroy(GTK_WIDGET(set_dialog));
2005     
2006     change_dialog = hildon_set_password_dialog_new(NULL, TRUE);
2007     gtk_widget_destroy(GTK_WIDGET(change_dialog));
2008     
2009     return 1;
2010 }
2011
2012 #ifndef HILDON_DISABLE_DEPRECATED
2013 int fsd_get_font(void)
2014 {
2015         GtkWidget *fsd;
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 );
2020         return 1;
2021 }
2022
2023 int fsd_set_font(void)
2024 {
2025         GtkWidget *fsd;
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);
2030         return 1;
2031 }
2032 #endif
2033 int fsd_set_pretext(void)
2034 {
2035         GtkWidget *fsd;
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);
2039         return 1;
2040 }
2041
2042 int fsd_get_pretext(void)
2043 {
2044         GtkWidget *fsd;
2045         char *str = NULL;
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));
2049
2050         assert( str!=NULL );
2051         return 1;
2052 }
2053
2054 /* hildon_number_editor_new */
2055 int test28a(void){
2056   GtkWidget *editor;
2057   gint min = -120;
2058   gint max = 900;
2059
2060   editor = hildon_number_editor_new (min, max);
2061   g_assert(editor);
2062
2063   return 1;
2064 }
2065
2066 /* hildon_number_editor_get_value  */
2067 int test28b(void){
2068   GtkWidget *editor;
2069   gint min = 450;
2070   gint max = 7500;
2071   gint value;
2072
2073   editor = hildon_number_editor_new (min, max);
2074   value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2075   g_assert (value == max);
2076
2077   return 1;
2078 }
2079
2080 /* hildon_number_editor_set_range  */
2081 int test28c(void){
2082   GtkWidget *editor;
2083   gint min = 450;
2084   gint max = 7500;
2085   gint value;
2086
2087   editor = hildon_number_editor_new (min, max);
2088   hildon_number_editor_set_range (HILDON_NUMBER_EDITOR (editor), 30, 80);
2089   value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2090   g_assert (value == 80);
2091
2092   return 1;
2093 }
2094
2095 /* hildon_number_editor_set_value */
2096 int test28d(void){
2097   GtkWidget *editor;
2098   gint min = 450;
2099   gint max = 7500;
2100   gint value;
2101
2102   editor = hildon_number_editor_new (min, max);
2103   hildon_number_editor_set_value (HILDON_NUMBER_EDITOR (editor), 3450);
2104   value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2105   g_assert (value == 3450);
2106
2107 return 1;
2108 }
2109
2110 /* Hildon-Color-Selector: 
2111     hildon_color_selector_new() 
2112     with base color
2113  */ 
2114 int test29a(void){
2115   GtkWidget *colselector;
2116   GdkColor redcolor = {0, 65535, 0, 0 };
2117   GdkColor *color;
2118
2119   colselector = hildon_color_selector_new( NULL );
2120
2121   hildon_color_selector_set_color( HILDON_COLOR_SELECTOR(colselector), &(redcolor) );
2122   color = hildon_color_selector_get_color( HILDON_COLOR_SELECTOR(colselector) );
2123
2124   g_assert( colselector );
2125   g_assert( redcolor.pixel == color->pixel );
2126   g_assert( redcolor.red   == color->red   );
2127   g_assert( redcolor.green == color->green );
2128   g_assert( redcolor.blue  == color->blue  );
2129
2130   g_free(color);
2131   gtk_widget_destroy ( colselector );   
2132
2133   return 1;
2134 }
2135 /* Hildon-Color-Selector: 
2136    HildonColorSelector with non-base color
2137  */ 
2138 int test29b(void){
2139
2140   HildonColorSelector *colorsel;
2141   GtkWidget *obj_self;
2142   GdkColor mixedcolor = { 0, 7281, 21845, 65535 };   
2143   GdkColor *color;
2144
2145   obj_self =  hildon_color_selector_new( NULL );
2146   colorsel = HILDON_COLOR_SELECTOR ( obj_self  );
2147
2148   hildon_color_selector_set_color( colorsel, &mixedcolor );
2149   color = hildon_color_selector_get_color( colorsel );  
2150
2151   g_assert( colorsel );
2152   g_assert( color->pixel == 0 );
2153   g_assert( color->red   == 7281 );
2154   g_assert( color->green == 21845 );
2155   g_assert( color->blue  == 65535 ); 
2156
2157   g_free( color ); 
2158   g_object_unref ( obj_self );
2159   gtk_widget_destroy( GTK_WIDGET(colorsel) );
2160   
2161   return 1;
2162 }
2163
2164 /* hildon_file_handling_note_new_moving */
2165 int test30a(void){
2166
2167    GtkWidget *file_note;
2168   
2169    file_note = hildon_file_handling_note_new_moving (NULL);
2170    hildon_file_handling_note_set_fraction (HILDON_FILE_HANDLING_NOTE(file_note), 0.7);
2171
2172    g_assert (file_note);
2173   
2174    return 1;
2175 }
2176
2177 /* hildon_file_handling_note_new_deleting */
2178 int test30b(void){
2179     
2180    GtkWidget *file_note;
2181   
2182    file_note = hildon_file_handling_note_new_deleting (NULL);
2183    hildon_file_handling_note_set_counter_and_name (HILDON_FILE_HANDLING_NOTE (file_note), 
2184                                                    1, 2, "bar.txt");
2185    hildon_file_handling_note_set_counter_and_name (HILDON_FILE_HANDLING_NOTE (file_note), 
2186                                                    2, 2, "foo.txt"); 
2187    g_assert (file_note);
2188   
2189    return 1;
2190 }
2191
2192 /* hildon_file_handling_note_new_opening */
2193 int test30c(void){
2194     
2195    GtkWidget *file_note;
2196   
2197    file_note = hildon_file_handling_note_new_opening (NULL);
2198    hildon_file_handling_note_set_name (HILDON_FILE_HANDLING_NOTE (file_note),
2199    "baz.txt");
2200    g_assert (file_note);
2201   
2202    return 1;
2203 }
2204
2205 /* hildon_file_handling_note_new_saving */
2206 int test30d(void){
2207     
2208    GtkWidget *file_note;
2209   
2210    file_note = hildon_file_handling_note_new_saving (NULL);
2211    hildon_file_handling_note_set_fraction (HILDON_FILE_HANDLING_NOTE (file_note), 0.7);
2212    g_assert (file_note);
2213   
2214    return 1;
2215 }
2216
2217 /* Add to Home dialog new: ok parameters */
2218 int test31a(void){
2219     GtkWidget *d;
2220     
2221     d = hildon_add_home_dialog_new( NULL, "name" , NULL);
2222     g_assert( d );
2223
2224     return 1;
2225 }
2226
2227 /* Add to Home dialog new: NULL parameter (is ok) */
2228 int test31b(void){
2229     GtkWidget *d;
2230     
2231     d = hildon_add_home_dialog_new( NULL, NULL, NULL );
2232     g_assert( d );
2233
2234     return 1;
2235 }
2236
2237 /* Rename dialog new: ok parameters */
2238 int test32a(void){
2239     GtkWidget *d;
2240     
2241     d = hildon_add_home_dialog_new( NULL, "name", "newname" );
2242     g_assert( d );
2243
2244     return 1;
2245 }
2246
2247 /* Rename dialog new: NULL parameter (is ok) */
2248 int test32b(void){
2249     GtkWidget *d;
2250     
2251     d = hildon_add_home_dialog_new( NULL, NULL, "newname" );
2252     g_assert( d );
2253
2254     return 1;
2255 }
2256
2257 /* Create item with icon basename. */
2258 int test33a1 (void)
2259 {
2260     /* If test fails, first see if icon exists. */
2261     GtkWidget *item;
2262     item = hildon_grid_item_new (VALID_ICON);
2263     g_assert (item);
2264     return 1;
2265 }
2266
2267 /* Create item without icon basename. */
2268 int test33a2 (void)
2269 {
2270     GtkWidget *item;
2271     item = hildon_grid_item_new (NULL);
2272     g_assert (item);
2273     return 1;
2274 }
2275
2276 /* Create item with icon basename and label. */
2277 int test33b1 (void)
2278 {
2279     /* If test fails, first see if icon exists. */
2280     GtkWidget *item;
2281     item = hildon_grid_item_new_with_label (VALID_ICON, "foo");
2282     g_assert (item);
2283     return 1;
2284 }
2285
2286 /* Create item with icon basename but with no label. */
2287 int test33b2 (void)
2288 {
2289     /* If test fails, first see if icon exists. */
2290     GtkWidget *item;
2291     item = hildon_grid_item_new_with_label (VALID_ICON, NULL);
2292     g_assert (item);
2293     return 1;
2294 }
2295 int test33b3 (void)
2296 {
2297     GtkWidget *item;
2298     item = hildon_grid_item_new_with_label (NULL, "foo");
2299     g_assert (item);
2300     return 1;
2301 }
2302
2303 /* Create item without icon basename and without label. */
2304 int test33b4 (void)
2305 {
2306     GtkWidget *item;
2307     item = hildon_grid_item_new_with_label (NULL, NULL);
2308     g_assert (item);
2309     return 1;
2310 }
2311
2312 /* Set emblem type. Non-NULL item, non-NULL emblem. */
2313 int test33c1 (void)
2314 {
2315     /* If test fails, first see if icon exists. */
2316     GtkWidget *item;
2317     item = hildon_grid_item_new (VALID_ICON);
2318     hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), VALID_ICON);
2319     return 1;
2320 }
2321
2322 /* Set emblem type. Non-NULL item, NULL emblem. */
2323 int test33c2 (void)
2324 {
2325     /* If test fails, first see if icon exists. */
2326     GtkWidget *item;
2327     item = hildon_grid_item_new (VALID_ICON);
2328     hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), NULL);
2329     return 1;
2330 }
2331
2332 /* Set emblem type. NULL item, non-NULL emblem. */
2333 int test33c3 (void)
2334 {
2335     hildon_grid_item_set_emblem_type (NULL, VALID_ICON);
2336     return 1;
2337 }
2338
2339 /* Set emblem type. NULL item, NULL emblem. */
2340 int test33c4 (void)
2341 {
2342     hildon_grid_item_set_emblem_type (NULL, NULL);
2343     return 1;
2344 }
2345
2346 /* Get emblem type from existing item - has emblem. */
2347 int test33d1 (void)
2348 {
2349     /* If test fails, first see if icon exists. */
2350     GtkWidget *item;
2351     const gchar *type;
2352     item = hildon_grid_item_new (VALID_ICON);
2353     hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), VALID_ICON);
2354     type = hildon_grid_item_get_emblem_type (HILDON_GRID_ITEM (item));
2355     g_assert (type);
2356     return 1;
2357 }
2358
2359 /* Get emblem type from existing item - has no emblem. */
2360 int test33d2 (void)
2361 {
2362     /* If test fails, first see if icon exists. */
2363     GtkWidget *item;
2364     const gchar *type;
2365     item = hildon_grid_item_new (VALID_ICON);
2366     type = hildon_grid_item_get_emblem_type (HILDON_GRID_ITEM (item));
2367     g_assert (type != NULL);
2368     return 1;
2369 }
2370
2371 /* Get emblem type from non-existing item. */
2372 int test33d3 (void)
2373 {
2374     const gchar *type;
2375     type = hildon_grid_item_get_emblem_type (NULL);
2376     g_assert (type != NULL);
2377     return 1;
2378 }
2379
2380 /* Destroy griditem. */
2381 int test33e(void)
2382 {
2383     GtkWidget *item;
2384     item = hildon_grid_item_new (VALID_ICON);
2385     gtk_widget_destroy (item);
2386     return 1;
2387 }
2388
2389 /* Create new grid. */
2390 int test34a (void)
2391 {
2392     GtkWidget *grid;
2393     grid = hildon_grid_new ();
2394     g_assert (grid);
2395     return 1;
2396 }
2397
2398 /* Set grid style. */
2399 int test34b1 (void)
2400 {
2401     GtkWidget *grid;
2402     grid = hildon_grid_new ();
2403     hildon_grid_set_style (HILDON_GRID (grid), "bar");
2404     return 1;
2405 }
2406
2407 /* Set grid style (no style). */
2408 int test34b2 (void)
2409 {
2410     GtkWidget *grid;
2411     grid = hildon_grid_new ();
2412     hildon_grid_set_style (HILDON_GRID (grid), NULL);
2413     return 1;
2414 }
2415
2416 /* Set grid style. Invalid grid. */
2417 int test34b3 (void)
2418 {
2419     hildon_grid_set_style (NULL, "bar");
2420     return 1;
2421 }
2422
2423 /* Set grid style. Invalid grid, no style. */
2424 int test34b4 (void)
2425 {
2426     hildon_grid_set_style (NULL, NULL);
2427     return 1;
2428 }
2429
2430 /* Get grid style. Valid grid, has style. */
2431 int test34c1 (void)
2432 {
2433     GtkWidget *grid;
2434     const gchar *style;
2435     grid = hildon_grid_new ();
2436     hildon_grid_set_style (HILDON_GRID (grid), "foo");
2437     style = hildon_grid_get_style (HILDON_GRID (grid));
2438     g_assert (style);
2439     return 1;
2440 }
2441
2442 /* Get grid style. Valid grid, has no style. */
2443 int test34c2 (void)
2444 {
2445     GtkWidget *grid;
2446     const gchar *style;
2447     grid = hildon_grid_new ();
2448     hildon_grid_set_style (HILDON_GRID (grid), NULL);
2449     style = hildon_grid_get_style (HILDON_GRID (grid));
2450     g_assert (style != NULL && strcmp (style, "HildonGrid") == 0);
2451     return 1;
2452 }
2453
2454 /* Get grid style. Invalid grid. */
2455 int test34c3 (void)
2456 {
2457     const gchar *style;
2458     style = hildon_grid_get_style (NULL);
2459     g_assert (style);
2460     return 1;
2461 }
2462
2463 /* Set grid scrollbar position. Valid grid. */
2464 int test34d1 (void)
2465 {
2466     GtkWidget *grid;
2467     grid = hildon_grid_new ();
2468     hildon_grid_set_scrollbar_pos (HILDON_GRID (grid), 0);
2469     return 1;
2470 }
2471
2472 /* Set grid scrollbar position. Invalid grid. */
2473 int test34d2 (void)
2474 {
2475     hildon_grid_set_scrollbar_pos (NULL, 0);
2476     return 1;
2477 }
2478
2479 /* Get grid scrollbar position. Valid grid. */
2480 int test34e1 (void)
2481 {
2482     GtkWidget *grid;
2483     gint pos;
2484     grid = hildon_grid_new ();
2485     pos = hildon_grid_get_scrollbar_pos (HILDON_GRID (grid));
2486     return 1;
2487 }
2488
2489 /* Get grid scrollbar position. Inalid grid. */
2490 int test34e2 (void)
2491 {
2492     gint pos;
2493     pos = hildon_grid_get_scrollbar_pos (NULL);
2494     return 1;
2495 }
2496
2497 /* Add item to existing grid. */
2498 int test34f1 (void)
2499 {
2500     GtkWidget *grid;
2501     GtkWidget *item;
2502     grid = hildon_grid_new ();
2503     item = hildon_grid_item_new (VALID_ICON);
2504     gtk_container_add (GTK_CONTAINER (grid), item);
2505     return 1;
2506 }
2507
2508 /* Add NULL to existing grid. */
2509 int test34f2 (void)
2510 {
2511     GtkWidget *grid;
2512     GtkWidget *item;
2513     grid = hildon_grid_new ();
2514     item = hildon_grid_item_new (VALID_ICON);
2515     gtk_container_add (GTK_CONTAINER (grid), NULL);
2516     return 1;
2517 }
2518
2519 /* Add something to existing grid. */
2520 int test34f3 (void)
2521 {
2522     GtkWidget *grid;
2523     GtkWidget *item;
2524     grid = hildon_grid_new ();
2525     item = gtk_button_new ();
2526     gtk_container_add (GTK_CONTAINER (grid), item);
2527     return 1;
2528 }
2529
2530 /* Add something to non-existing grid. */
2531 int test34f4 (void)
2532 {
2533     GtkWidget *item;
2534     item = gtk_button_new ();
2535     gtk_container_add (NULL, item);
2536     return 1;
2537 }
2538
2539 /* Add something to invalid grid. */
2540 int test34f5 (void)
2541 {
2542     GtkWidget *item;
2543     item = gtk_button_new ();
2544     gtk_container_add (GTK_CONTAINER (item), item);
2545     return 1;
2546 }
2547
2548 /* Remove item from grid. */
2549 int test34g1 (void)
2550 {
2551     GtkWidget *grid;
2552     GtkWidget *item;
2553     grid = hildon_grid_new ();
2554     item = hildon_grid_item_new (VALID_ICON);
2555     gtk_container_add (GTK_CONTAINER (grid), item);
2556     gtk_container_remove (GTK_CONTAINER (grid), item);
2557     return 1;
2558 }
2559
2560 /* Remove non-existing item from grid. */
2561 int test34g2 (void)
2562 {
2563     GtkWidget *grid;
2564     GtkWidget *item;
2565     grid = hildon_grid_new ();
2566     item = hildon_grid_item_new (VALID_ICON);
2567     gtk_container_add (GTK_CONTAINER (grid), item);
2568     item = hildon_grid_item_new (VALID_ICON);
2569     gtk_container_remove (GTK_CONTAINER (grid), item);
2570     return 1;
2571 }
2572
2573 /* Remove NULL from grid. */
2574 int test34g3 (void)
2575 {
2576     GtkWidget *grid;
2577     GtkWidget *item;
2578     grid = hildon_grid_new ();
2579     item = hildon_grid_item_new (VALID_ICON);
2580     gtk_container_add (GTK_CONTAINER (grid), item);
2581     gtk_container_remove (GTK_CONTAINER (grid), NULL);
2582     return 1;
2583 }
2584
2585 /* Remove something from grid. */
2586 int test34g4 (void)
2587 {
2588     GtkWidget *grid;
2589     GtkWidget *item;
2590     grid = hildon_grid_new ();
2591     item = hildon_grid_item_new (VALID_ICON);
2592     gtk_container_add (GTK_CONTAINER (grid), item);
2593     item = gtk_button_new ();
2594     gtk_container_remove (GTK_CONTAINER (grid), item);
2595     return 1;
2596 }
2597
2598 /* Remove something from NULL grid. */
2599 int test34g5 (void)
2600 {
2601     GtkWidget *item;
2602     item = gtk_button_new ();
2603     gtk_container_remove (NULL, item);
2604     return 1;
2605 }
2606
2607 /* Remove something from invalid grid. */
2608 int test34g6 (void)
2609 {
2610     GtkWidget *item0, *item1;
2611     item0 = gtk_button_new ();
2612     item1 = gtk_button_new ();
2613     gtk_container_remove (GTK_CONTAINER (item0), item1);
2614     return 1;
2615 }
2616
2617 /* Set focus. */
2618 int test34h1 (void)
2619 {
2620     GtkWidget *grid;
2621     GtkWidget *item;
2622     grid = hildon_grid_new ();
2623     item = hildon_grid_item_new (VALID_ICON);
2624     gtk_container_add (GTK_CONTAINER (grid), item);
2625     item = hildon_grid_item_new (VALID_ICON);
2626     gtk_container_add (GTK_CONTAINER (grid), item);
2627     gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2628     return 1;
2629 }
2630
2631 /* Set focus to non-existing. */
2632 int test34h2 (void)
2633 {
2634     GtkWidget *grid;
2635     GtkWidget *item;
2636     grid = hildon_grid_new ();
2637     item = hildon_grid_item_new (VALID_ICON);
2638     gtk_container_add (GTK_CONTAINER (grid), item);
2639     item = hildon_grid_item_new (VALID_ICON);
2640     gtk_container_add (GTK_CONTAINER (grid), item);
2641     gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2642     item = hildon_grid_item_new (VALID_ICON);
2643     gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2644     return 1;
2645 }
2646
2647 /* Set focus to NULL. */
2648 int test34h3 (void)
2649 {
2650     GtkWidget *grid;
2651     GtkWidget *item;
2652     grid = hildon_grid_new ();
2653     item = hildon_grid_item_new (VALID_ICON);
2654     gtk_container_add (GTK_CONTAINER (grid), item);
2655     item = hildon_grid_item_new (VALID_ICON);
2656     gtk_container_add (GTK_CONTAINER (grid), item);
2657     gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2658     return 1;
2659 }
2660
2661 /* Set focus to something. */
2662 int test34h4 (void)
2663 {
2664     GtkWidget *grid;
2665     GtkWidget *item;
2666     grid = hildon_grid_new ();
2667     item = hildon_grid_item_new (VALID_ICON);
2668     gtk_container_add (GTK_CONTAINER (grid), item);
2669     item = hildon_grid_item_new (VALID_ICON);
2670     gtk_container_add (GTK_CONTAINER (grid), item);
2671     item = gtk_button_new ();
2672     gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2673     return 1;
2674 }
2675
2676 /* Get focus. */
2677 int test34i1 (void)
2678 {
2679     GtkWidget *grid;
2680     GtkWidget *item;
2681     grid = hildon_grid_new ();
2682     item = hildon_grid_item_new (VALID_ICON);
2683     gtk_container_add (GTK_CONTAINER (grid), item);
2684     item = hildon_grid_item_new (VALID_ICON);
2685     gtk_container_add (GTK_CONTAINER (grid), item);
2686     gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2687     g_assert (GTK_CONTAINER (grid)->focus_child == item);
2688     return 1;
2689 }
2690
2691 /* Get focus (no focused). */
2692 int test34i2 (void)
2693 {
2694     GtkWidget *grid;
2695     grid = hildon_grid_new ();
2696     g_assert (GTK_CONTAINER (grid)->focus_child == NULL);
2697     return 1;
2698 }
2699
2700 /* Destroy grid. Has items. */
2701 int test34j1 (void)
2702 {
2703     GtkWidget *grid;
2704     grid = hildon_grid_new ();
2705     gtk_widget_destroy (grid);
2706     return 1;
2707 }
2708
2709 /* Destroy grid. No items. */
2710 int test34j2 (void)
2711 {
2712     GtkWidget *grid;
2713     GtkWidget *item;
2714     grid = hildon_grid_new ();
2715     item = hildon_grid_item_new (VALID_ICON);
2716     gtk_container_add (GTK_CONTAINER (grid), item);
2717     gtk_widget_destroy (grid);
2718     return 1;
2719 }
2720
2721 /* HildonTimeEditor: create editor widget */
2722 int test35a (void){
2723     GtkWidget *editor;
2724     editor = hildon_time_editor_new ();
2725     g_assert (editor);
2726     return 1;
2727 }
2728
2729 /* HildonTimeEditor: set time and check if returned
2730  * time value is same 
2731  */
2732 int test35b (void){
2733     GtkWidget *editor;
2734     guint hour, min, sec;
2735     editor = hildon_time_editor_new ();
2736     hildon_time_editor_set_time (HILDON_TIME_EDITOR (editor), 
2737                                  21, 39, 45);
2738     hildon_time_editor_get_time (HILDON_TIME_EDITOR (editor),
2739                                  &hour, &min, &sec);
2740     g_assert (hour == 21);
2741     g_assert (min == 39);
2742     g_assert (sec ==45);
2743     return 1;
2744 }
2745
2746 /* HildonTimeEditor: enable/disable seconds */
2747 int test35c (void){
2748     GtkWidget *editor;
2749     editor = hildon_time_editor_new ();
2750 #ifndef HILDON_DISABLE_DEPRECATED    
2751     hildon_time_editor_show_seconds (HILDON_TIME_EDITOR (editor), 1);
2752     hildon_time_editor_show_seconds (HILDON_TIME_EDITOR (editor), 0);
2753 #else
2754     hildon_time_editor_set_show_seconds (HILDON_TIME_EDITOR (editor), 1);
2755     hildon_time_editor_set_show_seconds (HILDON_TIME_EDITOR (editor), 0);
2756 #endif
2757     return 1;
2758 }
2759
2760 /* HildonTimeEditor: enable duration mode */
2761 int test35d (void){
2762     GtkWidget *editor;
2763     editor = hildon_time_editor_new ();
2764 #ifndef HILDON_DISABLE_DEPRECATED    
2765     hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2766                                              1);
2767 #else
2768     hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2769                                              1);
2770 #endif
2771     return 1;
2772 }
2773
2774 /* HildonTimeEditor: set duration range and check values
2775  * against returned values 
2776  */
2777 int test35e (void){
2778     GtkWidget *editor;
2779     guint min_seconds, max_seconds;
2780     editor = hildon_time_editor_new ();
2781 #ifndef HILDON_DISABLE_DEPRECATED    
2782     hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2783                                              1);
2784 #else
2785     hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2786                                              1);
2787 #endif
2788     hildon_time_editor_set_duration_range (HILDON_TIME_EDITOR (editor),
2789                                            3600, 14500);
2790     hildon_time_editor_get_duration_range (HILDON_TIME_EDITOR (editor),
2791                                            &min_seconds, &max_seconds);
2792     g_assert (min_seconds == 3600);
2793     g_assert (max_seconds == 14500);
2794     return 1;
2795 }
2796
2797 /* HildonTimeEditor: enable and disable duration modes */
2798 int test35f (void){
2799     GtkWidget *editor;
2800     editor = hildon_time_editor_new ();
2801 #ifndef HILDON_DISABLE_DEPRECATED    
2802     hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2803                                              1);
2804     hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2805                                              0);
2806 #else
2807     hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2808                                              1);
2809     hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2810                                              0);
2811 #endif
2812     return 1;
2813 }
2814
2815 /* HildonTimeEditor: set time and check against
2816  * foo values
2817  */
2818 int test35g (void){
2819     GtkWidget *editor;
2820     guint hour, min, sec;
2821     editor = hildon_time_editor_new ();
2822     hildon_time_editor_set_time (HILDON_TIME_EDITOR (editor), 
2823                                  21, 39, 45);
2824     hildon_time_editor_get_time (HILDON_TIME_EDITOR (editor),
2825                                  &hour, &min, &sec);
2826     g_assert (hour == 13);
2827     g_assert (min == 33);
2828     g_assert (sec ==42);
2829     return 1;
2830 }
2831
2832 /* HildonTimeEditor: set duration range and check values
2833  * against foo values
2834  */
2835 int test35h (void){
2836     GtkWidget *editor;
2837     guint min_seconds, max_seconds;
2838     editor = hildon_time_editor_new ();
2839 #ifndef HILDON_DISABLE_DEPRECATED
2840     hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2841                                              1);
2842 #else
2843     hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2844                                              1);
2845 #endif
2846     hildon_time_editor_set_duration_range (HILDON_TIME_EDITOR (editor),
2847                                            3600, 14500);
2848     hildon_time_editor_get_duration_range (HILDON_TIME_EDITOR (editor),
2849                                            &min_seconds, &max_seconds);
2850     g_assert (min_seconds == 4600);
2851     g_assert (max_seconds == 15500);
2852     return 1;
2853 }
2854
2855
2856 int test37a()
2857 {
2858      gtk_infoprint_temporarily_disable_wrap ();
2859      gtk_infoprint (NULL, "A suitably long text for testing the wrapping of gtkinfoprint.");
2860      return 1;
2861 }
2862
2863 int test37b()
2864 {
2865      gtk_banner_temporarily_disable_wrap ();
2866      gtk_banner_show_animation (NULL, "A suitably long text for testing the wrapping of gtkinfoprint.");
2867      return 1;
2868 }
2869
2870 int test39a()
2871 {
2872    gchar *name;
2873    GtkWidget *dialog;
2874    
2875    dialog = hildon_name_password_dialog_new(NULL);
2876    name = (gchar *)hildon_name_password_dialog_get_name(HILDON_NAME_PASSWORD_DIALOG(dialog));
2877    g_assert(name);
2878    
2879    return 1;
2880 }
2881
2882 int test39b()
2883 {
2884    gchar *password;
2885    GtkWidget *dialog;
2886    
2887    dialog = hildon_name_password_dialog_new(NULL);
2888    password = (gchar *)hildon_name_password_dialog_get_password(HILDON_NAME_PASSWORD_DIALOG(dialog));
2889    g_assert(password);
2890    
2891    return 1;
2892 }
2893
2894 int test42 ()
2895 {
2896   GtkWidget *entry, *caption;
2897
2898   entry = gtk_entry_new ();
2899   caption = hildon_caption_new (NULL /* group */,
2900                                 "caption text",
2901                                 GTK_WIDGET(entry), NULL,
2902                                 HILDON_CAPTION_OPTIONAL /* flag */);
2903
2904   g_assert (caption);
2905   return 1;
2906 }
2907
2908 int test43 ()
2909 {
2910   GtkWidget *dialog;
2911
2912   dialog = hildon_get_password_dialog_new (NULL, TRUE);
2913   g_assert (dialog);
2914
2915   dialog = hildon_get_password_dialog_new (NULL, FALSE);
2916   g_assert (dialog);
2917
2918   return 1;
2919 }
2920
2921 int test44 ()
2922 {
2923   GtkWidget *dialog;
2924
2925   dialog = hildon_get_password_dialog_new_with_default (NULL, "seekrit",
2926                                                         TRUE);
2927   g_assert (dialog);
2928
2929   dialog = hildon_get_password_dialog_new_with_default (NULL, "seekrit",
2930                                                         FALSE);
2931   g_assert (dialog);
2932
2933   return 1;
2934 }
2935
2936 int test45 ()
2937 {
2938   GtkWidget *dialog;
2939
2940   dialog = hildon_calendar_popup_new (NULL, 1973, 5, 11);
2941
2942   g_assert (dialog);
2943
2944   return 1;
2945 }
2946
2947 int test46 ()
2948 {
2949   GtkWidget *dialog;
2950
2951   dialog = hildon_add_home_dialog_new (NULL, "oldname", "newname");
2952
2953   g_assert (dialog);
2954
2955   dialog = hildon_add_home_dialog_new (NULL, "oldname", NULL);
2956
2957   g_assert (dialog);
2958
2959   return 1;
2960 }
2961
2962
2963 testcase tcases[] =
2964 {
2965     {*test1a, "hildon_controlbar_new", EXPECT_OK},
2966     {*test1b, "hildon_controlbar_get/set_max", EXPECT_OK},
2967     {*test1c, "hildon_controlbar_get/set_value", EXPECT_OK},
2968     {*test1d, "gtk_widget_destroy", EXPECT_OK},
2969     {*test1e, "hildon_controlbar_get/set_min", EXPECT_OK},
2970     {*test1f, "hildon_controlbar_set_range", EXPECT_OK},
2971     {*test1g, "hildon_controlbar_set/get_range", EXPECT_OK},
2972     {*test1h, "hildon_controlbar_range/set/get_value (min)", EXPECT_OK},
2973     {*test1i, "hildon_controlbar_range/set/get_value (max)", EXPECT_OK},
2974     {*test2a, "hildon_seekbar_new", EXPECT_OK},
2975     {*test2b, "hildon_seekbar_get/set_total_time", EXPECT_OK},
2976     {*test2c, "hildon_seekbar_get/set_position", EXPECT_OK},
2977     {*test2d, "gtk_widget_destroy", EXPECT_OK},
2978     {*test2e, "hildon_seekbat_get/set_fraction", EXPECT_OK},
2979     {*test3a, "gtk_infoprint system (something)", EXPECT_OK},
2980     {*test3b, "gtk_infoprint system (NULL)", EXPECT_OK},
2981     {*test3c, "gtk_infoprint_with_icon_stock (VALID ICON)", EXPECT_OK},
2982     {*test3d, "gtk_infoprint_with_icon_stock (EMPTY STRING)", EXPECT_OK},
2983     {*test3e, "gtk_infoprint_with_icon_stock (NULL STRING)", EXPECT_OK},
2984     {*test3f, "gtk_infoprintf (something)", EXPECT_OK},
2985     {*test3g, "gtk_infoprintf (NULL)", EXPECT_OK},
2986     {*test3h, "gtk_confirmation_banner (Somestring, NULL STRING)", EXPECT_OK},
2987     {*test3i, "gtk_confirmation_banner (Somestring, NULL)", EXPECT_OK},
2988     {*test3j, "gtk_banner_show_animation", EXPECT_OK},
2989     {*test3k, "gtk_banner_show_animation with set_fraction", EXPECT_OK},
2990     /*{*test3l, "gtk_banner_show_animation with two banner_closes", EXPECT_ASSERT},*/
2991     {*test3m, "gtk_banner_show_animation with destroy window", EXPECT_OK},
2992     {*test3n, "gtk_banner_show_bar", EXPECT_OK},
2993     {*test3o, "gtk_banner_show_bar with destroy window", EXPECT_OK},
2994     {*test3p, "gtk_banner_show_bar & close with null parent", EXPECT_OK},
2995     {*test3q, "gtk_banner_set_text with null parent", EXPECT_OK},
2996     {*test3r, "gtk_banner_set_fraction with null parent", EXPECT_OK},
2997     {*test3s, "gtk_banner_close with null parent", EXPECT_OK},
2998     {*test3t, "gtk_banner_set_fraction with invalid fraction", EXPECT_ASSERT},
2999     {*test3u, "gtk_banner_set_fraction with invalid fraction", EXPECT_ASSERT},
3000     {*test3v, "gtk_banner_show_animation & close with null parent", EXPECT_OK},
3001     {*test4a, "hildon_note_new_confirmation", EXPECT_OK},
3002     {*test4b, "hildon_note_new_confirmation_with_icon_stock", EXPECT_OK},
3003     {*test4c, "hildon_new_confirmation_add_buttons", EXPECT_OK},
3004     {*test4d, ".._new_confirmation: set_button_text", EXPECT_OK},
3005     {*test4e, "hildon_note_new_information", EXPECT_OK},
3006     {*test4f, "hildon_note_new_information_with_icon_stock", EXPECT_OK},
3007     {*test4g, ".._new_information: set_button_text", EXPECT_OK},
3008     /*    {*test4h, "hildon_note_new_cancel", EXPECT_OK},*/
3009     /*    {*test4i, ".._new_cancel: set_button_text", EXPECT_OK},*/
3010     {*test4j, "hildon_note_new_cancel_with_progress_bar", EXPECT_OK},
3011     {*test4k, ".._cancel_with_progress_bar: set_button_text", EXPECT_OK},
3012     {*test4l, "destroy note widgets", EXPECT_OK},
3013     
3014     {*test6a, "hildon_volumebar_new (horizontal)", EXPECT_OK},
3015     {*test6b, "hildon_volumebar_new (vertical)", EXPECT_OK},
3016     {*test6c, "hildon_volumebar_get/set_level", EXPECT_OK},
3017     {*test6d, "hildon_volumebar_get/set_mute", EXPECT_OK},
3018     {*test6e, "gtk_widget_destroy", EXPECT_OK},
3019     {*test10a, "hildon_weekday_picker_new", EXPECT_OK},
3020     {*test11a, "hildon_weekday_picker_{,un,is}set", EXPECT_OK},
3021     {*test11b, "hildon_weekday_picker_set: null", EXPECT_ASSERT},
3022     {*test11c, "hildon_weekday_picker_unset: null", EXPECT_ASSERT},
3023     {*test11d, "hildon_weekday_picker_isset: null", EXPECT_ASSERT},
3024     {*test12a, "hildon_weekday_picker_toggle_day", EXPECT_OK},
3025     {*test12b, "hildon_weekday_picker_toggle_day: null", EXPECT_ASSERT},
3026     {*test12c, "hildon_weekday_picker_set_all/unset_all", EXPECT_OK},
3027     {*test13a, "htp_editor_new: ok", EXPECT_OK},
3028     {*test13b, "htp_editor_new: inv", EXPECT_ASSERT},
3029     {*test14a, "htp_editor_set_editable: ok", EXPECT_OK},
3030     {*test14b, "htp_editor_set_editable: null", EXPECT_ASSERT},
3031     {*test15a, "htp_editor_set_show_plus: ok", EXPECT_OK},
3032     {*test15b, "htp_editor_set_show_plus: null", EXPECT_ASSERT},
3033     {*test15c, "htp_editor_get_show_plus: null", EXPECT_ASSERT},
3034     {*test15d, "htp_editor_set_show_border: ok", EXPECT_OK},
3035     {*test15e, "htp_editor_set_show_border: null", EXPECT_ASSERT},
3036     {*test15f, "htp_editor_get_show_border: null", EXPECT_ASSERT},
3037     {*test16a, "htp_editor_set_widths: ok", EXPECT_OK},
3038     {*test16b, "htp_editor_set_widths: null", EXPECT_ASSERT},
3039     {*test17a, "htp_editor_set/get_country: ok", EXPECT_OK},
3040     {*test17b, "htp_editor_set/get_country: inv", EXPECT_OK},
3041     {*test17c, "htp_editor_set_country: null", EXPECT_ASSERT},
3042     {*test17d, "htp_editor_get_country: null", EXPECT_ASSERT},
3043     {*test18a, "htp_editor_set/get_area: ok", EXPECT_OK},
3044     {*test18b, "htp_editor_set/get_area: inv", EXPECT_OK},
3045     {*test18c, "htp_editor_set_area: null", EXPECT_ASSERT},
3046     {*test18d, "htp_editor_get_area: null", EXPECT_ASSERT},
3047     {*test19a, "htp_editor_set/get_number: ok", EXPECT_OK},
3048     {*test19b, "htp_editor_set/get_number: FREE", EXPECT_OK},
3049     {*test19c, "htp_editor_set/get_number: inv", EXPECT_OK},
3050     {*test19d, "htp_editor_set_number: null", EXPECT_ASSERT},
3051     {*test19e, "htp_editor_get_number: null", EXPECT_ASSERT},
3052 #if 0
3053     {*test20a, "hildon_find_object: new", EXPECT_OK},
3054     {*test20b, "hildon_find_object: with_options", EXPECT_OK},
3055     {*test20c, "hildon_find_object: get_text", EXPECT_OK},
3056     {*test20d, "hildon_find_object: get_label", EXPECT_OK},
3057 #endif
3058     /*{*test21a, "hildon_find_options: new", EXPECT_OK},
3059     {*test21b, "hildon_find_options: hide_loc", EXPECT_OK},
3060     {*test21c, "hildon_find_options: hide_find_in", EXPECT_OK},
3061     {*test21d, "hildon_find_options: get_location", EXPECT_OK},
3062     {*test21e, "hildon_find_options: get_find", EXPECT_OK},
3063     {*test21f, "hildon_find_options: get_time_period", EXPECT_OK},
3064     {*test21g, "hildon_find_options: get_start", EXPECT_OK},
3065     {*test21h, "hildon_find_options: get_end", EXPECT_OK},
3066     {*test21i, "hildon_find_options: add_custom", EXPECT_OK},
3067     {*test21j, "hildon_find_options: date_matches", EXPECT_ASSERT},*/
3068     {*test22a, "range_editor_new", EXPECT_OK},
3069     {*test22b, "range_editor_new_with_separator", EXPECT_OK},
3070     {*test22c, "range_editor_new_with_separator_null", EXPECT_OK},
3071     {*test22d, "hildon_range_editor_get_range", EXPECT_OK},
3072     {*test22e, "hildon_range_editor_get_range_null", EXPECT_ASSERT},
3073     {*test22f, "hildon_range_editor_get_range_null2", EXPECT_ASSERT},
3074     {*test22g, "hildon_range_editor_get_range_null3", EXPECT_ASSERT},
3075     {*test22h, "hildon_range_editor_get_range_null4", EXPECT_ASSERT},
3076     {*test22i, "hildon_range_editor_set_range", EXPECT_OK},
3077     {*test22j, "hildon_range_editor_set_range_null_editor", EXPECT_ASSERT},
3078     {*test22k, "hildon_range_editor_set_limits", EXPECT_OK},
3079     {*test22l, "hildon_range_editor_set_limits&range", EXPECT_OK},
3080     {*test22m, "hildon_range_editor_set_limits_null", EXPECT_ASSERT},
3081     {*test23a, "hildon_sort_dialog_new", EXPECT_OK},
3082     {*test23b, "hildon_sort_dialog_get_sort_key", EXPECT_OK},
3083     {*test23c, "hildon_sort_dialog_set_sort_key", EXPECT_OK},
3084     {*test23d, "hildon_sort_dialog_add_sort_key", EXPECT_OK},
3085     {*test23e, "hildon_sort_dialog_get_sort_order", EXPECT_OK},
3086     {*test23f, "hildon_sort_dialog_set_sort_order", EXPECT_OK},
3087     {*test23g, "gtk_widget_destroy", EXPECT_OK},
3088     {*test24a, "get_password_dialog. get dialog", EXPECT_OK},
3089     {*test24b, "get_password_dialog. get old dialog", EXPECT_OK},
3090     {*test24c, "get_password_dialog_new_get_password", EXPECT_OK},
3091     {*test24d, "gtk_widget_destroy", EXPECT_OK},
3092     {*test25a, "set_password_dialog. set dialog ", EXPECT_OK},
3093     {*test25b, "set_password_dialog. change dialog", EXPECT_OK},
3094     {*test25c, "set_password_dialog_new_get_password", EXPECT_OK},
3095     {*test25d, "set_password_dialog_new_get_protected", EXPECT_ASSERT},
3096     {*test25e, "gtk_widget_destroy", EXPECT_OK},
3097 #ifndef HILDON_DISABLE_DEPRECATED
3098     {*fsd_set_font, "FontSelectionDialog Set font", EXPECT_OK},
3099     {*fsd_get_font,"FontSelectionDialog Get font", EXPECT_OK},
3100 #endif
3101     {*fsd_set_pretext, "FontSelectionDialog Set preview text", EXPECT_OK},
3102     {*fsd_get_pretext, "FontSelectionDialog Get preview text", EXPECT_OK},
3103     {*test28a, "hildon_number_editor_new", EXPECT_OK},
3104     {*test28b, "hildon_number_editor_get_value", EXPECT_OK},
3105     {*test28c, "hildon_number_editor_set_range", EXPECT_OK},
3106     {*test28d, "hildon_number_editor_set_value", EXPECT_OK},
3107     {*test29a, "hildon_color_selector: set and get red color", EXPECT_OK},
3108     {*test29b, "hildon_color_selector: set and get non-base color", EXPECT_ASSERT},
3109     {*test30a, "hildon_file_handling_note_new_moving", EXPECT_OK},
3110     {*test30b, "hildon_file_handling_note_new_deleting", EXPECT_OK},
3111     {*test30c, "hildon_file_handling_note_new_opening", EXPECT_OK},
3112     {*test30d, "hildon_file_handling_note_new_saving", EXPECT_OK},
3113     {*test31a, "hildon_add_home_dialog_new: ok", EXPECT_OK},
3114     {*test31b, "hildon_add_home_dialog_new: NULL(ok)", EXPECT_OK},
3115     {*test32a, "hildon_rename_dialog: ok", EXPECT_OK},
3116     {*test32b, "hildon_rename_dialog: NULL(ok)", EXPECT_OK},
3117     {*test33a1, "grid_item_new (\"foo\")", EXPECT_OK},
3118     {*test33a2, "grid_item_new (NULL)", EXPECT_OK},
3119     {*test33b1, "grid_item_new_label (\"foo\", \"bar\")", EXPECT_OK},
3120     {*test33b2, "grid_item_new_label (\"foo\", NULL)", EXPECT_OK},
3121     {*test33b3, "grid_item_new_label (NULL, \"bar\")", EXPECT_OK},
3122     {*test33b4, "grid_item_new_label (NULL, NULL)", EXPECT_OK},
3123     {*test33c1, "grid_item_set_emblem (foo, \"bar\")", EXPECT_OK},
3124     {*test33c2, "grid_item_set_emblem (foo, NULL)", EXPECT_OK},
3125     {*test33c3, "grid_item_set_emblem (NULL, \"bar\")", EXPECT_ASSERT},
3126     {*test33c4, "grid_item_set_emblem (NULL, NULL)", EXPECT_ASSERT},
3127     {*test33d1, "grid_item_get_emblem (foo)", EXPECT_OK},
3128     {*test33d2, "grid_item_get_emblem (foo) (no emblem)", EXPECT_ASSERT},
3129     {*test33d3, "grid_item_get_emblem (NULL)", EXPECT_ASSERT},
3130     {*test33e, "grid_item: destroy", EXPECT_OK},
3131     {*test34a, "grid_new ()", EXPECT_OK},
3132     {*test34b1, "grid_set_style (foo, \"bar\")", EXPECT_OK},
3133     {*test34b2, "grid_set_style (foo, NULL)", EXPECT_OK},
3134     {*test34b3, "grid_set_style (NULL, \"foo\")", EXPECT_ASSERT},
3135     {*test34b4, "grid_set_style (NULL, NULL)", EXPECT_ASSERT},
3136     {*test34c1, "grid_get_style (foo)", EXPECT_OK},
3137     {*test34c2, "grid_get_style (foo) (no style)", EXPECT_OK},
3138     {*test34c3, "grid_get_style (NULL)", EXPECT_ASSERT},
3139     {*test34d1, "grid_set_sb_pos (foo, 0)", EXPECT_OK},
3140     {*test34d2, "grid_set_sb_pos (NULL, 0)", EXPECT_ASSERT},
3141     {*test34e1, "grid_get_sb_pos (foo)", EXPECT_OK},
3142     {*test34e2, "grid_get_sb_pos (NULL)", EXPECT_ASSERT},
3143     {*test34f1, "grid_add (grid, item)", EXPECT_OK},
3144     {*test34f2, "grid_add (grid, NULL)", EXPECT_ASSERT},
3145     {*test34f3, "grid_add (grid, something)", EXPECT_ASSERT},
3146     {*test34f4, "grid_add (NULL, whatever)", EXPECT_ASSERT},
3147     {*test34f5, "grid_add (whatever, we)", EXPECT_ASSERT},
3148     {*test34g1, "grid_remove (item) (exist)", EXPECT_OK},
3149     {*test34g2, "grid_remove (item) (non-exist)", EXPECT_ASSERT},
3150     {*test34g3, "grid_remove (NULL)", EXPECT_ASSERT},
3151     {*test34g4, "grid_remove (something)", EXPECT_ASSERT},
3152     {*test34g5, "grid_remove (NULL, some)", EXPECT_ASSERT},
3153     {*test34g6, "grid_remove (some, some)", EXPECT_ASSERT},
3154     {*test34h1, "grid_set_focus (item) (exist)", EXPECT_OK},
3155     {*test34h2, "grid_set_focus (item) (non-exist)", EXPECT_ASSERT},
3156     {*test34h3, "grid_set_focus (NULL)", EXPECT_OK},
3157     {*test34h4, "grid_set_focus (something)", EXPECT_ASSERT},
3158     {*test34i1, "grid: CONTAINER->focus_child (set)", EXPECT_OK},
3159     {*test34i2, "grid: CONTAINER->focus_child (unset)", EXPECT_OK},
3160     {*test34j1, "grid: destroy (items)", EXPECT_OK},
3161     {*test34j2, "grid: destroy (no items)", EXPECT_OK},
3162     {*test35a, "hildon_time_editor_new", EXPECT_OK},
3163     {*test35b, "hildon_time_editor_set/get_time", EXPECT_OK},
3164     {*test35c, "hildon_time_editor_show_seconds", EXPECT_OK},
3165     {*test35d, "hildon_time_editor_enable_duration_mode", EXPECT_OK},
3166     {*test35e, "hildon_time_editor_set/get_duration_range", EXPECT_OK},
3167     {*test35f, "hildon_time_editor_enable_duration_mode (TRUE, FALSE", EXPECT_OK},
3168     {*test35g, "hildon_time_editor_set/get_time with foo value check", EXPECT_ASSERT},
3169     {*test35h, "hildon_time_editor_set/get_duration_range with foo value check", EXPECT_ASSERT},
3170 #if 0
3171     {*test36a, "hildon_find_replace_dialog_new", EXPECT_OK},
3172     {*test36b, "hildon_find_replace_dialog_new_with_options", EXPECT_OK},
3173     {*test36c, "hildon_find_replace_dialog_get_text", EXPECT_OK},
3174     {*test36d, "hildon_find_replace_dialog_get_new_text", EXPECT_OK},
3175 #endif
3176     {*test37a, "gtk_infoprint_temporarily_disable_wrap", EXPECT_OK},
3177     {*test37b, "gtk_banner_temporarily_disable_wrap", EXPECT_OK},
3178     {*test39a, "namepassword dialog get_name", EXPECT_OK},
3179     {*test39b, "namepassword dialog get_password", EXPECT_OK},
3180 /*    {*test38a, "gtk_confirmation_banner (sometext)", EXPECT_OK},
3181     {*test38a, "gtk_confirmation_banner (NULL)", EXPECT_OK},*/
3182
3183     { test42, "hildon_caption_new", EXPECT_OK },
3184     { test43, "hildon_get_password_dialog_new", EXPECT_OK },
3185     { test44, "hildon_get_password_dialog_new_with_default", EXPECT_OK },
3186     { test45, "hildon_calendor_popup_new", EXPECT_OK },
3187     { test46, "hildon_add_home_dialog_new", EXPECT_OK },
3188
3189     {0} /*REMEMBER THE TERMINATING NULL*/
3190 };
3191
3192 /*use EXPECT_ASSERT for the tests that are _meant_ to throw assert so they are 
3193 *considered passed when they throw assert and failed when they do not
3194 */
3195
3196 testcase* get_tests()
3197 {
3198     g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);
3199     return tcases;
3200 }