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 "common.h"
17
DuplicatesTests_TestGetVal1()18 static void DuplicatesTests_TestGetVal1() {
19 EXPECT_EQ(__func__, 1, get_val_from_A());
20 EXPECT_EQ(__func__, 2, get_val_from_B());
21 EXPECT_EQ(__func__, 3, get_val_from_C());
22 }
23
DuplicatesTests_TestGetVal2()24 static void DuplicatesTests_TestGetVal2() {
25 EXPECT_EQ(__func__, 1, get_valA_from_A());
26 EXPECT_EQ(__func__, 2, get_valB_from_A());
27 EXPECT_EQ(__func__, 3, get_valC_from_A());
28
29 EXPECT_EQ(__func__, 1, get_valA_from_B());
30 EXPECT_EQ(__func__, 2, get_valB_from_B());
31 EXPECT_EQ(__func__, 3, get_valC_from_B());
32
33 EXPECT_EQ(__func__, 1, get_valA_from_C());
34 EXPECT_EQ(__func__, 2, get_valB_from_C());
35 EXPECT_EQ(__func__, 3, get_valC_from_C());
36 }
37
38 // This test used symbols from first lib (A)
DuplicatesTests_TestGetVal3()39 static void DuplicatesTests_TestGetVal3() {
40 EXPECT_EQ(__func__, 1, val);
41 EXPECT_EQ(__func__, 1, get_val());
42 }
43
main(int argc,char ** argv)44 int main(int argc, char **argv) {
45 DuplicatesTests_TestGetVal1();
46 DuplicatesTests_TestGetVal2();
47 DuplicatesTests_TestGetVal3();
48 return t_status;
49 }
50