Adding new test harness
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-unmanaged / utc-Dali-DefaultControls.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 #include <iostream>
18 #include <stdlib.h>
19 #include <dali-toolkit-test-suite-utils.h>
20 #include <dali-toolkit/dali-toolkit.h>
21
22 using namespace Dali;
23 using namespace Toolkit;
24
25 void dali_default_controls_startup(void)
26 {
27   test_return_value = TET_UNDEF;
28 }
29
30 void dali_default_controls_cleanup(void)
31 {
32   test_return_value = TET_PASS;
33 }
34
35
36
37 int UtcDaliDefaultControlsCreateCheckBoxButton(void)
38 {
39   ToolkitTestApplication application;
40
41   tet_infoline(" UtcDaliDefaultControlsCreateCheckBoxButton");
42
43   const std::string imagePath( "Facke image path" );
44   const std::string voidImagePath( "" );
45
46   ImageActor image = CreateSolidColorActor( Color::RED );
47   ImageActor voidImage;
48
49   CheckBoxButton button0, button1, button2, button3, button4, button5;
50
51   try
52   {
53     button0 = CreateCheckBoxButton( voidImagePath, voidImagePath, voidImagePath, voidImagePath );
54     button1 = CreateCheckBoxButton( imagePath, voidImagePath, voidImagePath, voidImagePath );
55     button2 = CreateCheckBoxButton( voidImagePath, imagePath, voidImagePath, voidImagePath );
56     button3 = CreateCheckBoxButton( voidImagePath, voidImagePath, imagePath, voidImagePath );
57     button4 = CreateCheckBoxButton( voidImagePath, voidImagePath, voidImagePath, imagePath );
58     button5 = CreateCheckBoxButton( imagePath, imagePath, imagePath, imagePath );
59   }
60   catch( ... )
61   {
62     tet_result( TET_FAIL );
63   }
64
65   DALI_TEST_CHECK( button0 );
66   DALI_TEST_CHECK( button1 );
67   DALI_TEST_CHECK( button2 );
68   DALI_TEST_CHECK( button3 );
69   DALI_TEST_CHECK( button4 );
70   DALI_TEST_CHECK( button5 );
71
72   try
73   {
74     button0 = CreateCheckBoxButton( voidImage, voidImage, voidImage, voidImage );
75     button1 = CreateCheckBoxButton( image, voidImage, voidImage, voidImage );
76     button2 = CreateCheckBoxButton( voidImage, image, voidImage, voidImage );
77     button3 = CreateCheckBoxButton( voidImage, voidImage, image, voidImage );
78     button4 = CreateCheckBoxButton( voidImage, voidImage, voidImage, image );
79     button5 = CreateCheckBoxButton( image, image, image, image );
80   }
81   catch( ... )
82   {
83     tet_result( TET_FAIL );
84   }
85
86   DALI_TEST_CHECK( button0 );
87   DALI_TEST_CHECK( button1 );
88   DALI_TEST_CHECK( button2 );
89   DALI_TEST_CHECK( button3 );
90   DALI_TEST_CHECK( button4 );
91   DALI_TEST_CHECK( button5 );
92
93   try
94   {
95     button0 = CreateCheckBoxButton( voidImagePath, voidImagePath );
96     button1 = CreateCheckBoxButton( voidImagePath, imagePath );
97     button2 = CreateCheckBoxButton( imagePath, voidImagePath );
98     button3 = CreateCheckBoxButton( imagePath, imagePath );
99   }
100   catch( ... )
101   {
102     tet_result( TET_FAIL );
103   }
104
105   DALI_TEST_CHECK( button0 );
106   DALI_TEST_CHECK( button1 );
107   DALI_TEST_CHECK( button2 );
108   DALI_TEST_CHECK( button3 );
109
110   try
111   {
112     button0 = CreateCheckBoxButton( voidImage, voidImage );
113     button2 = CreateCheckBoxButton( voidImage, image );
114     button3 = CreateCheckBoxButton( voidImage, image );
115     button4 = CreateCheckBoxButton( image, image );
116   }
117   catch( ... )
118   {
119     tet_result( TET_FAIL );
120   }
121
122   DALI_TEST_CHECK( button0 );
123   DALI_TEST_CHECK( button1 );
124   DALI_TEST_CHECK( button2 );
125   DALI_TEST_CHECK( button3 );
126   END_TEST;
127 }