77c7a1f7628274513f2da5868f0b417ac2fd7ade
[platform/core/uifw/dali-core.git] / automated-tests / src / dali-internal / utc-Dali-Internal-Core.cpp
1 /*
2  * Copyright (c) 2016 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
20 #include <stdlib.h>
21 #include <dali/public-api/dali-core.h>
22
23 #include <dali-test-suite-utils.h>
24
25 // Internal headers are allowed here
26
27
28 using namespace Dali;
29
30 void utc_dali_internal_core_startup()
31 {
32   test_return_value = TET_UNDEF;
33 }
34
35 void utc_dali_internal_core_cleanup()
36 {
37   test_return_value = TET_PASS;
38 }
39
40
41 int UtcDaliCoreTopMargin(void)
42 {
43   TestApplication application;
44   tet_infoline("Testing Dali::Integration::Core::SetTopMargin");
45
46   Stage stage = Stage::GetCurrent();
47
48   // Test Stage size without top-margin
49
50   const unsigned int initialWidth(  stage.GetSize().width );
51   const unsigned int initialHeight( stage.GetSize().height );
52
53   DALI_TEST_EQUALS( TestApplication::DEFAULT_SURFACE_WIDTH,  initialWidth,  TEST_LOCATION );
54   DALI_TEST_EQUALS( TestApplication::DEFAULT_SURFACE_HEIGHT, initialHeight, TEST_LOCATION );
55
56   // Retest with top-margin
57
58   unsigned int margin( 10 );
59   application.SetTopMargin( margin );
60
61   const unsigned int newWidth(  stage.GetSize().width );
62   const unsigned int newHeight( stage.GetSize().height );
63
64   DALI_TEST_EQUALS( TestApplication::DEFAULT_SURFACE_WIDTH,             newWidth,  TEST_LOCATION );
65   DALI_TEST_EQUALS( (TestApplication::DEFAULT_SURFACE_HEIGHT - margin), newHeight, TEST_LOCATION );
66
67   END_TEST;
68 }