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