removed reliance on dali-adaptor
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-ImageAttributes.cpp
1 /*
2  * Copyright (c) 2014 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 <iostream>
19 #include <algorithm>
20 #include <stdlib.h>
21 #include <dali/public-api/dali-core.h>
22 #include <dali-test-suite-utils.h>
23
24 using std::max;
25 using namespace Dali;
26
27 void utc_dali_image_attributes_startup(void)
28 {
29   test_return_value = TET_UNDEF;
30 }
31
32 void utc_dali_image_attributes_cleanup(void)
33 {
34   test_return_value = TET_PASS;
35 }
36
37 int UtcDaliImageAttributesConstructor(void)
38 {
39   TestApplication application;
40
41   tet_infoline("UtcDaliImageAttributesConstructor");
42
43   // invoke default handle constructor
44   ImageAttributes imageAttributes;
45
46   DALI_TEST_CHECK( imageAttributes.GetWidth() == 0);
47   END_TEST;
48 }
49
50 int UtcDaliImageAttributesLessThan(void)
51 {
52   TestApplication application;
53
54   tet_infoline("UtcDaliImageAttributesLessThan");
55
56   // invoke default handle constructor
57   ImageAttributes imageAttributes;
58
59   ImageAttributes imageAttributesWidth;
60   imageAttributesWidth.SetSize(2,1);
61   DALI_TEST_CHECK(imageAttributes < imageAttributesWidth);
62
63   ImageAttributes imageAttributesHeight;
64   imageAttributesHeight.SetSize(1,2);
65   DALI_TEST_CHECK(imageAttributes < imageAttributesHeight);
66
67   imageAttributesWidth.SetSize(Size(2,1));
68   DALI_TEST_CHECK(imageAttributes < imageAttributesWidth);
69
70   imageAttributesHeight.SetSize(Size(1,2));
71   DALI_TEST_CHECK(imageAttributes < imageAttributesHeight);
72
73   ImageAttributes imageAttributesFormat;
74   imageAttributesFormat.SetPixelFormat(Pixel::BGRA8888);
75   DALI_TEST_CHECK(imageAttributes < imageAttributesFormat);
76
77   ImageAttributes imageAttributesScaling;
78   imageAttributesScaling.SetScalingMode(ImageAttributes::FitHeight);
79   DALI_TEST_CHECK(imageAttributes < imageAttributesScaling);
80   END_TEST;
81 }
82
83 int UtcDaliImageAttributesEquality(void)
84 {
85   TestApplication application;
86
87   tet_infoline("UtcDaliImageAttributesEquality");
88
89   // invoke default handle constructor
90   ImageAttributes imageAttributes01;
91   ImageAttributes imageAttributes02;
92
93   DALI_TEST_CHECK(imageAttributes02 == imageAttributes01);
94   END_TEST;
95 }
96
97 int UtcDaliImageAttributesInEquality(void)
98 {
99   TestApplication application;
100
101   tet_infoline("UtcDaliImageAttributesInEquality");
102
103   // invoke default handle constructor
104   ImageAttributes imageAttributes01;
105   ImageAttributes imageAttributes02;
106
107   DALI_TEST_CHECK((imageAttributes02 != imageAttributes01) == false);
108   END_TEST;
109 }