removed reliance on dali-adaptor
[platform/core/uifw/dali-core.git] / automated-tests / src / dali-internal / utc-Dali-Internal-Text.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
20 #include <stdlib.h>
21 #include <dali/public-api/dali-core.h>
22 #include <dali/integration-api/glyph-set.h>
23 #include <dali-test-suite-utils.h>
24
25 // Internal headers are allowed here
26
27 #include <dali/internal/event/text/text-impl.h>
28
29 using namespace Dali;
30
31 void utc_dali_internal_text_startup()
32 {
33   test_return_value = TET_UNDEF;
34 }
35
36 void utc_dali_internal_text_cleanup()
37 {
38   test_return_value = TET_PASS;
39 }
40
41
42 int UtcDaliTextGetImplementation(void)
43 {
44   TestApplication application;
45
46   Text text;
47
48   bool assert1 = false;
49   bool assert2 = false;
50
51   try  // const GetImpl
52   {
53     const Internal::Text& impl = text.GetImplementation();
54     (void)impl; // Avoid unused variable warning
55   }
56   catch( DaliException& e )
57   {
58     tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
59     DALI_TEST_EQUALS( e.mCondition, "NULL != mImpl && \"Text::GetImplementation: Text is uninitialized\"", TEST_LOCATION );
60
61     assert1 = true;
62   }
63
64   try   // non const getImp
65   {
66     Internal::Text& impl = text.GetImplementation();
67     (void)impl; // Avoid unused variable warning
68   }
69   catch( DaliException& e )
70   {
71     tet_printf( "Assertion %s failed at %s\n", e.mCondition.c_str(), e.mLocation.c_str() );
72     DALI_TEST_EQUALS( e.mCondition, "NULL != mImpl && \"Text::GetImplementation: Text is uninitialized\"", TEST_LOCATION );
73
74     assert2 = true;
75   }
76
77   if( assert1 && assert2 )
78   {
79     tet_result( TET_PASS );
80   }
81   else
82   {
83     tet_result( TET_FAIL );
84   }
85   END_TEST;
86 }