ModelView implementation.
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit-internal / utc-Dali-Text-Typesetter.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 <limits>
22
23 #include <dali-toolkit-test-suite-utils.h>
24 #include <dali-toolkit/dali-toolkit.h>
25 #include <dali-toolkit/internal/text/rendering/text-typesetter.h>
26 #include <dali-toolkit/internal/text/rendering/view-model.h>
27 #include <dali-toolkit/internal/text/text-controller.h>
28
29 using namespace Dali;
30 using namespace Toolkit;
31 using namespace Text;
32
33 int UtcDaliTextTypesetter(void)
34 {
35   tet_infoline(" UtcDaliTextTypesetter");
36   ToolkitTestApplication application;
37
38   // Creates a text controller.
39   ControllerPtr controller = Controller::New();
40
41   // Tests the rendering controller has been created.
42   TypesetterPtr typesetter = Typesetter::New( controller->GetTextModel() );
43   DALI_TEST_CHECK( typesetter );
44
45   tet_result(TET_PASS);
46   END_TEST;
47 }
48
49 int UtcDaliTextTypesetterGetViewModel(void)
50 {
51   tet_infoline(" UtcDaliTextTypesetter");
52   ToolkitTestApplication application;
53
54   // Creates a text controller.
55   ControllerPtr controller = Controller::New();
56
57   // Tests the rendering controller has been created.
58   TypesetterPtr typesetter = Typesetter::New( controller->GetTextModel() );
59   DALI_TEST_CHECK( typesetter );
60
61   // Tests the view model has been created.
62   ViewModel* model = typesetter->GetViewModel();
63   DALI_TEST_CHECK( NULL != model );
64
65   tet_result(TET_PASS);
66   END_TEST;
67 }