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
16 #include <gtest/gtest.h>
17
18 #include "avsession_dynamic_loader.h"
19
20 using namespace OHOS;
21 using namespace OHOS::AVSession;
22
23 #define AVSESSION_DYNAMIC_INSIGHT_LIBRARY_PATH "libavsession_dynamic_insight.z.so"
24
25 class AVSessionDynamicLoaderTest : public testing::Test {
26 public:
27 static void SetUpTestCase(void);
28 static void TearDownTestCase(void);
29 void SetUp();
30 void TearDown();
31 };
32
SetUpTestCase()33 void AVSessionDynamicLoaderTest::SetUpTestCase()
34 {}
35
TearDownTestCase()36 void AVSessionDynamicLoaderTest::TearDownTestCase()
37 {}
38
SetUp()39 void AVSessionDynamicLoaderTest::SetUp()
40 {}
41
TearDown()42 void AVSessionDynamicLoaderTest::TearDown()
43 {}
44
45 /**
46 * @tc.name: GetFuntion001
47 * @tc.desc: test GetFuntion
48 * @tc.type: FUNC
49 * @tc.require:
50 */
HWTEST_F(AVSessionDynamicLoaderTest, GetFuntion001, testing::ext::TestSize.Level1)51 static HWTEST_F(AVSessionDynamicLoaderTest, GetFuntion001, testing::ext::TestSize.Level1)
52 {
53 AVSessionDynamicLoader avsessionDynamicLoader;
54 avsessionDynamicLoader.OpenDynamicHandle(AVSESSION_DYNAMIC_INSIGHT_LIBRARY_PATH);
55 auto ptr = avsessionDynamicLoader.GetFuntion(AVSESSION_DYNAMIC_INSIGHT_LIBRARY_PATH, "aaa");
56 EXPECT_EQ(ptr, nullptr);
57 }