• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "functionalext.h"
17 
18 /**
19  * @tc.name      : ffs_0100
20  * @tc.desc      : Validation looks for first set value in integer (parameter is 0).
21  * @tc.level     : Level 0
22  */
ffs_0100(void)23 void ffs_0100(void)
24 {
25     int result = ffs(0);
26     EXPECT_EQ("ffs_0100", result, 0);
27 }
28 
29 /**
30  * @tc.name      : ffs_0200
31  * @tc.desc      : Validation looks for first set value in integer (parameter is 1).
32  * @tc.level     : Level 0
33  */
ffs_0200(void)34 void ffs_0200(void)
35 {
36     int result = ffs(1);
37     EXPECT_EQ("ffs_0200", result, 1);
38 }
39 
40 /**
41  * @tc.name      : ffs_0300
42  * @tc.desc      : Validation looks for first set value in integer (parameter is 2).
43  * @tc.level     : Level 0
44  */
ffs_0300(void)45 void ffs_0300(void)
46 {
47     int result = ffs(2);
48     EXPECT_EQ("ffs_0300", result, 2);
49 }
50 
51 /**
52  * @tc.name      : ffs_0400
53  * @tc.desc      : Validation looks for first set value in integer (parameter is 3).
54  * @tc.level     : Level 0
55  */
ffs_0400(void)56 void ffs_0400(void)
57 {
58     int result = ffs(3);
59     EXPECT_EQ("ffs_0400", result, 1);
60 }
61 
62 /**
63  * @tc.name      : ffs_0500
64  * @tc.desc      : Validation looks for first set value in integer (parameter is 255).
65  * @tc.level     : Level 0
66  */
ffs_0500(void)67 void ffs_0500(void)
68 {
69     int result = ffs(128);
70     EXPECT_EQ("ffs_0500", result, 8);
71 }
72 
main(int argc,char * argv[])73 int main(int argc, char *argv[])
74 {
75     ffs_0100();
76     ffs_0200();
77     ffs_0300();
78     ffs_0400();
79     ffs_0500();
80     return t_status;
81 }