• 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 <stdlib.h>
17 #include <string.h>
18 #include "functionalext.h"
19 
20 /**
21  * @tc.name      : strcoll_0100
22  * @tc.desc      : Verify strcoll process success when fist string equal second stirng
23  * @tc.level     : Level 0
24  */
strcoll_0100(void)25 void strcoll_0100(void)
26 {
27     int32_t ret = strcoll("aBcDeF", "aBcDeF");
28     EXPECT_EQ("strcoll_0100", ret, 0);
29 }
30 
31 /**
32  * @tc.name      : strcoll_0200
33  * @tc.desc      : Verify strcoll process success when fist string less than second stirng
34  * @tc.level     : Level 1
35  */
strcoll_0200(void)36 void strcoll_0200(void)
37 {
38     int32_t ret = strcoll("", "AbCdEf");
39     EXPECT_LT("strcoll_0200", ret, 0);
40 }
41 
42 /**
43  * @tc.name      : strcoll_0300
44  * @tc.desc      : Verify strcoll process success when fist string more than second stirng
45  * @tc.level     : Level 1
46  */
strcoll_0300(void)47 void strcoll_0300(void)
48 {
49     int32_t ret = strcoll("AbCdEf", "");
50     EXPECT_MT("strcoll_0300", ret, 0);
51 }
52 
53 /**
54  * @tc.name      : strcoll_0400
55  * @tc.desc      : Verify strcoll process success when fist string is null second stirng is null
56  * @tc.level     : Level 1
57  */
strcoll_0400(void)58 void strcoll_0400(void)
59 {
60     int32_t ret = strcoll("", "");
61     EXPECT_EQ("strcoll_0400", ret, 0);
62 }
63 
main(void)64 int main(void)
65 {
66     strcoll_0100();
67     strcoll_0200();
68     strcoll_0300();
69     strcoll_0400();
70     return t_status;
71 }
72