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>
27 // Positive test case for a method
28 int UtcDaliUtf8SequenceLength(void)
30 tet_infoline("UtcDaliUtf8SequenceLength ");
31 TestApplication application;
33 std::string latinText( "amazing" );
34 std::string japaneseText( "すごい" );
35 std::string accent("é");
37 tet_infoline("utf8 1 byte Test ");
38 DALI_TEST_EQUALS( Utf8SequenceLength( latinText[0] ), 1u, TEST_LOCATION );
39 tet_infoline("utf8 3 byte Test ");
40 DALI_TEST_EQUALS( Utf8SequenceLength( japaneseText[0] ), 3u, TEST_LOCATION );
41 tet_infoline("utf8 2 byte Test ");
42 DALI_TEST_EQUALS( Utf8SequenceLength( accent[0] ), 2u, TEST_LOCATION );