List bug number.
[hildon] / ut / hildon-widgets_tests.c
1 /*
2  * This file is part of hildon-libs
3  *
4  * Copyright (C) 2005 Nokia Corporation.
5  *
6  * Contact: Luc Pionchon <luc.pionchon@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; either version 2.1 of
11  * the License, or (at your option) any later version.
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-insert-object-dialog.h>
45 #include <hildon-widgets/hildon-number-editor.h>
46 #include <hildon-widgets/hildon-color-selector.h>
47 #include <hildon-widgets/hildon-file-handling-note.h>
48 #include <hildon-widgets/hildon-add-home-dialog.h>
49 #include <hildon-widgets/hildon-grid-item.h>
50 #include <hildon-widgets/hildon-grid.h>
51 #include <hildon-widgets/hildon-time-editor.h>
52 #include <hildon-widgets/hildon-name-password-dialog.h>
53 #include <hildon-widgets/hildon-caption.h>
54 #include <outo.h>
55
56 /* Icon which must exist (HildonGridItem). */
57 #define VALID_ICON  "Help"
58
59 /*prototypes to keep the compiler happy*/
60 testcase *get_tests(void);
61 void init_test(void);
62
63      /* the testfuncs */
64 int test1a(void);
65 int test1b(void);
66 int test1c(void);
67 int test1d(void);
68 int test1e(void);
69 int test1f(void);
70 int test1g(void);
71 int test1h(void);
72 int test1i(void);
73 int test2a(void);
74 int test2b(void);
75 int test2c(void);
76 int test2d(void);
77 int test2e(void);
78 int test3a(void);
79 int test3b(void);
80 int test3c(void);
81 int test3d(void);
82 int test3e(void);
83 int test3f(void);
84 int test3g(void);
85 int test3h(void);
86 int test3i(void);
87 int test3j(void);
88 int test3k(void);
89 /*int test3l(void);*/
90 int test3m(void);
91 int test3n(void);
92 int test3o(void);
93 int test3p(void);
94 int test3q(void);
95 int test3r(void);
96 int test3s(void);
97 int test3t(void);
98 int test3u(void);
99 int test3v(void);
100
101 /* notes */
102 int test4a(void);
103 int test4b(void);
104 int test4c(void);
105 int test4d(void);
106 int test4e(void);
107 int test4f(void);
108 int test4g(void);
109 int test4h(void);
110 int test4i(void);
111 int test4j(void);
112 int test4k(void);
113 int test4l(void);
114
115 /* volumebar */
116 int test6a(void);
117 int test6b(void);
118 int test6c(void);
119 int test6d(void);
120 int test6e(void);
121
122 int test8a(void);
123 int test8b(void);
124 int test8c(void);
125 int test8d(void);
126 int test8e(void);
127 int test8f(void);
128 int test8g(void);
129 int test8h(void);
130 int test8i(void);
131 int test8j(void);
132 int test8k(void);
133
134 /* weekday picker */
135 int test10a(void);
136 int test11a(void);
137 int test11b(void);
138 int test11c(void);
139 int test11d(void);
140 int test12a(void);
141 int test12b(void);
142 int test12c(void);
143
144 /* telephone editor */
145 int test13a(void);
146 int test13b(void);
147 int test14a(void);
148 int test14b(void);
149 int test15a(void);
150 int test15b(void);
151 int test15c(void);
152 int test15d(void);
153 int test15e(void);
154 int test15f(void);
155 int test16a(void);
156 int test16b(void);
157 int test17a(void);
158 int test17b(void);
159 int test17c(void);
160 int test17d(void);
161 int test18a(void);
162 int test18b(void);
163 int test18c(void);
164 int test18d(void);
165 int test19a(void);
166 int test19b(void);
167 int test19c(void);
168 int test19d(void);
169 int test19e(void);
170
171 #if 0
172 /* find object dialog */
173 int test20a(void);
174 int test20b(void);
175 int test20c(void);
176 int test20d(void);
177 #endif
178
179 /* find object options dialog */
180 /*int test21a(void);
181 int test21b(void);
182 int test21c(void);
183 int test21d(void);
184 int test21e(void);
185 int test21f(void);
186 int test21g(void);
187 int test21h(void);
188 int test21i(void);
189 int test21j(void);*/
190
191 /* range editor */
192 int test22a(void);
193 int test22b(void);
194 int test22c(void);
195 int test22d(void);
196 int test22e(void);
197 int test22f(void);
198 int test22g(void);
199 int test22h(void);
200 int test22i(void);
201 int test22j(void);
202 int test22k(void);
203 int test22l(void);
204 int test22m(void);
205
206 /* sort dialog */
207 int test23a(void);
208 int test23b(void);
209 int test23c(void);
210 int test23d(void);
211 int test23e(void);
212 int test23f(void);
213 int test23g(void);
214
215 /* get / get old password dialog */
216 int test24a(void);
217 int test24b(void);
218 int test24c(void);
219 int test24d(void);
220
221 /* set / change password dialog */
222 int test25a(void);
223 int test25b(void);
224 int test25c(void);
225 int test25d(void);
226 int test25e(void);
227
228 /*FontSelectionDialog*/
229 #ifndef HILDON_DISABLE_DEPRECATED
230 int fsd_set_font(void);
231 int fsd_get_font(void);
232 #endif
233 int fsd_set_pretext(void);
234 int fsd_get_pretext(void);
235
236 int test27a(void);
237 int test27b(void);
238 int test27c(void);
239
240 /* NumberEditor */
241 int test28a(void);
242 int test28b(void);
243 int test28c(void);
244 int test28d(void);
245
246 /* ColorSelector */
247 int test29a(void);
248 int test29b(void);
249
250 /* FontHandlingNote */
251 int test30a(void);
252 int test30b(void);
253 int test30c(void);
254 int test30d(void);
255
256 /* Add to Home / Rename dialog */
257 int test31a(void);
258 int test31b(void);
259 int test32a(void);
260 int test32b(void);
261
262 /* HildonGridItem */
263 int test33a1(void);
264 int test33a2(void);
265 int test33b1(void);
266 int test33b2(void);
267 int test33b3(void);
268 int test33b4(void);
269 int test33c1(void);
270 int test33c2(void);
271 int test33c3(void);
272 int test33c4(void);
273 int test33d1(void);
274 int test33d2(void);
275 int test33d3(void);
276 int test33e(void);
277
278 /* HildonGrid */
279 int test34a(void);
280 int test34b1(void);
281 int test34b2(void);
282 int test34b3(void);
283 int test34b4(void);
284 int test34c1(void);
285 int test34c2(void);
286 int test34c3(void);
287 int test34d1(void);
288 int test34d2(void);
289 int test34e1(void);
290 int test34e2(void);
291 int test34f1(void);
292 int test34f2(void);
293 int test34f3(void);
294 int test34f4(void);
295 int test34f5(void);
296 int test34g1(void);
297 int test34g2(void);
298 int test34g3(void);
299 int test34g4(void);
300 int test34g5(void);
301 int test34g6(void);
302 int test34h1(void);
303 int test34h2(void);
304 int test34h3(void);
305 int test34h4(void);
306 int test34i1(void);
307 int test34i2(void);
308 int test34j1(void);
309 int test34j2(void);
310
311 /* Time/Duration Editor */
312 int test35a(void);
313 int test35b(void);
314 int test35c(void);
315 int test35d(void);
316 int test35e(void);
317 int test35f(void);
318 int test35g(void);
319 int test35h(void);
320
321 #if 0
322 int test36a(void);
323 int test36b(void);
324 int test36c(void);
325 int test36d(void);
326 #endif
327
328 /* New infoprint/banner functionalities. */
329 int test37a(void);
330 int test37b(void);
331 int test38a(void);
332
333 /* namepassworddialog */
334 int test39a(void);
335 int test39b(void);
336
337 /* file details dialog */
338 #ifndef HILDON_DISABLE_DEPRECATED
339 int test41a(void);
340 #endif
341
342 int test42 (void);
343 int test43 (void);
344 int test44 (void);
345 int test45 (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 /* insert object dialog: new */
2054 int test27a(void){
2055   GtkWidget *dialog;
2056   dialog = hildon_insert_object_dialog_new(NULL);
2057   g_assert(dialog);
2058   return 1;  
2059 }
2060
2061 /* insert object dialog: get_name */
2062 int test27b(void){
2063   const gchar *string;
2064   GtkWidget *dialog;
2065
2066   dialog = hildon_insert_object_dialog_new(NULL);
2067   string = hildon_insert_object_dialog_get_name(HILDON_INSERT_OBJECT_DIALOG(dialog));
2068   g_assert(string);
2069   return 1;
2070 }
2071
2072 /* insert object dialog: get_mime_type */
2073 int test27c(void){
2074   const gchar *string;
2075   GtkWidget *dialog;
2076
2077   dialog = hildon_insert_object_dialog_new(NULL);
2078   string = hildon_insert_object_dialog_get_mime_type(HILDON_INSERT_OBJECT_DIALOG(dialog));
2079   g_assert(string);
2080   return 1;
2081 }
2082
2083 /* hildon_number_editor_new */
2084 int test28a(void){
2085   GtkWidget *editor;
2086   gint min = -120;
2087   gint max = 900;
2088
2089   editor = hildon_number_editor_new (min, max);
2090   g_assert(editor);
2091
2092   return 1;
2093 }
2094
2095 /* hildon_number_editor_get_value  */
2096 int test28b(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   value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2104   g_assert (value == max);
2105
2106   return 1;
2107 }
2108
2109 /* hildon_number_editor_set_range  */
2110 int test28c(void){
2111   GtkWidget *editor;
2112   gint min = 450;
2113   gint max = 7500;
2114   gint value;
2115
2116   editor = hildon_number_editor_new (min, max);
2117   hildon_number_editor_set_range (HILDON_NUMBER_EDITOR (editor), 30, 80);
2118   value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2119   g_assert (value == 80);
2120
2121   return 1;
2122 }
2123
2124 /* hildon_number_editor_set_value */
2125 int test28d(void){
2126   GtkWidget *editor;
2127   gint min = 450;
2128   gint max = 7500;
2129   gint value;
2130
2131   editor = hildon_number_editor_new (min, max);
2132   hildon_number_editor_set_value (HILDON_NUMBER_EDITOR (editor), 3450);
2133   value = hildon_number_editor_get_value (HILDON_NUMBER_EDITOR(editor));
2134   g_assert (value == 3450);
2135
2136 return 1;
2137 }
2138
2139 /* Hildon-Color-Selector: 
2140     hildon_color_selector_new() 
2141     with base color
2142  */ 
2143 int test29a(void){
2144   GtkWidget *colselector;
2145   GdkColor redcolor = {0, 65535, 0, 0 };
2146   GdkColor *color;
2147
2148   colselector = hildon_color_selector_new( NULL );
2149
2150   hildon_color_selector_set_color( HILDON_COLOR_SELECTOR(colselector), &(redcolor) );
2151   color = hildon_color_selector_get_color( HILDON_COLOR_SELECTOR(colselector) );
2152
2153   g_assert( colselector );
2154   g_assert( redcolor.pixel == color->pixel );
2155   g_assert( redcolor.red   == color->red   );
2156   g_assert( redcolor.green == color->green );
2157   g_assert( redcolor.blue  == color->blue  );
2158
2159   g_free(color);
2160   gtk_widget_destroy ( colselector );   
2161
2162   return 1;
2163 }
2164 /* Hildon-Color-Selector: 
2165    HildonColorSelector with non-base color
2166  */ 
2167 int test29b(void){
2168
2169   HildonColorSelector *colorsel;
2170   GtkWidget *obj_self;
2171   GdkColor mixedcolor = { 0, 7281, 21845, 65535 };   
2172   GdkColor *color;
2173
2174   obj_self =  hildon_color_selector_new( NULL );
2175   colorsel = HILDON_COLOR_SELECTOR ( obj_self  );
2176
2177   hildon_color_selector_set_color( colorsel, &mixedcolor );
2178   color = hildon_color_selector_get_color( colorsel );  
2179
2180   g_assert( colorsel );
2181   g_assert( color->pixel == 0 );
2182   g_assert( color->red   == 7281 );
2183   g_assert( color->green == 21845 );
2184   g_assert( color->blue  == 65535 ); 
2185
2186   g_free( color ); 
2187   g_object_unref ( obj_self );
2188   gtk_widget_destroy( GTK_WIDGET(colorsel) );
2189   
2190   return 1;
2191 }
2192
2193 /* hildon_file_handling_note_new_moving */
2194 int test30a(void){
2195
2196    GtkWidget *file_note;
2197   
2198    file_note = hildon_file_handling_note_new_moving (NULL);
2199    hildon_file_handling_note_set_fraction (HILDON_FILE_HANDLING_NOTE(file_note), 0.7);
2200
2201    g_assert (file_note);
2202   
2203    return 1;
2204 }
2205
2206 /* hildon_file_handling_note_new_deleting */
2207 int test30b(void){
2208     
2209    GtkWidget *file_note;
2210   
2211    file_note = hildon_file_handling_note_new_deleting (NULL);
2212    hildon_file_handling_note_set_counter_and_name (HILDON_FILE_HANDLING_NOTE (file_note), 
2213                                                    1, 2, "bar.txt");
2214    hildon_file_handling_note_set_counter_and_name (HILDON_FILE_HANDLING_NOTE (file_note), 
2215                                                    2, 2, "foo.txt"); 
2216    g_assert (file_note);
2217   
2218    return 1;
2219 }
2220
2221 /* hildon_file_handling_note_new_opening */
2222 int test30c(void){
2223     
2224    GtkWidget *file_note;
2225   
2226    file_note = hildon_file_handling_note_new_opening (NULL);
2227    hildon_file_handling_note_set_name (HILDON_FILE_HANDLING_NOTE (file_note),
2228    "baz.txt");
2229    g_assert (file_note);
2230   
2231    return 1;
2232 }
2233
2234 /* hildon_file_handling_note_new_saving */
2235 int test30d(void){
2236     
2237    GtkWidget *file_note;
2238   
2239    file_note = hildon_file_handling_note_new_saving (NULL);
2240    hildon_file_handling_note_set_fraction (HILDON_FILE_HANDLING_NOTE (file_note), 0.7);
2241    g_assert (file_note);
2242   
2243    return 1;
2244 }
2245
2246 /* Add to Home dialog new: ok parameters */
2247 int test31a(void){
2248     GtkWidget *d;
2249     
2250     d = hildon_add_home_dialog_new( NULL, "name" , NULL);
2251     g_assert( d );
2252
2253     return 1;
2254 }
2255
2256 /* Add to Home dialog new: NULL parameter (is ok) */
2257 int test31b(void){
2258     GtkWidget *d;
2259     
2260     d = hildon_add_home_dialog_new( NULL, NULL, NULL );
2261     g_assert( d );
2262
2263     return 1;
2264 }
2265
2266 /* Rename dialog new: ok parameters */
2267 int test32a(void){
2268     GtkWidget *d;
2269     
2270     d = hildon_add_home_dialog_new( NULL, "name", "newname" );
2271     g_assert( d );
2272
2273     return 1;
2274 }
2275
2276 /* Rename dialog new: NULL parameter (is ok) */
2277 int test32b(void){
2278     GtkWidget *d;
2279     
2280     d = hildon_add_home_dialog_new( NULL, NULL, "newname" );
2281     g_assert( d );
2282
2283     return 1;
2284 }
2285
2286 /* Create item with icon basename. */
2287 int test33a1 (void)
2288 {
2289     /* If test fails, first see if icon exists. */
2290     GtkWidget *item;
2291     item = hildon_grid_item_new (VALID_ICON);
2292     g_assert (item);
2293     return 1;
2294 }
2295
2296 /* Create item without icon basename. */
2297 int test33a2 (void)
2298 {
2299     GtkWidget *item;
2300     item = hildon_grid_item_new (NULL);
2301     g_assert (item);
2302     return 1;
2303 }
2304
2305 /* Create item with icon basename and label. */
2306 int test33b1 (void)
2307 {
2308     /* If test fails, first see if icon exists. */
2309     GtkWidget *item;
2310     item = hildon_grid_item_new_with_label (VALID_ICON, "foo");
2311     g_assert (item);
2312     return 1;
2313 }
2314
2315 /* Create item with icon basename but with no label. */
2316 int test33b2 (void)
2317 {
2318     /* If test fails, first see if icon exists. */
2319     GtkWidget *item;
2320     item = hildon_grid_item_new_with_label (VALID_ICON, NULL);
2321     g_assert (item);
2322     return 1;
2323 }
2324 int test33b3 (void)
2325 {
2326     GtkWidget *item;
2327     item = hildon_grid_item_new_with_label (NULL, "foo");
2328     g_assert (item);
2329     return 1;
2330 }
2331
2332 /* Create item without icon basename and without label. */
2333 int test33b4 (void)
2334 {
2335     GtkWidget *item;
2336     item = hildon_grid_item_new_with_label (NULL, NULL);
2337     g_assert (item);
2338     return 1;
2339 }
2340
2341 /* Set emblem type. Non-NULL item, non-NULL emblem. */
2342 int test33c1 (void)
2343 {
2344     /* If test fails, first see if icon exists. */
2345     GtkWidget *item;
2346     item = hildon_grid_item_new (VALID_ICON);
2347     hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), VALID_ICON);
2348     return 1;
2349 }
2350
2351 /* Set emblem type. Non-NULL item, NULL emblem. */
2352 int test33c2 (void)
2353 {
2354     /* If test fails, first see if icon exists. */
2355     GtkWidget *item;
2356     item = hildon_grid_item_new (VALID_ICON);
2357     hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), NULL);
2358     return 1;
2359 }
2360
2361 /* Set emblem type. NULL item, non-NULL emblem. */
2362 int test33c3 (void)
2363 {
2364     hildon_grid_item_set_emblem_type (NULL, VALID_ICON);
2365     return 1;
2366 }
2367
2368 /* Set emblem type. NULL item, NULL emblem. */
2369 int test33c4 (void)
2370 {
2371     hildon_grid_item_set_emblem_type (NULL, NULL);
2372     return 1;
2373 }
2374
2375 /* Get emblem type from existing item - has emblem. */
2376 int test33d1 (void)
2377 {
2378     /* If test fails, first see if icon exists. */
2379     GtkWidget *item;
2380     const gchar *type;
2381     item = hildon_grid_item_new (VALID_ICON);
2382     hildon_grid_item_set_emblem_type (HILDON_GRID_ITEM (item), VALID_ICON);
2383     type = hildon_grid_item_get_emblem_type (HILDON_GRID_ITEM (item));
2384     g_assert (type);
2385     return 1;
2386 }
2387
2388 /* Get emblem type from existing item - has no emblem. */
2389 int test33d2 (void)
2390 {
2391     /* If test fails, first see if icon exists. */
2392     GtkWidget *item;
2393     const gchar *type;
2394     item = hildon_grid_item_new (VALID_ICON);
2395     type = hildon_grid_item_get_emblem_type (HILDON_GRID_ITEM (item));
2396     g_assert (type != NULL);
2397     return 1;
2398 }
2399
2400 /* Get emblem type from non-existing item. */
2401 int test33d3 (void)
2402 {
2403     const gchar *type;
2404     type = hildon_grid_item_get_emblem_type (NULL);
2405     g_assert (type != NULL);
2406     return 1;
2407 }
2408
2409 /* Destroy griditem. */
2410 int test33e(void)
2411 {
2412     GtkWidget *item;
2413     item = hildon_grid_item_new (VALID_ICON);
2414     gtk_widget_destroy (item);
2415     return 1;
2416 }
2417
2418 /* Create new grid. */
2419 int test34a (void)
2420 {
2421     GtkWidget *grid;
2422     grid = hildon_grid_new ();
2423     g_assert (grid);
2424     return 1;
2425 }
2426
2427 /* Set grid style. */
2428 int test34b1 (void)
2429 {
2430     GtkWidget *grid;
2431     grid = hildon_grid_new ();
2432     hildon_grid_set_style (HILDON_GRID (grid), "bar");
2433     return 1;
2434 }
2435
2436 /* Set grid style (no style). */
2437 int test34b2 (void)
2438 {
2439     GtkWidget *grid;
2440     grid = hildon_grid_new ();
2441     hildon_grid_set_style (HILDON_GRID (grid), NULL);
2442     return 1;
2443 }
2444
2445 /* Set grid style. Invalid grid. */
2446 int test34b3 (void)
2447 {
2448     hildon_grid_set_style (NULL, "bar");
2449     return 1;
2450 }
2451
2452 /* Set grid style. Invalid grid, no style. */
2453 int test34b4 (void)
2454 {
2455     hildon_grid_set_style (NULL, NULL);
2456     return 1;
2457 }
2458
2459 /* Get grid style. Valid grid, has style. */
2460 int test34c1 (void)
2461 {
2462     GtkWidget *grid;
2463     const gchar *style;
2464     grid = hildon_grid_new ();
2465     hildon_grid_set_style (HILDON_GRID (grid), "foo");
2466     style = hildon_grid_get_style (HILDON_GRID (grid));
2467     g_assert (style);
2468     return 1;
2469 }
2470
2471 /* Get grid style. Valid grid, has no style. */
2472 int test34c2 (void)
2473 {
2474     GtkWidget *grid;
2475     const gchar *style;
2476     grid = hildon_grid_new ();
2477     hildon_grid_set_style (HILDON_GRID (grid), NULL);
2478     style = hildon_grid_get_style (HILDON_GRID (grid));
2479     g_assert (style != NULL && strcmp (style, "HildonGrid") == 0);
2480     return 1;
2481 }
2482
2483 /* Get grid style. Invalid grid. */
2484 int test34c3 (void)
2485 {
2486     const gchar *style;
2487     style = hildon_grid_get_style (NULL);
2488     g_assert (style);
2489     return 1;
2490 }
2491
2492 /* Set grid scrollbar position. Valid grid. */
2493 int test34d1 (void)
2494 {
2495     GtkWidget *grid;
2496     grid = hildon_grid_new ();
2497     hildon_grid_set_scrollbar_pos (HILDON_GRID (grid), 0);
2498     return 1;
2499 }
2500
2501 /* Set grid scrollbar position. Invalid grid. */
2502 int test34d2 (void)
2503 {
2504     hildon_grid_set_scrollbar_pos (NULL, 0);
2505     return 1;
2506 }
2507
2508 /* Get grid scrollbar position. Valid grid. */
2509 int test34e1 (void)
2510 {
2511     GtkWidget *grid;
2512     gint pos;
2513     grid = hildon_grid_new ();
2514     pos = hildon_grid_get_scrollbar_pos (HILDON_GRID (grid));
2515     return 1;
2516 }
2517
2518 /* Get grid scrollbar position. Inalid grid. */
2519 int test34e2 (void)
2520 {
2521     gint pos;
2522     pos = hildon_grid_get_scrollbar_pos (NULL);
2523     return 1;
2524 }
2525
2526 /* Add item to existing grid. */
2527 int test34f1 (void)
2528 {
2529     GtkWidget *grid;
2530     GtkWidget *item;
2531     grid = hildon_grid_new ();
2532     item = hildon_grid_item_new (VALID_ICON);
2533     gtk_container_add (GTK_CONTAINER (grid), item);
2534     return 1;
2535 }
2536
2537 /* Add NULL to existing grid. */
2538 int test34f2 (void)
2539 {
2540     GtkWidget *grid;
2541     GtkWidget *item;
2542     grid = hildon_grid_new ();
2543     item = hildon_grid_item_new (VALID_ICON);
2544     gtk_container_add (GTK_CONTAINER (grid), NULL);
2545     return 1;
2546 }
2547
2548 /* Add something to existing grid. */
2549 int test34f3 (void)
2550 {
2551     GtkWidget *grid;
2552     GtkWidget *item;
2553     grid = hildon_grid_new ();
2554     item = gtk_button_new ();
2555     gtk_container_add (GTK_CONTAINER (grid), item);
2556     return 1;
2557 }
2558
2559 /* Add something to non-existing grid. */
2560 int test34f4 (void)
2561 {
2562     GtkWidget *item;
2563     item = gtk_button_new ();
2564     gtk_container_add (NULL, item);
2565     return 1;
2566 }
2567
2568 /* Add something to invalid grid. */
2569 int test34f5 (void)
2570 {
2571     GtkWidget *item;
2572     item = gtk_button_new ();
2573     gtk_container_add (GTK_CONTAINER (item), item);
2574     return 1;
2575 }
2576
2577 /* Remove item from grid. */
2578 int test34g1 (void)
2579 {
2580     GtkWidget *grid;
2581     GtkWidget *item;
2582     grid = hildon_grid_new ();
2583     item = hildon_grid_item_new (VALID_ICON);
2584     gtk_container_add (GTK_CONTAINER (grid), item);
2585     gtk_container_remove (GTK_CONTAINER (grid), item);
2586     return 1;
2587 }
2588
2589 /* Remove non-existing item from grid. */
2590 int test34g2 (void)
2591 {
2592     GtkWidget *grid;
2593     GtkWidget *item;
2594     grid = hildon_grid_new ();
2595     item = hildon_grid_item_new (VALID_ICON);
2596     gtk_container_add (GTK_CONTAINER (grid), item);
2597     item = hildon_grid_item_new (VALID_ICON);
2598     gtk_container_remove (GTK_CONTAINER (grid), item);
2599     return 1;
2600 }
2601
2602 /* Remove NULL from grid. */
2603 int test34g3 (void)
2604 {
2605     GtkWidget *grid;
2606     GtkWidget *item;
2607     grid = hildon_grid_new ();
2608     item = hildon_grid_item_new (VALID_ICON);
2609     gtk_container_add (GTK_CONTAINER (grid), item);
2610     gtk_container_remove (GTK_CONTAINER (grid), NULL);
2611     return 1;
2612 }
2613
2614 /* Remove something from grid. */
2615 int test34g4 (void)
2616 {
2617     GtkWidget *grid;
2618     GtkWidget *item;
2619     grid = hildon_grid_new ();
2620     item = hildon_grid_item_new (VALID_ICON);
2621     gtk_container_add (GTK_CONTAINER (grid), item);
2622     item = gtk_button_new ();
2623     gtk_container_remove (GTK_CONTAINER (grid), item);
2624     return 1;
2625 }
2626
2627 /* Remove something from NULL grid. */
2628 int test34g5 (void)
2629 {
2630     GtkWidget *item;
2631     item = gtk_button_new ();
2632     gtk_container_remove (NULL, item);
2633     return 1;
2634 }
2635
2636 /* Remove something from invalid grid. */
2637 int test34g6 (void)
2638 {
2639     GtkWidget *item0, *item1;
2640     item0 = gtk_button_new ();
2641     item1 = gtk_button_new ();
2642     gtk_container_remove (GTK_CONTAINER (item0), item1);
2643     return 1;
2644 }
2645
2646 /* Set focus. */
2647 int test34h1 (void)
2648 {
2649     GtkWidget *grid;
2650     GtkWidget *item;
2651     grid = hildon_grid_new ();
2652     item = hildon_grid_item_new (VALID_ICON);
2653     gtk_container_add (GTK_CONTAINER (grid), item);
2654     item = hildon_grid_item_new (VALID_ICON);
2655     gtk_container_add (GTK_CONTAINER (grid), item);
2656     gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2657     return 1;
2658 }
2659
2660 /* Set focus to non-existing. */
2661 int test34h2 (void)
2662 {
2663     GtkWidget *grid;
2664     GtkWidget *item;
2665     grid = hildon_grid_new ();
2666     item = hildon_grid_item_new (VALID_ICON);
2667     gtk_container_add (GTK_CONTAINER (grid), item);
2668     item = hildon_grid_item_new (VALID_ICON);
2669     gtk_container_add (GTK_CONTAINER (grid), item);
2670     gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2671     item = hildon_grid_item_new (VALID_ICON);
2672     gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2673     return 1;
2674 }
2675
2676 /* Set focus to NULL. */
2677 int test34h3 (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     return 1;
2688 }
2689
2690 /* Set focus to something. */
2691 int test34h4 (void)
2692 {
2693     GtkWidget *grid;
2694     GtkWidget *item;
2695     grid = hildon_grid_new ();
2696     item = hildon_grid_item_new (VALID_ICON);
2697     gtk_container_add (GTK_CONTAINER (grid), item);
2698     item = hildon_grid_item_new (VALID_ICON);
2699     gtk_container_add (GTK_CONTAINER (grid), item);
2700     item = gtk_button_new ();
2701     gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2702     return 1;
2703 }
2704
2705 /* Get focus. */
2706 int test34i1 (void)
2707 {
2708     GtkWidget *grid;
2709     GtkWidget *item;
2710     grid = hildon_grid_new ();
2711     item = hildon_grid_item_new (VALID_ICON);
2712     gtk_container_add (GTK_CONTAINER (grid), item);
2713     item = hildon_grid_item_new (VALID_ICON);
2714     gtk_container_add (GTK_CONTAINER (grid), item);
2715     gtk_container_set_focus_child (GTK_CONTAINER (grid), item);
2716     g_assert (GTK_CONTAINER (grid)->focus_child == item);
2717     return 1;
2718 }
2719
2720 /* Get focus (no focused). */
2721 int test34i2 (void)
2722 {
2723     GtkWidget *grid;
2724     grid = hildon_grid_new ();
2725     g_assert (GTK_CONTAINER (grid)->focus_child == NULL);
2726     return 1;
2727 }
2728
2729 /* Destroy grid. Has items. */
2730 int test34j1 (void)
2731 {
2732     GtkWidget *grid;
2733     grid = hildon_grid_new ();
2734     gtk_widget_destroy (grid);
2735     return 1;
2736 }
2737
2738 /* Destroy grid. No items. */
2739 int test34j2 (void)
2740 {
2741     GtkWidget *grid;
2742     GtkWidget *item;
2743     grid = hildon_grid_new ();
2744     item = hildon_grid_item_new (VALID_ICON);
2745     gtk_container_add (GTK_CONTAINER (grid), item);
2746     gtk_widget_destroy (grid);
2747     return 1;
2748 }
2749
2750 /* HildonTimeEditor: create editor widget */
2751 int test35a (void){
2752     GtkWidget *editor;
2753     editor = hildon_time_editor_new ();
2754     g_assert (editor);
2755     return 1;
2756 }
2757
2758 /* HildonTimeEditor: set time and check if returned
2759  * time value is same 
2760  */
2761 int test35b (void){
2762     GtkWidget *editor;
2763     guint hour, min, sec;
2764     editor = hildon_time_editor_new ();
2765     hildon_time_editor_set_time (HILDON_TIME_EDITOR (editor), 
2766                                  21, 39, 45);
2767     hildon_time_editor_get_time (HILDON_TIME_EDITOR (editor),
2768                                  &hour, &min, &sec);
2769     g_assert (hour == 21);
2770     g_assert (min == 39);
2771     g_assert (sec ==45);
2772     return 1;
2773 }
2774
2775 /* HildonTimeEditor: enable/disable seconds */
2776 int test35c (void){
2777     GtkWidget *editor;
2778     editor = hildon_time_editor_new ();
2779 #ifndef HILDON_DISABLE_DEPRECATED    
2780     hildon_time_editor_show_seconds (HILDON_TIME_EDITOR (editor), 1);
2781     hildon_time_editor_show_seconds (HILDON_TIME_EDITOR (editor), 0);
2782 #else
2783     hildon_time_editor_set_show_seconds (HILDON_TIME_EDITOR (editor), 1);
2784     hildon_time_editor_set_show_seconds (HILDON_TIME_EDITOR (editor), 0);
2785 #endif
2786     return 1;
2787 }
2788
2789 /* HildonTimeEditor: enable duration mode */
2790 int test35d (void){
2791     GtkWidget *editor;
2792     editor = hildon_time_editor_new ();
2793 #ifndef HILDON_DISABLE_DEPRECATED    
2794     hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2795                                              1);
2796 #else
2797     hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2798                                              1);
2799 #endif
2800     return 1;
2801 }
2802
2803 /* HildonTimeEditor: set duration range and check values
2804  * against returned values 
2805  */
2806 int test35e (void){
2807     GtkWidget *editor;
2808     guint min_seconds, max_seconds;
2809     editor = hildon_time_editor_new ();
2810 #ifndef HILDON_DISABLE_DEPRECATED    
2811     hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2812                                              1);
2813 #else
2814     hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2815                                              1);
2816 #endif
2817     hildon_time_editor_set_duration_range (HILDON_TIME_EDITOR (editor),
2818                                            3600, 14500);
2819     hildon_time_editor_get_duration_range (HILDON_TIME_EDITOR (editor),
2820                                            &min_seconds, &max_seconds);
2821     g_assert (min_seconds == 3600);
2822     g_assert (max_seconds == 14500);
2823     return 1;
2824 }
2825
2826 /* HildonTimeEditor: enable and disable duration modes */
2827 int test35f (void){
2828     GtkWidget *editor;
2829     editor = hildon_time_editor_new ();
2830 #ifndef HILDON_DISABLE_DEPRECATED    
2831     hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2832                                              1);
2833     hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2834                                              0);
2835 #else
2836     hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2837                                              1);
2838     hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2839                                              0);
2840 #endif
2841     return 1;
2842 }
2843
2844 /* HildonTimeEditor: set time and check against
2845  * foo values
2846  */
2847 int test35g (void){
2848     GtkWidget *editor;
2849     guint hour, min, sec;
2850     editor = hildon_time_editor_new ();
2851     hildon_time_editor_set_time (HILDON_TIME_EDITOR (editor), 
2852                                  21, 39, 45);
2853     hildon_time_editor_get_time (HILDON_TIME_EDITOR (editor),
2854                                  &hour, &min, &sec);
2855     g_assert (hour == 13);
2856     g_assert (min == 33);
2857     g_assert (sec ==42);
2858     return 1;
2859 }
2860
2861 /* HildonTimeEditor: set duration range and check values
2862  * against foo values
2863  */
2864 int test35h (void){
2865     GtkWidget *editor;
2866     guint min_seconds, max_seconds;
2867     editor = hildon_time_editor_new ();
2868 #ifndef HILDON_DISABLE_DEPRECATED
2869     hildon_time_editor_enable_duration_mode (HILDON_TIME_EDITOR (editor),
2870                                              1);
2871 #else
2872     hildon_time_editor_set_duration_mode (HILDON_TIME_EDITOR (editor),
2873                                              1);
2874 #endif
2875     hildon_time_editor_set_duration_range (HILDON_TIME_EDITOR (editor),
2876                                            3600, 14500);
2877     hildon_time_editor_get_duration_range (HILDON_TIME_EDITOR (editor),
2878                                            &min_seconds, &max_seconds);
2879     g_assert (min_seconds == 4600);
2880     g_assert (max_seconds == 15500);
2881     return 1;
2882 }
2883
2884
2885 int test37a()
2886 {
2887      gtk_infoprint_temporarily_disable_wrap ();
2888      gtk_infoprint (NULL, "A suitably long text for testing the wrapping of gtkinfoprint.");
2889      return 1;
2890 }
2891
2892 int test37b()
2893 {
2894      gtk_banner_temporarily_disable_wrap ();
2895      gtk_banner_show_animation (NULL, "A suitably long text for testing the wrapping of gtkinfoprint.");
2896      return 1;
2897 }
2898
2899 int test39a()
2900 {
2901    gchar *name;
2902    GtkWidget *dialog;
2903    
2904    dialog = hildon_name_password_dialog_new(NULL);
2905    name = (gchar *)hildon_name_password_dialog_get_name(HILDON_NAME_PASSWORD_DIALOG(dialog));
2906    g_assert(name);
2907    
2908    return 1;
2909 }
2910
2911 int test39b()
2912 {
2913    gchar *password;
2914    GtkWidget *dialog;
2915    
2916    dialog = hildon_name_password_dialog_new(NULL);
2917    password = (gchar *)hildon_name_password_dialog_get_password(HILDON_NAME_PASSWORD_DIALOG(dialog));
2918    g_assert(password);
2919    
2920    return 1;
2921 }
2922
2923 int test42 ()
2924 {
2925   GtkWidget *entry, *caption;
2926
2927   entry = gtk_entry_new ();
2928   caption = hildon_caption_new (NULL /* group */,
2929                                 "caption text",
2930                                 GTK_WIDGET(entry), NULL,
2931                                 HILDON_CAPTION_OPTIONAL /* flag */);
2932
2933   g_assert (caption);
2934   return 1;
2935 }
2936
2937 int test43 ()
2938 {
2939   GtkWidget *dialog;
2940
2941   dialog = hildon_get_password_dialog_new (NULL, TRUE);
2942   g_assert (dialog);
2943
2944   dialog = hildon_get_password_dialog_new (NULL, FALSE);
2945   g_assert (dialog);
2946
2947   return 1;
2948 }
2949
2950 int test44 ()
2951 {
2952   GtkWidget *dialog;
2953
2954   dialog = hildon_get_password_dialog_new_with_default (NULL, "seekrit",
2955                                                         TRUE);
2956   g_assert (dialog);
2957
2958   dialog = hildon_get_password_dialog_new_with_default (NULL, "seekrit",
2959                                                         FALSE);
2960   g_assert (dialog);
2961
2962   return 1;
2963 }
2964
2965 int test45 ()
2966 {
2967   GtkWidget *dialog;
2968
2969   dialog = hildon_calendar_popup_new (NULL, 1973, 5, 11);
2970
2971   g_assert (dialog);
2972
2973   return 1;
2974 }
2975
2976
2977 testcase tcases[] =
2978 {
2979     {*test1a, "hildon_controlbar_new", EXPECT_OK},
2980     {*test1b, "hildon_controlbar_get/set_max", EXPECT_OK},
2981     {*test1c, "hildon_controlbar_get/set_value", EXPECT_OK},
2982     {*test1d, "gtk_widget_destroy", EXPECT_OK},
2983     {*test1e, "hildon_controlbar_get/set_min", EXPECT_OK},
2984     {*test1f, "hildon_controlbar_set_range", EXPECT_OK},
2985     {*test1g, "hildon_controlbar_set/get_range", EXPECT_OK},
2986     {*test1h, "hildon_controlbar_range/set/get_value (min)", EXPECT_OK},
2987     {*test1i, "hildon_controlbar_range/set/get_value (max)", EXPECT_OK},
2988     {*test2a, "hildon_seekbar_new", EXPECT_OK},
2989     {*test2b, "hildon_seekbar_get/set_total_time", EXPECT_OK},
2990     {*test2c, "hildon_seekbar_get/set_position", EXPECT_OK},
2991     {*test2d, "gtk_widget_destroy", EXPECT_OK},
2992     {*test2e, "hildon_seekbat_get/set_fraction", EXPECT_OK},
2993     {*test3a, "gtk_infoprint system (something)", EXPECT_OK},
2994     {*test3b, "gtk_infoprint system (NULL)", EXPECT_OK},
2995     {*test3c, "gtk_infoprint_with_icon_stock (VALID ICON)", EXPECT_OK},
2996     {*test3d, "gtk_infoprint_with_icon_stock (EMPTY STRING)", EXPECT_OK},
2997     {*test3e, "gtk_infoprint_with_icon_stock (NULL STRING)", EXPECT_OK},
2998     {*test3f, "gtk_infoprintf (something)", EXPECT_OK},
2999     {*test3g, "gtk_infoprintf (NULL)", EXPECT_OK},
3000     {*test3h, "gtk_confirmation_banner (Somestring, NULL STRING)", EXPECT_OK},
3001     {*test3i, "gtk_confirmation_banner (Somestring, NULL)", EXPECT_OK},
3002     {*test3j, "gtk_banner_show_animation", EXPECT_OK},
3003     {*test3k, "gtk_banner_show_animation with set_fraction", EXPECT_OK},
3004     /*{*test3l, "gtk_banner_show_animation with two banner_closes", EXPECT_ASSERT},*/
3005     {*test3m, "gtk_banner_show_animation with destroy window", EXPECT_OK},
3006     {*test3n, "gtk_banner_show_bar", EXPECT_OK},
3007     {*test3o, "gtk_banner_show_bar with destroy window", EXPECT_OK},
3008     {*test3p, "gtk_banner_show_bar & close with null parent", EXPECT_OK},
3009     {*test3q, "gtk_banner_set_text with null parent", EXPECT_OK},
3010     {*test3r, "gtk_banner_set_fraction with null parent", EXPECT_OK},
3011     {*test3s, "gtk_banner_close with null parent", EXPECT_OK},
3012     {*test3t, "gtk_banner_set_fraction with invalid fraction", EXPECT_ASSERT},
3013     {*test3u, "gtk_banner_set_fraction with invalid fraction", EXPECT_ASSERT},
3014     {*test3v, "gtk_banner_show_animation & close with null parent", EXPECT_OK},
3015     {*test4a, "hildon_note_new_confirmation", EXPECT_OK},
3016     {*test4b, "hildon_note_new_confirmation_with_icon_stock", EXPECT_OK},
3017     {*test4c, "hildon_new_confirmation_add_buttons", EXPECT_OK},
3018     {*test4d, ".._new_confirmation: set_button_text", EXPECT_OK},
3019     {*test4e, "hildon_note_new_information", EXPECT_OK},
3020     {*test4f, "hildon_note_new_information_with_icon_stock", EXPECT_OK},
3021     {*test4g, ".._new_information: set_button_text", EXPECT_OK},
3022     /*    {*test4h, "hildon_note_new_cancel", EXPECT_OK},*/
3023     /*    {*test4i, ".._new_cancel: set_button_text", EXPECT_OK},*/
3024     {*test4j, "hildon_note_new_cancel_with_progress_bar", EXPECT_OK},
3025     {*test4k, ".._cancel_with_progress_bar: set_button_text", EXPECT_OK},
3026     {*test4l, "destroy note widgets", EXPECT_OK},
3027     
3028     {*test6a, "hildon_volumebar_new (horizontal)", EXPECT_OK},
3029     {*test6b, "hildon_volumebar_new (vertical)", EXPECT_OK},
3030     {*test6c, "hildon_volumebar_get/set_level", EXPECT_OK},
3031     {*test6d, "hildon_volumebar_get/set_mute", EXPECT_OK},
3032     {*test6e, "gtk_widget_destroy", EXPECT_OK},
3033     {*test10a, "hildon_weekday_picker_new", EXPECT_OK},
3034     {*test11a, "hildon_weekday_picker_{,un,is}set", EXPECT_OK},
3035     {*test11b, "hildon_weekday_picker_set: null", EXPECT_ASSERT},
3036     {*test11c, "hildon_weekday_picker_unset: null", EXPECT_ASSERT},
3037     {*test11d, "hildon_weekday_picker_isset: null", EXPECT_ASSERT},
3038     {*test12a, "hildon_weekday_picker_toggle_day", EXPECT_OK},
3039     {*test12b, "hildon_weekday_picker_toggle_day: null", EXPECT_ASSERT},
3040     {*test12c, "hildon_weekday_picker_set_all/unset_all", EXPECT_OK},
3041     {*test13a, "htp_editor_new: ok", EXPECT_OK},
3042     {*test13b, "htp_editor_new: inv", EXPECT_ASSERT},
3043     {*test14a, "htp_editor_set_editable: ok", EXPECT_OK},
3044     {*test14b, "htp_editor_set_editable: null", EXPECT_ASSERT},
3045     {*test15a, "htp_editor_set_show_plus: ok", EXPECT_OK},
3046     {*test15b, "htp_editor_set_show_plus: null", EXPECT_ASSERT},
3047     {*test15c, "htp_editor_get_show_plus: null", EXPECT_ASSERT},
3048     {*test15d, "htp_editor_set_show_border: ok", EXPECT_OK},
3049     {*test15e, "htp_editor_set_show_border: null", EXPECT_ASSERT},
3050     {*test15f, "htp_editor_get_show_border: null", EXPECT_ASSERT},
3051     {*test16a, "htp_editor_set_widths: ok", EXPECT_OK},
3052     {*test16b, "htp_editor_set_widths: null", EXPECT_ASSERT},
3053     {*test17a, "htp_editor_set/get_country: ok", EXPECT_OK},
3054     {*test17b, "htp_editor_set/get_country: inv", EXPECT_OK},
3055     {*test17c, "htp_editor_set_country: null", EXPECT_ASSERT},
3056     {*test17d, "htp_editor_get_country: null", EXPECT_ASSERT},
3057     {*test18a, "htp_editor_set/get_area: ok", EXPECT_OK},
3058     {*test18b, "htp_editor_set/get_area: inv", EXPECT_OK},
3059     {*test18c, "htp_editor_set_area: null", EXPECT_ASSERT},
3060     {*test18d, "htp_editor_get_area: null", EXPECT_ASSERT},
3061     {*test19a, "htp_editor_set/get_number: ok", EXPECT_OK},
3062     {*test19b, "htp_editor_set/get_number: FREE", EXPECT_OK},
3063     {*test19c, "htp_editor_set/get_number: inv", EXPECT_OK},
3064     {*test19d, "htp_editor_set_number: null", EXPECT_ASSERT},
3065     {*test19e, "htp_editor_get_number: null", EXPECT_ASSERT},
3066 #if 0
3067     {*test20a, "hildon_find_object: new", EXPECT_OK},
3068     {*test20b, "hildon_find_object: with_options", EXPECT_OK},
3069     {*test20c, "hildon_find_object: get_text", EXPECT_OK},
3070     {*test20d, "hildon_find_object: get_label", EXPECT_OK},
3071 #endif
3072     /*{*test21a, "hildon_find_options: new", EXPECT_OK},
3073     {*test21b, "hildon_find_options: hide_loc", EXPECT_OK},
3074     {*test21c, "hildon_find_options: hide_find_in", EXPECT_OK},
3075     {*test21d, "hildon_find_options: get_location", EXPECT_OK},
3076     {*test21e, "hildon_find_options: get_find", EXPECT_OK},
3077     {*test21f, "hildon_find_options: get_time_period", EXPECT_OK},
3078     {*test21g, "hildon_find_options: get_start", EXPECT_OK},
3079     {*test21h, "hildon_find_options: get_end", EXPECT_OK},
3080     {*test21i, "hildon_find_options: add_custom", EXPECT_OK},
3081     {*test21j, "hildon_find_options: date_matches", EXPECT_ASSERT},*/
3082     {*test22a, "range_editor_new", EXPECT_OK},
3083     {*test22b, "range_editor_new_with_separator", EXPECT_OK},
3084     {*test22c, "range_editor_new_with_separator_null", EXPECT_OK},
3085     {*test22d, "hildon_range_editor_get_range", EXPECT_OK},
3086     {*test22e, "hildon_range_editor_get_range_null", EXPECT_ASSERT},
3087     {*test22f, "hildon_range_editor_get_range_null2", EXPECT_ASSERT},
3088     {*test22g, "hildon_range_editor_get_range_null3", EXPECT_ASSERT},
3089     {*test22h, "hildon_range_editor_get_range_null4", EXPECT_ASSERT},
3090     {*test22i, "hildon_range_editor_set_range", EXPECT_OK},
3091     {*test22j, "hildon_range_editor_set_range_null_editor", EXPECT_ASSERT},
3092     {*test22k, "hildon_range_editor_set_limits", EXPECT_OK},
3093     {*test22l, "hildon_range_editor_set_limits&range", EXPECT_OK},
3094     {*test22m, "hildon_range_editor_set_limits_null", EXPECT_ASSERT},
3095     {*test23a, "hildon_sort_dialog_new", EXPECT_OK},
3096     {*test23b, "hildon_sort_dialog_get_sort_key", EXPECT_OK},
3097     {*test23c, "hildon_sort_dialog_set_sort_key", EXPECT_OK},
3098     {*test23d, "hildon_sort_dialog_add_sort_key", EXPECT_OK},
3099     {*test23e, "hildon_sort_dialog_get_sort_order", EXPECT_OK},
3100     {*test23f, "hildon_sort_dialog_set_sort_order", EXPECT_OK},
3101     {*test23g, "gtk_widget_destroy", EXPECT_OK},
3102     {*test24a, "get_password_dialog. get dialog", EXPECT_OK},
3103     {*test24b, "get_password_dialog. get old dialog", EXPECT_OK},
3104     {*test24c, "get_password_dialog_new_get_password", EXPECT_OK},
3105     {*test24d, "gtk_widget_destroy", EXPECT_OK},
3106     {*test25a, "set_password_dialog. set dialog ", EXPECT_OK},
3107     {*test25b, "set_password_dialog. change dialog", EXPECT_OK},
3108     {*test25c, "set_password_dialog_new_get_password", EXPECT_OK},
3109     {*test25d, "set_password_dialog_new_get_protected", EXPECT_ASSERT},
3110     {*test25e, "gtk_widget_destroy", EXPECT_OK},
3111 #ifndef HILDON_DISABLE_DEPRECATED
3112     {*fsd_set_font, "FontSelectionDialog Set font", EXPECT_OK},
3113     {*fsd_get_font,"FontSelectionDialog Get font", EXPECT_OK},
3114 #endif
3115     {*fsd_set_pretext, "FontSelectionDialog Set preview text", EXPECT_OK},
3116     {*fsd_get_pretext, "FontSelectionDialog Get preview text", EXPECT_OK},
3117     {*test27a, "hildon_insert_object: new", EXPECT_OK},
3118     {*test27b, "hildon_insert_object: get_name", EXPECT_OK},
3119     {*test27c, "hildon_insert_object: get_mime_type", EXPECT_ASSERT},
3120     {*test28a, "hildon_number_editor_new", EXPECT_OK},
3121     {*test28b, "hildon_number_editor_get_value", EXPECT_OK},
3122     {*test28c, "hildon_number_editor_set_range", EXPECT_OK},
3123     {*test28d, "hildon_number_editor_set_value", EXPECT_OK},
3124     {*test29a, "hildon_color_selector: set and get red color", EXPECT_OK},
3125     {*test29b, "hildon_color_selector: set and get non-base color", EXPECT_ASSERT},
3126     {*test30a, "hildon_file_handling_note_new_moving", EXPECT_OK},
3127     {*test30b, "hildon_file_handling_note_new_deleting", EXPECT_OK},
3128     {*test30c, "hildon_file_handling_note_new_opening", EXPECT_OK},
3129     {*test30d, "hildon_file_handling_note_new_saving", EXPECT_OK},
3130     {*test31a, "hildon_add_home_dialog_new: ok", EXPECT_OK},
3131     {*test31b, "hildon_add_home_dialog_new: NULL(ok)", EXPECT_OK},
3132     {*test32a, "hildon_rename_dialog: ok", EXPECT_OK},
3133     {*test32b, "hildon_rename_dialog: NULL(ok)", EXPECT_OK},
3134     {*test33a1, "grid_item_new (\"foo\")", EXPECT_OK},
3135     {*test33a2, "grid_item_new (NULL)", EXPECT_ASSERT},
3136     {*test33b1, "grid_item_new_label (\"foo\", \"bar\")", EXPECT_OK},
3137     {*test33b2, "grid_item_new_label (\"foo\", NULL)", EXPECT_OK},
3138     {*test33b3, "grid_item_new_label (NULL, \"bar\")", EXPECT_ASSERT},
3139     {*test33b4, "grid_item_new_label (NULL, NULL)", EXPECT_ASSERT},
3140     {*test33c1, "grid_item_set_emblem (foo, \"bar\")", EXPECT_OK},
3141     {*test33c2, "grid_item_set_emblem (foo, NULL)", EXPECT_OK},
3142     {*test33c3, "grid_item_set_emblem (NULL, \"bar\")", EXPECT_ASSERT},
3143     {*test33c4, "grid_item_set_emblem (NULL, NULL)", EXPECT_ASSERT},
3144     {*test33d1, "grid_item_get_emblem (foo)", EXPECT_OK},
3145     {*test33d2, "grid_item_get_emblem (foo) (no emblem)", EXPECT_ASSERT},
3146     {*test33d3, "grid_item_get_emblem (NULL)", EXPECT_ASSERT},
3147     {*test33e, "grid_item: destroy", EXPECT_OK},
3148     {*test34a, "grid_new ()", EXPECT_OK},
3149     {*test34b1, "grid_set_style (foo, \"bar\")", EXPECT_OK},
3150     {*test34b2, "grid_set_style (foo, NULL)", EXPECT_OK},
3151     {*test34b3, "grid_set_style (NULL, \"foo\")", EXPECT_ASSERT},
3152     {*test34b4, "grid_set_style (NULL, NULL)", EXPECT_ASSERT},
3153     {*test34c1, "grid_get_style (foo)", EXPECT_OK},
3154     {*test34c2, "grid_get_style (foo) (no style)", EXPECT_OK},
3155     {*test34c3, "grid_get_style (NULL)", EXPECT_ASSERT},
3156     {*test34d1, "grid_set_sb_pos (foo, 0)", EXPECT_OK},
3157     {*test34d2, "grid_set_sb_pos (NULL, 0)", EXPECT_ASSERT},
3158     {*test34e1, "grid_get_sb_pos (foo)", EXPECT_OK},
3159     {*test34e2, "grid_get_sb_pos (NULL)", EXPECT_ASSERT},
3160     {*test34f1, "grid_add (grid, item)", EXPECT_OK},
3161     {*test34f2, "grid_add (grid, NULL)", EXPECT_ASSERT},
3162     {*test34f3, "grid_add (grid, something)", EXPECT_ASSERT},
3163     {*test34f4, "grid_add (NULL, whatever)", EXPECT_ASSERT},
3164     {*test34f5, "grid_add (whatever, we)", EXPECT_ASSERT},
3165     {*test34g1, "grid_remove (item) (exist)", EXPECT_OK},
3166     {*test34g2, "grid_remove (item) (non-exist)", EXPECT_ASSERT},
3167     {*test34g3, "grid_remove (NULL)", EXPECT_ASSERT},
3168     {*test34g4, "grid_remove (something)", EXPECT_ASSERT},
3169     {*test34g5, "grid_remove (NULL, some)", EXPECT_ASSERT},
3170     {*test34g6, "grid_remove (some, some)", EXPECT_ASSERT},
3171     {*test34h1, "grid_set_focus (item) (exist)", EXPECT_OK},
3172     {*test34h2, "grid_set_focus (item) (non-exist)", EXPECT_ASSERT},
3173     {*test34h3, "grid_set_focus (NULL)", EXPECT_OK},
3174     {*test34h4, "grid_set_focus (something)", EXPECT_ASSERT},
3175     {*test34i1, "grid: CONTAINER->focus_child (set)", EXPECT_OK},
3176     {*test34i2, "grid: CONTAINER->focus_child (unset)", EXPECT_OK},
3177     {*test34j1, "grid: destroy (items)", EXPECT_OK},
3178     {*test34j2, "grid: destroy (no items)", EXPECT_OK},
3179     {*test35a, "hildon_time_editor_new", EXPECT_OK},
3180     {*test35b, "hildon_time_editor_set/get_time", EXPECT_OK},
3181     {*test35c, "hildon_time_editor_show_seconds", EXPECT_OK},
3182     {*test35d, "hildon_time_editor_enable_duration_mode", EXPECT_OK},
3183     {*test35e, "hildon_time_editor_set/get_duration_range", EXPECT_OK},
3184     {*test35f, "hildon_time_editor_enable_duration_mode (TRUE, FALSE", EXPECT_OK},
3185     {*test35g, "hildon_time_editor_set/get_time with foo value check", EXPECT_ASSERT},
3186     {*test35h, "hildon_time_editor_set/get_duration_range with foo value check", EXPECT_ASSERT},
3187 #if 0
3188     {*test36a, "hildon_find_replace_dialog_new", EXPECT_OK},
3189     {*test36b, "hildon_find_replace_dialog_new_with_options", EXPECT_OK},
3190     {*test36c, "hildon_find_replace_dialog_get_text", EXPECT_OK},
3191     {*test36d, "hildon_find_replace_dialog_get_new_text", EXPECT_OK},
3192 #endif
3193     {*test37a, "gtk_infoprint_temporarily_disable_wrap", EXPECT_OK},
3194     {*test37b, "gtk_banner_temporarily_disable_wrap", EXPECT_OK},
3195     {*test39a, "namepassword dialog get_name", EXPECT_OK},
3196     {*test39b, "namepassword dialog get_password", EXPECT_OK},
3197 /*    {*test38a, "gtk_confirmation_banner (sometext)", EXPECT_OK},
3198     {*test38a, "gtk_confirmation_banner (NULL)", EXPECT_OK},*/
3199
3200     { test42, "hildon_caption_new", EXPECT_OK },
3201     { test43, "hildon_get_password_dialog_new", EXPECT_OK },
3202     { test44, "hildon_get_password_dialog_new_with_default", EXPECT_OK },
3203     { test45, "hildon_calendor_popup_new", EXPECT_OK },
3204
3205     {0} /*REMEMBER THE TERMINATING NULL*/
3206 };
3207
3208 /*use EXPECT_ASSERT for the tests that are _meant_ to throw assert so they are 
3209 *considered passed when they throw assert and failed when they do not
3210 */
3211
3212 testcase* get_tests()
3213 {
3214     g_log_set_always_fatal (G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING);
3215     return tcases;
3216 }
3217
3218