2 * Copyright (c) 2022 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.
22 #include <dali-toolkit-test-suite-utils.h>
23 #include <dali-toolkit/dali-toolkit.h>
24 #include <dali-toolkit/devel-api/text/range.h>
27 using namespace Toolkit;
29 int UtcDaliToolkitTextRangeNew(void)
31 ToolkitTestApplication application;
32 tet_infoline(" UtcDaliToolkitTextRangeNew");
34 auto range15to20 = Dali::Toolkit::Text::Range::New(15u, 20u);
35 DALI_TEST_CHECK(range15to20);
37 auto range25to20 = Dali::Toolkit::Text::Range::New(25u, 20u);
38 DALI_TEST_CHECK(range25to20);
43 int UtcDaliToolkitTextRangeGetStartIndex(void)
45 ToolkitTestApplication application;
46 tet_infoline(" UtcDaliToolkitTextRangeGetStartIndex");
48 auto range15to20 = Dali::Toolkit::Text::Range::New(15u, 20u);
49 DALI_TEST_CHECK(range15to20);
50 DALI_TEST_EQUALS(15u, range15to20.GetStartIndex(), TEST_LOCATION);
52 auto range25to20 = Dali::Toolkit::Text::Range::New(25u, 20u);
53 DALI_TEST_CHECK(range25to20);
54 DALI_TEST_EQUALS(20u, range25to20.GetStartIndex(), TEST_LOCATION);
59 int UtcDaliToolkitTextRangeGetEndIndex(void)
61 ToolkitTestApplication application;
62 tet_infoline(" UtcDaliToolkitTextRangeGetEndIndex");
64 auto range15to20 = Dali::Toolkit::Text::Range::New(15u, 20u);
65 DALI_TEST_CHECK(range15to20);
66 DALI_TEST_EQUALS(20u, range15to20.GetEndIndex(), TEST_LOCATION);
68 auto range25to20 = Dali::Toolkit::Text::Range::New(25u, 20u);
69 DALI_TEST_CHECK(range25to20);
70 DALI_TEST_EQUALS(25u, range25to20.GetEndIndex(), TEST_LOCATION);
75 int UtcDaliToolkitTextRangeGetNumberOfIndices(void)
77 ToolkitTestApplication application;
78 tet_infoline(" UtcDaliToolkitTextRangeGetNumberOfIndices");
80 auto range15to20 = Dali::Toolkit::Text::Range::New(15u, 20u);
81 DALI_TEST_CHECK(range15to20);
82 DALI_TEST_EQUALS(6u, range15to20.GetNumberOfIndices(), TEST_LOCATION);
84 auto range25to20 = Dali::Toolkit::Text::Range::New(25u, 20u);
85 DALI_TEST_CHECK(range25to20);
86 DALI_TEST_EQUALS(6u, range25to20.GetNumberOfIndices(), TEST_LOCATION);