1800b99b8Sopenharmony_ci/*
2800b99b8Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
3800b99b8Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4800b99b8Sopenharmony_ci * you may not use this file except in compliance with the License.
5800b99b8Sopenharmony_ci * You may obtain a copy of the License at
6800b99b8Sopenharmony_ci *
7800b99b8Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8800b99b8Sopenharmony_ci *
9800b99b8Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10800b99b8Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11800b99b8Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12800b99b8Sopenharmony_ci * See the License for the specific language governing permissions and
13800b99b8Sopenharmony_ci * limitations under the License.
14800b99b8Sopenharmony_ci */
15800b99b8Sopenharmony_ci
16800b99b8Sopenharmony_ci#include <gtest/gtest.h>
17800b99b8Sopenharmony_ci#include "dfx_define.h"
18800b99b8Sopenharmony_ci#include "dfx_param.h"
19800b99b8Sopenharmony_ci#include "dfx_trace.h"
20800b99b8Sopenharmony_ci#include "dfx_util.h"
21800b99b8Sopenharmony_ci
22800b99b8Sopenharmony_ciusing namespace OHOS::HiviewDFX;
23800b99b8Sopenharmony_ciusing namespace testing::ext;
24800b99b8Sopenharmony_ciusing namespace std;
25800b99b8Sopenharmony_ci
26800b99b8Sopenharmony_cinamespace OHOS {
27800b99b8Sopenharmony_cinamespace HiviewDFX {
28800b99b8Sopenharmony_ciclass ParamTest : public testing::Test {
29800b99b8Sopenharmony_cipublic:
30800b99b8Sopenharmony_ci    static void SetUpTestCase(void) {}
31800b99b8Sopenharmony_ci    static void TearDownTestCase(void) {}
32800b99b8Sopenharmony_ci    void SetUp() {}
33800b99b8Sopenharmony_ci    void TearDown() {}
34800b99b8Sopenharmony_ci};
35800b99b8Sopenharmony_ci
36800b99b8Sopenharmony_ci/**
37800b99b8Sopenharmony_ci * @tc.name: DfxParamTest001
38800b99b8Sopenharmony_ci * @tc.desc: test DfxParam class functions
39800b99b8Sopenharmony_ci * @tc.type: FUNC
40800b99b8Sopenharmony_ci */
41800b99b8Sopenharmony_ciHWTEST_F(ParamTest, DfxParamTest001, TestSize.Level2)
42800b99b8Sopenharmony_ci{
43800b99b8Sopenharmony_ci    GTEST_LOG_(INFO) << "DfxParamTest001: start.";
44800b99b8Sopenharmony_ci    ASSERT_EQ(DfxParam::EnableMixstack(), true);
45800b99b8Sopenharmony_ci    GTEST_LOG_(INFO) << "DfxParamTest001: end.";
46800b99b8Sopenharmony_ci}
47800b99b8Sopenharmony_ci
48800b99b8Sopenharmony_ci/**
49800b99b8Sopenharmony_ci * @tc.name: TraceTest001
50800b99b8Sopenharmony_ci * @tc.desc: test FormatTraceName functions
51800b99b8Sopenharmony_ci * @tc.type: FUNC
52800b99b8Sopenharmony_ci */
53800b99b8Sopenharmony_ciHWTEST_F(ParamTest, TraceTest001, TestSize.Level2)
54800b99b8Sopenharmony_ci{
55800b99b8Sopenharmony_ci    GTEST_LOG_(INFO) << "TraceTest001: start.";
56800b99b8Sopenharmony_ci    char *name = nullptr;
57800b99b8Sopenharmony_ci    FormatTraceName(name, 0, nullptr);
58800b99b8Sopenharmony_ci    ASSERT_EQ(name, nullptr);
59800b99b8Sopenharmony_ci    const size_t size = 2;
60800b99b8Sopenharmony_ci    FormatTraceName(name, size, nullptr);
61800b99b8Sopenharmony_ci    ASSERT_EQ(name, nullptr);
62800b99b8Sopenharmony_ci    GTEST_LOG_(INFO) << "TraceTest001: end.";
63800b99b8Sopenharmony_ci}
64800b99b8Sopenharmony_ci
65800b99b8Sopenharmony_ci/**
66800b99b8Sopenharmony_ci * @tc.name: DfxutilTest001
67800b99b8Sopenharmony_ci * @tc.desc: test TrimAndDupStr functions
68800b99b8Sopenharmony_ci * @tc.type: FUNC
69800b99b8Sopenharmony_ci */
70800b99b8Sopenharmony_ciHWTEST_F(ParamTest, DfxutilTest001, TestSize.Level2)
71800b99b8Sopenharmony_ci{
72800b99b8Sopenharmony_ci    GTEST_LOG_(INFO) << "DfxutilTest001: start.";
73800b99b8Sopenharmony_ci    std::string filePath = "";
74800b99b8Sopenharmony_ci    std::vector<const std::string> validPaths;
75800b99b8Sopenharmony_ci    bool ret = VerifyFilePath(filePath, validPaths);
76800b99b8Sopenharmony_ci    ASSERT_EQ(ret, true);
77800b99b8Sopenharmony_ci    GTEST_LOG_(INFO) << "DfxutilTest001: end.";
78800b99b8Sopenharmony_ci}
79800b99b8Sopenharmony_ci} // namespace HiviewDFX
80800b99b8Sopenharmony_ci} // namespace OHOS