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      : ffsll_0100
20  * @tc.desc      : Verify to find the first set value of a value of type long long
21  *                 (valid for each argument, 0, bit 1)
22  * @tc.level     : Level 0
23  */
ffsll_0100(void)24 void ffsll_0100(void)
25 {
26     int result = ffsll(0);
27     EXPECT_EQ("ffsll_0100", result, 0);
28 }
29 
30 /**
31  * @tc.name      : ffsll_0200
32  * @tc.desc      : Verify to find the first set value of a value of type long long
33  *                 (valid for each argument, 0x8000000,bit 1)
34  * @tc.level     : Level 0
35  */
ffsll_0200(void)36 void ffsll_0200(void)
37 {
38     int result = ffsll(0x8000000);
39     EXPECT_EQ("ffsll_0200", result, 28);
40 }
41 
42 /**
43  * @tc.name      : ffsll_0300
44  * @tc.desc      : Verify to find the first set value of a value of type long long
45  *                 (valid for each argument, 0x800000000,bit 1)
46  * @tc.level     : Level 0
47  */
ffsll_0300(void)48 void ffsll_0300(void)
49 {
50     int result = ffsll(0x800000000);
51     EXPECT_EQ("ffsll_0300", result, 36);
52 }
53 
main(int argc, char *argv[])54 int main(int argc, char *argv[])
55 {
56     ffsll_0100();
57     ffsll_0200();
58     ffsll_0300();
59     return t_status;
60 }