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