1 /*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 #include "test_case_factory.h"
16 #include "test_case/draw_path_test.h"
17 #include "test_case/draw_rect_test.h"
18 #include "test_case/draw_textblob_test.h"
19
20 using namespace OHOS::Rosen;
21 namespace {
22 std::unordered_map<std::string, std::function<std::shared_ptr<TestBase>()>> FunctionalMap = {
__anon1144a44e0202() 23 {"drawrect", []() -> std::shared_ptr<TestBase> {return std::make_shared<DrawRectTest>();}},
__anon1144a44e0302() 24 {"drawpath", []() -> std::shared_ptr<TestBase> {return std::make_shared<DrawPathTest>();}},
__anon1144a44e0402() 25 {"drawtextblob", []() -> std::shared_ptr<TestBase> {return std::make_shared<DrawTextBlobTest>();}},
26 };
27 std::unordered_map<std::string, std::function<std::shared_ptr<TestBase>()>> PerformanceMap = {
__anon1144a44e0502() 28 {"drawrect", []() -> std::shared_ptr<TestBase> {return std::make_shared<DrawRectTest>();}},
__anon1144a44e0602() 29 {"drawpath", []() -> std::shared_ptr<TestBase> {return std::make_shared<DrawPathTest>();}},
__anon1144a44e0702() 30 {"drawtextblob", []() -> std::shared_ptr<TestBase> {return std::make_shared<DrawTextBlobTest>();}},
31 };
32 } // namespace
33
34 namespace OHOS {
35 namespace Rosen {
GetFunctionCase()36 std::unordered_map<std::string, std::function<std::shared_ptr<TestBase>()>> TestCaseFactory::GetFunctionCase()
37 {
38 return FunctionalMap;
39 }
40
GetPerformanceCase()41 std::unordered_map<std::string, std::function<std::shared_ptr<TestBase>()>> TestCaseFactory::GetPerformanceCase()
42 {
43 return PerformanceMap;
44 }
45 } // namespace Rosen
46 } // namespace OHOS