db45460c2b84a3a31c0b6e89ff8e8c73562a1b66
[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::Uint16Pair 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 UtcDaliWindowGetRootLayerNegative(void)
947 {
948   Dali::Window instance;
949   try
950   {
951     instance.GetRootLayer();
952     DALI_TEST_CHECK(false); // Should not get here
953   }
954   catch(...)
955   {
956     DALI_TEST_CHECK(true); // We expect an assert
957   }
958   END_TEST;
959 }
960
961 int UtcDaliWindowGetBrightnessNegative(void)
962 {
963   Dali::Window instance;
964   try
965   {
966     instance.GetBrightness();
967     DALI_TEST_CHECK(false); // Should not get here
968   }
969   catch(...)
970   {
971     DALI_TEST_CHECK(true); // We expect an assert
972   }
973   END_TEST;
974 }
975
976 int UtcDaliWindowGetLayerCountNegative(void)
977 {
978   Dali::Window instance;
979   try
980   {
981     instance.GetLayerCount();
982     DALI_TEST_CHECK(false); // Should not get here
983   }
984   catch(...)
985   {
986     DALI_TEST_CHECK(true); // We expect an assert
987   }
988   END_TEST;
989 }
990
991 int UtcDaliWindowIsOpaqueStateNegative(void)
992 {
993   Dali::Window instance;
994   try
995   {
996     instance.IsOpaqueState();
997     DALI_TEST_CHECK(false); // Should not get here
998   }
999   catch(...)
1000   {
1001     DALI_TEST_CHECK(true); // We expect an assert
1002   }
1003   END_TEST;
1004 }
1005
1006 int UtcDaliWindowGetNativeHandleNegative(void)
1007 {
1008   Dali::Window instance;
1009   try
1010   {
1011     instance.GetNativeHandle();
1012     DALI_TEST_CHECK(false); // Should not get here
1013   }
1014   catch(...)
1015   {
1016     DALI_TEST_CHECK(true); // We expect an assert
1017   }
1018   END_TEST;
1019 }
1020
1021 int UtcDaliWindowGetScreenOffModeNegative(void)
1022 {
1023   Dali::Window instance;
1024   try
1025   {
1026     instance.GetScreenOffMode();
1027     DALI_TEST_CHECK(false); // Should not get here
1028   }
1029   catch(...)
1030   {
1031     DALI_TEST_CHECK(true); // We expect an assert
1032   }
1033   END_TEST;
1034 }
1035
1036 int UtcDaliWindowIsFocusAcceptableNegative(void)
1037 {
1038   Dali::Window instance;
1039   try
1040   {
1041     instance.IsFocusAcceptable();
1042     DALI_TEST_CHECK(false); // Should not get here
1043   }
1044   catch(...)
1045   {
1046     DALI_TEST_CHECK(true); // We expect an assert
1047   }
1048   END_TEST;
1049 }
1050
1051 int UtcDaliWindowGetAuxiliaryHintIdNegative(void)
1052 {
1053   Dali::Window instance;
1054   try
1055   {
1056     std::string arg1;
1057     instance.GetAuxiliaryHintId(arg1);
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 UtcDaliWindowGetBackgroundColorNegative(void)
1068 {
1069   Dali::Window instance;
1070   try
1071   {
1072     instance.GetBackgroundColor();
1073     DALI_TEST_CHECK(false); // Should not get here
1074   }
1075   catch(...)
1076   {
1077     DALI_TEST_CHECK(true); // We expect an assert
1078   }
1079   END_TEST;
1080 }
1081
1082 int UtcDaliWindowGetNotificationLevelNegative(void)
1083 {
1084   Dali::Window instance;
1085   try
1086   {
1087     instance.GetNotificationLevel();
1088     DALI_TEST_CHECK(false); // Should not get here
1089   }
1090   catch(...)
1091   {
1092     DALI_TEST_CHECK(true); // We expect an assert
1093   }
1094   END_TEST;
1095 }
1096
1097 int UtcDaliWindowGetAuxiliaryHintValueNegative(void)
1098 {
1099   Dali::Window instance;
1100   try
1101   {
1102     unsigned int arg1(0u);
1103     instance.GetAuxiliaryHintValue(arg1);
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 UtcDaliWindowGetSupportedAuxiliaryHintNegative(void)
1114 {
1115   Dali::Window instance;
1116   try
1117   {
1118     unsigned int arg1(0u);
1119     instance.GetSupportedAuxiliaryHint(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 UtcDaliWindowGetSupportedAuxiliaryHintCountNegative(void)
1130 {
1131   Dali::Window instance;
1132   try
1133   {
1134     instance.GetSupportedAuxiliaryHintCount();
1135     DALI_TEST_CHECK(false); // Should not get here
1136   }
1137   catch(...)
1138   {
1139     DALI_TEST_CHECK(true); // We expect an assert
1140   }
1141   END_TEST;
1142 }
1143
1144 int UtcDaliWindowGetDpiNegative(void)
1145 {
1146   Dali::Window instance;
1147   try
1148   {
1149     instance.GetDpi();
1150     DALI_TEST_CHECK(false); // Should not get here
1151   }
1152   catch(...)
1153   {
1154     DALI_TEST_CHECK(true); // We expect an assert
1155   }
1156   END_TEST;
1157 }
1158
1159 int UtcDaliWindowGetSizeNegative(void)
1160 {
1161   Dali::Window instance;
1162   try
1163   {
1164     instance.GetSize();
1165     DALI_TEST_CHECK(false); // Should not get here
1166   }
1167   catch(...)
1168   {
1169     DALI_TEST_CHECK(true); // We expect an assert
1170   }
1171   END_TEST;
1172 }
1173
1174 int UtcDaliWindowGetTypeNegative(void)
1175 {
1176   Dali::Window instance;
1177   try
1178   {
1179     instance.GetType();
1180     DALI_TEST_CHECK(false); // Should not get here
1181   }
1182   catch(...)
1183   {
1184     DALI_TEST_CHECK(true); // We expect an assert
1185   }
1186   END_TEST;
1187 }
1188
1189 int UtcDaliWindowGetLayerNegative(void)
1190 {
1191   Dali::Window instance;
1192   try
1193   {
1194     unsigned int arg1(0u);
1195     instance.GetLayer(arg1);
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 UtcDaliWindowIsVisibleNegative(void)
1206 {
1207   Dali::Window instance;
1208   try
1209   {
1210     instance.IsVisible();
1211     DALI_TEST_CHECK(false); // Should not get here
1212   }
1213   catch(...)
1214   {
1215     DALI_TEST_CHECK(true); // We expect an assert
1216   }
1217   END_TEST;
1218 }
1219
1220 int UtcDaliWindowGetNativeIdNegative(void)
1221 {
1222   try
1223   {
1224     Dali::Window arg1;
1225     DevelWindow::GetNativeId(arg1);
1226     DALI_TEST_CHECK(false); // Should not get here
1227   }
1228   catch(...)
1229   {
1230     DALI_TEST_CHECK(true); // We expect an assert
1231   }
1232   END_TEST;
1233 }
1234
1235 int UtcDaliWindowSetPositionSizeNegative(void)
1236 {
1237   try
1238   {
1239     Dali::Window    arg1;
1240     Dali::Rect<int> arg2;
1241     DevelWindow::SetPositionSize(arg1, arg2);
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 UtcDaliWindowWheelEventSignalNegative(void)
1252 {
1253   try
1254   {
1255     Dali::Window arg1;
1256     DevelWindow::WheelEventSignal(arg1);
1257     DALI_TEST_CHECK(false); // Should not get here
1258   }
1259   catch(...)
1260   {
1261     DALI_TEST_CHECK(true); // We expect an assert
1262   }
1263   END_TEST;
1264 }
1265
1266 int UtcDaliWindowGetCurrentOrientationNegative(void)
1267 {
1268   try
1269   {
1270     Dali::Window arg1;
1271     DevelWindow::GetCurrentOrientation(arg1);
1272     DALI_TEST_CHECK(false); // Should not get here
1273   }
1274   catch(...)
1275   {
1276     DALI_TEST_CHECK(true); // We expect an assert
1277   }
1278   END_TEST;
1279 }
1280
1281 int UtcDaliWindowGetPhysicalOrientationNegative(void)
1282 {
1283   try
1284   {
1285     Dali::Window arg1;
1286     DevelWindow::GetPhysicalOrientation(arg1);
1287     DALI_TEST_CHECK(false); // Should not get here
1288   }
1289   catch(...)
1290   {
1291     DALI_TEST_CHECK(true); // We expect an assert
1292   }
1293   END_TEST;
1294 }
1295
1296 int UtcDaliWindowVisibilityChangedSignalNegative(void)
1297 {
1298   try
1299   {
1300     Dali::Window arg1;
1301     DevelWindow::VisibilityChangedSignal(arg1);
1302     DALI_TEST_CHECK(false); // Should not get here
1303   }
1304   catch(...)
1305   {
1306     DALI_TEST_CHECK(true); // We expect an assert
1307   }
1308   END_TEST;
1309 }
1310
1311 int UtcDaliWindowAddFrameRenderedCallbackNegative(void)
1312 {
1313   try
1314   {
1315     Dali::Window                        arg1;
1316     std::unique_ptr<Dali::CallbackBase> arg2;
1317     int                                 arg3(0);
1318     DevelWindow::AddFrameRenderedCallback(arg1, std::move(arg2), arg3);
1319     DALI_TEST_CHECK(false); // Should not get here
1320   }
1321   catch(...)
1322   {
1323     DALI_TEST_CHECK(true); // We expect an assert
1324   }
1325   END_TEST;
1326 }
1327
1328 int UtcDaliWindowSetAvailableOrientationsNegative(void)
1329 {
1330   try
1331   {
1332     Dali::Window                          arg1;
1333     Dali::Vector<Dali::WindowOrientation> arg2;
1334     DevelWindow::SetAvailableOrientations(arg1, arg2);
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 UtcDaliWindowAddFramePresentedCallbackNegative(void)
1345 {
1346   try
1347   {
1348     Dali::Window                        arg1;
1349     std::unique_ptr<Dali::CallbackBase> arg2;
1350     int                                 arg3(0);
1351     DevelWindow::AddFramePresentedCallback(arg1, std::move(arg2), arg3);
1352     DALI_TEST_CHECK(false); // Should not get here
1353   }
1354   catch(...)
1355   {
1356     DALI_TEST_CHECK(true); // We expect an assert
1357   }
1358   END_TEST;
1359 }
1360
1361 int UtcDaliWindowTransitionEffectEventSignalNegative(void)
1362 {
1363   try
1364   {
1365     Dali::Window arg1;
1366     DevelWindow::TransitionEffectEventSignal(arg1);
1367     DALI_TEST_CHECK(false); // Should not get here
1368   }
1369   catch(...)
1370   {
1371     DALI_TEST_CHECK(true); // We expect an assert
1372   }
1373   END_TEST;
1374 }
1375
1376 int UtcDaliWindowEventProcessingFinishedSignalNegative(void)
1377 {
1378   try
1379   {
1380     Dali::Window arg1;
1381     DevelWindow::EventProcessingFinishedSignal(arg1);
1382     DALI_TEST_CHECK(false); // Should not get here
1383   }
1384   catch(...)
1385   {
1386     DALI_TEST_CHECK(true); // We expect an assert
1387   }
1388   END_TEST;
1389 }
1390
1391 int UtcDaliWindowKeyboardRepeatSettingsChangedSignalNegative(void)
1392 {
1393   try
1394   {
1395     Dali::Window arg1;
1396     DevelWindow::KeyboardRepeatSettingsChangedSignal(arg1);
1397     DALI_TEST_CHECK(false); // Should not get here
1398   }
1399   catch(...)
1400   {
1401     DALI_TEST_CHECK(true); // We expect an assert
1402   }
1403   END_TEST;
1404 }
1405
1406 int UtcDaliWindowUnparentNegative(void)
1407 {
1408   try
1409   {
1410     Dali::Window arg1;
1411     DevelWindow::Unparent(arg1);
1412     DALI_TEST_CHECK(false); // Should not get here
1413   }
1414   catch(...)
1415   {
1416     DALI_TEST_CHECK(true); // We expect an assert
1417   }
1418   END_TEST;
1419 }
1420
1421 int UtcDaliWindowGetParentNegative(void)
1422 {
1423   try
1424   {
1425     Dali::Window arg1;
1426     DevelWindow::GetParent(arg1);
1427     DALI_TEST_CHECK(false); // Should not get here
1428   }
1429   catch(...)
1430   {
1431     DALI_TEST_CHECK(true); // We expect an assert
1432   }
1433   END_TEST;
1434 }
1435
1436 int UtcDaliWindowSetParentNegative(void)
1437 {
1438   try
1439   {
1440     Dali::Window arg1;
1441     Dali::Window arg2;
1442     DevelWindow::SetParent(arg1, arg2);
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 UtcDaliWindowSetParentWithBelowParentNegative(void)
1453 {
1454   try
1455   {
1456     Dali::Window arg1;
1457     Dali::Window arg2;
1458     DevelWindow::SetParent(arg1, arg2, true);
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 UtcDaliWindowAddInputRegion(void)
1469 {
1470   Dali::Window instance;
1471   try
1472   {
1473     Rect<int> includedInputRegion(0,0,720,640);
1474     DevelWindow::IncludeInputRegion(instance, includedInputRegion);
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 UtcDaliWindowSubtractInputRegion(void)
1485 {
1486   Dali::Window instance;
1487   try
1488   {
1489     Rect<int> includedInputRegion(0,0,720,1280);
1490     DevelWindow::IncludeInputRegion(instance, includedInputRegion);
1491
1492     Rect<int> excludedInputRegion(0,641,720,640);
1493     DevelWindow::ExcludeInputRegion(instance, excludedInputRegion);
1494
1495     DALI_TEST_CHECK(false); // Should not get here
1496   }
1497   catch(...)
1498   {
1499     DALI_TEST_CHECK(true); // We expect an assert
1500   }
1501   END_TEST;
1502 }
1503
1504
1505 int UtcDaliWindowSetNeedsRotationCompletedAcknowledgementNegative(void)
1506 {
1507   try
1508   {
1509     Dali::Window arg1;
1510     DevelWindow::SetNeedsRotationCompletedAcknowledgement(arg1, true);
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 UtcDaliWindowUnsetNeedsRotationCompletedAcknowledgementNegative(void)
1521 {
1522   try
1523   {
1524     Dali::Window arg1;
1525     DevelWindow::SetNeedsRotationCompletedAcknowledgement(arg1, false);
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 UtcDaliWindowSendRotationCompletedAcknowledgementNegative(void)
1536 {
1537   try
1538   {
1539     Dali::Window arg1;
1540     DevelWindow::SendRotationCompletedAcknowledgement(arg1);
1541
1542     DALI_TEST_CHECK(false); // Should not get here
1543   }
1544   catch(...)
1545   {
1546     DALI_TEST_CHECK(true); // We expect an assert
1547   }
1548   END_TEST;
1549 }