• 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      : strerror_0100
22  * @tc.desc      : Verify strerror process success when param is EILSEQ
23  * @tc.level     : Level 0
24  */
strerror_0100(void)25 void strerror_0100(void)
26 {
27     char *ret = strerror(EILSEQ);
28     EXPECT_STREQ("strerror_0100", ret, "Illegal byte sequence");
29 }
30 
31 /**
32  * @tc.name      : strerror_0200
33  * @tc.desc      : Verify strerror process success when param is 0
34  * @tc.level     : Level 0
35  */
strerror_0200(void)36 void strerror_0200(void)
37 {
38     char *ret = strerror(0);
39     EXPECT_STREQ("strerror_0200", ret, "No error information");
40 }
41 
main(void)42 int main(void)
43 {
44     strerror_0100();
45     strerror_0200();
46     return t_status;
47 }
48