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/public-api/dali-core.h>
22 #include <dali-test-suite-utils.h>
26 ///////////////////////////////////////////////////////////////////////////////
27 void utc_dali_constraint_source_startup(void)
29 test_return_value = TET_UNDEF;
32 void utc_dali_constraint_source_cleanup(void)
34 test_return_value = TET_PASS;
36 ///////////////////////////////////////////////////////////////////////////////
38 ///////////////////////////////////////////////////////////////////////////////
40 ///////////////////////////////////////////////////////////////////////////////
41 int UtcDaliLocalSource(void)
43 LocalSource source( Actor::Property::POSITION );
45 DALI_TEST_EQUALS( source.propertyIndex, (Property::Index)Actor::Property::POSITION, TEST_LOCATION );
50 ///////////////////////////////////////////////////////////////////////////////
52 ///////////////////////////////////////////////////////////////////////////////
54 ///////////////////////////////////////////////////////////////////////////////
55 int UtcDaliParentSource(void)
57 ParentSource source( Actor::Property::POSITION );
59 DALI_TEST_EQUALS( source.propertyIndex, (Property::Index)Actor::Property::POSITION, TEST_LOCATION );
64 ///////////////////////////////////////////////////////////////////////////////
66 ///////////////////////////////////////////////////////////////////////////////
68 ///////////////////////////////////////////////////////////////////////////////
69 int UtcDaliSource1(void)
72 Source source( actor, Actor::Property::SIZE );
74 DALI_TEST_CHECK( ! source.object );
75 DALI_TEST_EQUALS( source.propertyIndex, (Property::Index)Actor::Property::SIZE, TEST_LOCATION );
80 int UtcDaliSource2(void)
82 TestApplication application;
84 Actor actor = Actor::New();
86 Source source( actor, Actor::Property::SIZE );
87 DALI_TEST_EQUALS( source.object, actor, TEST_LOCATION );
88 DALI_TEST_EQUALS( source.propertyIndex, (Property::Index)Actor::Property::SIZE, TEST_LOCATION );
92 ///////////////////////////////////////////////////////////////////////////////
94 ///////////////////////////////////////////////////////////////////////////////
96 ///////////////////////////////////////////////////////////////////////////////
97 int UtcDaliConstraintSourceWithSource1(void)
101 ConstraintSource source( Source( actor, Actor::Property::PARENT_ORIGIN ) );
102 DALI_TEST_CHECK( ! source.object );
103 DALI_TEST_EQUALS( source.propertyIndex, (Property::Index)Actor::Property::PARENT_ORIGIN, TEST_LOCATION );
104 DALI_TEST_EQUALS( source.sourceType, OBJECT_PROPERTY, TEST_LOCATION );
109 int UtcDaliConstraintSourceWithSource2(void)
111 TestApplication application;
113 Actor actor = Actor::New();
115 ConstraintSource source( Source( actor, Actor::Property::PARENT_ORIGIN ) );
116 DALI_TEST_EQUALS( source.object, actor, TEST_LOCATION );
117 DALI_TEST_EQUALS( source.propertyIndex, (Property::Index)Actor::Property::PARENT_ORIGIN, TEST_LOCATION );
118 DALI_TEST_EQUALS( source.sourceType, OBJECT_PROPERTY, TEST_LOCATION );
123 int UtcDaliConstraintSourceWithLocalSource(void)
127 ConstraintSource source( LocalSource( Actor::Property::PARENT_ORIGIN ) );
128 DALI_TEST_CHECK( ! source.object );
129 DALI_TEST_EQUALS( source.propertyIndex, (Property::Index)Actor::Property::PARENT_ORIGIN, TEST_LOCATION );
130 DALI_TEST_EQUALS( source.sourceType, LOCAL_PROPERTY, TEST_LOCATION );
135 int UtcDaliConstraintSourceWithParentSource(void)
139 ConstraintSource source( ParentSource( Actor::Property::PARENT_ORIGIN ) );
140 DALI_TEST_CHECK( ! source.object );
141 DALI_TEST_EQUALS( source.propertyIndex, (Property::Index)Actor::Property::PARENT_ORIGIN, TEST_LOCATION );
142 DALI_TEST_EQUALS( source.sourceType, PARENT_PROPERTY, TEST_LOCATION );
146 ///////////////////////////////////////////////////////////////////////////////