1 /*
2 * Copyright (c) 2022 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
16 #include <gtest/gtest.h>
17 #include "ast/ast_method.h"
18 #include "ast/ast_void_type.h"
19
20 using namespace testing;
21 using namespace testing::ext;
22 using namespace OHOS::Idl;
23
24 namespace OHOS {
25 namespace idl {
26 class AstMethodUnitTest : public testing::Test {
27 public:
AstMethodUnitTest()28 AstMethodUnitTest() {}
29
~AstMethodUnitTest()30 virtual ~AstMethodUnitTest() {}
31
32 static void SetUpTestCase();
33
34 static void TearDownTestCase();
35
36 void SetUp();
37
38 void TearDown();
39 };
40
SetUpTestCase()41 void AstMethodUnitTest::SetUpTestCase() {}
42
TearDownTestCase()43 void AstMethodUnitTest::TearDownTestCase() {}
44
SetUp()45 void AstMethodUnitTest::SetUp() {}
46
TearDown()47 void AstMethodUnitTest::TearDown() {}
48
49 /*
50 * @tc.name: GetParameterTest_0100
51 * @tc.desc: test GetParameter in AstMethodUnitTest.
52 * @tc.type: FUNC
53 * @tc.require:
54 */
55 HWTEST_F(AstMethodUnitTest, GetParameterTest_0100, Function | MediumTest | Level1)
56 {
57 GTEST_LOG_(INFO)
58 << "AstMethodUnitTest, GetParameterTest_0100, TestSize.Level1";
59 std::shared_ptr<ASTMethod> imageASTMethod = std::make_shared<ASTMethod>();
60 size_t index = 3;
61 AutoPtr<ASTParameter> result = imageASTMethod->GetParameter(index);
62
63 EXPECT_EQ(result, nullptr);
64 }
65 } // namespace idl
66 } // namespace OHOS
67