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