Add Window::SetLayout method
[platform/core/uifw/dali-adaptor.git] / automated-tests / src / dali-adaptor / utc-Dali-Window.cpp
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 #include <dali-test-suite-utils.h>
19 #include <dali/dali.h>
20 #include <dali/devel-api/adaptor-framework/window-devel.h>
21 #include <dali/internal/system/linux/dali-ecore-x.h>
22
23 using namespace Dali;
24
25 void utc_dali_window_startup(void)
26 {
27   test_return_value = TET_UNDEF;
28 }
29
30 void utc_dali_window_cleanup(void)
31 {
32   test_return_value = TET_PASS;
33 }
34
35 namespace
36 {
37 intptr_t screenId = 0; // intptr_t has the same size as a pointer and is platform independent so this can be returned as a pointer in ecore_x_default_screen_get below without compilation warnings
38
39 } // unnamed namespace
40
41 extern "C"
42 {
43   Ecore_X_Screen* ecore_x_default_screen_get(void)
44   {
45     screenId += 8;
46     return (Ecore_X_Screen*)screenId;
47   }
48
49   void ecore_x_screen_size_get(const Ecore_X_Screen* screen, int* w, int* h)
50   {
51     *w = 100;
52     *h = 100;
53   }
54
55   Ecore_X_Window ecore_x_window_argb_new(Ecore_X_Window parent, int x, int y, int w, int h)
56   {
57     return 0;
58   }
59 }
60
61 int UtcDaliWindowConstructorP(void)
62 {
63   Dali::Window window;
64   DALI_TEST_CHECK(!window);
65   END_TEST;
66 }
67
68 int UtcDaliWindowCopyConstructorP(void)
69 {
70   Dali::Window window;
71   Dali::Window copy(window);
72   DALI_TEST_CHECK(copy == window);
73
74   END_TEST;
75 }
76
77 int UtcDaliWindowConstructorFromInternalPointerN(void)
78 {
79   Internal::Adaptor::Window* internalWindow = NULL;
80   Dali::Window               window(internalWindow);
81   DALI_TEST_CHECK(!window); // Should not reach here!
82
83   END_TEST;
84 }
85
86 int UtcDaliWindowAssignmentOperatorP(void)
87 {
88   const Dali::Window window;
89   Dali::Window       copy;
90   DALI_TEST_CHECK(!copy);
91   copy = window;
92   DALI_TEST_CHECK(copy == window);
93
94   END_TEST;
95 }
96
97 int UtcDaliWindowDestructorP(void)
98 {
99   Dali::Window* window = new Dali::Window();
100   delete window;
101
102   DALI_TEST_CHECK(true);
103   END_TEST;
104 }
105
106 int UtcDaliWindowNewN(void)
107 {
108   // Attempt to create a new window
109   try
110   {
111     PositionSize windowPosition(0, 0, 0, 0);
112     Dali::Window window = Dali::Window::New(windowPosition, "test-window", true);
113
114     tet_result(TET_FAIL);
115   }
116   catch(DaliException& e)
117   {
118     DALI_TEST_ASSERT(e, "Failed to create X window", TEST_LOCATION);
119   }
120
121   // Attempt to create a new window
122   try
123   {
124     PositionSize windowPosition(0, 0, 0, 0);
125     Dali::Window window = Dali::Window::New(windowPosition, "test-window", "test-window-class", true);
126
127     tet_result(TET_FAIL);
128   }
129   catch(DaliException& e)
130   {
131     DALI_TEST_ASSERT(e, "Failed to create X window", TEST_LOCATION);
132   }
133
134   END_TEST;
135 }
136
137 int UtcDaliWindowSetClassN(void)
138 {
139   Dali::Window window;
140   try
141   {
142     window.SetClass("window-name", "window-class");
143     DALI_TEST_CHECK(false); // Should not reach here!
144   }
145   catch(...)
146   {
147     DALI_TEST_CHECK(true);
148   }
149
150   END_TEST;
151 }
152
153 int UtcDaliWindowRaiseN(void)
154 {
155   Dali::Window window;
156   try
157   {
158     window.Raise();
159     DALI_TEST_CHECK(false); // Should not reach here!
160   }
161   catch(...)
162   {
163     DALI_TEST_CHECK(true);
164   }
165
166   END_TEST;
167 }
168
169 int UtcDaliWindowLowerN(void)
170 {
171   Dali::Window window;
172   try
173   {
174     window.Lower();
175     DALI_TEST_CHECK(false); // Should not reach here!
176   }
177   catch(...)
178   {
179     DALI_TEST_CHECK(true);
180   }
181
182   END_TEST;
183 }
184
185 int UtcDaliWindowActivateN(void)
186 {
187   Dali::Window window;
188   try
189   {
190     window.Activate();
191     DALI_TEST_CHECK(false); // Should not reach here!
192   }
193   catch(...)
194   {
195     DALI_TEST_CHECK(true);
196   }
197
198   END_TEST;
199 }
200
201 int UtcDaliWindowMaximizeN(void)
202 {
203   try
204   {
205     Dali::Window instance;
206     DevelWindow::Maximize(instance, true);
207     DALI_TEST_CHECK(false); // Should not reach here!
208   }
209   catch(...)
210   {
211     DALI_TEST_CHECK(true);
212   }
213
214   END_TEST;
215 }
216
217 int UtcDaliWindowIsMaximizedN(void)
218 {
219   try
220   {
221     Dali::Window instance;
222     DevelWindow::IsMaximized(instance);
223     DALI_TEST_CHECK(false); // Should not reach here!
224   }
225   catch(...)
226   {
227     DALI_TEST_CHECK(true);
228   }
229
230   END_TEST;
231 }
232
233 int UtcDaliWindowSetMaximumSizeN(void)
234 {
235   try
236   {
237     Dali::Window             instance;
238     Dali::Window::WindowSize size(100, 100);
239     DevelWindow::SetMaximumSize(instance, size);
240     DALI_TEST_CHECK(false); // Should not reach here!
241   }
242   catch(...)
243   {
244     DALI_TEST_CHECK(true);
245   }
246
247   END_TEST;
248 }
249
250 int UtcDaliWindowMinimizeN(void)
251 {
252   try
253   {
254     Dali::Window instance;
255     DevelWindow::Minimize(instance, true);
256     DALI_TEST_CHECK(false); // Should not reach here!
257   }
258   catch(...)
259   {
260     DALI_TEST_CHECK(true);
261   }
262
263   END_TEST;
264 }
265
266 int UtcDaliWindowIsMinimizedN(void)
267 {
268   try
269   {
270     Dali::Window instance;
271     DevelWindow::IsMinimized(instance);
272     DALI_TEST_CHECK(false); // Should not reach here!
273   }
274   catch(...)
275   {
276     DALI_TEST_CHECK(true);
277   }
278
279   END_TEST;
280 }
281
282 int UtcDaliWindowSetMimimumSizeN(void)
283 {
284   try
285   {
286     Dali::Window             instance;
287     Dali::Window::WindowSize size(100, 100);
288     DevelWindow::SetMimimumSize(instance, size);
289     DALI_TEST_CHECK(false); // Should not reach here!
290   }
291   catch(...)
292   {
293     DALI_TEST_CHECK(true);
294   }
295
296   END_TEST;
297 }
298
299 int UtcDaliWindowAddAvailableOrientationN(void)
300 {
301   Dali::Window window;
302   try
303   {
304     window.AddAvailableOrientation(Dali::WindowOrientation::PORTRAIT);
305     DALI_TEST_CHECK(false); // Should not reach here!
306   }
307   catch(...)
308   {
309     DALI_TEST_CHECK(true);
310   }
311
312   END_TEST;
313 }
314
315 int UtcDaliWindowRemoveAvailableOrientationN(void)
316 {
317   Dali::Window window;
318   try
319   {
320     window.RemoveAvailableOrientation(Dali::WindowOrientation::PORTRAIT);
321     DALI_TEST_CHECK(false); // Should not reach here!
322   }
323   catch(...)
324   {
325     DALI_TEST_CHECK(true);
326   }
327
328   END_TEST;
329 }
330
331 int UtcDaliWindowSetPreferredOrientationN(void)
332 {
333   Dali::Window window;
334   try
335   {
336     window.SetPreferredOrientation(Dali::WindowOrientation::PORTRAIT);
337     DALI_TEST_CHECK(false); // Should not reach here!
338   }
339   catch(...)
340   {
341     DALI_TEST_CHECK(true);
342   }
343
344   END_TEST;
345 }
346
347 int UtcDaliWindowGetPreferredOrientationN(void)
348 {
349   Dali::Window window;
350   try
351   {
352     Dali::WindowOrientation orientation = window.GetPreferredOrientation();
353     DALI_TEST_CHECK(orientation == Dali::WindowOrientation::PORTRAIT); // Should not reach here!
354   }
355   catch(...)
356   {
357     DALI_TEST_CHECK(true);
358   }
359
360   END_TEST;
361 }
362
363 int UtcDaliWindowSetPositionSizeWithOrientationN(void)
364 {
365   Dali::Window window;
366   try
367   {
368     DevelWindow::SetPositionSizeWithOrientation(window, PositionSize(0, 0, 200, 100), Dali::WindowOrientation::PORTRAIT);
369     DALI_TEST_CHECK(false); // Should not reach here!
370   }
371   catch(...)
372   {
373     DALI_TEST_CHECK(true);
374   }
375
376   END_TEST;
377 }
378
379 int UtcDaliWindowGetNativeHandleN(void)
380 {
381   Dali::Window window;
382   try
383   {
384     Dali::Any handle = window.GetNativeHandle();
385     DALI_TEST_CHECK(false); // Should not reach here!
386   }
387   catch(...)
388   {
389     DALI_TEST_CHECK(true);
390   }
391
392   END_TEST;
393 }
394
395 int UtcDaliWindowSetAcceptFocusN(void)
396 {
397   Dali::Window window;
398   try
399   {
400     window.SetAcceptFocus(true);
401     DALI_TEST_CHECK(false); // Should not reach here!
402   }
403   catch(...)
404   {
405     DALI_TEST_CHECK(true);
406   }
407
408   END_TEST;
409 }
410
411 int UtcDaliWindowIsFocusAcceptableN(void)
412 {
413   Dali::Window window;
414   try
415   {
416     window.IsFocusAcceptable();
417     DALI_TEST_CHECK(false); // Should not reach here!
418   }
419   catch(...)
420   {
421     DALI_TEST_CHECK(true);
422   }
423
424   END_TEST;
425 }
426
427 int UtcDaliWindowFocusChangeSignalN(void)
428 {
429   Dali::Window window;
430   try
431   {
432     window.FocusChangeSignal();
433     DALI_TEST_CHECK(false); // Should not reach here!
434   }
435   catch(...)
436   {
437     DALI_TEST_CHECK(true);
438   }
439
440   END_TEST;
441 }
442
443 int UtcDaliWindowSetPositionNegative(void)
444 {
445   Dali::Window instance;
446   try
447   {
448     Dali::Window::WindowPosition arg1;
449     instance.SetPosition(arg1);
450     DALI_TEST_CHECK(false); // Should not get here
451   }
452   catch(...)
453   {
454     DALI_TEST_CHECK(true); // We expect an assert
455   }
456   END_TEST;
457 }
458
459 int UtcDaliWindowResizeSignalNegative(void)
460 {
461   Dali::Window instance;
462   try
463   {
464     instance.ResizeSignal();
465     DALI_TEST_CHECK(false); // Should not get here
466   }
467   catch(...)
468   {
469     DALI_TEST_CHECK(true); // We expect an assert
470   }
471   END_TEST;
472 }
473
474 int UtcDaliWindowSetBrightnessNegative(void)
475 {
476   Dali::Window instance;
477   try
478   {
479     int arg1(0);
480     instance.SetBrightness(arg1);
481     DALI_TEST_CHECK(false); // Should not get here
482   }
483   catch(...)
484   {
485     DALI_TEST_CHECK(true); // We expect an assert
486   }
487   END_TEST;
488 }
489
490 int UtcDaliWindowTouchedSignalNegative(void)
491 {
492   Dali::Window instance;
493   try
494   {
495     instance.TouchedSignal();
496     DALI_TEST_CHECK(false); // Should not get here
497   }
498   catch(...)
499   {
500     DALI_TEST_CHECK(true); // We expect an assert
501   }
502   END_TEST;
503 }
504
505 int UtcDaliWindowKeyEventSignalNegative(void)
506 {
507   Dali::Window instance;
508   try
509   {
510     instance.KeyEventSignal();
511     DALI_TEST_CHECK(false); // Should not get here
512   }
513   catch(...)
514   {
515     DALI_TEST_CHECK(true); // We expect an assert
516   }
517   END_TEST;
518 }
519
520 int UtcDaliWindowSetAcceptFocusNegative(void)
521 {
522   Dali::Window instance;
523   try
524   {
525     bool arg1(false);
526     instance.SetAcceptFocus(arg1);
527     DALI_TEST_CHECK(false); // Should not get here
528   }
529   catch(...)
530   {
531     DALI_TEST_CHECK(true); // We expect an assert
532   }
533   END_TEST;
534 }
535
536 int UtcDaliWindowSetInputRegionNegative(void)
537 {
538   Dali::Window instance;
539   try
540   {
541     Dali::Rect<int> arg1;
542     instance.SetInputRegion(arg1);
543     DALI_TEST_CHECK(false); // Should not get here
544   }
545   catch(...)
546   {
547     DALI_TEST_CHECK(true); // We expect an assert
548   }
549   END_TEST;
550 }
551
552 int UtcDaliWindowSetOpaqueStateNegative(void)
553 {
554   Dali::Window instance;
555   try
556   {
557     bool arg1(false);
558     instance.SetOpaqueState(arg1);
559     DALI_TEST_CHECK(false); // Should not get here
560   }
561   catch(...)
562   {
563     DALI_TEST_CHECK(true); // We expect an assert
564   }
565   END_TEST;
566 }
567
568 int UtcDaliWindowSetTransparencyNegative(void)
569 {
570   Dali::Window instance;
571   try
572   {
573     bool arg1(false);
574     instance.SetTransparency(arg1);
575     DALI_TEST_CHECK(false); // Should not get here
576   }
577   catch(...)
578   {
579     DALI_TEST_CHECK(true); // We expect an assert
580   }
581   END_TEST;
582 }
583
584 int UtcDaliWindowAddAuxiliaryHintNegative(void)
585 {
586   Dali::Window instance;
587   try
588   {
589     std::string arg1;
590     std::string arg2;
591     instance.AddAuxiliaryHint(arg1, arg2);
592     DALI_TEST_CHECK(false); // Should not get here
593   }
594   catch(...)
595   {
596     DALI_TEST_CHECK(true); // We expect an assert
597   }
598   END_TEST;
599 }
600
601 int UtcDaliWindowSetScreenOffModeNegative(void)
602 {
603   Dali::Window instance;
604   try
605   {
606     Dali::WindowScreenOffMode arg1(Dali::WindowScreenOffMode::NEVER);
607     instance.SetScreenOffMode(arg1);
608     DALI_TEST_CHECK(false); // Should not get here
609   }
610   catch(...)
611   {
612     DALI_TEST_CHECK(true); // We expect an assert
613   }
614   END_TEST;
615 }
616
617 int UtcDaliWindowFocusChangeSignalNegative(void)
618 {
619   Dali::Window instance;
620   try
621   {
622     instance.FocusChangeSignal();
623     DALI_TEST_CHECK(false); // Should not get here
624   }
625   catch(...)
626   {
627     DALI_TEST_CHECK(true); // We expect an assert
628   }
629   END_TEST;
630 }
631
632 int UtcDaliWindowGetRenderTaskListNegative(void)
633 {
634   Dali::Window instance;
635   try
636   {
637     instance.GetRenderTaskList();
638     DALI_TEST_CHECK(false); // Should not get here
639   }
640   catch(...)
641   {
642     DALI_TEST_CHECK(true); // We expect an assert
643   }
644   END_TEST;
645 }
646
647 int UtcDaliWindowSetBackgroundColorNegative(void)
648 {
649   Dali::Window instance;
650   try
651   {
652     Dali::Vector4 arg1;
653     instance.SetBackgroundColor(arg1);
654     DALI_TEST_CHECK(false); // Should not get here
655   }
656   catch(...)
657   {
658     DALI_TEST_CHECK(true); // We expect an assert
659   }
660   END_TEST;
661 }
662
663 int UtcDaliWindowRemoveAuxiliaryHintNegative(void)
664 {
665   Dali::Window instance;
666   try
667   {
668     unsigned int arg1(0u);
669     instance.RemoveAuxiliaryHint(arg1);
670     DALI_TEST_CHECK(false); // Should not get here
671   }
672   catch(...)
673   {
674     DALI_TEST_CHECK(true); // We expect an assert
675   }
676   END_TEST;
677 }
678
679 int UtcDaliWindowSetNotificationLevelNegative(void)
680 {
681   Dali::Window instance;
682   try
683   {
684     Dali::WindowNotificationLevel arg1(Dali::WindowNotificationLevel::NONE);
685     instance.SetNotificationLevel(arg1);
686     DALI_TEST_CHECK(false); // Should not get here
687   }
688   catch(...)
689   {
690     DALI_TEST_CHECK(true); // We expect an assert
691   }
692   END_TEST;
693 }
694
695 int UtcDaliWindowSetAuxiliaryHintValueNegative(void)
696 {
697   Dali::Window instance;
698   try
699   {
700     unsigned int arg1(0u);
701     std::string  arg2;
702     instance.SetAuxiliaryHintValue(arg1, arg2);
703     DALI_TEST_CHECK(false); // Should not get here
704   }
705   catch(...)
706   {
707     DALI_TEST_CHECK(true); // We expect an assert
708   }
709   END_TEST;
710 }
711
712 int UtcDaliWindowAddAvailableOrientationNegative(void)
713 {
714   Dali::Window instance;
715   try
716   {
717     Dali::WindowOrientation arg1(Dali::WindowOrientation::PORTRAIT);
718     instance.AddAvailableOrientation(arg1);
719     DALI_TEST_CHECK(false); // Should not get here
720   }
721   catch(...)
722   {
723     DALI_TEST_CHECK(true); // We expect an assert
724   }
725   END_TEST;
726 }
727
728 int UtcDaliWindowGetPreferredOrientationNegative(void)
729 {
730   Dali::Window instance;
731   try
732   {
733     instance.GetPreferredOrientation();
734     DALI_TEST_CHECK(false); // Should not get here
735   }
736   catch(...)
737   {
738     DALI_TEST_CHECK(true); // We expect an assert
739   }
740   END_TEST;
741 }
742
743 int UtcDaliWindowSetPreferredOrientationNegative(void)
744 {
745   Dali::Window instance;
746   try
747   {
748     Dali::WindowOrientation arg1(Dali::WindowOrientation::PORTRAIT);
749     instance.SetPreferredOrientation(arg1);
750     DALI_TEST_CHECK(false); // Should not get here
751   }
752   catch(...)
753   {
754     DALI_TEST_CHECK(true); // We expect an assert
755   }
756   END_TEST;
757 }
758
759 int UtcDaliWindowRemoveAvailableOrientationNegative(void)
760 {
761   Dali::Window instance;
762   try
763   {
764     Dali::WindowOrientation arg1(Dali::WindowOrientation::PORTRAIT);
765     instance.RemoveAvailableOrientation(arg1);
766     DALI_TEST_CHECK(false); // Should not get here
767   }
768   catch(...)
769   {
770     DALI_TEST_CHECK(true); // We expect an assert
771   }
772   END_TEST;
773 }
774
775 int UtcDaliWindowAddNegative(void)
776 {
777   Dali::Window instance;
778   try
779   {
780     Dali::Actor arg1;
781     instance.Add(arg1);
782     DALI_TEST_CHECK(false); // Should not get here
783   }
784   catch(...)
785   {
786     DALI_TEST_CHECK(true); // We expect an assert
787   }
788   END_TEST;
789 }
790
791 int UtcDaliWindowHideNegative(void)
792 {
793   Dali::Window instance;
794   try
795   {
796     instance.Hide();
797     DALI_TEST_CHECK(false); // Should not get here
798   }
799   catch(...)
800   {
801     DALI_TEST_CHECK(true); // We expect an assert
802   }
803   END_TEST;
804 }
805
806 int UtcDaliWindowShowNegative(void)
807 {
808   Dali::Window instance;
809   try
810   {
811     instance.Show();
812     DALI_TEST_CHECK(false); // Should not get here
813   }
814   catch(...)
815   {
816     DALI_TEST_CHECK(true); // We expect an assert
817   }
818   END_TEST;
819 }
820
821 int UtcDaliWindowLowerNegative(void)
822 {
823   Dali::Window instance;
824   try
825   {
826     instance.Lower();
827     DALI_TEST_CHECK(false); // Should not get here
828   }
829   catch(...)
830   {
831     DALI_TEST_CHECK(true); // We expect an assert
832   }
833   END_TEST;
834 }
835
836 int UtcDaliWindowRaiseNegative(void)
837 {
838   Dali::Window instance;
839   try
840   {
841     instance.Raise();
842     DALI_TEST_CHECK(false); // Should not get here
843   }
844   catch(...)
845   {
846     DALI_TEST_CHECK(true); // We expect an assert
847   }
848   END_TEST;
849 }
850
851 int UtcDaliWindowRemoveNegative(void)
852 {
853   Dali::Window instance;
854   try
855   {
856     Dali::Actor arg1;
857     instance.Remove(arg1);
858     DALI_TEST_CHECK(false); // Should not get here
859   }
860   catch(...)
861   {
862     DALI_TEST_CHECK(true); // We expect an assert
863   }
864   END_TEST;
865 }
866
867 int UtcDaliWindowSetSizeNegative(void)
868 {
869   Dali::Window instance;
870   try
871   {
872     Dali::Uint16Pair arg1;
873     instance.SetSize(arg1);
874     DALI_TEST_CHECK(false); // Should not get here
875   }
876   catch(...)
877   {
878     DALI_TEST_CHECK(true); // We expect an assert
879   }
880   END_TEST;
881 }
882
883 int UtcDaliWindowSetTypeNegative(void)
884 {
885   Dali::Window instance;
886   try
887   {
888     Dali::WindowType arg1(Dali::WindowType::NORMAL);
889     instance.SetType(arg1);
890     DALI_TEST_CHECK(false); // Should not get here
891   }
892   catch(...)
893   {
894     DALI_TEST_CHECK(true); // We expect an assert
895   }
896   END_TEST;
897 }
898
899 int UtcDaliWindowActivateNegative(void)
900 {
901   Dali::Window instance;
902   try
903   {
904     instance.Activate();
905     DALI_TEST_CHECK(false); // Should not get here
906   }
907   catch(...)
908   {
909     DALI_TEST_CHECK(true); // We expect an assert
910   }
911   END_TEST;
912 }
913
914 int UtcDaliWindowSetClassNegative(void)
915 {
916   Dali::Window instance;
917   try
918   {
919     std::string arg1;
920     std::string arg2;
921     instance.SetClass(arg1, arg2);
922     DALI_TEST_CHECK(false); // Should not get here
923   }
924   catch(...)
925   {
926     DALI_TEST_CHECK(true); // We expect an assert
927   }
928   END_TEST;
929 }
930
931 int UtcDaliWindowGetPositionNegative(void)
932 {
933   Dali::Window instance;
934   try
935   {
936     instance.GetPosition();
937     DALI_TEST_CHECK(false); // Should not get here
938   }
939   catch(...)
940   {
941     DALI_TEST_CHECK(true); // We expect an assert
942   }
943   END_TEST;
944 }
945
946 int UtcDaliWindowSetLayoutNegative(void)
947 {
948   Dali::Window instance;
949   try
950   {
951     unsigned int arg1(0);
952     instance.SetLayout(arg1, arg1, arg1, arg1, arg1, arg1);
953     DALI_TEST_CHECK(false); // Should not get here
954   }
955   catch(...)
956   {
957     DALI_TEST_CHECK(true); // We expect an assert
958   }
959   END_TEST;
960 }
961
962 int UtcDaliWindowGetRootLayerNegative(void)
963 {
964   Dali::Window instance;
965   try
966   {
967     instance.GetRootLayer();
968     DALI_TEST_CHECK(false); // Should not get here
969   }
970   catch(...)
971   {
972     DALI_TEST_CHECK(true); // We expect an assert
973   }
974   END_TEST;
975 }
976
977 int UtcDaliWindowGetBrightnessNegative(void)
978 {
979   Dali::Window instance;
980   try
981   {
982     instance.GetBrightness();
983     DALI_TEST_CHECK(false); // Should not get here
984   }
985   catch(...)
986   {
987     DALI_TEST_CHECK(true); // We expect an assert
988   }
989   END_TEST;
990 }
991
992 int UtcDaliWindowGetLayerCountNegative(void)
993 {
994   Dali::Window instance;
995   try
996   {
997     instance.GetLayerCount();
998     DALI_TEST_CHECK(false); // Should not get here
999   }
1000   catch(...)
1001   {
1002     DALI_TEST_CHECK(true); // We expect an assert
1003   }
1004   END_TEST;
1005 }
1006
1007 int UtcDaliWindowIsOpaqueStateNegative(void)
1008 {
1009   Dali::Window instance;
1010   try
1011   {
1012     instance.IsOpaqueState();
1013     DALI_TEST_CHECK(false); // Should not get here
1014   }
1015   catch(...)
1016   {
1017     DALI_TEST_CHECK(true); // We expect an assert
1018   }
1019   END_TEST;
1020 }
1021
1022 int UtcDaliWindowGetNativeHandleNegative(void)
1023 {
1024   Dali::Window instance;
1025   try
1026   {
1027     instance.GetNativeHandle();
1028     DALI_TEST_CHECK(false); // Should not get here
1029   }
1030   catch(...)
1031   {
1032     DALI_TEST_CHECK(true); // We expect an assert
1033   }
1034   END_TEST;
1035 }
1036
1037 int UtcDaliWindowGetScreenOffModeNegative(void)
1038 {
1039   Dali::Window instance;
1040   try
1041   {
1042     instance.GetScreenOffMode();
1043     DALI_TEST_CHECK(false); // Should not get here
1044   }
1045   catch(...)
1046   {
1047     DALI_TEST_CHECK(true); // We expect an assert
1048   }
1049   END_TEST;
1050 }
1051
1052 int UtcDaliWindowIsFocusAcceptableNegative(void)
1053 {
1054   Dali::Window instance;
1055   try
1056   {
1057     instance.IsFocusAcceptable();
1058     DALI_TEST_CHECK(false); // Should not get here
1059   }
1060   catch(...)
1061   {
1062     DALI_TEST_CHECK(true); // We expect an assert
1063   }
1064   END_TEST;
1065 }
1066
1067 int UtcDaliWindowGetAuxiliaryHintIdNegative(void)
1068 {
1069   Dali::Window instance;
1070   try
1071   {
1072     std::string arg1;
1073     instance.GetAuxiliaryHintId(arg1);
1074     DALI_TEST_CHECK(false); // Should not get here
1075   }
1076   catch(...)
1077   {
1078     DALI_TEST_CHECK(true); // We expect an assert
1079   }
1080   END_TEST;
1081 }
1082
1083 int UtcDaliWindowGetBackgroundColorNegative(void)
1084 {
1085   Dali::Window instance;
1086   try
1087   {
1088     instance.GetBackgroundColor();
1089     DALI_TEST_CHECK(false); // Should not get here
1090   }
1091   catch(...)
1092   {
1093     DALI_TEST_CHECK(true); // We expect an assert
1094   }
1095   END_TEST;
1096 }
1097
1098 int UtcDaliWindowGetNotificationLevelNegative(void)
1099 {
1100   Dali::Window instance;
1101   try
1102   {
1103     instance.GetNotificationLevel();
1104     DALI_TEST_CHECK(false); // Should not get here
1105   }
1106   catch(...)
1107   {
1108     DALI_TEST_CHECK(true); // We expect an assert
1109   }
1110   END_TEST;
1111 }
1112
1113 int UtcDaliWindowGetAuxiliaryHintValueNegative(void)
1114 {
1115   Dali::Window instance;
1116   try
1117   {
1118     unsigned int arg1(0u);
1119     instance.GetAuxiliaryHintValue(arg1);
1120     DALI_TEST_CHECK(false); // Should not get here
1121   }
1122   catch(...)
1123   {
1124     DALI_TEST_CHECK(true); // We expect an assert
1125   }
1126   END_TEST;
1127 }
1128
1129 int UtcDaliWindowGetSupportedAuxiliaryHintNegative(void)
1130 {
1131   Dali::Window instance;
1132   try
1133   {
1134     unsigned int arg1(0u);
1135     instance.GetSupportedAuxiliaryHint(arg1);
1136     DALI_TEST_CHECK(false); // Should not get here
1137   }
1138   catch(...)
1139   {
1140     DALI_TEST_CHECK(true); // We expect an assert
1141   }
1142   END_TEST;
1143 }
1144
1145 int UtcDaliWindowGetSupportedAuxiliaryHintCountNegative(void)
1146 {
1147   Dali::Window instance;
1148   try
1149   {
1150     instance.GetSupportedAuxiliaryHintCount();
1151     DALI_TEST_CHECK(false); // Should not get here
1152   }
1153   catch(...)
1154   {
1155     DALI_TEST_CHECK(true); // We expect an assert
1156   }
1157   END_TEST;
1158 }
1159
1160 int UtcDaliWindowGetDpiNegative(void)
1161 {
1162   Dali::Window instance;
1163   try
1164   {
1165     instance.GetDpi();
1166     DALI_TEST_CHECK(false); // Should not get here
1167   }
1168   catch(...)
1169   {
1170     DALI_TEST_CHECK(true); // We expect an assert
1171   }
1172   END_TEST;
1173 }
1174
1175 int UtcDaliWindowGetSizeNegative(void)
1176 {
1177   Dali::Window instance;
1178   try
1179   {
1180     instance.GetSize();
1181     DALI_TEST_CHECK(false); // Should not get here
1182   }
1183   catch(...)
1184   {
1185     DALI_TEST_CHECK(true); // We expect an assert
1186   }
1187   END_TEST;
1188 }
1189
1190 int UtcDaliWindowGetTypeNegative(void)
1191 {
1192   Dali::Window instance;
1193   try
1194   {
1195     instance.GetType();
1196     DALI_TEST_CHECK(false); // Should not get here
1197   }
1198   catch(...)
1199   {
1200     DALI_TEST_CHECK(true); // We expect an assert
1201   }
1202   END_TEST;
1203 }
1204
1205 int UtcDaliWindowGetLayerNegative(void)
1206 {
1207   Dali::Window instance;
1208   try
1209   {
1210     unsigned int arg1(0u);
1211     instance.GetLayer(arg1);
1212     DALI_TEST_CHECK(false); // Should not get here
1213   }
1214   catch(...)
1215   {
1216     DALI_TEST_CHECK(true); // We expect an assert
1217   }
1218   END_TEST;
1219 }
1220
1221 int UtcDaliWindowIsVisibleNegative(void)
1222 {
1223   Dali::Window instance;
1224   try
1225   {
1226     instance.IsVisible();
1227     DALI_TEST_CHECK(false); // Should not get here
1228   }
1229   catch(...)
1230   {
1231     DALI_TEST_CHECK(true); // We expect an assert
1232   }
1233   END_TEST;
1234 }
1235
1236 int UtcDaliWindowGetNativeIdNegative(void)
1237 {
1238   try
1239   {
1240     Dali::Window arg1;
1241     DevelWindow::GetNativeId(arg1);
1242     DALI_TEST_CHECK(false); // Should not get here
1243   }
1244   catch(...)
1245   {
1246     DALI_TEST_CHECK(true); // We expect an assert
1247   }
1248   END_TEST;
1249 }
1250
1251 int UtcDaliWindowSetPositionSizeNegative(void)
1252 {
1253   try
1254   {
1255     Dali::Window    arg1;
1256     Dali::Rect<int> arg2;
1257     DevelWindow::SetPositionSize(arg1, arg2);
1258     DALI_TEST_CHECK(false); // Should not get here
1259   }
1260   catch(...)
1261   {
1262     DALI_TEST_CHECK(true); // We expect an assert
1263   }
1264   END_TEST;
1265 }
1266
1267 int UtcDaliWindowWheelEventSignalNegative(void)
1268 {
1269   try
1270   {
1271     Dali::Window arg1;
1272     DevelWindow::WheelEventSignal(arg1);
1273     DALI_TEST_CHECK(false); // Should not get here
1274   }
1275   catch(...)
1276   {
1277     DALI_TEST_CHECK(true); // We expect an assert
1278   }
1279   END_TEST;
1280 }
1281
1282 int UtcDaliWindowGetCurrentOrientationNegative(void)
1283 {
1284   try
1285   {
1286     Dali::Window arg1;
1287     DevelWindow::GetCurrentOrientation(arg1);
1288     DALI_TEST_CHECK(false); // Should not get here
1289   }
1290   catch(...)
1291   {
1292     DALI_TEST_CHECK(true); // We expect an assert
1293   }
1294   END_TEST;
1295 }
1296
1297 int UtcDaliWindowGetPhysicalOrientationNegative(void)
1298 {
1299   try
1300   {
1301     Dali::Window arg1;
1302     DevelWindow::GetPhysicalOrientation(arg1);
1303     DALI_TEST_CHECK(false); // Should not get here
1304   }
1305   catch(...)
1306   {
1307     DALI_TEST_CHECK(true); // We expect an assert
1308   }
1309   END_TEST;
1310 }
1311
1312 int UtcDaliWindowVisibilityChangedSignalNegative(void)
1313 {
1314   try
1315   {
1316     Dali::Window arg1;
1317     DevelWindow::VisibilityChangedSignal(arg1);
1318     DALI_TEST_CHECK(false); // Should not get here
1319   }
1320   catch(...)
1321   {
1322     DALI_TEST_CHECK(true); // We expect an assert
1323   }
1324   END_TEST;
1325 }
1326
1327 int UtcDaliWindowAddFrameRenderedCallbackNegative(void)
1328 {
1329   try
1330   {
1331     Dali::Window                        arg1;
1332     std::unique_ptr<Dali::CallbackBase> arg2;
1333     int                                 arg3(0);
1334     DevelWindow::AddFrameRenderedCallback(arg1, std::move(arg2), arg3);
1335     DALI_TEST_CHECK(false); // Should not get here
1336   }
1337   catch(...)
1338   {
1339     DALI_TEST_CHECK(true); // We expect an assert
1340   }
1341   END_TEST;
1342 }
1343
1344 int UtcDaliWindowSetAvailableOrientationsNegative(void)
1345 {
1346   try
1347   {
1348     Dali::Window                          arg1;
1349     Dali::Vector<Dali::WindowOrientation> arg2;
1350     DevelWindow::SetAvailableOrientations(arg1, arg2);
1351     DALI_TEST_CHECK(false); // Should not get here
1352   }
1353   catch(...)
1354   {
1355     DALI_TEST_CHECK(true); // We expect an assert
1356   }
1357   END_TEST;
1358 }
1359
1360 int UtcDaliWindowAddFramePresentedCallbackNegative(void)
1361 {
1362   try
1363   {
1364     Dali::Window                        arg1;
1365     std::unique_ptr<Dali::CallbackBase> arg2;
1366     int                                 arg3(0);
1367     DevelWindow::AddFramePresentedCallback(arg1, std::move(arg2), arg3);
1368     DALI_TEST_CHECK(false); // Should not get here
1369   }
1370   catch(...)
1371   {
1372     DALI_TEST_CHECK(true); // We expect an assert
1373   }
1374   END_TEST;
1375 }
1376
1377 int UtcDaliWindowTransitionEffectEventSignalNegative(void)
1378 {
1379   try
1380   {
1381     Dali::Window arg1;
1382     DevelWindow::TransitionEffectEventSignal(arg1);
1383     DALI_TEST_CHECK(false); // Should not get here
1384   }
1385   catch(...)
1386   {
1387     DALI_TEST_CHECK(true); // We expect an assert
1388   }
1389   END_TEST;
1390 }
1391
1392 int UtcDaliWindowEventProcessingFinishedSignalNegative(void)
1393 {
1394   try
1395   {
1396     Dali::Window arg1;
1397     DevelWindow::EventProcessingFinishedSignal(arg1);
1398     DALI_TEST_CHECK(false); // Should not get here
1399   }
1400   catch(...)
1401   {
1402     DALI_TEST_CHECK(true); // We expect an assert
1403   }
1404   END_TEST;
1405 }
1406
1407 int UtcDaliWindowKeyboardRepeatSettingsChangedSignalNegative(void)
1408 {
1409   try
1410   {
1411     Dali::Window arg1;
1412     DevelWindow::KeyboardRepeatSettingsChangedSignal(arg1);
1413     DALI_TEST_CHECK(false); // Should not get here
1414   }
1415   catch(...)
1416   {
1417     DALI_TEST_CHECK(true); // We expect an assert
1418   }
1419   END_TEST;
1420 }
1421
1422 int UtcDaliWindowUnparentNegative(void)
1423 {
1424   try
1425   {
1426     Dali::Window arg1;
1427     DevelWindow::Unparent(arg1);
1428     DALI_TEST_CHECK(false); // Should not get here
1429   }
1430   catch(...)
1431   {
1432     DALI_TEST_CHECK(true); // We expect an assert
1433   }
1434   END_TEST;
1435 }
1436
1437 int UtcDaliWindowGetParentNegative(void)
1438 {
1439   try
1440   {
1441     Dali::Window arg1;
1442     DevelWindow::GetParent(arg1);
1443     DALI_TEST_CHECK(false); // Should not get here
1444   }
1445   catch(...)
1446   {
1447     DALI_TEST_CHECK(true); // We expect an assert
1448   }
1449   END_TEST;
1450 }
1451
1452 int UtcDaliWindowSetParentNegative(void)
1453 {
1454   try
1455   {
1456     Dali::Window arg1;
1457     Dali::Window arg2;
1458     DevelWindow::SetParent(arg1, arg2);
1459     DALI_TEST_CHECK(false); // Should not get here
1460   }
1461   catch(...)
1462   {
1463     DALI_TEST_CHECK(true); // We expect an assert
1464   }
1465   END_TEST;
1466 }
1467
1468 int UtcDaliWindowSetParentWithBelowParentNegative(void)
1469 {
1470   try
1471   {
1472     Dali::Window arg1;
1473     Dali::Window arg2;
1474     DevelWindow::SetParent(arg1, arg2, true);
1475     DALI_TEST_CHECK(false); // Should not get here
1476   }
1477   catch(...)
1478   {
1479     DALI_TEST_CHECK(true); // We expect an assert
1480   }
1481   END_TEST;
1482 }
1483
1484 int UtcDaliWindowAddInputRegion(void)
1485 {
1486   Dali::Window instance;
1487   try
1488   {
1489     Rect<int> includedInputRegion(0, 0, 720, 640);
1490     DevelWindow::IncludeInputRegion(instance, includedInputRegion);
1491     DALI_TEST_CHECK(false); // Should not get here
1492   }
1493   catch(...)
1494   {
1495     DALI_TEST_CHECK(true); // We expect an assert
1496   }
1497   END_TEST;
1498 }
1499
1500 int UtcDaliWindowSubtractInputRegion(void)
1501 {
1502   Dali::Window instance;
1503   try
1504   {
1505     Rect<int> includedInputRegion(0, 0, 720, 1280);
1506     DevelWindow::IncludeInputRegion(instance, includedInputRegion);
1507
1508     Rect<int> excludedInputRegion(0, 641, 720, 640);
1509     DevelWindow::ExcludeInputRegion(instance, excludedInputRegion);
1510
1511     DALI_TEST_CHECK(false); // Should not get here
1512   }
1513   catch(...)
1514   {
1515     DALI_TEST_CHECK(true); // We expect an assert
1516   }
1517   END_TEST;
1518 }
1519
1520 int UtcDaliWindowSetNeedsRotationCompletedAcknowledgementNegative(void)
1521 {
1522   try
1523   {
1524     Dali::Window arg1;
1525     DevelWindow::SetNeedsRotationCompletedAcknowledgement(arg1, true);
1526     DALI_TEST_CHECK(false); // Should not get here
1527   }
1528   catch(...)
1529   {
1530     DALI_TEST_CHECK(true); // We expect an assert
1531   }
1532   END_TEST;
1533 }
1534
1535 int UtcDaliWindowUnsetNeedsRotationCompletedAcknowledgementNegative(void)
1536 {
1537   try
1538   {
1539     Dali::Window arg1;
1540     DevelWindow::SetNeedsRotationCompletedAcknowledgement(arg1, false);
1541     DALI_TEST_CHECK(false); // Should not get here
1542   }
1543   catch(...)
1544   {
1545     DALI_TEST_CHECK(true); // We expect an assert
1546   }
1547   END_TEST;
1548 }
1549
1550 int UtcDaliWindowSendRotationCompletedAcknowledgementNegative(void)
1551 {
1552   try
1553   {
1554     Dali::Window arg1;
1555     DevelWindow::SendRotationCompletedAcknowledgement(arg1);
1556
1557     DALI_TEST_CHECK(false); // Should not get here
1558   }
1559   catch(...)
1560   {
1561     DALI_TEST_CHECK(true); // We expect an assert
1562   }
1563   END_TEST;
1564 }
1565
1566 int UtcDaliWindowMovedSignalNegative(void)
1567 {
1568   Dali::Window instance;
1569   try
1570   {
1571     DevelWindow::MovedSignal(instance);
1572     DALI_TEST_CHECK(false); // Should not get here
1573   }
1574   catch(...)
1575   {
1576     DALI_TEST_CHECK(true); // We expect an assert
1577   }
1578   END_TEST;
1579 }
1580
1581 int UtcDaliWindowOrientationChangedSignalNegative(void)
1582 {
1583   Dali::Window instance;
1584   try
1585   {
1586     DevelWindow::OrientationChangedSignal(instance);
1587     DALI_TEST_CHECK(false); // Should not get here
1588   }
1589   catch(...)
1590   {
1591     DALI_TEST_CHECK(true); // We expect an assert
1592   }
1593   END_TEST;
1594 }