2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 #include <dali/dali.h>
22 #include <dali-test-suite-utils.h>
27 void utc_dali_image_attributes_startup(void)
29 test_return_value = TET_UNDEF;
32 void utc_dali_image_attributes_cleanup(void)
34 test_return_value = TET_PASS;
37 int UtcDaliImageAttributesConstructor(void)
39 TestApplication application;
41 tet_infoline("UtcDaliImageAttributesConstructor");
43 // invoke default handle constructor
44 ImageAttributes imageAttributes;
46 DALI_TEST_CHECK( imageAttributes.GetWidth() == 0);
50 int UtcDaliImageAttributesLessThan(void)
52 TestApplication application;
54 tet_infoline("UtcDaliImageAttributesLessThan");
56 // invoke default handle constructor
57 ImageAttributes imageAttributes;
59 ImageAttributes imageAttributesWidth;
60 imageAttributesWidth.SetSize(2,1);
61 DALI_TEST_CHECK(imageAttributes < imageAttributesWidth);
63 ImageAttributes imageAttributesHeight;
64 imageAttributesHeight.SetSize(1,2);
65 DALI_TEST_CHECK(imageAttributes < imageAttributesHeight);
67 imageAttributesWidth.SetSize(Size(2,1));
68 DALI_TEST_CHECK(imageAttributes < imageAttributesWidth);
70 imageAttributesHeight.SetSize(Size(1,2));
71 DALI_TEST_CHECK(imageAttributes < imageAttributesHeight);
73 ImageAttributes imageAttributesCrop;
74 imageAttributesCrop.SetCrop(Rect<float>(0.0f, 0.0f, 8.0f, 8.0f));
75 DALI_TEST_CHECK(imageAttributes < imageAttributesCrop);
77 ImageAttributes imageAttributesFormat;
78 imageAttributesFormat.SetPixelFormat(Pixel::BGRA8888);
79 DALI_TEST_CHECK(imageAttributes < imageAttributesFormat);
81 ImageAttributes imageAttributesScaling;
82 imageAttributesScaling.SetScalingMode(ImageAttributes::FitHeight);
83 DALI_TEST_CHECK(imageAttributes < imageAttributesScaling);
87 int UtcDaliImageAttributesEquality(void)
89 TestApplication application;
91 tet_infoline("UtcDaliImageAttributesEquality");
93 // invoke default handle constructor
94 ImageAttributes imageAttributes01;
95 ImageAttributes imageAttributes02;
97 DALI_TEST_CHECK(imageAttributes02 == imageAttributes01);
101 int UtcDaliImageAttributesInEquality(void)
103 TestApplication application;
105 tet_infoline("UtcDaliImageAttributesInEquality");
107 // invoke default handle constructor
108 ImageAttributes imageAttributes01;
109 ImageAttributes imageAttributes02;
111 DALI_TEST_CHECK((imageAttributes02 != imageAttributes01) == false);