Improved pan gesture prediction
[platform/core/uifw/dali-core.git] / automated-tests / src / dali-unmanaged / utc-Dali-Utf8.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-test-suite-utils.h>
23
24 using namespace Dali;
25
26
27 // Positive test case for a method
28 int UtcDaliUtf8SequenceLength(void)
29 {
30   tet_infoline("UtcDaliUtf8SequenceLength ");
31   TestApplication application;
32
33   std::string latinText( "amazing" );
34   std::string japaneseText( "すごい" );
35   std::string accent("é");
36
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  );
43   END_TEST;
44 }