• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Copyright (C) 2025 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 "functionalext.h"
16 #include "testdlopen.h"
17 
18 static const char *fileName = "libadlt_base_dlopen_cpp_lib.so";
19 
DlopenCPPTests_TestGetStorage()20 static void DlopenCPPTests_TestGetStorage() {
21     EXPECT_EQ(__func__, 42, testdlopen::testCtor(fileName, 42));
22 }
23 
DlopenCPPTests_TestGetVer()24 static void DlopenCPPTests_TestGetVer() {
25     char *p = const_cast<char *>(testdlopen::testVer(fileName).c_str());
26     EXPECT_STREQ(__func__, "1.1", p);
27 }
28 
DlopenCPPTests_TestPrintf()29 static void DlopenCPPTests_TestPrintf() {
30     EXPECT_EQ(__func__, 0, testdlopen::testPrintf(fileName, "some text\n"));
31 }
32 
DlopenCPPTests_TestMax()33 static void DlopenCPPTests_TestMax() {
34     EXPECT_EQ(__func__, 2, testdlopen::testMax(fileName, 1, 2));
35 }
36 
main(int argc,char ** argv)37 int main(int argc, char **argv) {
38     DlopenCPPTests_TestGetStorage();
39     DlopenCPPTests_TestGetVer();
40     DlopenCPPTests_TestPrintf();
41     DlopenCPPTests_TestMax();
42     return t_status;
43 }
44