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 int UtcDaliGlyphImageNew01(void)
28 TestApplication application;
30 tet_infoline("UtcDaliGlyphImageNew01");
34 DALI_TEST_CHECK( !image );
36 image = GlyphImage::New( Text( std::string( "H" ) )[0] );
38 DALI_TEST_CHECK( image );
39 DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::GetGlyphImageFunc ) );
43 int UtcDaliGlyphImageNew02(void)
45 TestApplication application;
47 tet_infoline("UtcDaliGlyphImageNew02");
51 DALI_TEST_CHECK( !image );
54 image = GlyphImage::New( Text( std::string( "H" ) )[0], style );
56 DALI_TEST_CHECK( image );
57 DALI_TEST_CHECK( application.GetPlatform().WasCalled( TestPlatformAbstraction::GetGlyphImageFunc ) );
61 int UtcDaliGlyphImageDownCast(void)
63 TestApplication application;
65 tet_infoline("UtcDaliGlyphImageDownCast");
67 GlyphImage image = GlyphImage::New( Text( std::string( "H" ) )[0] );
69 DALI_TEST_CHECK( image );
71 BaseHandle object(image);
73 GlyphImage image2 = GlyphImage::DownCast(object);
74 DALI_TEST_CHECK(image2);
76 GlyphImage image3 = DownCast< GlyphImage >(object);
77 DALI_TEST_CHECK(image3);
79 BaseHandle unInitializedObject;
80 GlyphImage image4 = GlyphImage::DownCast(unInitializedObject);
81 DALI_TEST_CHECK(!image4);
83 GlyphImage image5 = DownCast< GlyphImage >(unInitializedObject);
84 DALI_TEST_CHECK(!image5);
88 int UtcDaliGlyphImageIsColorGlyph(void)
90 TestApplication application;
92 tet_infoline("UtcDaliGlyphImageIsColorGlyph");
94 Character character = Text( std::string( "\xf0\x9f\x98\x81" ) )[0];
96 DALI_TEST_CHECK( GlyphImage::IsColorGlyph( character ) );