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/integration-api/glyph-set.h>
23 #include <dali-test-suite-utils.h>
25 // Internal headers are allowed here
27 #include <dali/internal/event/text/text-impl.h>
31 void utc_dali_internal_text_startup()
33 test_return_value = TET_UNDEF;
36 void utc_dali_internal_text_cleanup()
38 test_return_value = TET_PASS;
41 int UtcDaliTextGetImplementation01(void)
43 TestApplication application;
45 Text text( std::string( "Hello world" ) );
47 const Internal::Text& textImpl1 = text.GetImplementation();
49 DALI_TEST_CHECK( NULL != &textImpl1 );
51 Internal::Text& textImpl2 = text.GetImplementation();
53 DALI_TEST_CHECK( NULL != &textImpl2 );
58 int UtcDaliTextGetImplementation02(void)
60 TestApplication application;
69 const Internal::Text& impl = text.GetImplementation();
70 (void)impl; // Avoid unused variable warning
72 catch( DaliException& e )
74 DALI_TEST_PRINT_ASSERT( e );
75 DALI_TEST_EQUALS( e.condition, "NULL != mImpl && \"Text::GetImplementation: Text is uninitialized\"", TEST_LOCATION );
80 try // non const getImp
82 Internal::Text& impl = text.GetImplementation();
83 (void)impl; // Avoid unused variable warning
85 catch( DaliException& e )
87 DALI_TEST_PRINT_ASSERT( e );
88 DALI_TEST_EQUALS( e.condition, "NULL != mImpl && \"Text::GetImplementation: Text is uninitialized\"", TEST_LOCATION );
93 if( assert1 && assert2 )
95 tet_result( TET_PASS );
99 tet_result( TET_FAIL );
104 int UtcDaliTextGetTextArray(void)
106 TestApplication application;
108 Text text( std::string( "Hello world" ) );
110 DALI_TEST_EQUALS( text.GetImplementation().GetTextArray().Count(), 11u, TEST_LOCATION );